[Openvas-commits] r5506 - in trunk/gsa: . src
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Oct 13 08:07:38 CEST 2009
Author: jan
Date: 2009-10-13 08:07:35 +0200 (Tue, 13 Oct 2009)
New Revision: 5506
Added:
trunk/gsa/src/gsad-base.h
trunk/gsa/src/gsad-oap.h
trunk/gsa/src/tracef.h
Modified:
trunk/gsa/ChangeLog
trunk/gsa/src/CMakeLists.txt
Log:
* src/gsad-oap.h: New.
* src/gsad-base.h: New.
* src/tracef.h: New.
* src/CMakeLists.txt: Handle modules gsad-omp and gsad-oap.
Modified: trunk/gsa/ChangeLog
===================================================================
--- trunk/gsa/ChangeLog 2009-10-13 04:53:32 UTC (rev 5505)
+++ trunk/gsa/ChangeLog 2009-10-13 06:07:35 UTC (rev 5506)
@@ -1,3 +1,13 @@
+2009-10-13 Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
+
+ * src/gsad-oap.h: New.
+
+ * src/gsad-base.h: New.
+
+ * src/tracef.h: New.
+
+ * src/CMakeLists.txt: Handle modules gsad-omp and gsad-oap.
+
2009-10-12 Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
* VERSION: New.
Modified: trunk/gsa/src/CMakeLists.txt
===================================================================
--- trunk/gsa/src/CMakeLists.txt 2009-10-13 04:53:32 UTC (rev 5505)
+++ trunk/gsa/src/CMakeLists.txt 2009-10-13 06:07:35 UTC (rev 5506)
@@ -68,12 +68,15 @@
## Libraries
add_library (gsad-omp gsad-omp.c)
-set_target_properties (omp PROPERTIES COMPILE_FLAGS "${HEADER_TEMP} ${TASKS_CFLAG} ${GLIB_CFLAGS} ${LIBXML_CFLAGS}")
+set_target_properties (gsad-omp PROPERTIES COMPILE_FLAGS "${HEADER_TEMP} ${TASKS_CFLAG} ${GLIB_CFLAGS} ${LIBXML_CFLAGS}")
+add_library (gsad-oap gsad-oap.c)
+set_target_properties (gsad-oap PROPERTIES COMPILE_FLAGS "${HEADER_TEMP} ${TASKS_CFLAG} ${GLIB_CFLAGS} ${LIBXML_CFLAGS}")
+
## Program
add_executable (gsad gsad.c)
-target_link_libraries (gsad gsad-omp)
+target_link_libraries (gsad gsad-omp gsad-oap)
set_target_properties (gsad PROPERTIES LINKER_LANGUAGE C)
Added: trunk/gsa/src/gsad-base.h
===================================================================
--- trunk/gsa/src/gsad-base.h 2009-10-13 04:53:32 UTC (rev 5505)
+++ trunk/gsa/src/gsad-base.h 2009-10-13 06:07:35 UTC (rev 5506)
@@ -0,0 +1,44 @@
+/* Greenbone Security Assistant
+ * $Id$
+ * Description: Headers/structs used generally in GSA
+ *
+ * Authors:
+ * Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
+ * Matthew Mundell <matthew.mundell at intevation.de>
+ *
+ * Copyright:
+ * Copyright (C) 2009 Greenbone Networks GmbH
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or, at your option, any later version as published by the Free
+ * Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/**
+ * @file gsad.h
+ * @brief Headers/structs used generally in GSA
+ */
+
+#ifndef GSAD_BASE_H
+#define GSAD_BASE_H
+
+/**
+ * @brief Structure that combines username and password
+ */
+typedef struct
+{
+ char *username;
+ char *password;
+} credentials_t;
+
+#endif
Added: trunk/gsa/src/gsad-oap.h
===================================================================
--- trunk/gsa/src/gsad-oap.h 2009-10-13 04:53:32 UTC (rev 5505)
+++ trunk/gsa/src/gsad-oap.h 2009-10-13 06:07:35 UTC (rev 5506)
@@ -0,0 +1,45 @@
+/* Greenbone Security Assistant
+ * $Id$
+ * Description: Headers for GSA's OAP communication module
+ *
+ * Authors:
+ * Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
+ * Michael Wiegand <michael.wiegand at intevation.de>
+ * Matthew Mundell <matthew.mundell at intevation.de>
+ *
+ * Copyright:
+ * Copyright (C) 2009 Greenbone Networks GmbH
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or, at your option, any later version as published by the Free
+ * Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/**
+ * @file gsad-oap.h
+ * @brief Headers for GSA's OAP communication module
+ */
+
+#ifndef GSAD_OAP_H
+#define GSAD_OAP_H
+
+#include "gsad-base.h" /* for credentials_t */
+
+void oap_init (int);
+
+char * get_users_oap (credentials_t *);
+char * create_user_oap (credentials_t *,
+ const char *, const char *, const char *);
+char * delete_user_oap (credentials_t *, const char *);
+
+#endif
Added: trunk/gsa/src/tracef.h
===================================================================
--- trunk/gsa/src/tracef.h 2009-10-13 04:53:32 UTC (rev 5505)
+++ trunk/gsa/src/tracef.h 2009-10-13 06:07:35 UTC (rev 5506)
@@ -0,0 +1,89 @@
+/* Greenbone Security Assistant
+ * $Id$
+ * Description: A printf like macro for tracing.
+ *
+ * Authors:
+ * Matthew Mundell <matthew.mundell at intevation.de>
+ *
+ * Copyright:
+ * Copyright (C) 2009 Greenbone Networks GmbH
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or, at your option, any later version as published by the Free
+ * Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/**
+ * @file tracef.h
+ * @brief A printf like macro for tracing.
+ */
+
+#ifndef GSAD_TRACE_H
+#define GSAD_TRACE_H
+
+/**
+ * @brief GLib log domain.
+ *
+ * Libraries can override this by setting it after including tracef.h.
+ */
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "gsad main"
+
+#include <strings.h>
+#include <glib.h>
+
+/**
+ * @brief Flag with all Glib log levels.
+ */
+#define ALL_LOG_LEVELS (G_LOG_LEVEL_MASK \
+ | G_LOG_FLAG_FATAL \
+ | G_LOG_FLAG_RECURSION)
+
+/**
+ * @brief Trace text flag.
+ *
+ * 0 to turn off echoing of actual data transfered (requires TRACE).
+ */
+#define TRACE_TEXT 1
+
+/**
+ * @brief Verbose output flag.
+ */
+extern int verbose;
+
+/**
+ * @brief Logging parameters, as passed to setup_log_handlers.
+ */
+extern GSList *log_config;
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/**
+ * @brief Formatted trace output.
+ *
+ * Print the printf style \a args to stderr, preceded by the process ID.
+ */
+#define tracef(args...) \
+ do { \
+ if (verbose) \
+ { \
+ gchar* iso = g_strdup_printf (args); \
+ g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s", iso); \
+ g_free (iso); \
+ } \
+ } while (0)
+
+#endif
More information about the Openvas-commits
mailing list