Split LOG_SOURCES into olsr_logging_sources to make it easier to use olsr_logging...
authorHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Wed, 6 Apr 2011 09:16:33 +0000 (11:16 +0200)
committerHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Wed, 6 Apr 2011 09:16:33 +0000 (11:16 +0200)
src/olsr_comport.h
src/olsr_logging.c
src/olsr_logging.h
src/olsr_logging_sources.c [new file with mode: 0644]
src/olsr_logging_sources.h [new file with mode: 0644]

index 0f454fd..e3c5fdc 100644 (file)
 #ifndef OLSR_COMPORT_H_
 #define OLSR_COMPORT_H_
 
-#include "defs.h"
+#include "common/common_types.h"
 #include "common/autobuf.h"
 #include "common/list.h"
 
+#include "defs.h"
+#include "olsr_types.h"
+
 enum http_header_type {
   PLAIN,
   HTTP_PLAIN,
index 9853137..e02eb0f 100644 (file)
@@ -67,44 +67,6 @@ const char *LOG_SEVERITY_NAMES[] = {
   "ERROR"
 };
 
-/*
- * String constants for olsr_log_* and if_mode as used in olsrd.conf.
- * Keep this in the same order as the log_source and
- * log_severity enums (see olsr_logging.h).
- */
-
-const char *LOG_SOURCE_NAMES[] = {
-  "all",
-  "logging",
-  "config",
-  "main",
-  "interface",
-  "networking",
-  "packet_creation",
-  "packet_parsing",
-  "routing",
-  "scheduler",
-  "timer",
-  "plugins",
-  "lq-plugins",
-  "ll-plugins",
-  "links",
-  "neighbors",
-  "mpr",
-  "mprset",
-  "2-hop",
-  "tc",
-  "hna",
-  "mid",
-  "duplicate-set",
-  "cookie",
-  "comport",
-  "apm",
-  "rtnetlink",
-  "tunnel",
-  "callback"
-};
-
 static void olsr_log_stderr(enum log_severity severity, enum log_source source,
                             bool no_header, const char *file, int line, char *buffer,
                             int timeLength, int prefixLength);
index 9dd235d..c84786e 100644 (file)
 #ifndef OLSR_LOGGING_H_
 #define OLSR_LOGGING_H_
 
+#include "common/common_types.h"
 #include "common/list.h"
 #include "defs.h"
-#include "olsr_types.h"
+#include "olsr_logging_sources.h"
 
 #define LOGBUFFER_SIZE 1024
 
@@ -61,45 +62,6 @@ enum log_severity {
   LOG_SEVERITY_COUNT                   //!< LOG_SEVERITY_COUNT
 };
 
-/**
- * defines the source of a logging event
- */
-enum log_source {
-  LOG_ALL,
-  LOG_LOGGING,
-  LOG_CONFIG,
-  LOG_MAIN,
-  LOG_INTERFACE,
-  LOG_NETWORKING,
-  LOG_PACKET_CREATION,
-  LOG_PACKET_PARSING,
-  LOG_ROUTING,
-  LOG_SCHEDULER,
-  LOG_TIMER,
-  LOG_PLUGINS,
-  LOG_LQ_PLUGINS,
-  LOG_LL_PLUGINS,
-  LOG_LINKS,
-  LOG_NEIGHTABLE,
-  LOG_MPR,
-  LOG_MPRS,
-  LOG_2NEIGH,
-  LOG_TC,
-  LOG_HNA,
-  LOG_MID,
-  LOG_DUPLICATE_SET,
-  LOG_COOKIE,
-  LOG_COMPORT,
-  LOG_APM,
-  LOG_RTNETLINK,
-  LOG_TUNNEL,
-  LOG_CALLBACK,
-
-  /* this one must be the last of the enums ! */
-  LOG_SOURCE_COUNT
-};
-
-extern const char *LOG_SOURCE_NAMES[];
 extern const char *LOG_SEVERITY_NAMES[];
 
 /**
diff --git a/src/olsr_logging_sources.c b/src/olsr_logging_sources.c
new file mode 100644 (file)
index 0000000..993ac3c
--- /dev/null
@@ -0,0 +1,79 @@
+
+/*
+ * The olsr.org Optimized Link-State Routing daemon(olsrd)
+ * Copyright (c) 2004-2009, the olsr.org team - see HISTORY file
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in
+ *   the documentation and/or other materials provided with the
+ *   distribution.
+ * * Neither the name of olsr.org, olsrd nor the names of its
+ *   contributors may be used to endorse or promote products derived
+ *   from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Visit http://www.olsr.org for more information.
+ *
+ * If you find this software useful feel free to make a donation
+ * to the project. For more information see the website or contact
+ * the copyright holders.
+ *
+ */
+#include "olsr_logging_sources.h"
+
+/*
+ * String constants for olsr_log_* and if_mode as used in olsrd.conf.
+ * Keep this in the same order as the log_source and
+ * log_severity enums (see olsr_logging_sources.h).
+ */
+
+const char *LOG_SOURCE_NAMES[] = {
+  "all",
+  "logging",
+  "config",
+  "main",
+  "interface",
+  "networking",
+  "packet_creation",
+  "packet_parsing",
+  "routing",
+  "scheduler",
+  "timer",
+  "plugins",
+  "lq-plugins",
+  "ll-plugins",
+  "links",
+  "neighbors",
+  "mpr",
+  "mprset",
+  "2-hop",
+  "tc",
+  "hna",
+  "mid",
+  "duplicate-set",
+  "cookie",
+  "comport",
+  "apm",
+  "rtnetlink",
+  "tunnel",
+  "callback"
+};
diff --git a/src/olsr_logging_sources.h b/src/olsr_logging_sources.h
new file mode 100644 (file)
index 0000000..5a70f14
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * olsr_logging_sources.h
+ *
+ *  Created on: Apr 6, 2011
+ *      Author: rogge
+ */
+
+#ifndef OLSR_LOGGING_SOURCES_H_
+#define OLSR_LOGGING_SOURCES_H_
+
+/**
+ * defines the source of a logging event
+ */
+enum log_source {
+  LOG_ALL,
+  LOG_LOGGING,
+  LOG_CONFIG,
+  LOG_MAIN,
+  LOG_INTERFACE,
+  LOG_NETWORKING,
+  LOG_PACKET_CREATION,
+  LOG_PACKET_PARSING,
+  LOG_ROUTING,
+  LOG_SCHEDULER,
+  LOG_TIMER,
+  LOG_PLUGINS,
+  LOG_LQ_PLUGINS,
+  LOG_LL_PLUGINS,
+  LOG_LINKS,
+  LOG_NEIGHTABLE,
+  LOG_MPR,
+  LOG_MPRS,
+  LOG_2NEIGH,
+  LOG_TC,
+  LOG_HNA,
+  LOG_MID,
+  LOG_DUPLICATE_SET,
+  LOG_COOKIE,
+  LOG_COMPORT,
+  LOG_APM,
+  LOG_RTNETLINK,
+  LOG_TUNNEL,
+  LOG_CALLBACK,
+
+  /* this one must be the last of the enums ! */
+  LOG_SOURCE_COUNT
+};
+
+extern const char *LOG_SOURCE_NAMES[];
+
+#endif /* OLSR_LOGGING_SOURCES_H_ */