Put includes necessary for code files into code files, not in central headers
authorHenning Rogge <hrogge@googlemail.com>
Fri, 25 Feb 2011 17:44:51 +0000 (18:44 +0100)
committerHenning Rogge <hrogge@googlemail.com>
Fri, 25 Feb 2011 17:44:51 +0000 (18:44 +0100)
38 files changed:
lib/arproaming/src/olsrd_arproaming.c
lib/bmf/src/NetworkInterfaces.c
lib/debuginfo/src/olsrd_debuginfo.c
lib/dot_draw/src/olsrd_dot_draw.c
lib/dyn_gw/src/olsrd_dyn_gw.c
lib/lq_etx_ff/src/lq_plugin_etx_ff.c
lib/lq_etx_float/src/lq_plugin_etx_float.c
lib/lq_etx_fpm/src/lq_plugin_etx_fpm.c
lib/lq_rfc/src/lq_plugin_rfc.c
lib/mdns/src/mdns.c
lib/mdns/src/olsrd_plugin.c
lib/obamp/src/olsrd_plugin.c
lib/txtinfo/src/olsrd_txtinfo.c
src/defs.h
src/duplicate_set.c
src/interfaces.c
src/ipcalc.c
src/linux/kernel_routes.c
src/linux/kernel_tunnel.c
src/linux/net.c
src/main.c
src/mid_set.c
src/neighbor_table.c
src/net_olsr.c
src/olsr.c
src/olsr.h
src/olsr_callbacks.c
src/olsr_cfg.c
src/olsr_clock.c
src/olsr_comport_http.c
src/olsr_comport_txt.c
src/olsr_logging.h
src/olsr_memcookie.c
src/olsr_spf.h
src/plugin_loader.c
src/routing_table.c
src/tc_set.c
src/unix/log.c

index 00dddb1..3507a94 100644 (file)
@@ -37,8 +37,8 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <time.h>
+#include <unistd.h>
 #include <malloc.h>
 #include <net/if_arp.h>
 #include <netinet/in.h>
@@ -47,6 +47,7 @@
 #include <arpa/inet.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
+#include <errno.h>
 
 #include "olsr.h"
 #include "defs.h"
index cf55826..bba371f 100644 (file)
@@ -57,6 +57,7 @@
 #include <netinet/ip.h>         /* struct ip */
 #include <netinet/udp.h>        /* SOL_UDP */
 #include <stdlib.h>             /* atoi, malloc */
+#include <stdio.h>
 
 /* OLSRD includes */
 #include "olsr.h"
index a053664..fffe752 100644 (file)
@@ -45,6 +45,8 @@
 
 #include <stdlib.h>
 
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "olsr.h"
 #include "ipcalc.h"
 #include "neighbor_table.h"
index edf37b9..721001c 100644 (file)
  * Dynamic linked library for the olsr.org olsr daemon
  */
 
-#include "olsr.h"
-#include "ipcalc.h"
-#include "neighbor_table.h"
-#include "tc_set.h"
-#include "hna_set.h"
-#include "link_set.h"
-#include "olsr_ip_prefix_list.h"
-#include "olsr_logging.h"
-#include "os_net.h"
-#include "plugin_util.h"
 
 #ifdef _WRS_KERNEL
 #include <vxWorks.h>
 #include <errno.h>
 #include <stdarg.h>
 #endif
+#include <stdio.h>
+
+#include "olsr.h"
+#include "ipcalc.h"
+#include "neighbor_table.h"
+#include "tc_set.h"
+#include "hna_set.h"
+#include "link_set.h"
+#include "olsr_ip_prefix_list.h"
+#include "olsr_logging.h"
+#include "os_net.h"
+#include "plugin_util.h"
 
 #define PLUGIN_DESCR    "OLSRD dot draw plugin"
 #define PLUGIN_AUTHOR   "Andreas Tonnesen"
index 1a3ed43..b66c868 100644 (file)
@@ -54,6 +54,8 @@
 #include "olsr_ip_prefix_list.h"
 #include "olsr_logging.h"
 
+#include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <net/route.h>
 #include <arpa/inet.h>
index 9880302..8b814bd 100644 (file)
  *
  */
 
+#include <stdio.h>
+
 #include "tc_set.h"
 #include "link_set.h"
 #include "lq_plugin.h"
 #include "olsr_spf.h"
 #include "lq_packet.h"
 #include "olsr.h"
-#include "lq_plugin_etx_ff.h"
 #include "parser.h"
 #include "mid_set.h"
 #include "olsr_timer.h"
@@ -53,6 +54,7 @@
 #include "olsr_logging.h"
 #include "common/string.h"
 #include "neighbor_table.h"
+#include "lq_plugin_etx_ff.h"
 
 #define PLUGIN_DESCR "Freifunk ETX metric based on the original design of Elektra and Thomas Lopatic"
 #define PLUGIN_AUTHOR "Henning Rogge"
index bdcbe8e..0a54c65 100644 (file)
@@ -39,6 +39,8 @@
  *
  */
 
+#include <stdio.h>
+
 #include "tc_set.h"
 #include "link_set.h"
 #include "olsr_spf.h"
index b5da585..1faeb92 100644 (file)
@@ -39,6 +39,8 @@
  *
  */
 
+#include <stdio.h>
+
 #include "tc_set.h"
 #include "link_set.h"
 #include "olsr_spf.h"
index 350376b..8642b24 100644 (file)
@@ -39,6 +39,8 @@
  *
  */
 
+#include <stdio.h>
+
 #include "tc_set.h"
 #include "link_set.h"
 #include "olsr_spf.h"
index d3df183..0026750 100644 (file)
@@ -55,6 +55,7 @@
 #include <netinet/ip.h>         /* struct ip */
 #include <netinet/udp.h>        /* struct udphdr */
 #include <unistd.h>             /* close() */
+#include <stdio.h>
 
 #include <netinet/in.h>
 #include <netinet/ip6.h>
index 02ac122..23ca012 100644 (file)
@@ -41,6 +41,7 @@
 /* System includes */
 #include <assert.h>             /* assert() */
 #include <stddef.h>             /* NULL */
+#include <stdio.h>
 
 /* OLSRD includes */
 #include "plugin.h"
index 03f1b50..f1c17ba 100644 (file)
@@ -44,6 +44,7 @@
 /* System includes */
 #include <assert.h>             /* assert() */
 #include <stddef.h>             /* NULL */
+#include <stdio.h>
 
 /* OLSRD includes */
 #include "plugin.h"
index 3be2ad3..7a04a7a 100644 (file)
@@ -42,6 +42,9 @@
 /*
  * Dynamic linked library for the olsr.org olsr daemon
  */
+
+#include <stdio.h>
+
 #include "olsr.h"
 #include "ipcalc.h"
 #include "neighbor_table.h"
index d78a547..80f84a3 100644 (file)
 #ifndef _OLSR_DEFS
 #define _OLSR_DEFS
 
-#include "olsr_types.h"
-
-#include <stdio.h>
-#include <errno.h>
-
-#include "common/list.h"
-
 #ifdef WIN32
 #define IF_NAMESIZE 32
 #endif
index ede65b4..72c0edb 100644 (file)
  *
  */
 
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "duplicate_set.h"
 #include "ipcalc.h"
-#include "common/avl.h"
 #include "olsr.h"
 #include "mid_set.h"
 #include "olsr_timer.h"
index 099ca67..d3aa73f 100644 (file)
  *
  */
 
+#include "common/avl_olsr_comp.h"
+#include "common/avl.h"
+#include "common/string.h"
+
 #include "defs.h"
 #include "interfaces.h"
 #include "olsr_timer.h"
@@ -47,8 +51,6 @@
 #include "parser.h"
 #include "net_olsr.h"
 #include "ipcalc.h"
-#include "common/string.h"
-#include "common/avl.h"
 #include "olsr_logging.h"
 #include "os_net.h"
 
index 8dc0874..67d925f 100644 (file)
@@ -46,6 +46,8 @@
  *
  */
 
+#include <stdio.h>
+
 #include "ipcalc.h"
 
 #define IN6ADDR_V4MAPPED_LOOPBACK_INIT \
index 1280e16..dee1f11 100644 (file)
  *
  */
 
-#include "interfaces.h"
-#include "olsr_logging.h"
-#include "os_net.h"
-#include "os_kernel_routes.h"
-
-#include <assert.h>
-#include <linux/types.h>
-#include <linux/rtnetlink.h>
-
 //ipip includes
 #include <netinet/in.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <net/if.h>
 
+#include <linux/types.h>
+#include <linux/rtnetlink.h>
+#include <assert.h>
+#include <errno.h>
+
+#include "interfaces.h"
+#include "olsr_logging.h"
+#include "os_net.h"
+#include "os_kernel_routes.h"
+
 /*
  * This file contains the linux routing code. (rtnetlink based)
  */
index f0831f7..ea3d0d4 100644 (file)
  *
  */
 
-#include "defs.h"
-#include "olsr_types.h"
-#include "olsr_memcookie.h"
-#include "olsr_logging.h"
-#include "ipcalc.h"
-#include "os_net.h"
-#include "os_kernel_tunnel.h"
-#include "os_kernel_routes.h"
-
-#include <assert.h>
-
 //ipip includes
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <sys/types.h>
 #include <net/if.h>
 
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
+#include "defs.h"
+#include "olsr_types.h"
+#include "olsr_memcookie.h"
+#include "olsr_logging.h"
+#include "ipcalc.h"
+#include "os_net.h"
+#include "os_kernel_tunnel.h"
+#include "os_kernel_routes.h"
+
 static const char DEV_IPV4_TUNNEL[IFNAMSIZ] = TUNNEL_ENDPOINT_IF;
 static const char DEV_IPV6_TUNNEL[IFNAMSIZ] = TUNNEL_ENDPOINT_IF6;
 
index e8ecafd..7885b98 100644 (file)
  * Linux spesific code
  */
 
-#include "ipcalc.h"
-#include "common/string.h"
-#include "olsr_protocol.h"
-#include "olsr_logging.h"
-#include "olsr.h"
-#include "os_kernel_tunnel.h"
-#include "os_net.h"
-#include "linux/linux_net.h"
-
 #include <net/if.h>
 #include <netinet/ip.h>
 
 #include <sys/ioctl.h>
 #include <sys/utsname.h>
 
+#include <errno.h>
 #include <fcntl.h>
-#include <string.h>
 #include <stdio.h>
+#include <string.h>
 #include <syslog.h>
 #include <unistd.h>
 
+#include "ipcalc.h"
+#include "common/string.h"
+#include "olsr_protocol.h"
+#include "olsr_logging.h"
+#include "olsr.h"
+#include "os_kernel_tunnel.h"
+#include "os_net.h"
+#include "linux/linux_net.h"
+
 /**
  * Fix bug in GLIBC, see https://bugzilla.redhat.com/show_bug.cgi?id=635260
  */
index 6e39c0e..62721f1 100644 (file)
  *
  */
 
-#include <unistd.h>
-#include <signal.h>
 #include <sys/stat.h>
 #include <assert.h>
 #include <errno.h>
+#include <stdio.h>
+#include <signal.h>
+#include <unistd.h>
 
 #include "defs.h"
 #include "common/avl.h"
index f8de775..a25f786 100644 (file)
@@ -39,6 +39,8 @@
  *
  */
 
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "ipcalc.h"
 #include "defs.h"
 #include "mid_set.h"
index 8779e80..3a46553 100644 (file)
  *
  */
 
+#include <assert.h>
+#include <stdlib.h>
+
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "ipcalc.h"
 #include "defs.h"
 #include "mid_set.h"
@@ -50,9 +55,6 @@
 #include "net_olsr.h"
 #include "olsr_logging.h"
 
-#include <assert.h>
-#include <stdlib.h>
-
 /* Root of the one hop and two hop neighbor trees */
 struct avl_tree nbr_tree;
 struct avl_tree nbr2_tree;
index bb86feb..ab61df2 100644 (file)
@@ -39,6 +39,8 @@
  *
  */
 
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "net_olsr.h"
 #include "ipcalc.h"
 #include "olsr.h"
index d2b9a56..c91fbe2 100644 (file)
  * All these functions are global
  */
 
+#include <assert.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
 #include "defs.h"
 #include "olsr.h"
 #include "link_set.h"
 #include "os_system.h"
 #include "os_apm.h"
 
-#include <assert.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <stdlib.h>
-
 static void olsr_update_willingness(void *);
 
 bool changes_topology = false;
index 847cd2f..f474323 100644 (file)
@@ -43,9 +43,8 @@
 #ifndef _OLSR_FUNCTIONS
 #define _OLSR_FUNCTIONS
 
+#include "olsr_types.h"
 #include "olsr_protocol.h"
-#include "interfaces.h"
-#include "common/avl_olsr_comp.h"
 
 extern bool changes_topology;
 extern bool changes_neighborhood;
index f8e341d..7aa9b21 100644 (file)
@@ -5,6 +5,7 @@
  *      Author: henning
  */
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
index 7c51a93..a99137e 100644 (file)
  *
  */
 
+#include <arpa/inet.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <assert.h>
+#include <errno.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "olsr_cfg.h"
 #include "olsr_cfg_data.h"
 
 #include "os_net.h"
 #include "os_system.h"
 
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <getopt.h>
-#include <errno.h>
-#include <assert.h>
-
 #ifdef DEBUG
 #define PARSER_DEBUG_PRINTF(x, args...)   printf(x, ##args)
 #else
index fde6b80..3374330 100644 (file)
@@ -41,6 +41,8 @@
 
 #include <assert.h>
 #include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
 
 #include "os_time.h"
 #include "olsr_logging.h"
index e6ceb09..7a46489 100644 (file)
@@ -40,6 +40,7 @@
  */
 
 #include <assert.h>
+#include <stdio.h>
 #include <string.h>
 
 #include "common/autobuf.h"
index d87ad9b..f2aa08e 100644 (file)
@@ -42,6 +42,8 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "olsr_cfg.h"
 #include "olsr_logging.h"
 #include "olsr_memcookie.h"
index f181e9f..04b0507 100644 (file)
@@ -42,7 +42,9 @@
 #ifndef OLSR_LOGGING_H_
 #define OLSR_LOGGING_H_
 
+#include "common/list.h"
 #include "defs.h"
+#include "olsr_types.h"
 #include "olsr_cfg_data.h"
 
 #define LOGBUFFER_SIZE 1024
index 84ac172..6a5acc0 100644 (file)
  *
  */
 
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#include "common/list.h"
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "olsr.h"
 #include "defs.h"
 #include "olsr_memcookie.h"
 #include "olsr_logging.h"
-#include "common/list.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
 
 struct avl_tree olsr_cookie_tree;
 
index a63dd5c..72a9b7b 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef _OLSR_SPF_H
 #define _OLSR_SPF_H
 
-#include "defs.h"
+#include "olsr_types.h"
 
 #define OLSR_SPF_BACKOFF_TIME  (1*1000) /* milliseconds */
 #define OLSR_SPF_BACKOFF_JITTER 5       /* percent */
index 394a986..10af0cb 100644 (file)
  *
  */
 
+#include <assert.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "common/list.h"
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "plugin_loader.h"
 #include "plugin.h"
 #include "plugin_util.h"
 #include "defs.h"
 #include "olsr.h"
 #include "olsr_logging.h"
-#include "common/avl.h"
-#include "common/list.h"
 #include "olsr_memcookie.h"
 
-#include <dlfcn.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <assert.h>
-
 /* Local functions */
 static struct olsr_plugin *olsr_load_legacy_plugin(const char *, void *);
 
@@ -74,7 +76,7 @@ static int olsr_internal_unload_plugin(struct olsr_plugin *plugin, bool cleanup)
 void
 olsr_hookup_plugin(struct olsr_plugin *pl_def) {
   assert (pl_def->name);
-  fprintf(stdout, "hookup %s\n", pl_def->name);
+  fprintf(stderr, "hookup %s\n", pl_def->name);
   if (!plugin_tree_initialized) {
     avl_init(&plugin_tree, avl_comp_strcasecmp, false, NULL);
     plugin_tree_initialized = true;
index 4cd7a35..3a53bdf 100644 (file)
  *
  */
 
+#include <assert.h>
+#include <stdio.h>
+#include <limits.h>
+
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "routing_table.h"
 #include "ipcalc.h"
 #include "defs.h"
 #include "neighbor_table.h"
 #include "olsr.h"
 #include "link_set.h"
-#include "common/avl.h"
 #include "olsr_spf.h"
 #include "net_olsr.h"
 #include "olsr_logging.h"
 
-#include <limits.h>
-#include <assert.h>
-
 /* Cookies */
 struct olsr_memcookie_info *rt_mem_cookie = NULL;
 struct olsr_memcookie_info *rtp_mem_cookie = NULL; /* Maybe static */
index 45af42b..d23eff6 100644 (file)
  *
  */
 #include <assert.h>
+#include <stdio.h>
 
+#include "common/avl.h"
+#include "common/avl_olsr_comp.h"
 #include "tc_set.h"
 #include "olsr.h"
 #include "lq_packet.h"
index c2f29df..cf88937 100644 (file)
  * System logging interface for GNU/Linux systems
  */
 
+#include <stdio.h>
+#include <syslog.h>
+
 #include "olsr_logging.h"
 #include "os_system.h"
 #include "unix/unix_log.h"
 
-#include <syslog.h>
-
 void
 os_syslog_init(const char *ident)
 {