Fixed script and line-break quirks
authorSven-Ola Tuecke <sven-ola@gmx.de>
Sun, 23 Nov 2008 16:05:22 +0000 (17:05 +0100)
committerSven-Ola Tuecke <sven-ola@gmx.de>
Sun, 23 Nov 2008 16:05:22 +0000 (17:05 +0100)
64 files changed:
gnu-indent.sh
gui/linux-gtk/src/interface.c
gui/linux-gtk/src/ipc.c
gui/win32/Main/TrayIcon.h
lib/arprefresh/src/olsrd_arprefresh.c
lib/bmf/src/Bmf.c
lib/bmf/src/NetworkInterfaces.c
lib/bmf/src/NetworkInterfaces.h
lib/dot_draw/src/olsrd_dot_draw.c
lib/dyn_gw_plain/src/olsrd_dyn_gw_plain.c
lib/httpinfo/src/admin_interface.c
lib/httpinfo/src/olsrd_httpinfo.c
lib/nameservice/src/mapwrite.c
lib/nameservice/src/nameservice.c
lib/pgraph/src/olsrd_pgraph.c
lib/quagga/src/quagga.c
lib/quagga/test/quagga.try1.c
lib/secure/src/olsrd_secure.c
lib/tas/src/glua.h
lib/tas/src/http.c
lib/tas/src/lua/lparser.c
lib/tas/src/lua/lvm.c
lib/tas/src/plugin.c
lib/txtinfo/src/olsrd_txtinfo.c
src/bsd/kernel_routes.c
src/bsd/net.c
src/build_msg.c
src/cfgparser/cfgfile_gen.c
src/cfgparser/olsrd_conf.c
src/duplicate_set.c
src/hna_set.c
src/hysteresis.c
src/interfaces.c
src/ipc_frontend.c
src/link_set.c
src/link_set.h
src/linux/apm.c
src/linux/kernel_routes.c
src/linux/link_layer.c
src/linux/net.c
src/lq_plugin_default_ff.c
src/lq_plugin_default_fpm.c
src/mid_set.c
src/mpr.c
src/neighbor_table.c
src/net_olsr.c
src/olsr.c
src/olsr_spf.c
src/olsr_switch/link_rules.c
src/olsr_switch/main.c
src/olsr_switch/ohs_cmd.c
src/parser.c
src/plugin_loader.c
src/print_packet.c
src/process_package.c
src/routing_table.c
src/scheduler.c
src/tc_set.c
src/two_hop_neighbor_table.c
src/unix/ifnet.c
src/win32/compat.c
src/win32/ifnet.c
src/win32/kernel_routes.c
src/win32/net.c

index de2b21c..d09dbbe 100755 (executable)
@@ -27,9 +27,9 @@ sed -i 's/\r//g;s/[     ]\+$//' $(find -name "*.[ch]" -not -path "*/.hg*")
 
 addon=
 test "--cmp" = "$1" && {
-  # Note: --swallow-optional-blank-lines --ignore-newlines
-  #       to compare two manually formatted source trees.
-  addon=--swallow-optional-blank-lines --ignore-newlines
+  # Note: may help to compare two messy formatted source trees.
+  addon="--swallow-optional-blank-lines --ignore-newlines"
+  shift
 }
 indent $(cat ${0%/*}/src/.indent.pro) $addon $(find -name "*.[ch]" -not -path "*/.hg*")
 
index febb06b..48ba31a 100644 (file)
@@ -569,8 +569,8 @@ create_main_window(void)
    */
   packet_content_list = gtk_clist_new(4);
   gtk_widget_ref(packet_content_list);
-  gtk_object_set_data_full(GTK_OBJECT(main_window), "packet_content_list",
-                           packet_content_list, (GtkDestroyNotify) gtk_widget_unref);
+  gtk_object_set_data_full(GTK_OBJECT(main_window), "packet_content_list", packet_content_list,
+                           (GtkDestroyNotify) gtk_widget_unref);
 
   gtk_widget_show(packet_content_list);
   gtk_container_add(GTK_CONTAINER(scrolledwindow3), packet_content_list);
@@ -663,8 +663,8 @@ create_main_window(void)
 
   route_scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
   gtk_widget_ref(route_scrolledwindow);
-  gtk_object_set_data_full(GTK_OBJECT(main_window), "route_scrolledwindow",
-                           route_scrolledwindow, (GtkDestroyNotify) gtk_widget_unref);
+  gtk_object_set_data_full(GTK_OBJECT(main_window), "route_scrolledwindow", route_scrolledwindow,
+                           (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show(route_scrolledwindow);
   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(route_scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 
index bc405a7..0897931 100644 (file)
@@ -322,16 +322,14 @@ ipc_eval_net_info(struct netmsg *msg)
     ipsize = sizeof(struct in_addr);
     sprintf(&info[0],
             "IP version 4\nMain address: %s\nMid addresses: %d\nHna addresses: %d\nHELLO interval: %d\nHELLO LAN interval: %d\nTC interval: %d\nNeighbor hold time: %d\nTopology hold: %d\n",
-            ip_to_string(&msg->main_addr), msg->mids, msg->hnas,
-            ntohs(msg->hello_int), ntohs(msg->hello_lan_int),
+            ip_to_string(&msg->main_addr), msg->mids, msg->hnas, ntohs(msg->hello_int), ntohs(msg->hello_lan_int),
             ntohs(msg->tc_int), ntohs(msg->neigh_hold), ntohs(msg->topology_hold));
   } else {
     ipversion = AF_INET6;
     ipsize = sizeof(struct in6_addr);
     sprintf(&info[0],
             "IP version 6\nMain address: %s\nMid addresses: %d\nHna addresses: %d\nHELLO interval: %d\nHELLO LAN interval: %d\nTC interval: %d\nNeighbor hold time: %d\nTopology hold: %d\n",
-            ip_to_string(&msg->main_addr), msg->mids, msg->hnas,
-            ntohs(msg->hello_int), ntohs(msg->hello_lan_int),
+            ip_to_string(&msg->main_addr), msg->mids, msg->hnas, ntohs(msg->hello_int), ntohs(msg->hello_lan_int),
             ntohs(msg->tc_int), ntohs(msg->neigh_hold), ntohs(msg->topology_hold));
   }
 
index 22480e0..e6d5d63 100644 (file)
@@ -12,7 +12,8 @@ public:
 
   static TrayIcon *getInstance() {
     return instance;
-  } enum status { CONNECTED, ON, OFF };
+  }
+  enum status { CONNECTED, ON, OFF };
 
   void setStatus(status con_status, const char *message);
 
index b35f253..49bbacf 100644 (file)
@@ -135,8 +135,8 @@ olsr_arp_event(void *foo __attribute__ ((unused)))
         int i;
         OLSR_PRINTF(0, "Refresh on %s, %s=", req.arp.arp_dev, inet_ntoa(*((struct in_addr *)&buf.ip.saddr)));
         for (i = 0; i < (ssize_t) sizeof(buf.eth.h_source); i++) {
-          OLSR_PRINTF(0, "%02x%s",
-                      ((unsigned char *)&buf.eth.h_source)[i], i < (ssize_t) sizeof(buf.eth.h_source) - 1 ? ":" : "\n");
+          OLSR_PRINTF(0, "%02x%s", ((unsigned char *)&buf.eth.h_source)[i],
+                      i < (ssize_t) sizeof(buf.eth.h_source) - 1 ? ":" : "\n");
         }
       }
 #endif
index 31e2dbb..77c33ee 100644 (file)
@@ -169,9 +169,8 @@ EncapsulateAndForwardPacket(struct TBmfInterface *intf, unsigned char *encapsula
   FindNeighbors(&bestNeighborLinks, &bestNeighbor, intf, NULL, NULL, NULL, &nPossibleNeighbors);
 
   if (nPossibleNeighbors <= 0) {
-    OLSR_PRINTF(8,
-                "%s: --> not encap-forwarding on \"%s\": there is no neighbor that needs my retransmission\n",
-                PLUGIN_NAME_SHORT, intf->ifName);
+    OLSR_PRINTF(8, "%s: --> not encap-forwarding on \"%s\": there is no neighbor that needs my retransmission\n", PLUGIN_NAME_SHORT,
+                intf->ifName);
     return;
   }
 
@@ -221,8 +220,8 @@ EncapsulateAndForwardPacket(struct TBmfInterface *intf, unsigned char *encapsula
 
     /* Forward the BMF packet via the encapsulation socket */
     nBytesWritten =
-      sendto(intf->encapsulatingSkfd, encapsulationUdpData, udpDataLen,
-             MSG_DONTROUTE, (struct sockaddr *)&forwardTo, sizeof(forwardTo));
+      sendto(intf->encapsulatingSkfd, encapsulationUdpData, udpDataLen, MSG_DONTROUTE, (struct sockaddr *)&forwardTo,
+             sizeof(forwardTo));
 
     /* Evaluate and display result */
     if (nBytesWritten != udpDataLen) {
@@ -231,9 +230,8 @@ EncapsulateAndForwardPacket(struct TBmfInterface *intf, unsigned char *encapsula
       /* Increase counter */
       intf->nBmfPacketsTx++;
 
-      OLSR_PRINTF(8,
-                  "%s: --> encapsulated and forwarded on \"%s\" to %s\n",
-                  PLUGIN_NAME_SHORT, intf->ifName, inet_ntoa(forwardTo.sin_addr));
+      OLSR_PRINTF(8, "%s: --> encapsulated and forwarded on \"%s\" to %s\n", PLUGIN_NAME_SHORT, intf->ifName,
+                  inet_ntoa(forwardTo.sin_addr));
     }                           /* if (nBytesWritten != udpDataLen) */
   }                             /* for */
 }                               /* EncapsulateAndForwardPacket */
@@ -304,11 +302,8 @@ BmfPacketCaptured(struct TBmfInterface *intf, unsigned char sllPkttype, unsigned
 
   src.v4 = ipHeader->ip_src;
 
-  OLSR_PRINTF(8,
-              "%s: %s pkt of %ld bytes captured on %s interface \"%s\": %s->%s\n",
-              PLUGIN_NAME_SHORT,
-              sllPkttype == PACKET_OUTGOING ? "outgoing" : "incoming",
-              (long)ipPacketLen, isFromOlsrIntf ? "OLSR" : "non-OLSR",
+  OLSR_PRINTF(8, "%s: %s pkt of %ld bytes captured on %s interface \"%s\": %s->%s\n", PLUGIN_NAME_SHORT,
+              sllPkttype == PACKET_OUTGOING ? "outgoing" : "incoming", (long)ipPacketLen, isFromOlsrIntf ? "OLSR" : "non-OLSR",
               intf->ifName, olsr_ip_to_string(&srcBuf, &src), olsr_ip_to_string(&dstBuf, &dst));
 
   /* Lookup main address of source in the MID table of OLSR */
@@ -399,14 +394,12 @@ BmfPacketCaptured(struct TBmfInterface *intf, unsigned char sllPkttype, unsigned
         /* Case 1.1 */
         {
           struct ipaddr_str buf;
-          OLSR_PRINTF(8,
-                      "%s: --> not encap-forwarding on \"%s\": I am not selected as MPR by neighbor %s\n",
-                      PLUGIN_NAME_SHORT, walker->ifName, olsr_ip_to_string(&buf, &src));
+          OLSR_PRINTF(8, "%s: --> not encap-forwarding on \"%s\": I am not selected as MPR by neighbor %s\n", PLUGIN_NAME_SHORT,
+                      walker->ifName, olsr_ip_to_string(&buf, &src));
         }
       } else if (sllPkttype == PACKET_OUTGOING && intf == walker) {
-        OLSR_PRINTF(8,
-                    "%s: --> not encap-forwarding on \"%s\": pkt was captured on that interface\n",
-                    PLUGIN_NAME_SHORT, walker->ifName);
+        OLSR_PRINTF(8, "%s: --> not encap-forwarding on \"%s\": pkt was captured on that interface\n", PLUGIN_NAME_SHORT,
+                    walker->ifName);
       } else {
         /* Case 1.2 and 1.3 */
         EncapsulateAndForwardPacket(walker, encapsulationUdpData);
@@ -518,9 +511,8 @@ BmfPacketCaptured(struct TBmfInterface *intf, unsigned char sllPkttype, unsigned
  * Data Used  : BmfInterfaces
  * ------------------------------------------------------------------------- */
 static void
-BmfEncapsulationPacketReceived(struct TBmfInterface *intf,
-                               union olsr_ip_addr *forwardedBy,
-                               union olsr_ip_addr *forwardedTo, unsigned char *encapsulationUdpData)
+BmfEncapsulationPacketReceived(struct TBmfInterface *intf, union olsr_ip_addr *forwardedBy, union olsr_ip_addr *forwardedTo,
+                               unsigned char *encapsulationUdpData)
 {
   int iAmMpr;                          /* True (1) if I am selected as MPR by 'forwardedBy' */
   struct sockaddr_in forwardTo;        /* Next destination of encapsulation packet */
@@ -555,13 +547,10 @@ BmfEncapsulationPacketReceived(struct TBmfInterface *intf,
   intf->nBmfPacketsRx++;
 
   /* Beware: not possible to call olsr_ip_to_string more than 4 times in same printf */
-  OLSR_PRINTF(8,
-              "%s: encapsulated pkt of %ld bytes incoming on \"%s\": %s->%s, forwarded by %s to %s\n",
-              PLUGIN_NAME_SHORT, (long)ipPacketLen, intf->ifName,
-              olsr_ip_to_string(&mcSrcBuf, &mcSrc),
-              olsr_ip_to_string(&mcDstBuf, &mcDst),
-              olsr_ip_to_string(&forwardedByBuf, forwardedBy),
-              forwardedTo != NULL ? olsr_ip_to_string(&forwardedToBuf, forwardedTo) : "me");
+  OLSR_PRINTF(8, "%s: encapsulated pkt of %ld bytes incoming on \"%s\": %s->%s, forwarded by %s to %s\n", PLUGIN_NAME_SHORT,
+              (long)ipPacketLen, intf->ifName, olsr_ip_to_string(&mcSrcBuf, &mcSrc), olsr_ip_to_string(&mcDstBuf, &mcDst),
+              olsr_ip_to_string(&forwardedByBuf, forwardedBy), forwardedTo != NULL ? olsr_ip_to_string(&forwardedToBuf,
+                                                                                                       forwardedTo) : "me");
 
   /* Get encapsulation header */
   encapsulationHdr = (struct TEncapHeader *)encapsulationUdpData;
@@ -607,7 +596,6 @@ BmfEncapsulationPacketReceived(struct TBmfInterface *intf,
     }
   }
 
-
   /* if (EtherTunTapFd >= 0) */
   /* Check if I am MPR for the forwarder */
   /* TODO: olsr_lookup_mprs_set() is not thread-safe! */
@@ -682,9 +670,8 @@ BmfEncapsulationPacketReceived(struct TBmfInterface *intf,
       FindNeighbors(&bestNeighborLinks, &bestNeighbor, walker, &mcSrc, forwardedBy, forwardedTo, &nPossibleNeighbors);
 
       if (nPossibleNeighbors <= 0) {
-        OLSR_PRINTF(8,
-                    "%s: --> not forwarding on \"%s\": there is no neighbor that needs my retransmission\n",
-                    PLUGIN_NAME_SHORT, walker->ifName);
+        OLSR_PRINTF(8, "%s: --> not forwarding on \"%s\": there is no neighbor that needs my retransmission\n", PLUGIN_NAME_SHORT,
+                    walker->ifName);
 
         continue;               /* for */
       }
@@ -730,8 +717,8 @@ BmfEncapsulationPacketReceived(struct TBmfInterface *intf,
 
         /* Forward the BMF packet via the encapsulation socket */
         nBytesWritten =
-          sendto(walker->encapsulatingSkfd, encapsulationUdpData,
-                 encapsulationUdpDataLen, MSG_DONTROUTE, (struct sockaddr *)&forwardTo, sizeof(forwardTo));
+          sendto(walker->encapsulatingSkfd, encapsulationUdpData, encapsulationUdpDataLen, MSG_DONTROUTE,
+                 (struct sockaddr *)&forwardTo, sizeof(forwardTo));
 
         /* Evaluate and display result */
         if (nBytesWritten != encapsulationUdpDataLen) {
@@ -750,9 +737,8 @@ BmfEncapsulationPacketReceived(struct TBmfInterface *intf,
       struct ipaddr_str buf;
       /* 'walker' is an OLSR interface, but I am not selected as MPR. In that
        * case, don't forward. */
-      OLSR_PRINTF(8,
-                  "%s: --> not forwarding on \"%s\": I am not selected as MPR by %s\n",
-                  PLUGIN_NAME_SHORT, walker->ifName, olsr_ip_to_string(&buf, forwardedBy));
+      OLSR_PRINTF(8, "%s: --> not forwarding on \"%s\": I am not selected as MPR by %s\n", PLUGIN_NAME_SHORT, walker->ifName,
+                  olsr_ip_to_string(&buf, forwardedBy));
     }                           /* else */
   }                             /* for */
 }                               /* BmfEncapsulationPacketReceived */
@@ -798,10 +784,8 @@ BmfTunPacketCaptured(unsigned char *encapsulationUdpData)
 
   srcIp.v4 = ipHeader->ip_src;
 
-  OLSR_PRINTF(8,
-              "%s: outgoing pkt of %ld bytes captured on tuntap interface \"%s\": %s->%s\n",
-              PLUGIN_NAME_SHORT, (long)ipPacketLen, EtherTunTapIfName,
-              olsr_ip_to_string(&srcIpBuf, &srcIp), olsr_ip_to_string(&dstIpBuf, &dstIp));
+  OLSR_PRINTF(8, "%s: outgoing pkt of %ld bytes captured on tuntap interface \"%s\": %s->%s\n", PLUGIN_NAME_SHORT,
+              (long)ipPacketLen, EtherTunTapIfName, olsr_ip_to_string(&srcIpBuf, &srcIp), olsr_ip_to_string(&dstIpBuf, &dstIp));
 
   /* Calculate packet fingerprint */
   crc32 = PacketCrc32(ipPacket, ipPacketLen);
@@ -940,8 +924,8 @@ DoBmf(void)
           continue;             /* for */
         }
 
-        if (pktAddr.sll_pkttype == PACKET_OUTGOING
-            || pktAddr.sll_pkttype == PACKET_MULTICAST || pktAddr.sll_pkttype == PACKET_BROADCAST) {
+        if (pktAddr.sll_pkttype == PACKET_OUTGOING || pktAddr.sll_pkttype == PACKET_MULTICAST
+            || pktAddr.sll_pkttype == PACKET_BROADCAST) {
           /* A multicast or broadcast packet was captured */
 
           BmfPacketCaptured(walker, pktAddr.sll_pkttype, rxBuffer);
@@ -1012,16 +996,16 @@ DoBmf(void)
          * the same ethernet frame. */
         minimumLength = GetIpHeaderLength(rxBuffer) + sizeof(struct udphdr) + ENCAP_HDR_LEN + sizeof(struct ip);
         if (nBytes < minimumLength) {
-          olsr_printf(1,
-                      "%s: captured a too short encapsulation packet (%d bytes) on \"%s\"\n", PLUGIN_NAME, nBytes, walker->ifName);
+          olsr_printf(1, "%s: captured a too short encapsulation packet (%d bytes) on \"%s\"\n", PLUGIN_NAME, nBytes,
+                      walker->ifName);
 
           continue;             /* for */
         }
 
         forwardedBy.v4 = ipHeader->ip_src;
         forwardedTo.v4 = ipHeader->ip_dst;
-        BmfEncapsulationPacketReceived(walker, &forwardedBy,
-                                       &forwardedTo, rxBuffer + GetIpHeaderLength(rxBuffer) + sizeof(struct udphdr));
+        BmfEncapsulationPacketReceived(walker, &forwardedBy, &forwardedTo,
+                                       rxBuffer + GetIpHeaderLength(rxBuffer) + sizeof(struct udphdr));
 
       }                         /* if (skfd >= 0 && (FD_ISSET...)) */
     }                           /* for */
@@ -1057,9 +1041,8 @@ DoBmf(void)
         minimumLength = ENCAP_HDR_LEN + sizeof(struct ip);
         if (nBytes < minimumLength) {
           struct ipaddr_str buf;
-          olsr_printf(1,
-                      "%s: received a too short encapsulation packet (%d bytes) from %s on \"%s\"\n",
-                      PLUGIN_NAME, nBytes, olsr_ip_to_string(&buf, &forwardedBy), walker->ifName);
+          olsr_printf(1, "%s: received a too short encapsulation packet (%d bytes) from %s on \"%s\"\n", PLUGIN_NAME, nBytes,
+                      olsr_ip_to_string(&buf, &forwardedBy), walker->ifName);
 
           continue;             /* for */
         }
index 2d0d319..3e915fd 100644 (file)
@@ -130,8 +130,8 @@ int CapturePacketsOnOlsrInterfaces = 0;
  * Data Used  : EtherTunTapIfName
  * ------------------------------------------------------------------------- */
 int
-SetBmfInterfaceName(const char *ifname, void *data
-                    __attribute__ ((unused)), set_plugin_parameter_addon addon __attribute__ ((unused)))
+SetBmfInterfaceName(const char *ifname, void *data __attribute__ ((unused)), set_plugin_parameter_addon addon
+                    __attribute__ ((unused)))
 {
   strncpy(EtherTunTapIfName, ifname, IFNAMSIZ - 1);
   EtherTunTapIfName[IFNAMSIZ - 1] = '\0';       /* Ensures null termination */
@@ -217,8 +217,8 @@ SetBmfInterfaceIp(const char *ip, void *data __attribute__ ((unused)), set_plugi
  * Data Used  : none
  * ------------------------------------------------------------------------- */
 int
-SetCapturePacketsOnOlsrInterfaces(const char *enable, void *data
-                                  __attribute__ ((unused)), set_plugin_parameter_addon addon __attribute__ ((unused)))
+SetCapturePacketsOnOlsrInterfaces(const char *enable, void *data __attribute__ ((unused)), set_plugin_parameter_addon addon
+                                  __attribute__ ((unused)))
 {
   if (strcmp(enable, "yes") == 0) {
     CapturePacketsOnOlsrInterfaces = 1;
@@ -244,8 +244,8 @@ SetCapturePacketsOnOlsrInterfaces(const char *enable, void *data
  * Data Used  : none
  * ------------------------------------------------------------------------- */
 int
-SetBmfMechanism(const char *mechanism, void *data
-                __attribute__ ((unused)), set_plugin_parameter_addon addon __attribute__ ((unused)))
+SetBmfMechanism(const char *mechanism, void *data __attribute__ ((unused)), set_plugin_parameter_addon addon
+                __attribute__ ((unused)))
 {
   if (strcmp(mechanism, "Broadcast") == 0) {
     BmfMechanism = BM_BROADCAST;
@@ -306,10 +306,9 @@ DeactivateSpoofFilter(void)
   procSpoof = fopen(procFile, "r");
   if (procSpoof == NULL) {
     fprintf(stderr,
-            "WARNING! Could not open the %s file to check/disable the IP spoof filter!\n"
-            "Are you using the procfile filesystem?\n"
-            "Does your system support IPv4?\n"
-            "I will continue (in 3 sec) - but you should manually ensure that IP spoof\n" "filtering is disabled!\n\n", procFile);
+            "WARNING! Could not open the %s file to check/disable the IP spoof filter!\n" "Are you using the procfile filesystem?\n"
+            "Does your system support IPv4?\n" "I will continue (in 3 sec) - but you should manually ensure that IP spoof\n"
+            "filtering is disabled!\n\n", procFile);
 
     sleep(3);
     return 0;
@@ -382,8 +381,7 @@ RestoreSpoofFilter(void)
  * Data Used  : FanOutLimit
  * ------------------------------------------------------------------------- */
 void
-FindNeighbors(struct TBestNeighbors *neighbors,
-              struct link_entry **bestNeighbor, struct TBmfInterface *intf,
+FindNeighbors(struct TBestNeighbors *neighbors, struct link_entry **bestNeighbor, struct TBmfInterface *intf,
               union olsr_ip_addr *source, union olsr_ip_addr *forwardedBy, union olsr_ip_addr *forwardedTo, int *nPossibleNeighbors)
 {
   int i;
@@ -409,9 +407,8 @@ FindNeighbors(struct TBestNeighbors *neighbors,
         continue;               /* for */
       }
 
-      OLSR_PRINTF(8,
-                  "%s: ----> Considering forwarding pkt on \"%s\" to %s\n",
-                  PLUGIN_NAME_SHORT, intf->ifName, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+      OLSR_PRINTF(8, "%s: ----> Considering forwarding pkt on \"%s\" to %s\n", PLUGIN_NAME_SHORT, intf->ifName,
+                  olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
       neighborMainIp = MainAddressOf(&walker->neighbor_iface_addr);
 
@@ -419,9 +416,8 @@ FindNeighbors(struct TBestNeighbors *neighbors,
        * passed IP addresses (if passed). Rely on short-circuit boolean evaluation. */
       if (source != NULL && ipequal(neighborMainIp, MainAddressOf(source))) {
         struct ipaddr_str buf;
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: is source of pkt\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: is source of pkt\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
@@ -429,9 +425,8 @@ FindNeighbors(struct TBestNeighbors *neighbors,
       /* Rely on short-circuit boolean evaluation */
       if (forwardedBy != NULL && ipequal(neighborMainIp, MainAddressOf(forwardedBy))) {
         struct ipaddr_str buf;
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: is the node that forwarded the pkt\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: is the node that forwarded the pkt\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
@@ -439,9 +434,8 @@ FindNeighbors(struct TBestNeighbors *neighbors,
       /* Rely on short-circuit boolean evaluation */
       if (forwardedTo != NULL && ipequal(neighborMainIp, MainAddressOf(forwardedTo))) {
         struct ipaddr_str buf;
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: is the node to which the pkt was forwarded\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: is the node to which the pkt was forwarded\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
@@ -496,36 +490,32 @@ FindNeighbors(struct TBestNeighbors *neighbors,
         continue;               /* for */
       }
 
-      OLSR_PRINTF(9,
-                  "%s: ----> Considering forwarding pkt on \"%s\" to %s\n",
-                  PLUGIN_NAME_SHORT, intf->ifName, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+      OLSR_PRINTF(9, "%s: ----> Considering forwarding pkt on \"%s\" to %s\n", PLUGIN_NAME_SHORT, intf->ifName,
+                  olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
       neighborMainIp = MainAddressOf(&walker->neighbor_iface_addr);
 
       /* Consider only neighbors with an IP address that differs from the
        * passed IP addresses (if passed). Rely on short-circuit boolean evaluation. */
       if (source != NULL && ipequal(neighborMainIp, MainAddressOf(source))) {
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: is source of pkt\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: is source of pkt\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
 
       /* Rely on short-circuit boolean evaluation */
       if (forwardedBy != NULL && ipequal(neighborMainIp, MainAddressOf(forwardedBy))) {
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: is the node that forwarded the pkt\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: is the node that forwarded the pkt\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
 
       /* Rely on short-circuit boolean evaluation */
       if (forwardedTo != NULL && ipequal(neighborMainIp, MainAddressOf(forwardedTo))) {
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: is the node to which the pkt was forwarded\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: is the node to which the pkt was forwarded\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
@@ -533,16 +523,15 @@ FindNeighbors(struct TBestNeighbors *neighbors,
       /* Found a candidate neighbor to direct our packet to */
 
       if (walker->link_cost >= INFINITE_COST) {
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: link is timing out\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: link is timing out\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
 
       /* Compare costs to check if the candidate neighbor is best reached via 'intf' */
-      OLSR_PRINTF(9, "%s: ----> Forwarding pkt to %s will cost %5.2f\n",
-                  PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), walker->link_cost);
+      OLSR_PRINTF(9, "%s: ----> Forwarding pkt to %s will cost %5.2f\n", PLUGIN_NAME_SHORT,
+                  olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), walker->link_cost);
 
       /* If the candidate neighbor is best reached via another interface, then skip
        * the candidate neighbor; the candidate neighbor has been / will be selected via that
@@ -552,17 +541,14 @@ FindNeighbors(struct TBestNeighbors *neighbors,
 
       if (walker != bestLinkToNeighbor) {
         if (bestLinkToNeighbor == NULL) {
-          OLSR_PRINTF(9,
-                      "%s: ----> Not forwarding to %s: no link found\n",
-                      PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+          OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: no link found\n", PLUGIN_NAME_SHORT,
+                      olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
         } else {
           struct interface *bestIntf = if_ifwithaddr(&bestLinkToNeighbor->local_iface_addr);
 
-          OLSR_PRINTF(9,
-                      "%s: ----> Not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %5.2f\n",
-                      PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf,
-                                                           &walker->
-                                                           neighbor_iface_addr), bestIntf->int_name, bestLinkToNeighbor->link_cost);
+          OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %5.2f\n",
+                      PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), bestIntf->int_name,
+                      bestLinkToNeighbor->link_cost);
         }
 
         continue;               /* for */
@@ -570,11 +556,9 @@ FindNeighbors(struct TBestNeighbors *neighbors,
 
       if (forwardedBy != NULL) {
         struct ipaddr_str forwardedByBuf, niaBuf;
-        OLSR_PRINTF(9,
-                    "%s: ----> 2-hop path from %s via me to %s will cost %5.2f\n",
-                    PLUGIN_NAME_SHORT,
-                    olsr_ip_to_string(&forwardedByBuf, forwardedBy),
-                    olsr_ip_to_string(&niaBuf, &walker->neighbor_iface_addr), previousLinkCost + walker->link_cost);
+        OLSR_PRINTF(9, "%s: ----> 2-hop path from %s via me to %s will cost %5.2f\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&forwardedByBuf, forwardedBy), olsr_ip_to_string(&niaBuf, &walker->neighbor_iface_addr),
+                    previousLinkCost + walker->link_cost);
       }
 
       /* Check the topology table whether the 'forwardedBy' node is itself a direct
@@ -597,11 +581,9 @@ FindNeighbors(struct TBestNeighbors *neighbors,
               struct ipaddr_str neighbor_iface_buf, forw_buf;
               olsr_ip_to_string(&neighbor_iface_buf, &walker->neighbor_iface_addr);
 #endif
-              OLSR_PRINTF(9,
-                          "%s: ----> Not forwarding to %s: I am not an MPR between %s and %s, direct link costs %5.2f\n",
-                          PLUGIN_NAME_SHORT,
-                          neighbor_iface_buf.buf,
-                          olsr_ip_to_string(&forw_buf, forwardedBy), neighbor_iface_buf.buf, tc_edge->link_cost);
+              OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: I am not an MPR between %s and %s, direct link costs %5.2f\n",
+                          PLUGIN_NAME_SHORT, neighbor_iface_buf.buf, olsr_ip_to_string(&forw_buf, forwardedBy),
+                          neighbor_iface_buf.buf, tc_edge->link_cost);
 
               continue;         /* for */
             }                   /* if */
@@ -653,36 +635,32 @@ FindNeighbors(struct TBestNeighbors *neighbors,
         continue;               /* for */
       }
 
-      OLSR_PRINTF(9,
-                  "%s: ----> Considering forwarding pkt on \"%s\" to %s\n",
-                  PLUGIN_NAME_SHORT, intf->ifName, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+      OLSR_PRINTF(9, "%s: ----> Considering forwarding pkt on \"%s\" to %s\n", PLUGIN_NAME_SHORT, intf->ifName,
+                  olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
       neighborMainIp = MainAddressOf(&walker->neighbor_iface_addr);
 
       /* Consider only neighbors with an IP address that differs from the
        * passed IP addresses (if passed). Rely on short-circuit boolean evaluation. */
       if (source != NULL && ipequal(neighborMainIp, MainAddressOf(source))) {
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: is source of pkt\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: is source of pkt\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
 
       /* Rely on short-circuit boolean evaluation */
       if (forwardedBy != NULL && ipequal(neighborMainIp, MainAddressOf(forwardedBy))) {
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: is the node that forwarded the pkt\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: is the node that forwarded the pkt\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
 
       /* Rely on short-circuit boolean evaluation */
       if (forwardedTo != NULL && ipequal(neighborMainIp, MainAddressOf(forwardedTo))) {
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: is the node to which the pkt was forwarded\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: is the node to which the pkt was forwarded\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
@@ -693,17 +671,15 @@ FindNeighbors(struct TBestNeighbors *neighbors,
       currEtx = walker->linkcost;
 
       if (currEtx >= LINK_COST_BROKEN) {
-        OLSR_PRINTF(9,
-                    "%s: ----> Not forwarding to %s: link is timing out\n",
-                    PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+        OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: link is timing out\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
 
         continue;               /* for */
       }
 
       /* Compare costs to check if the candidate neighbor is best reached via 'intf' */
-      OLSR_PRINTF(9,
-                  "%s: ----> Forwarding pkt to %s will cost ETX %5.2f\n",
-                  PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), currEtx);
+      OLSR_PRINTF(9, "%s: ----> Forwarding pkt to %s will cost ETX %5.2f\n", PLUGIN_NAME_SHORT,
+                  olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), currEtx);
 
       /* If the candidate neighbor is best reached via another interface, then skip
        * the candidate neighbor; the candidate neighbor has been / will be selected via that
@@ -714,21 +690,17 @@ FindNeighbors(struct TBestNeighbors *neighbors,
       if (walker != bestLinkToNeighbor) {
         if (bestLinkToNeighbor == NULL) {
           struct ipaddr_str buf;
-          OLSR_PRINTF(9,
-                      "%s: ----> Not forwarding to %s: no link found\n",
-                      PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
+          OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: no link found\n", PLUGIN_NAME_SHORT,
+                      olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
         } else {
 #ifndef NODEBUG
           struct interface *bestIntf = if_ifwithaddr(&bestLinkToNeighbor->local_iface_addr);
           struct ipaddr_str buf;
           struct lqtextbuffer lqbuffer;
 #endif
-          OLSR_PRINTF(9,
-                      "%s: ----> Not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %s\n",
-                      PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf,
-                                                           &walker->
-                                                           neighbor_iface_addr),
-                      bestIntf->int_name, get_linkcost_text(bestLinkToNeighbor->linkcost, OLSR_FALSE, &lqbuffer));
+          OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %s\n",
+                      PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), bestIntf->int_name,
+                      get_linkcost_text(bestLinkToNeighbor->linkcost, OLSR_FALSE, &lqbuffer));
         }
 
         continue;               /* for */
@@ -739,12 +711,8 @@ FindNeighbors(struct TBestNeighbors *neighbors,
         struct ipaddr_str forwardedByBuf, niaBuf;
         struct lqtextbuffer lqbuffer;
 #endif
-        OLSR_PRINTF(9,
-                    "%s: ----> 2-hop path from %s via me to %s will cost ETX %s\n",
-                    PLUGIN_NAME_SHORT,
-                    olsr_ip_to_string(&forwardedByBuf, forwardedBy),
-                    olsr_ip_to_string(&niaBuf,
-                                      &walker->neighbor_iface_addr),
+        OLSR_PRINTF(9, "%s: ----> 2-hop path from %s via me to %s will cost ETX %s\n", PLUGIN_NAME_SHORT,
+                    olsr_ip_to_string(&forwardedByBuf, forwardedBy), olsr_ip_to_string(&niaBuf, &walker->neighbor_iface_addr),
                     get_linkcost_text(previousLinkEtx + currEtx, OLSR_TRUE, &lqbuffer));
       }
 
@@ -771,12 +739,9 @@ FindNeighbors(struct TBestNeighbors *neighbors,
               struct lqtextbuffer lqbuffer;
               olsr_ip_to_string(&neighbor_iface_buf, &walker->neighbor_iface_addr);
 #endif
-              OLSR_PRINTF(9,
-                          "%s: ----> Not forwarding to %s: I am not an MPR between %s and %s, direct link costs %s\n",
-                          PLUGIN_NAME_SHORT,
-                          neighbor_iface_buf.buf,
-                          olsr_ip_to_string(&forw_buf,
-                                            forwardedBy), neighbor_iface_buf.buf, get_linkcost_text(tcEtx, OLSR_FALSE, &lqbuffer));
+              OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: I am not an MPR between %s and %s, direct link costs %s\n",
+                          PLUGIN_NAME_SHORT, neighbor_iface_buf.buf, olsr_ip_to_string(&forw_buf, forwardedBy),
+                          neighbor_iface_buf.buf, get_linkcost_text(tcEtx, OLSR_FALSE, &lqbuffer));
 
               continue;         /* for */
             }                   /* if */
@@ -811,10 +776,8 @@ FindNeighbors(struct TBestNeighbors *neighbors,
     OLSR_PRINTF(9, "%s: ----> No suitable neighbor found to forward to on \"%s\"\n", PLUGIN_NAME_SHORT, intf->ifName);
   } else {
     struct ipaddr_str buf;
-    OLSR_PRINTF(9,
-                "%s: ----> %d neighbors found on \"%s\"; best neighbor to forward to: %s\n",
-                PLUGIN_NAME_SHORT, *nPossibleNeighbors, intf->ifName,
-                olsr_ip_to_string(&buf, &(*bestNeighbor)->neighbor_iface_addr));
+    OLSR_PRINTF(9, "%s: ----> %d neighbors found on \"%s\"; best neighbor to forward to: %s\n", PLUGIN_NAME_SHORT,
+                *nPossibleNeighbors, intf->ifName, olsr_ip_to_string(&buf, &(*bestNeighbor)->neighbor_iface_addr));
   }                             /* if */
 
 }                               /* FindNeighbors */
@@ -1330,8 +1293,8 @@ CreateInterface(const char *ifName, struct interface *olsrIntf)
     LastBmfInterface = newIf;
   }
 
-  OLSR_PRINTF(8, "%s: opened %d socket%s on %s interface \"%s\"\n",
-              PLUGIN_NAME_SHORT, nOpened, nOpened == 1 ? "" : "s", olsrIntf != NULL ? "OLSR" : "non-OLSR", ifName);
+  OLSR_PRINTF(8, "%s: opened %d socket%s on %s interface \"%s\"\n", PLUGIN_NAME_SHORT, nOpened, nOpened == 1 ? "" : "s",
+              olsrIntf != NULL ? "OLSR" : "non-OLSR", ifName);
 
   return nOpened;
 }                               /* CreateInterface */
@@ -1496,14 +1459,12 @@ CloseBmfNetworkInterfaces(void)
       nClosed++;
     }
 
-    OLSR_PRINTF(7,
-                "%s: %s interface \"%s\": RX pkts %d (%d dups); TX pkts %d\n",
-                PLUGIN_NAME_SHORT,
-                bmfIf->olsrIntf != NULL ? "OLSR" : "non-OLSR",
-                bmfIf->ifName, bmfIf->nBmfPacketsRx, bmfIf->nBmfPacketsRxDup, bmfIf->nBmfPacketsTx);
+    OLSR_PRINTF(7, "%s: %s interface \"%s\": RX pkts %d (%d dups); TX pkts %d\n", PLUGIN_NAME_SHORT,
+                bmfIf->olsrIntf != NULL ? "OLSR" : "non-OLSR", bmfIf->ifName, bmfIf->nBmfPacketsRx, bmfIf->nBmfPacketsRxDup,
+                bmfIf->nBmfPacketsTx);
 
-    olsr_printf(1, "%s: closed %s interface \"%s\"\n", PLUGIN_NAME_SHORT,
-                bmfIf->olsrIntf != NULL ? "OLSR" : "non-OLSR", bmfIf->ifName);
+    olsr_printf(1, "%s: closed %s interface \"%s\"\n", PLUGIN_NAME_SHORT, bmfIf->olsrIntf != NULL ? "OLSR" : "non-OLSR",
+                bmfIf->ifName);
 
     /* Add totals */
     if (bmfIf->olsrIntf != NULL) {
@@ -1530,12 +1491,10 @@ CloseBmfNetworkInterfaces(void)
 
   olsr_printf(1, "%s: closed %d sockets\n", PLUGIN_NAME_SHORT, nClosed);
 
-  OLSR_PRINTF(7,
-              "%s: Total all OLSR interfaces    : RX pkts %d (%d dups); TX pkts %d\n",
-              PLUGIN_NAME_SHORT, totalOlsrBmfPacketsRx, totalOlsrBmfPacketsRxDup, totalOlsrBmfPacketsTx);
-  OLSR_PRINTF(7,
-              "%s: Total all non-OLSR interfaces: RX pkts %d (%d dups); TX pkts %d\n",
-              PLUGIN_NAME_SHORT, totalNonOlsrBmfPacketsRx, totalNonOlsrBmfPacketsRxDup, totalNonOlsrBmfPacketsTx);
+  OLSR_PRINTF(7, "%s: Total all OLSR interfaces    : RX pkts %d (%d dups); TX pkts %d\n", PLUGIN_NAME_SHORT, totalOlsrBmfPacketsRx,
+              totalOlsrBmfPacketsRxDup, totalOlsrBmfPacketsTx);
+  OLSR_PRINTF(7, "%s: Total all non-OLSR interfaces: RX pkts %d (%d dups); TX pkts %d\n", PLUGIN_NAME_SHORT,
+              totalNonOlsrBmfPacketsRx, totalNonOlsrBmfPacketsRxDup, totalNonOlsrBmfPacketsTx);
 }                               /* CloseBmfNetworkInterfaces */
 
 #define MAX_NON_OLSR_IFS 32
index 1ab45f9..b7d3e30 100644 (file)
@@ -131,10 +131,9 @@ struct TBestNeighbors {
   struct link_entry *links[MAX_UNICAST_NEIGHBORS];
 };
 
-void FindNeighbors(struct TBestNeighbors *neighbors,
-                   struct link_entry **bestNeighbor,
-                   struct TBmfInterface *intf, union olsr_ip_addr *source,
-                   union olsr_ip_addr *forwardedBy, union olsr_ip_addr *forwardedTo, int *nPossibleNeighbors);
+void FindNeighbors(struct TBestNeighbors *neighbors, struct link_entry **bestNeighbor, struct TBmfInterface *intf,
+                   union olsr_ip_addr *source, union olsr_ip_addr *forwardedBy, union olsr_ip_addr *forwardedTo,
+                   int *nPossibleNeighbors);
 
 int CreateBmfNetworkInterfaces(struct interface *skipThisIntf);
 void AddInterface(struct interface *newIntf);
index 114e7aa..21ad4ce 100644 (file)
@@ -179,8 +179,8 @@ ipc_print_neigh_link(const struct neighbor_entry *neighbor)
     style = "solid";
   }
 
-  ipc_send_fmt("\"%s\" -> \"%s\"[label=\"%s\", style=%s];\n", adr,
-               olsr_ip_to_string(&strbuf, &neighbor->neighbor_main_addr), get_linkcost_text(etx, OLSR_FALSE, &lqbuffer), style);
+  ipc_send_fmt("\"%s\" -> \"%s\"[label=\"%s\", style=%s];\n", adr, olsr_ip_to_string(&strbuf, &neighbor->neighbor_main_addr),
+               get_linkcost_text(etx, OLSR_FALSE, &lqbuffer), style);
 
   if (neighbor->is_mpr) {
     ipc_send_fmt("\"%s\"[shape=box];\n", adr);
@@ -342,8 +342,7 @@ ipc_print_tc_link(const struct tc_entry *entry, const struct tc_edge_entry *dst_
   struct ipaddr_str strbuf1, strbuf2;
   struct lqtextbuffer lqbuffer;
 
-  ipc_send_fmt("\"%s\" -> \"%s\"[label=\"%s\"];\n",
-               olsr_ip_to_string(&strbuf1, &entry->addr),
+  ipc_send_fmt("\"%s\" -> \"%s\"[label=\"%s\"];\n", olsr_ip_to_string(&strbuf1, &entry->addr),
                olsr_ip_to_string(&strbuf2, &dst_entry->T_dest_addr), get_linkcost_text(dst_entry->cost, OLSR_FALSE, &lqbuffer));
 }
 
index 06e4151..049f065 100644 (file)
@@ -127,8 +127,8 @@ check_gw(union olsr_ip_addr *net, union olsr_ip_addr *mask)
    */
   while (fgets(buff, 1023, fp)) {
     num =
-      sscanf(buff, "%16s %128X %128X %X %d %d %d %128X \n", iface,
-             &dest_addr, &gate_addr, &iflags, &refcnt, &use, &metric, &netmask);
+      sscanf(buff, "%16s %128X %128X %X %d %d %d %128X \n", iface, &dest_addr, &gate_addr, &iflags, &refcnt, &use, &metric,
+             &netmask);
 
     if (num < 8) {
       continue;
index e3bc051..97b7482 100644 (file)
@@ -67,22 +67,19 @@ static const char admin_basic_setting_string[] =
   "<td><strong>%s</strong></td><td><input type=\"text\" name=\"%s\" maxlength=\"%d\" class=\"input_text\" value=\"%s\"></td>\n";
 
 static const char admin_frame_prolog[] =
-  "<strong>Administrator interface</strong><hr>\n"
-  "<h2>Change basic settings</h2>\n" "<form action=\"set_values\" method=\"post\">\n" "<table width=\"100%%\">\n";
+  "<strong>Administrator interface</strong><hr>\n" "<h2>Change basic settings</h2>\n"
+  "<form action=\"set_values\" method=\"post\">\n" "<table width=\"100%%\">\n";
 
 static const char admin_frame_mid[] =
-  "</table>\n<br>\n"
-  "<center><input type=\"submit\" value=\"Submit\" class=\"input_button\">\n"
-  "<input type=\"reset\" value=\"Reset\" class=\"input_button\"></center>\n"
-  "</form>\n" "<h2>Add/remove local HNA entries</h2>\n"
-  "<form action=\"set_values\" method=\"post\">\n"
-  "<table width=\"100%%\"><tr><td><strong>Network:</strong></td>\n"
+  "</table>\n<br>\n" "<center><input type=\"submit\" value=\"Submit\" class=\"input_button\">\n"
+  "<input type=\"reset\" value=\"Reset\" class=\"input_button\"></center>\n" "</form>\n" "<h2>Add/remove local HNA entries</h2>\n"
+  "<form action=\"set_values\" method=\"post\">\n" "<table width=\"100%%\"><tr><td><strong>Network:</strong></td>\n"
   "<td><input type=\"text\" name=\"hna_new_net\" maxlength=\"16\" class=\"input_text\" value=\"0.0.0.0\"></td>\n"
   "<td><strong>Netmask/Prefix:</strong></td>\n"
   "<td><input type=\"text\" name=\"hna_new_netmask\" maxlength=\"16\" class=\"input_text\" value=\"0.0.0.0\"></td>\n"
-  "<td><input type=\"submit\" value=\"Add entry\" class=\"input_button\"></td></form>\n"
-  "</table><hr>\n" "<form action=\"set_values\" method=\"post\">\n"
-  "<table width=\"100%%\">\n" "<tr><th width=50 halign=\"middle\">Delete</th><th>Network</th><th>Netmask</th></tr>\n";
+  "<td><input type=\"submit\" value=\"Add entry\" class=\"input_button\"></td></form>\n" "</table><hr>\n"
+  "<form action=\"set_values\" method=\"post\">\n" "<table width=\"100%%\">\n"
+  "<tr><th width=50 halign=\"middle\">Delete</th><th>Network</th><th>Netmask</th></tr>\n";
 
 static const char admin_frame_epilog[] =
   "</table>\n<br>\n" "<center><input type=\"submit\" value=\"Delete selected\" class=\"input_button\"></center>\n" "</form>\n";
@@ -110,15 +107,15 @@ build_admin_body(char *buf, olsr_u32_t bufsize __attribute__ ((unused)))
 
   if (olsr_cnf->use_hysteresis) {
     size +=
-      snprintf(&buf[size], bufsize - size, admin_basic_setting_float,
-               "Hyst scaling:", "hyst_scaling", 4, olsr_cnf->hysteresis_param.scaling);
+      snprintf(&buf[size], bufsize - size, admin_basic_setting_float, "Hyst scaling:", "hyst_scaling", 4,
+               olsr_cnf->hysteresis_param.scaling);
 
     size +=
-      snprintf(&buf[size], bufsize - size, admin_basic_setting_float,
-               "Lower thr:", "hyst_lower", 4, olsr_cnf->hysteresis_param.thr_low);
+      snprintf(&buf[size], bufsize - size, admin_basic_setting_float, "Lower thr:", "hyst_lower", 4,
+               olsr_cnf->hysteresis_param.thr_low);
     size +=
-      snprintf(&buf[size], bufsize - size, admin_basic_setting_float,
-               "Upper thr:", "hyst_upper", 4, olsr_cnf->hysteresis_param.thr_high);
+      snprintf(&buf[size], bufsize - size, admin_basic_setting_float, "Upper thr:", "hyst_upper", 4,
+               olsr_cnf->hysteresis_param.thr_high);
   } else {
     size += snprintf(&buf[size], bufsize - size, "<td>Hysteresis disabled</td>\n");
   }
@@ -357,8 +354,8 @@ process_set_values(char *data, olsr_u32_t data_size, char *buf, olsr_u32_t bufsi
       data[i] = '\0';
       if (!process_param(&data[key_start], &data[val_start])) {
         size +=
-          snprintf(&buf[size], bufsize - size,
-                   "<h2>FAILED PROCESSING!</h2><br>Key: %s Value: %s<br>\n", &data[key_start], &data[val_start]);
+          snprintf(&buf[size], bufsize - size, "<h2>FAILED PROCESSING!</h2><br>Key: %s Value: %s<br>\n", &data[key_start],
+                   &data[val_start]);
         return -1;
       }
 
@@ -368,8 +365,8 @@ process_set_values(char *data, olsr_u32_t data_size, char *buf, olsr_u32_t bufsi
 
   if (!process_param(&data[key_start], &data[val_start])) {
     size +=
-      snprintf(&buf[size], bufsize - size,
-               "<b>FAILED PROCESSING!</b><br>Key: %s Value: %s<br>\n", &data[key_start], &data[val_start]);
+      snprintf(&buf[size], bufsize - size, "<b>FAILED PROCESSING!</b><br>Key: %s Value: %s<br>\n", &data[key_start],
+               &data[val_start]);
     return -1;
   }
 
index 36a891e..c2d887b 100644 (file)
@@ -106,32 +106,26 @@ static char copyright_string[] __attribute__ ((unused)) =
         (strlen(req) && !strcmp(&req[1], filename))
 
 static const char httpinfo_css[] =
-  "#A {text-decoration: none}\n" "TH{text-align: left}\n"
-  "H1, H3, TD, TH {font-family: Helvetica; font-size: 80%}\n"
+  "#A {text-decoration: none}\n" "TH{text-align: left}\n" "H1, H3, TD, TH {font-family: Helvetica; font-size: 80%}\n"
   "h2\n {\nfont-family: Helvetica;\n font-size: 14px;text-align: center;\n"
-  "line-height: 16px;\ntext-decoration: none;\nborder: 1px solid #ccc;\n"
-  "margin: 5px;\nbackground: #ececec;\n}\n"
+  "line-height: 16px;\ntext-decoration: none;\nborder: 1px solid #ccc;\n" "margin: 5px;\nbackground: #ececec;\n}\n"
   "hr\n{\nborder: none;\npadding: 1px;\nbackground: url(grayline.gif) repeat-x bottom;\n}\n"
   "#maintable\n{\nmargin: 0px;\npadding: 5px;\nborder-left: 1px solid #ccc;\n"
   "border-right: 1px solid #ccc;\nborder-bottom: 1px solid #ccc;\n}\n"
   "#footer\n{\nfont-size: 10px;\nline-height: 14px;\ntext-decoration: none;\ncolor: #666;\n}\n"
-  "#hdr\n{\nfont-size: 14px;\ntext-align: center;\nline-height: 16px;\n"
-  "text-decoration: none;\nborder: 1px solid #ccc;\n"
+  "#hdr\n{\nfont-size: 14px;\ntext-align: center;\nline-height: 16px;\n" "text-decoration: none;\nborder: 1px solid #ccc;\n"
   "margin: 5px;\nbackground: #ececec;\n}\n"
   "#container\n{\nwidth: 1000px;\npadding: 30px;\nborder: 1px solid #ccc;\nbackground: #fff;\n}\n"
-  "#tabnav\n{\nheight: 20px;\nmargin: 0;\npadding-left: 10px;\n"
-  "background: url(grayline.gif) repeat-x bottom;\n}\n"
+  "#tabnav\n{\nheight: 20px;\nmargin: 0;\npadding-left: 10px;\n" "background: url(grayline.gif) repeat-x bottom;\n}\n"
   "#tabnav li\n{\nmargin: 0;\npadding: 0;\ndisplay: inline;\nlist-style-type: none;\n}\n"
   "#tabnav a:link, #tabnav a:visited\n{\nfloat: left;\nbackground: #ececec;\n"
   "font-size: 12px;\nline-height: 14px;\nfont-weight: bold;\npadding: 2px 10px 2px 10px;\n"
   "margin-right: 4px;\nborder: 1px solid #ccc;\ntext-decoration: none;\ncolor: #777;\n}\n"
-  "#tabnav a:link.active, #tabnav a:visited.active\n{\nborder-bottom: 1px solid #fff;\n"
-  "background: #ffffff;\ncolor: #000;\n}\n"
+  "#tabnav a:link.active, #tabnav a:visited.active\n{\nborder-bottom: 1px solid #fff;\n" "background: #ffffff;\ncolor: #000;\n}\n"
   "#tabnav a:hover\n{\nbackground: #777777;\ncolor: #ffffff;\n}\n"
   ".input_text\n{\nbackground: #E5E5E5;\nmargin-left: 5px; margin-top: 0px;\n"
   "text-align: left;\n\nwidth: 100px;\npadding: 0px;\ncolor: #000000;\n"
-  "text-decoration: none;\nfont-family: verdana;\nfont-size: 12px;\n"
-  "border: 1px solid #ccc;\n}\n"
+  "text-decoration: none;\nfont-family: verdana;\nfont-size: 12px;\n" "border: 1px solid #ccc;\n}\n"
   ".input_button\n{\nbackground: #B5D1EE;\nmargin-left: 5px;\nmargin-top: 0px;\n"
   "text-align: center;\nwidth: 120px;\npadding: 0px;\ncolor: #000000;\n"
   "text-decoration: none;\nfont-family: verdana;\nfont-size: 12px;\n" "border: 1px solid #000;\n}\n";
@@ -191,11 +185,11 @@ static int build_cfgfile_body(char *, olsr_u32_t);
 
 static int check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr);
 
-static int build_ip_txt(char *buf, const olsr_u32_t bufsize,
-                        const olsr_bool want_link, const char *const ipaddrstr, const int prefix_len);
+static int build_ip_txt(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const char *const ipaddrstr,
+                        const int prefix_len);
 
-static int build_ipaddr_link(char *buf, const olsr_u32_t bufsize,
-                             const olsr_bool want_link, const union olsr_ip_addr *const ipaddr, const int prefix_len);
+static int build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const union olsr_ip_addr *const ipaddr,
+                             const int prefix_len);
 static int section_title(char *buf, olsr_u32_t bufsize, const char *title);
 
 static ssize_t writen(int fd, const void *buf, size_t count);
@@ -468,22 +462,18 @@ parse_http_request(int fd)
 #endif
       size +=
         snprintf(&body[size], sizeof(body) - size,
-                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
-                 "<head>\n"
+                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" "<head>\n"
                  "<meta http-equiv=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">\n"
-                 "<title>olsr.org httpinfo plugin</title>\n"
-                 "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
+                 "<title>olsr.org httpinfo plugin</title>\n" "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
                  "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
-                 "<link rel=\"stylesheet\" type=\"text/css\" href=\"httpinfo.css\">\n"
-                 "</head>\n"
+                 "<link rel=\"stylesheet\" type=\"text/css\" href=\"httpinfo.css\">\n" "</head>\n"
                  "<body bgcolor=\"#ffffff\" text=\"#000000\">\n"
                  "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"%d\">\n"
-                 "<tbody><tr bgcolor=\"#ffffff\">\n"
-                 "<td align=\"left\" height=\"69\" valign=\"middle\" width=\"80%%\">\n"
+                 "<tbody><tr bgcolor=\"#ffffff\">\n" "<td align=\"left\" height=\"69\" valign=\"middle\" width=\"80%%\">\n"
                  "<font color=\"black\" face=\"timesroman\" size=\"6\">&nbsp;&nbsp;&nbsp;<a href=\"http://www.olsr.org/\">olsr.org OLSR daemon</a></font></td>\n"
                  "<td align=\"right\" height=\"69\" valign=\"middle\" width=\"20%%\">\n"
-                 "<a href=\"http://www.olsr.org/\"><img border=\"0\" src=\"/logo.gif\" alt=\"olsrd logo\"></a></td>\n"
-                 "</tr>\n" "</tbody>\n" "</table>\n", FRAMEWIDTH);
+                 "<a href=\"http://www.olsr.org/\"><img border=\"0\" src=\"/logo.gif\" alt=\"olsrd logo\"></a></td>\n" "</tr>\n"
+                 "</tbody>\n" "</table>\n", FRAMEWIDTH);
 
       size += build_tabs(&body[size], sizeof(body) - size, i);
       size += build_frame(&body[size], sizeof(body) - size, "Current Routes", "routes", FRAMEWIDTH, tab_entries[i].build_body_cb);
@@ -492,8 +482,7 @@ parse_http_request(int fd)
 
       size +=
         snprintf(&body[size], sizeof(body) - size,
-                 "</table>\n" "<div id=\"footer\">\n" "<center>\n"
-                 "(C)2005 Andreas T&oslash;nnesen<br/>\n"
+                 "</table>\n" "<div id=\"footer\">\n" "<center>\n" "(C)2005 Andreas T&oslash;nnesen<br/>\n"
                  "<a href=\"http://www.olsr.org/\">http://www.olsr.org</a>\n" "</center>\n" "</div>\n" "</body>\n" "</html>\n");
 
 #ifdef NETDIRECT
@@ -604,9 +593,8 @@ build_tabs(char *buf, const olsr_u32_t bufsize, int active)
       continue;
     }
     size +=
-      snprintf(&buf[size], bufsize - size,
-               "<li><a href=\"%s\"%s>%s</a></li>\n",
-               tab_entries[tabs].filename, tabs == active ? " class=\"active\"" : "", tab_entries[tabs].tab_label);
+      snprintf(&buf[size], bufsize - size, "<li><a href=\"%s\"%s>%s</a></li>\n", tab_entries[tabs].filename,
+               tabs == active ? " class=\"active\"" : "", tab_entries[tabs].tab_label);
   }
   size += snprintf(&buf[size], bufsize - size, "</ul>\n" "</td></tr>\n" "<tr><td>\n");
   return size;
@@ -627,13 +615,12 @@ static int
 section_title(char *buf, olsr_u32_t bufsize, const char *title)
 {
   return snprintf(buf, bufsize,
-                  "<h2>%s</h2>\n"
-                  "<table width=\"100%%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n", title);
+                  "<h2>%s</h2>\n" "<table width=\"100%%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n",
+                  title);
 }
 
 static int
-build_frame(char *buf, olsr_u32_t bufsize, const char *title
-            __attribute__ ((unused)), const char *link
+build_frame(char *buf, olsr_u32_t bufsize, const char *title __attribute__ ((unused)), const char *link
             __attribute__ ((unused)), int width __attribute__ ((unused)), build_body_callback frame_body_cb)
 {
   int size = 0;
@@ -671,8 +658,8 @@ build_ip_txt(char *buf, const olsr_u32_t bufsize, const olsr_bool print_link, co
 }
 
 static int
-build_ipaddr_link(char *buf, const olsr_u32_t bufsize,
-                  const olsr_bool want_link, const union olsr_ip_addr *const ipaddr, const int prefix_len)
+build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const union olsr_ip_addr *const ipaddr,
+                  const int prefix_len)
 {
   int size = 0;
   struct ipaddr_str ipaddrstr;
@@ -728,8 +715,8 @@ build_route(char *buf, olsr_u32_t bufsize, const struct rt_entry *rt)
     snprintf(&buf[size], bufsize - size, "<td align=\"right\">%s</td>",
              get_linkcost_text(rt->rt_best->rtp_metric.cost, OLSR_TRUE, &lqbuffer));
   size +=
-    snprintf(&buf[size], bufsize - size,
-             "<td align=\"center\">%s</td></tr>\n", if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
+    snprintf(&buf[size], bufsize - size, "<td align=\"center\">%s</td></tr>\n",
+             if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
   return size;
 }
 
@@ -799,9 +786,8 @@ build_config_body(char *buf, olsr_u32_t bufsize)
   }
 
   size +=
-    snprintf(&buf[size], bufsize - size,
-             "HTTP stats(ok/dyn/error/illegal): <em>%d/%d/%d/%d</em><br>\n",
-             stats.ok_hits, stats.dyn_hits, stats.err_hits, stats.ill_hits);
+    snprintf(&buf[size], bufsize - size, "HTTP stats(ok/dyn/error/illegal): <em>%d/%d/%d/%d</em><br>\n", stats.ok_hits,
+             stats.dyn_hits, stats.err_hits, stats.ill_hits);
 
   size +=
     snprintf(&buf[size], bufsize - size,
@@ -812,14 +798,14 @@ build_config_body(char *buf, olsr_u32_t bufsize)
   size += snprintf(&buf[size], bufsize - size, "<table width=\"100%%\" border=\"0\">\n<tr>");
 
   size +=
-    snprintf(&buf[size], bufsize - size,
-             "<td>Main address: <strong>%s</strong></td>\n", olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->main_addr));
+    snprintf(&buf[size], bufsize - size, "<td>Main address: <strong>%s</strong></td>\n",
+             olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->main_addr));
   size += snprintf(&buf[size], bufsize - size, "<td>IP version: %d</td>\n", olsr_cnf->ip_version == AF_INET ? 4 : 6);
   size += snprintf(&buf[size], bufsize - size, "<td>Debug level: %d</td>\n", olsr_cnf->debug_level);
   size +=
     snprintf(&buf[size], bufsize - size, "<td>FIB Metrics: %s</td>\n",
-             FIBM_FLAT ==
-             olsr_cnf->fib_metric ? CFG_FIBM_FLAT : FIBM_CORRECT == olsr_cnf->fib_metric ? CFG_FIBM_CORRECT : CFG_FIBM_APPROX);
+             FIBM_FLAT == olsr_cnf->fib_metric ? CFG_FIBM_FLAT : FIBM_CORRECT ==
+             olsr_cnf->fib_metric ? CFG_FIBM_CORRECT : CFG_FIBM_APPROX);
 
   size += snprintf(&buf[size], bufsize - size, "</tr>\n<tr>\n");
 
@@ -834,32 +820,31 @@ build_config_body(char *buf, olsr_u32_t bufsize)
   size += snprintf(&buf[size], bufsize - size, "<td>TOS: 0x%04x</td>\n", olsr_cnf->tos);
   size += snprintf(&buf[size], bufsize - size, "<td>RtTable: 0x%04x/%d</td>\n", olsr_cnf->rttable, olsr_cnf->rttable);
   size +=
-    snprintf(&buf[size], bufsize - size,
-             "<td>RtTableDefault: 0x%04x/%d</td>\n", olsr_cnf->rttable_default, olsr_cnf->rttable_default);
+    snprintf(&buf[size], bufsize - size, "<td>RtTableDefault: 0x%04x/%d</td>\n", olsr_cnf->rttable_default,
+             olsr_cnf->rttable_default);
   size +=
-    snprintf(&buf[size], bufsize - size, "<td>Willingness: %d %s</td>\n",
-             olsr_cnf->willingness, olsr_cnf->willingness_auto ? "(auto)" : "");
+    snprintf(&buf[size], bufsize - size, "<td>Willingness: %d %s</td>\n", olsr_cnf->willingness,
+             olsr_cnf->willingness_auto ? "(auto)" : "");
 
   if (olsr_cnf->lq_level == 0) {
     size +=
-      snprintf(&buf[size], bufsize - size,
-               "</tr>\n<tr>\n" "<td>Hysteresis: %s</td>\n", olsr_cnf->use_hysteresis ? "Enabled" : "Disabled");
+      snprintf(&buf[size], bufsize - size, "</tr>\n<tr>\n" "<td>Hysteresis: %s</td>\n",
+               olsr_cnf->use_hysteresis ? "Enabled" : "Disabled");
     if (olsr_cnf->use_hysteresis) {
       size += snprintf(&buf[size], bufsize - size, "<td>Hyst scaling: %0.2f</td>\n", olsr_cnf->hysteresis_param.scaling);
       size +=
-        snprintf(&buf[size], bufsize - size,
-                 "<td>Hyst lower/upper: %0.2f/%0.2f</td>\n",
-                 olsr_cnf->hysteresis_param.thr_low, olsr_cnf->hysteresis_param.thr_high);
+        snprintf(&buf[size], bufsize - size, "<td>Hyst lower/upper: %0.2f/%0.2f</td>\n", olsr_cnf->hysteresis_param.thr_low,
+                 olsr_cnf->hysteresis_param.thr_high);
     }
   }
 
   size +=
-    snprintf(&buf[size], bufsize - size,
-             "</tr>\n<tr>\n" "<td>LQ extension: %s</td>\n", olsr_cnf->lq_level ? "Enabled" : "Disabled");
+    snprintf(&buf[size], bufsize - size, "</tr>\n<tr>\n" "<td>LQ extension: %s</td>\n",
+             olsr_cnf->lq_level ? "Enabled" : "Disabled");
   if (olsr_cnf->lq_level) {
     size +=
-      snprintf(&buf[size], bufsize - size,
-               "<td>LQ level: %d</td>\n" "<td>LQ aging: %f</td>\n", olsr_cnf->lq_level, olsr_cnf->lq_aging);
+      snprintf(&buf[size], bufsize - size, "<td>LQ level: %d</td>\n" "<td>LQ aging: %f</td>\n", olsr_cnf->lq_level,
+               olsr_cnf->lq_aging);
   }
   size += snprintf(&buf[size], bufsize - size, "</tr></table>\n");
 
@@ -876,31 +861,23 @@ build_config_body(char *buf, olsr_u32_t bufsize)
     if (olsr_cnf->ip_version == AF_INET) {
       struct ipaddr_str addrbuf, maskbuf, bcastbuf;
       size +=
-        snprintf(&buf[size], bufsize - size,
-                 "<tr>\n" "<td>IP: %s</td>\n" "<td>MASK: %s</td>\n"
-                 "<td>BCAST: %s</td>\n" "</tr>\n",
-                 ip4_to_string(&addrbuf, rifs->int_addr.sin_addr),
-                 ip4_to_string(&maskbuf, rifs->int_netmask.sin_addr), ip4_to_string(&bcastbuf, rifs->int_broadaddr.sin_addr));
+        snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>IP: %s</td>\n" "<td>MASK: %s</td>\n" "<td>BCAST: %s</td>\n" "</tr>\n",
+                 ip4_to_string(&addrbuf, rifs->int_addr.sin_addr), ip4_to_string(&maskbuf, rifs->int_netmask.sin_addr),
+                 ip4_to_string(&bcastbuf, rifs->int_broadaddr.sin_addr));
     } else {
       struct ipaddr_str addrbuf, maskbuf;
       size +=
-        snprintf(&buf[size], bufsize - size,
-                 "<tr>\n" "<td>IP: %s</td>\n" "<td>MCAST: %s</td>\n"
-                 "<td></td>\n" "</tr>\n", ip6_to_string(&addrbuf,
-                                                        &rifs->
-                                                        int6_addr.
-                                                        sin6_addr), ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr));
+        snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>IP: %s</td>\n" "<td>MCAST: %s</td>\n" "<td></td>\n" "</tr>\n",
+                 ip6_to_string(&addrbuf, &rifs->int6_addr.sin6_addr), ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr));
     }
     size +=
-      snprintf(&buf[size], bufsize - size,
-               "<tr>\n" "<td>MTU: %d</td>\n" "<td>WLAN: %s</td>\n"
-               "<td>STATUS: UP</td>\n" "</tr>\n", rifs->int_mtu, rifs->is_wireless ? "Yes" : "No");
+      snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>MTU: %d</td>\n" "<td>WLAN: %s</td>\n" "<td>STATUS: UP</td>\n" "</tr>\n",
+               rifs->int_mtu, rifs->is_wireless ? "Yes" : "No");
   }
   size += snprintf(&buf[size], bufsize - size, "</table>\n");
 
   size +=
-    snprintf(&buf[size], bufsize - size,
-             "<em>Olsrd is configured to %s if no interfaces are available</em><br>\n",
+    snprintf(&buf[size], bufsize - size, "<em>Olsrd is configured to %s if no interfaces are available</em><br>\n",
              olsr_cnf->allow_no_interfaces ? "run even" : "halt");
 
   size += snprintf(&buf[size], bufsize - size, "<h2>Plugins</h2>\n");
@@ -924,8 +901,8 @@ build_config_body(char *buf, olsr_u32_t bufsize)
     for (hna = olsr_cnf->hna_entries; hna; hna = hna->next) {
       struct ipaddr_str netbuf;
       size +=
-        snprintf(&buf[size], bufsize - size, "<tr><td>%s/%d</td></tr>\n",
-                 olsr_ip_to_string(&netbuf, &hna->net.prefix), hna->net.prefix_len);
+        snprintf(&buf[size], bufsize - size, "<tr><td>%s/%d</td></tr>\n", olsr_ip_to_string(&netbuf, &hna->net.prefix),
+                 hna->net.prefix_len);
     }
   } else {
     size += snprintf(&buf[size], bufsize - size, "<tr><td></td></tr>\n");
@@ -962,9 +939,8 @@ build_neigh_body(char *buf, olsr_u32_t bufsize)
     if (olsr_cnf->lq_level > 0) {
       struct lqtextbuffer lqbuffer1, lqbuffer2;
       size +=
-        snprintf(&buf[size], bufsize - size,
-                 "<td align=\"right\">(%s) %s</td>",
-                 get_link_entry_text(link, '/', &lqbuffer1), get_linkcost_text(link->linkcost, OLSR_FALSE, &lqbuffer2));
+        snprintf(&buf[size], bufsize - size, "<td align=\"right\">(%s) %s</td>", get_link_entry_text(link, '/', &lqbuffer1),
+                 get_linkcost_text(link->linkcost, OLSR_FALSE, &lqbuffer2));
     }
     size += snprintf(&buf[size], bufsize - size, "</tr>\n");
   } OLSR_FOR_ALL_LINK_ENTRIES_END(link);
@@ -985,10 +961,9 @@ build_neigh_body(char *buf, olsr_u32_t bufsize)
     size += build_ipaddr_with_link(&buf[size], bufsize, &neigh->neighbor_main_addr, -1);
     size +=
       snprintf(&buf[size], bufsize - size,
-               "<td align=\"center\">%s</td>" "<td align=\"center\">%s</td>"
-               "<td align=\"center\">%s</td>" "<td align=\"center\">%d</td>",
-               (neigh->status == SYM) ? "YES" : "NO",
-               neigh->is_mpr ? "YES" : "NO", olsr_lookup_mprs_set(&neigh->neighbor_main_addr) ? "YES" : "NO", neigh->willingness);
+               "<td align=\"center\">%s</td>" "<td align=\"center\">%s</td>" "<td align=\"center\">%s</td>"
+               "<td align=\"center\">%d</td>", (neigh->status == SYM) ? "YES" : "NO", neigh->is_mpr ? "YES" : "NO",
+               olsr_lookup_mprs_set(&neigh->neighbor_main_addr) ? "YES" : "NO", neigh->willingness);
 
     size += snprintf(&buf[size], bufsize - size, "<td><select>\n" "<option>IP ADDRESS</option>\n");
 
@@ -1014,8 +989,8 @@ build_topo_body(char *buf, olsr_u32_t bufsize)
 
   size += section_title(&buf[size], bufsize - size, "Topology Entries");
   size +=
-    snprintf(&buf[size], bufsize - size,
-             "<tr><th align=\"center\"%s>Destination IP</th><th align=\"center\"%s>Last Hop IP</th>", colspan, colspan);
+    snprintf(&buf[size], bufsize - size, "<tr><th align=\"center\"%s>Destination IP</th><th align=\"center\"%s>Last Hop IP</th>",
+             colspan, colspan);
   if (olsr_cnf->lq_level > 0) {
     size += snprintf(&buf[size], bufsize - size, "<th align=\"right\">Linkcost</th>");
   }
@@ -1031,8 +1006,7 @@ build_topo_body(char *buf, olsr_u32_t bufsize)
         if (olsr_cnf->lq_level > 0) {
           struct lqtextbuffer lqbuffer1, lqbuffer2;
           size +=
-            snprintf(&buf[size], bufsize - size,
-                     "<td align=\"right\">(%s) %s</td>\n",
+            snprintf(&buf[size], bufsize - size, "<td align=\"right\">(%s) %s</td>\n",
                      get_tc_edge_entry_text(tc_edge, '/', &lqbuffer1), get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer2));
         }
         size += snprintf(&buf[size], bufsize - size, "</tr>\n");
@@ -1107,13 +1081,12 @@ static int
 build_about_body(char *buf, olsr_u32_t bufsize)
 {
   return snprintf(buf, bufsize,
-                  "<strong>" PLUGIN_NAME " version " PLUGIN_VERSION
-                  "</strong><br/>\n" "by Andreas T&oslash;nnesen (C)2005.<br/>\n" "Compiled "
+                  "<strong>" PLUGIN_NAME " version " PLUGIN_VERSION "</strong><br/>\n" "by Andreas T&oslash;nnesen (C)2005.<br/>\n"
+                  "Compiled "
 #ifdef ADMIN_INTERFACE
                   "<em>with experimental admin interface</em> "
 #endif
-                  "%s at %s<hr/>\n"
-                  "This plugin implements a HTTP server that supplies\n"
+                  "%s at %s<hr/>\n" "This plugin implements a HTTP server that supplies\n"
                   "the client with various dynamic web pages representing\n"
                   "the current olsrd status.<br/>The different pages include:\n"
                   "<ul>\n<li><strong>Configuration</strong> - This page displays information\n"
@@ -1125,8 +1098,7 @@ build_about_body(char *buf, olsr_u32_t bufsize)
                   "HNA entries are shown. These are the networks that the local host\n"
                   "will anounce itself as a gateway to.</li>\n"
                   "<li><strong>Routes</strong> - This page displays all routes currently set in\n"
-                  "the kernel <em>by olsrd</em>. The type of route is also displayed(host\n"
-                  "or HNA).</li>\n"
+                  "the kernel <em>by olsrd</em>. The type of route is also displayed(host\n" "or HNA).</li>\n"
                   "<li><strong>Links/Topology</strong> - This page displays all information about\n"
                   "links, neighbors, topology, MID and HNA entries.</li>\n"
                   "<li><strong>All</strong> - Here all the previous pages are displayed as one.\n"
@@ -1139,12 +1111,11 @@ build_about_body(char *buf, olsr_u32_t bufsize)
                   "changing olsrd settings in realtime. These settings include various\n"
                   "\"basic\" settings and local HNA settings.</li>\n"
 #endif
-                  "<li><strong>About</strong> - this help page.</li>\n</ul>"
-                  "<hr/>\n" "Send questions or comments to\n"
+                  "<li><strong>About</strong> - this help page.</li>\n</ul>" "<hr/>\n" "Send questions or comments to\n"
                   "<a href=\"mailto:olsr-users@olsr.org\">olsr-users@olsr.org</a> or\n"
                   "<a href=\"mailto:andreto-at-olsr.org\">andreto-at-olsr.org</a><br/>\n"
-                  "Official olsrd homepage: <a href=\"http://www.olsr.org/\">http://www.olsr.org</a><br/>\n",
-                  build_date, build_host);
+                  "Official olsrd homepage: <a href=\"http://www.olsr.org/\">http://www.olsr.org</a><br/>\n", build_date,
+                  build_host);
 }
 
 static int
@@ -1154,8 +1125,7 @@ build_cfgfile_body(char *buf, olsr_u32_t bufsize)
 
   size +=
     snprintf(&buf[size], bufsize - size,
-             "\n\n"
-             "<strong>This is a automatically generated configuration\n"
+             "\n\n" "<strong>This is a automatically generated configuration\n"
              "file based on the current olsrd configuration of this node.<br/>\n" "<hr/>\n" "<pre>\n");
 
 #ifdef NETDIRECT
index 0edf6e7..6ac36cb 100644 (file)
@@ -98,16 +98,15 @@ mapwrite_work(FILE * fmap)
       if (olsr_cnf->ip_version == AF_INET) {
         if (!(ip4equal((struct in_addr *)&olsr_cnf->main_addr, &ifs->interf->int_addr.sin_addr))) {
           if (0 >
-              fprintf(fmap, "Mid('%s','%s');\n",
-                      olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr), olsr_ip_to_string(&strbuf2, (union olsr_ip_addr *)
-                                                                                           &ifs->interf->int_addr.sin_addr))) {
+              fprintf(fmap, "Mid('%s','%s');\n", olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr),
+                      olsr_ip_to_string(&strbuf2, (union olsr_ip_addr *)
+                                        &ifs->interf->int_addr.sin_addr))) {
             return;
           }
         }
       } else if (!(ip6equal((struct in6_addr *)&olsr_cnf->main_addr, &ifs->interf->int6_addr.sin6_addr))) {
         if (0 >
-            fprintf(fmap, "Mid('%s','%s');\n",
-                    olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr),
+            fprintf(fmap, "Mid('%s','%s');\n", olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr),
                     olsr_ip_to_string(&strbuf2, (union olsr_ip_addr *)&ifs->interf->int6_addr.sin6_addr))) {
           return;
         }
@@ -121,8 +120,8 @@ mapwrite_work(FILE * fmap)
       struct mid_address *alias = entry->aliases;
       while (alias) {
         if (0 >
-            fprintf(fmap, "Mid('%s','%s');\n",
-                    olsr_ip_to_string(&strbuf1, &entry->main_addr), olsr_ip_to_string(&strbuf2, &alias->alias))) {
+            fprintf(fmap, "Mid('%s','%s');\n", olsr_ip_to_string(&strbuf1, &entry->main_addr),
+                    olsr_ip_to_string(&strbuf2, &alias->alias))) {
           return;
         }
         alias = alias->next_alias;
@@ -133,8 +132,8 @@ mapwrite_work(FILE * fmap)
   lookup_defhna_latlon(&ip);
   sprintf(my_latlon_str, "%f,%f,%d", my_lat, my_lon, get_isdefhna_latlon());
   if (0 >
-      fprintf(fmap, "Self('%s',%s,'%s','%s');\n",
-              olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr), my_latlon_str, olsr_ip_to_string(&strbuf2, &ip), my_names->name)) {
+      fprintf(fmap, "Self('%s',%s,'%s','%s');\n", olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr), my_latlon_str,
+              olsr_ip_to_string(&strbuf2, &ip), my_names->name)) {
     return;
   }
   for (hash = 0; hash < HASHSIZE; hash++) {
@@ -148,9 +147,8 @@ mapwrite_work(FILE * fmap)
 
       if (NULL != entry->names) {
         if (0 >
-            fprintf(fmap, "Node('%s',%s,'%s','%s');\n",
-                    olsr_ip_to_string(&strbuf1, &entry->originator),
-                    entry->names->name, olsr_ip_to_string(&strbuf2, &entry->names->ip), lookup_name_latlon(&entry->originator))) {
+            fprintf(fmap, "Node('%s',%s,'%s','%s');\n", olsr_ip_to_string(&strbuf1, &entry->originator), entry->names->name,
+                    olsr_ip_to_string(&strbuf2, &entry->names->ip), lookup_name_latlon(&entry->originator))) {
           return;
         }
       }
@@ -168,10 +166,8 @@ mapwrite_work(FILE * fmap)
          * To speed up processing, Links with both positions are named PLink()
          */
         if (0 >
-            fprintf(fmap, "PLink('%s','%s',%s,%s,%s,%s);\n",
-                    olsr_ip_to_string(&strbuf1, &tc_edge->T_dest_addr),
-                    olsr_ip_to_string(&strbuf2, &tc->addr),
-                    get_tc_edge_entry_text(tc_edge, ',', &lqbuffer2),
+            fprintf(fmap, "PLink('%s','%s',%s,%s,%s,%s);\n", olsr_ip_to_string(&strbuf1, &tc_edge->T_dest_addr),
+                    olsr_ip_to_string(&strbuf2, &tc->addr), get_tc_edge_entry_text(tc_edge, ',', &lqbuffer2),
                     get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer), lla, llb)) {
           return;
         }
@@ -182,10 +178,9 @@ mapwrite_work(FILE * fmap)
          * If one link end pos is unkown, only send Link()
          */
         if (0 >
-            fprintf(fmap, "Link('%s','%s',%s,%s);\n",
-                    olsr_ip_to_string(&strbuf1, &tc_edge->T_dest_addr),
-                    olsr_ip_to_string(&strbuf2, &tc->addr),
-                    get_tc_edge_entry_text(tc_edge, ',', &lqbuffer2), get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer))) {
+            fprintf(fmap, "Link('%s','%s',%s,%s);\n", olsr_ip_to_string(&strbuf1, &tc_edge->T_dest_addr),
+                    olsr_ip_to_string(&strbuf2, &tc->addr), get_tc_edge_entry_text(tc_edge, ',', &lqbuffer2),
+                    get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer))) {
           return;
         }
       }
index e42a63f..eaa3491 100644 (file)
@@ -235,19 +235,19 @@ set_nameservice_float(const char *value, void *data, set_plugin_parameter_addon
 static const struct olsrd_plugin_parameters plugin_parameters[] = {
   {.name = "interval",.set_plugin_parameter = &set_plugin_int,.data = &my_interval},
   {.name = "timeout",.set_plugin_parameter = &set_nameservice_float,.data = &my_timeout},
-  {.name = "sighup-pid-file",.set_plugin_parameter =
-   &set_plugin_string,.data = &my_sighup_pid_file,.addon = {sizeof(my_sighup_pid_file)}
+  {.name = "sighup-pid-file",.set_plugin_parameter = &set_plugin_string,.data = &my_sighup_pid_file,.addon =
+   {sizeof(my_sighup_pid_file)}
    }
   ,
   {.name = "hosts-file",.set_plugin_parameter = &set_plugin_string,.data = &my_hosts_file,.addon = {sizeof(my_hosts_file)}
    }
   ,
-  {.name = "name-change-script",.set_plugin_parameter =
-   &set_plugin_string,.data = &my_name_change_script,.addon = {sizeof(my_name_change_script)}
+  {.name = "name-change-script",.set_plugin_parameter = &set_plugin_string,.data = &my_name_change_script,.addon =
+   {sizeof(my_name_change_script)}
    }
   ,
-  {.name = "services-change-script",.set_plugin_parameter =
-   &set_plugin_string,.data = &my_services_change_script,.addon = {sizeof(my_services_change_script)}
+  {.name = "services-change-script",.set_plugin_parameter = &set_plugin_string,.data = &my_services_change_script,.addon =
+   {sizeof(my_services_change_script)}
    }
   ,
   {.name = "resolv-file",.set_plugin_parameter = &set_plugin_string,.data = &my_resolv_file,.addon = {sizeof(my_resolv_file)}
@@ -442,9 +442,8 @@ remove_nonvalid_names_from_list(struct name_entry *my_list, int type)
 
   if (!valid) {
     struct ipaddr_str strbuf;
-    OLSR_PRINTF(1,
-                "NAME PLUGIN: invalid or malformed parameter %s (%s), fix your config!\n",
-                my_list->name, olsr_ip_to_string(&strbuf, &my_list->ip));
+    OLSR_PRINTF(1, "NAME PLUGIN: invalid or malformed parameter %s (%s), fix your config!\n", my_list->name,
+                olsr_ip_to_string(&strbuf, &my_list->ip));
     next = my_list->next;
     free(my_list->name);
     my_list->name = NULL;
@@ -784,8 +783,7 @@ decap_namemsg(struct name *from_packet, struct name_entry **to, olsr_bool * this
   //ignore all packets with a too long name
   //or a spoofed len of its included name string
   if (len_of_name > MAX_NAME || strlen(name) != len_of_name || NULL != strchr(name, '\\') || NULL != strchr(name, '\'')) {
-    OLSR_PRINTF(4,
-                "NAME PLUGIN: from_packet->len %d > MAX_NAME %d or from_packet->len %d !0 strlen(name [%s] in packet)\n",
+    OLSR_PRINTF(4, "NAME PLUGIN: from_packet->len %d > MAX_NAME %d or from_packet->len %d !0 strlen(name [%s] in packet)\n",
                 len_of_name, MAX_NAME, len_of_name, name);
     return;
   }
@@ -795,19 +793,17 @@ decap_namemsg(struct name *from_packet, struct name_entry **to, olsr_bool * this
        already_saved_name_entries = already_saved_name_entries->next) {
     if ((type_of_from_packet == NAME_HOST || type_of_from_packet == NAME_SERVICE)
         && strncmp(already_saved_name_entries->name, name, len_of_name) == 0) {
-      OLSR_PRINTF(4,
-                  "NAME PLUGIN: received name or service entry %s (%s) already in hash table\n",
-                  name, olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip));
+      OLSR_PRINTF(4, "NAME PLUGIN: received name or service entry %s (%s) already in hash table\n", name,
+                  olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip));
       return;
     } else if (type_of_from_packet == NAME_FORWARDER && ipequal(&already_saved_name_entries->ip, &from_packet->ip)) {
-      OLSR_PRINTF(4,
-                  "NAME PLUGIN: received forwarder entry %s (%s) already in hash table\n",
-                  name, olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip));
+      OLSR_PRINTF(4, "NAME PLUGIN: received forwarder entry %s (%s) already in hash table\n", name,
+                  olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip));
       return;
     } else if (type_of_from_packet == NAME_LATLON) {
       if (0 != strncmp(already_saved_name_entries->name, name, len_of_name)) {
-        OLSR_PRINTF(4, "NAME PLUGIN: updating name %s -> %s (%s)\n",
-                    already_saved_name_entries->name, name, olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip));
+        OLSR_PRINTF(4, "NAME PLUGIN: updating name %s -> %s (%s)\n", already_saved_name_entries->name, name,
+                    olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip));
         free(already_saved_name_entries->name);
         already_saved_name_entries->name = olsr_malloc(len_of_name + 1, "upd name_entry name");
         strscpy(already_saved_name_entries->name, name, len_of_name + 1);
@@ -817,10 +813,7 @@ decap_namemsg(struct name *from_packet, struct name_entry **to, olsr_bool * this
       }
       if (!ipequal(&already_saved_name_entries->ip, &from_packet->ip)) {
         struct ipaddr_str strbuf2, strbuf3;
-        OLSR_PRINTF(4, "NAME PLUGIN: updating ip %s -> %s (%s)\n",
-                    olsr_ip_to_string(&strbuf,
-                                      &already_saved_name_entries->
-                                      ip),
+        OLSR_PRINTF(4, "NAME PLUGIN: updating ip %s -> %s (%s)\n", olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip),
                     olsr_ip_to_string(&strbuf2, &from_packet->ip), olsr_ip_to_string(&strbuf3, &already_saved_name_entries->ip));
         already_saved_name_entries->ip = from_packet->ip;
 
@@ -828,9 +821,8 @@ decap_namemsg(struct name *from_packet, struct name_entry **to, olsr_bool * this
         olsr_start_write_file_timer();
       }
       if (!*this_table_changed) {
-        OLSR_PRINTF(4,
-                    "NAME PLUGIN: received latlon entry %s (%s) already in hash table\n",
-                    name, olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip));
+        OLSR_PRINTF(4, "NAME PLUGIN: received latlon entry %s (%s) already in hash table\n", name,
+                    olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip));
       }
       return;
     }
@@ -844,9 +836,8 @@ decap_namemsg(struct name *from_packet, struct name_entry **to, olsr_bool * this
   tmp->ip = from_packet->ip;
   strscpy(tmp->name, name, tmp->len + 1);
 
-  OLSR_PRINTF(3,
-              "\nNAME PLUGIN: create new name/service/forwarder entry %s (%s) [len=%d] [type=%d] in linked list\n",
-              tmp->name, olsr_ip_to_string(&strbuf, &tmp->ip), tmp->len, tmp->type);
+  OLSR_PRINTF(3, "\nNAME PLUGIN: create new name/service/forwarder entry %s (%s) [len=%d] [type=%d] in linked list\n", tmp->name,
+              olsr_ip_to_string(&strbuf, &tmp->ip), tmp->len, tmp->type);
 
   *this_table_changed = OLSR_TRUE;
   olsr_start_write_file_timer();
@@ -896,9 +887,8 @@ update_name_entry(union olsr_ip_addr *originator, struct namemsg *msg, int msg_s
       insert_new_name_in_list(originator, latlon_list, from_packet, &latlon_table_changed, vtime);
       break;
     default:
-      OLSR_PRINTF(3,
-                  "NAME PLUGIN: Received Message of unknown type [%d] from (%s)\n",
-                  from_packet->type, olsr_ip_to_string(&strbuf, originator));
+      OLSR_PRINTF(3, "NAME PLUGIN: Received Message of unknown type [%d] from (%s)\n", from_packet->type,
+                  olsr_ip_to_string(&strbuf, originator));
       break;
     }
 
@@ -906,9 +896,8 @@ update_name_entry(union olsr_ip_addr *originator, struct namemsg *msg, int msg_s
     pos += 1 + ((ntohs(from_packet->len) - 1) | 3);
   }
   if (i != 0)
-    OLSR_PRINTF(4,
-                "NAME PLUGIN: Lost %d entries in received packet due to length inconsistency (%s)\n",
-                i, olsr_ip_to_string(&strbuf, originator));
+    OLSR_PRINTF(4, "NAME PLUGIN: Lost %d entries in received packet due to length inconsistency (%s)\n", i,
+                olsr_ip_to_string(&strbuf, originator));
 }
 
 /**
@@ -916,8 +905,8 @@ update_name_entry(union olsr_ip_addr *originator, struct namemsg *msg, int msg_s
  * corresponding entry for this ip in the corresponding hash table
  */
 void
-insert_new_name_in_list(union olsr_ip_addr *originator,
-                        struct list_node *this_list, struct name *from_packet, olsr_bool * this_table_changed, olsr_reltime vtime)
+insert_new_name_in_list(union olsr_ip_addr *originator, struct list_node *this_list, struct name *from_packet,
+                        olsr_bool * this_table_changed, olsr_reltime vtime)
 {
   int hash;
   struct db_entry *entry;
@@ -941,8 +930,8 @@ insert_new_name_in_list(union olsr_ip_addr *originator,
       //delegate to function for parsing the packet and linking it to entry->names
       decap_namemsg(from_packet, &entry->names, this_table_changed);
 
-      olsr_set_timer(&entry->db_timer, vtime, OLSR_NAMESVC_DB_JITTER,
-                     OLSR_TIMER_ONESHOT, &olsr_nameservice_expire_db_timer, entry, 0);
+      olsr_set_timer(&entry->db_timer, vtime, OLSR_NAMESVC_DB_JITTER, OLSR_TIMER_ONESHOT, &olsr_nameservice_expire_db_timer, entry,
+                     0);
 
       entry_found = OLSR_TRUE;
     }
@@ -1080,11 +1069,11 @@ write_hosts_file(void)
 
       for (name = entry->names; name != NULL; name = name->next) {
         struct ipaddr_str strbuf;
-        OLSR_PRINTF(6, "%s\t%s%s\t#%s\n",
-                    olsr_ip_to_string(&strbuf, &name->ip), name->name, my_suffix, olsr_ip_to_string(&strbuf, &entry->originator));
+        OLSR_PRINTF(6, "%s\t%s%s\t#%s\n", olsr_ip_to_string(&strbuf, &name->ip), name->name, my_suffix,
+                    olsr_ip_to_string(&strbuf, &entry->originator));
 
-        fprintf(hosts, "%s\t%s%s\t# %s\n",
-                olsr_ip_to_string(&strbuf, &name->ip), name->name, my_suffix, olsr_ip_to_string(&strbuf, &entry->originator));
+        fprintf(hosts, "%s\t%s%s\t# %s\n", olsr_ip_to_string(&strbuf, &name->ip), name->name, my_suffix,
+                olsr_ip_to_string(&strbuf, &entry->originator));
 
 #ifdef MID_ENTRIES
         // write mid entries
@@ -1098,13 +1087,11 @@ write_hosts_file(void)
             // generate mid prefix
             sprintf(mid_prefix, MID_PREFIX, mid_num);
 
-            OLSR_PRINTF(6, "%s\t%s%s%s\t# %s (mid #%i)\n",
-                        olsr_ip_to_string(&midbuf, &alias->alias),
-                        mid_prefix, name->name, my_suffix, olsr_ip_to_string(&strbuf, &entry->originator), mid_num);
+            OLSR_PRINTF(6, "%s\t%s%s%s\t# %s (mid #%i)\n", olsr_ip_to_string(&midbuf, &alias->alias), mid_prefix, name->name,
+                        my_suffix, olsr_ip_to_string(&strbuf, &entry->originator), mid_num);
 
-            fprintf(hosts, "%s\t%s%s%s\t# %s (mid #%i)\n",
-                    olsr_ip_to_string(&midbuf, &alias->alias),
-                    mid_prefix, name->name, my_suffix, olsr_ip_to_string(&strbuf, &entry->originator), mid_num);
+            fprintf(hosts, "%s\t%s%s%s\t# %s (mid #%i)\n", olsr_ip_to_string(&midbuf, &alias->alias), mid_prefix, name->name,
+                    my_suffix, olsr_ip_to_string(&strbuf, &entry->originator), mid_num);
 
             alias = alias->next_alias;
             mid_num++;
@@ -1238,8 +1225,7 @@ select_best_nameserver(struct rt_entry **rt)
       /*
        * first is better, swap the pointers.
        */
-      OLSR_PRINTF(6, "NAME PLUGIN: nameserver %s, cost %s\n",
-                  olsr_ip_to_string(&strbuf, &rt1->rt_dst.prefix),
+      OLSR_PRINTF(6, "NAME PLUGIN: nameserver %s, cost %s\n", olsr_ip_to_string(&strbuf, &rt1->rt_dst.prefix),
                   get_linkcost_text(rt1->rt_best->rtp_metric.cost, OLSR_TRUE, &lqbuffer));
 
       rt[nameserver_idx] = rt2;
@@ -1284,16 +1270,15 @@ write_resolv_file(void)
 #endif
         route = olsr_lookup_routing_table(&name->ip);
 
-        OLSR_PRINTF(6, "NAME PLUGIN: check route for nameserver %s %s",
-                    olsr_ip_to_string(&strbuf, &name->ip), route ? "suceeded" : "failed");
+        OLSR_PRINTF(6, "NAME PLUGIN: check route for nameserver %s %s", olsr_ip_to_string(&strbuf, &name->ip),
+                    route ? "suceeded" : "failed");
 
         if (route == NULL)      // it's possible that route is not present yet
           continue;
 
         /* enqueue it on the head of list */
         *nameserver_routes = route;
-        OLSR_PRINTF(6, "NAME PLUGIN: found nameserver %s, cost %s",
-                    olsr_ip_to_string(&strbuf, &name->ip),
+        OLSR_PRINTF(6, "NAME PLUGIN: found nameserver %s, cost %s", olsr_ip_to_string(&strbuf, &name->ip),
                     get_linkcost_text(route->rt_best->rtp_metric.cost, OLSR_TRUE, &lqbuffer));
 
         /* find the closet one */
@@ -1492,9 +1477,8 @@ allowed_hostname_or_ip_in_service(const char *service_line, const regmatch_t * h
     }
   }
 
-  OLSR_PRINTF(1,
-              "NAME PLUGIN: ip or hostname %s in service %s is NOT allowed (does not belong to you)\n",
-              hostname_or_ip, service_line);
+  OLSR_PRINTF(1, "NAME PLUGIN: ip or hostname %s in service %s is NOT allowed (does not belong to you)\n", hostname_or_ip,
+              service_line);
   free(hostname_or_ip);
   hostname_or_ip = NULL;
 
index 5947e72..d31c07c 100644 (file)
@@ -162,8 +162,8 @@ ipc_print_neigh_link(struct neighbor_entry *neighbor)
 //  struct link_entry* link;
 
   len =
-    sprintf(buf, "add link %s %s\n",
-            olsr_ip_to_string(&main_adr, &olsr_cnf->main_addr), olsr_ip_to_string(&adr, &neighbor->neighbor_main_addr));
+    sprintf(buf, "add link %s %s\n", olsr_ip_to_string(&main_adr, &olsr_cnf->main_addr),
+            olsr_ip_to_string(&adr, &neighbor->neighbor_main_addr));
   ipc_send(buf, len);
 
 //  if (neighbor->status == 0) { // non SYM
index 580411e..821f78e 100644 (file)
@@ -512,8 +512,7 @@ zebra_parse_packet(unsigned char *packet, ssize_t maxlen)
 
   /* Array of functions */
   int (*foo[ZEBRA_MESSAGE_MAX]) (unsigned char *, size_t) = {
-  parse_interface_add, parse_interface_delete, parse_interface_address_add,
-      parse_interface_address_delete, parse_interface_up,
+  parse_interface_add, parse_interface_delete, parse_interface_address_add, parse_interface_address_delete, parse_interface_up,
       parse_interface_down, ipv4_route_add, ipv4_route_delete, parse_ipv6_route_add};
 
   uint16_t length;
index 46da0de..a617742 100644 (file)
@@ -347,8 +347,7 @@ zebra_parse_packet(char *packet, ssize_t maxlen)
 
   /* Array of functions */
   int (*foo[ZEBRA_MESSAGE_MAX]) (char *, size_t) = {
-  parse_interface_add, parse_interface_delete, parse_interface_address_add,
-      parse_interface_address_delete, parse_interface_up,
+  parse_interface_add, parse_interface_delete, parse_interface_address_add, parse_interface_address_delete, parse_interface_up,
       parse_interface_down, ipv4_route_add, ipv4_route_delete, parse_ipv6_route_add};
 
   puts("DEBUG: zebra_parse_packet");
@@ -717,8 +716,8 @@ while (mask & (1 << ++prefixlen && prefixlen < 32); return prefixlen;}
 
        static void zebra_free_ipv4_route_table(struct ipv4_route *r) {
        struct ipv4_route * n; if (!r) return; while ((n = r->next)) {
-       if (r->message & ZAPI_MESSAGE_NEXTHOP) free(r->nexthops);
-       if (r->message & ZAPI_MESSAGE_IFINDEX) free(r->index); free(r); r = n;}
+       if (r->message & ZAPI_MESSAGE_NEXTHOP) free(r->nexthops); if (r->message & ZAPI_MESSAGE_IFINDEX) free(r->index); free(r);
+       r = n;}
        }
 
 /*
index 3d8a5b5..312de91 100644 (file)
@@ -662,8 +662,7 @@ parse_cres(struct interface *olsr_if, char *in_msg)
   /* Now to check the digest from the emitted challenge */
   if ((entry = lookup_timestamp_entry((const union olsr_ip_addr *)&msg->originator)) == NULL) {
     struct ipaddr_str buf;
-    olsr_printf(1,
-                "[ENC]Received challenge-response from non-registered node %s!\n",
+    olsr_printf(1, "[ENC]Received challenge-response from non-registered node %s!\n",
                 olsr_ip_to_string(&buf, (union olsr_ip_addr *)&msg->originator));
     return 0;
   }
@@ -700,8 +699,8 @@ parse_cres(struct interface *olsr_if, char *in_msg)
   /* update validtime - validated entry */
   entry->valtime = GET_TIMESTAMP(TIMESTAMP_HOLD_TIME * 1000);
 
-  olsr_printf(1, "[ENC]%s registered with diff %d!\n",
-              olsr_ip_to_string(&buf, (union olsr_ip_addr *)&msg->originator), entry->diff);
+  olsr_printf(1, "[ENC]%s registered with diff %d!\n", olsr_ip_to_string(&buf, (union olsr_ip_addr *)&msg->originator),
+              entry->diff);
 
   /* Send response-response */
   send_rres(olsr_if, (union olsr_ip_addr *)&msg->originator, (union olsr_ip_addr *)&msg->destination, ntohl(msg->challenge));
@@ -751,8 +750,7 @@ parse_rres(char *in_msg)
   /* Now to check the digest from the emitted challenge */
   if ((entry = lookup_timestamp_entry((const union olsr_ip_addr *)&msg->originator)) == NULL) {
     struct ipaddr_str buf;
-    olsr_printf(1,
-                "[ENC]Received response-response from non-registered node %s!\n",
+    olsr_printf(1, "[ENC]Received response-response from non-registered node %s!\n",
                 olsr_ip_to_string(&buf, (union olsr_ip_addr *)&msg->originator));
     return 0;
   }
@@ -789,8 +787,8 @@ parse_rres(char *in_msg)
   /* update validtime - validated entry */
   entry->valtime = GET_TIMESTAMP(TIMESTAMP_HOLD_TIME * 1000);
 
-  olsr_printf(1, "[ENC]%s registered with diff %d!\n",
-              olsr_ip_to_string(&buf, (union olsr_ip_addr *)&msg->originator), entry->diff);
+  olsr_printf(1, "[ENC]%s registered with diff %d!\n", olsr_ip_to_string(&buf, (union olsr_ip_addr *)&msg->originator),
+              entry->diff);
 
   return 1;
 }
index 6096d3b..127d113 100644 (file)
@@ -42,8 +42,8 @@
 
 extern int lspToLua(const char *rootDir, const char *lspFileName, const char *workDir, const char *luaFileName);
 extern int luaToLex(char **errMsg, const char *workDir, const char *luaFileName, const char *lexFileName);
-extern int runLua(char **errMsg, struct connInfo *info, const char *workDir,
-                  const char *lexFileName, char **argList, void **session);
+extern int runLua(char **errMsg, struct connInfo *info, const char *workDir, const char *lexFileName, char **argList,
+                  void **session);
 extern void freeLuaSession(void *session);
 
 /*
index 29ba689..ebb33d8 100644 (file)
@@ -396,9 +396,8 @@ allocBuff(struct connInfo *info, int len)
   debug(DEBUG_CONNECTION, "%d bytes of buffer space requested\n", len);
 
   if (info->buff != NULL)
-    debug(DEBUG_CONNECTION,
-          "existing buffer, size = %d bytes, used = %d bytes, remaining = %d bytes\n",
-          info->buffTotal, info->buffUsed, info->buffTotal - info->buffUsed);
+    debug(DEBUG_CONNECTION, "existing buffer, size = %d bytes, used = %d bytes, remaining = %d bytes\n", info->buffTotal,
+          info->buffUsed, info->buffTotal - info->buffUsed);
 
   else
     debug(DEBUG_CONNECTION, "no existing buffer\n");
@@ -501,8 +500,8 @@ httpSetWorkDir(const char *workDir, void *data __attribute__ ((unused)), set_plu
 }
 
 int
-httpSetIndexFile(const char *indexFile, void *data
-                 __attribute__ ((unused)), set_plugin_parameter_addon addon __attribute__ ((unused)))
+httpSetIndexFile(const char *indexFile, void *data __attribute__ ((unused)), set_plugin_parameter_addon addon
+                 __attribute__ ((unused)))
 {
   confIndexFile = myStrdup(indexFile);
   return 0;
@@ -516,8 +515,8 @@ httpSetUser(const char *user, void *data __attribute__ ((unused)), set_plugin_pa
 }
 
 int
-httpSetPassword(const char *password, void *data
-                __attribute__ ((unused)), set_plugin_parameter_addon addon __attribute__ ((unused)))
+httpSetPassword(const char *password, void *data __attribute__ ((unused)), set_plugin_parameter_addon addon
+                __attribute__ ((unused)))
 {
   confPassword = myStrdup(password);
   return 0;
@@ -551,8 +550,8 @@ httpSetPubDir(const char *pubDir, void *data __attribute__ ((unused)), set_plugi
 }
 
 int
-httpSetQuantum(const char *quantumStr, void *data
-               __attribute__ ((unused)), set_plugin_parameter_addon addon __attribute__ ((unused)))
+httpSetQuantum(const char *quantumStr, void *data __attribute__ ((unused)), set_plugin_parameter_addon addon
+               __attribute__ ((unused)))
 {
   unsigned int quantum;
 
@@ -592,8 +591,8 @@ httpSetMessTime(const char *timeStr, void *data __attribute__ ((unused)), set_pl
 }
 
 int
-httpSetMessLimit(const char *limitStr, void *data
-                 __attribute__ ((unused)), set_plugin_parameter_addon addon __attribute__ ((unused)))
+httpSetMessLimit(const char *limitStr, void *data __attribute__ ((unused)), set_plugin_parameter_addon addon
+                 __attribute__ ((unused)))
 {
   unsigned int limit;
 
@@ -1033,8 +1032,8 @@ writeErrorMsg(struct connInfo *info, int errNo, char *errMsg)
   if (info->verb == NULL || strcmp(info->verb, "HEAD") != 0) {
     printBuff(&info->write[2], "<html>\r\n");
     printBuff(&info->write[2], "<head><title>Error %d: %s</title></head>\r\n", errNo, errNoToErrStr(errNo));
-    printBuff(&info->write[2], "<body>Error %d: %s (%s)</body>\r\n", errNo,
-              errNoToErrStr(errNo), (errMsg == NULL) ? "Unknown Reason" : errMsg);
+    printBuff(&info->write[2], "<body>Error %d: %s (%s)</body>\r\n", errNo, errNoToErrStr(errNo),
+              (errMsg == NULL) ? "Unknown Reason" : errMsg);
     printBuff(&info->write[2], "</html>\r\n");
 
     info->contLen = info->write[2].cont;
@@ -1123,12 +1122,12 @@ serviceConn(struct connInfo *info)
     tmp = getToken(&line);
     info->proto = getToken(&line);
 
-    debug(DEBUG_REQUEST, "verb = %s, uri = %s, protocol = %s\n",
-          (info->verb == NULL) ? "none" : info->verb, (tmp == NULL) ? "none" : tmp, (info->proto == NULL) ? "none" : info->proto);
+    debug(DEBUG_REQUEST, "verb = %s, uri = %s, protocol = %s\n", (info->verb == NULL) ? "none" : info->verb,
+          (tmp == NULL) ? "none" : tmp, (info->proto == NULL) ? "none" : info->proto);
 
     if (info->verb == NULL || tmp == NULL || info->proto == NULL) {
-      error("request without verb (%s), URI (%s), or protocol (%s)\n",
-            (info->verb == NULL) ? "none" : info->verb, (tmp == NULL) ? "none" : tmp, (info->proto == NULL) ? "none" : info->proto);
+      error("request without verb (%s), URI (%s), or protocol (%s)\n", (info->verb == NULL) ? "none" : info->verb,
+            (tmp == NULL) ? "none" : tmp, (info->proto == NULL) ? "none" : info->proto);
       writeError(info, 400);
       return 0;
     }
@@ -1738,8 +1737,8 @@ httpService(int freq)
   while (numTasMsg > 0 && confMessTime > 0 && timedOut(&firstTasMsg->time, confMessTime) >= 0) {
     tasMsg = firstTasMsg;
 
-    debug(DEBUG_MESSAGE,
-          "message timed out, service ='%s', string = '%s', from = %s\n", tasMsg->service, tasMsg->string, tasMsg->from);
+    debug(DEBUG_MESSAGE, "message timed out, service ='%s', string = '%s', from = %s\n", tasMsg->service, tasMsg->string,
+          tasMsg->from);
 
     firstTasMsg = firstTasMsg->next;
 
index 0e5b829..2ff4568 100644 (file)
@@ -97,9 +97,8 @@ check_match(LexState * ls, int what, int who, int where)
       error_expected(ls, what);
     else {
       luaX_syntaxerror(ls,
-                       luaO_pushfstring(ls->L,
-                                        "`%s' expected (to close `%s' at line %d)",
-                                        luaX_token2str(ls, what), luaX_token2str(ls, who), where));
+                       luaO_pushfstring(ls->L, "`%s' expected (to close `%s' at line %d)", luaX_token2str(ls, what),
+                                        luaX_token2str(ls, who), where));
     }
   }
 }
index 7a9c8c0..8ff7264 100644 (file)
@@ -464,8 +464,8 @@ retentry:                      /* entry point when returning to old functions */
     lua_assert(L->ci->state & CI_HASFRAME);
     lua_assert(base == L->ci->base);
     lua_assert(L->top <= L->stack + L->stacksize && L->top >= base);
-    lua_assert(L->top == L->ci->top || GET_OPCODE(i) == OP_CALL
-               || GET_OPCODE(i) == OP_TAILCALL || GET_OPCODE(i) == OP_RETURN || GET_OPCODE(i) == OP_SETLISTO);
+    lua_assert(L->top == L->ci->top || GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL || GET_OPCODE(i) == OP_RETURN
+               || GET_OPCODE(i) == OP_SETLISTO);
     switch (GET_OPCODE(i)) {
     case OP_MOVE:
       {
index 222a15d..5204f5d 100644 (file)
@@ -115,10 +115,9 @@ iterLinkTabNext(char *buff, int len)
     return -1;
 
   snprintf(buff, len, "local~%s~remote~%s~main~%s~hysteresis~%f~cost~%s~",
-           rawIpAddrToString(&iterLinkTab->local_iface_addr, ipAddrLen),
-           rawIpAddrToString(&iterLinkTab->neighbor_iface_addr, ipAddrLen),
-           rawIpAddrToString(&iterLinkTab->neighbor->neighbor_main_addr,
-                             ipAddrLen), iterLinkTab->L_link_quality,
+           rawIpAddrToString(&iterLinkTab->local_iface_addr, ipAddrLen), rawIpAddrToString(&iterLinkTab->neighbor_iface_addr,
+                                                                                           ipAddrLen),
+           rawIpAddrToString(&iterLinkTab->neighbor->neighbor_main_addr, ipAddrLen), iterLinkTab->L_link_quality,
            get_linkcost_text(iterLinkTab->linkcost, OLSR_FALSE, &lqbuffer));
 
   link_node = iterLinkTab->link_list.next;
@@ -155,11 +154,8 @@ iterNeighTabNext(char *buff, int len)
     return -1;
 
   res =
-    snprintf(buff, len,
-             "main~%s~symmetric~%s~mpr~%s~mprs~%s~willingness~%d~[~neighbors2~",
-             rawIpAddrToString(&iterNeighTab->neighbor_main_addr,
-                               ipAddrLen),
-             iterNeighTab->status == SYM ? "true" : "false",
+    snprintf(buff, len, "main~%s~symmetric~%s~mpr~%s~mprs~%s~willingness~%d~[~neighbors2~",
+             rawIpAddrToString(&iterNeighTab->neighbor_main_addr, ipAddrLen), iterNeighTab->status == SYM ? "true" : "false",
              iterNeighTab->is_mpr != 0 ? "true" : "false",
              olsr_lookup_mprs_set(&iterNeighTab->neighbor_main_addr) != NULL ? "true" : "false", iterNeighTab->willingness);
 
@@ -226,8 +222,7 @@ iterRouteTabNext(char *buff, int len)
 
   snprintf(buff, len, "destination~%s~gateway~%s~interface~%s~metric~%d~",
            rawIpAddrToString(&iterRouteTab->rt_dst.prefix, ipAddrLen),
-           rawIpAddrToString(&iterRouteTab->rt_best->rtp_nexthop.gateway,
-                             ipAddrLen),
+           rawIpAddrToString(&iterRouteTab->rt_best->rtp_nexthop.gateway, ipAddrLen),
            if_ifwithindex_name(iterRouteTab->rt_best->rtp_nexthop.iif_index), iterRouteTab->rt_best->rtp_metric.hops);
 
   rt_tree_node = avl_walk_next(&iterRouteTab->rt_tree_node);
@@ -289,8 +284,8 @@ iterTcTabNext(char *buff, int len)
   OLSR_FOR_ALL_TC_EDGE_ENTRIES(iterTcTab, tc_edge) {
 
     res =
-      snprintf(buff, len, "[~%d~address~%s~cost~%s~]~", i,
-               rawIpAddrToString(&tc_edge->T_dest_addr, ipAddrLen), get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer));
+      snprintf(buff, len, "[~%d~address~%s~cost~%s~]~", i, rawIpAddrToString(&tc_edge->T_dest_addr, ipAddrLen),
+               get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer));
 
     if (res < len)
       buff += res;
index 0567b6e..ef2015b 100644 (file)
@@ -326,9 +326,7 @@ ipc_print_neigh(void)
 
   /* Neighbors */
   OLSR_FOR_ALL_NBR_ENTRIES(neigh) {
-    ipc_sendf("%s\t%s\t%s\t%s\t%d\t",
-              olsr_ip_to_string(&buf1, &neigh->neighbor_main_addr),
-              (neigh->status == SYM) ? "YES" : "NO",
+    ipc_sendf("%s\t%s\t%s\t%s\t%d\t", olsr_ip_to_string(&buf1, &neigh->neighbor_main_addr), (neigh->status == SYM) ? "YES" : "NO",
               neigh->is_mpr ? "YES" : "NO", olsr_lookup_mprs_set(&neigh->neighbor_main_addr) ? "YES" : "NO", neigh->willingness);
     thop_cnt = 0;
 
@@ -354,11 +352,10 @@ ipc_print_link(void)
 
   /* Link set */
   OLSR_FOR_ALL_LINK_ENTRIES(link) {
-    ipc_sendf("%s\t%s\t%0.2f\t%s\t%s\t\n",
-              olsr_ip_to_string(&buf1, &link->local_iface_addr),
-              olsr_ip_to_string(&buf2, &link->neighbor_iface_addr),
-              link->L_link_quality, get_link_entry_text(link, '\t',
-                                                        &lqbuffer1), get_linkcost_text(link->linkcost, OLSR_FALSE, &lqbuffer2));
+    ipc_sendf("%s\t%s\t%0.2f\t%s\t%s\t\n", olsr_ip_to_string(&buf1, &link->local_iface_addr),
+              olsr_ip_to_string(&buf2, &link->neighbor_iface_addr), link->L_link_quality, get_link_entry_text(link, '\t',
+                                                                                                              &lqbuffer1),
+              get_linkcost_text(link->linkcost, OLSR_FALSE, &lqbuffer2));
   } OLSR_FOR_ALL_LINK_ENTRIES_END(link);
 
   ipc_sendf("\n");
@@ -375,14 +372,10 @@ ipc_print_routes(void)
 
   /* Walk the route table */
   OLSR_FOR_ALL_RT_ENTRIES(rt) {
-    ipc_sendf("%s/%d\t%s\t%d\t%s\t%s\t\n",
-              olsr_ip_to_string(&buf1, &rt->rt_dst.prefix),
-              rt->rt_dst.prefix_len, olsr_ip_to_string(&buf2,
-                                                       &rt->rt_best->
-                                                       rtp_nexthop.gateway),
-              rt->rt_best->rtp_metric.hops,
-              get_linkcost_text(rt->rt_best->rtp_metric.cost, OLSR_TRUE,
-                                &lqbuffer), if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
+    ipc_sendf("%s/%d\t%s\t%d\t%s\t%s\t\n", olsr_ip_to_string(&buf1, &rt->rt_dst.prefix), rt->rt_dst.prefix_len,
+              olsr_ip_to_string(&buf2, &rt->rt_best->rtp_nexthop.gateway), rt->rt_best->rtp_metric.hops,
+              get_linkcost_text(rt->rt_best->rtp_metric.cost, OLSR_TRUE, &lqbuffer),
+              if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
   } OLSR_FOR_ALL_RT_ENTRIES_END(rt);
 
   ipc_sendf("\n");
@@ -403,9 +396,7 @@ ipc_print_topology(void)
       if (tc_edge->edge_inv) {
         struct ipaddr_str dstbuf, addrbuf;
         struct lqtextbuffer lqbuffer1, lqbuffer2;
-        ipc_sendf("%s\t%s\t%s\t%s\n",
-                  olsr_ip_to_string(&dstbuf, &tc_edge->T_dest_addr),
-                  olsr_ip_to_string(&addrbuf, &tc->addr),
+        ipc_sendf("%s\t%s\t%s\t%s\n", olsr_ip_to_string(&dstbuf, &tc_edge->T_dest_addr), olsr_ip_to_string(&addrbuf, &tc->addr),
                   get_tc_edge_entry_text(tc_edge, '\t', &lqbuffer1), get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer2));
       }
     } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
@@ -431,16 +422,14 @@ ipc_print_hna(void)
   if (olsr_cnf->ip_version == AF_INET) {
     for (hna = olsr_cnf->hna_entries; hna != NULL; hna = hna->next) {
       struct ipaddr_str addrbuf, mainaddrbuf;
-      ipc_sendf("%s/%d\t%s\n",
-                olsr_ip_to_string(&addrbuf, &hna->net.prefix),
-                hna->net.prefix_len, olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->main_addr));
+      ipc_sendf("%s/%d\t%s\n", olsr_ip_to_string(&addrbuf, &hna->net.prefix), hna->net.prefix_len,
+                olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->main_addr));
     }
   } else {
     for (hna = olsr_cnf->hna_entries; hna != NULL; hna = hna->next) {
       struct ipaddr_str addrbuf, mainaddrbuf;
-      ipc_sendf("%s/%d\t%s\n",
-                olsr_ip_to_string(&addrbuf, &hna->net.prefix),
-                hna->net.prefix_len, olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->main_addr));
+      ipc_sendf("%s/%d\t%s\n", olsr_ip_to_string(&addrbuf, &hna->net.prefix), hna->net.prefix_len,
+                olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->main_addr));
     }
   }
 
@@ -450,9 +439,8 @@ ipc_print_hna(void)
     /* Check all networks */
     for (tmp_net = tmp_hna->networks.next; tmp_net != &tmp_hna->networks; tmp_net = tmp_net->next) {
 
-      ipc_sendf("%s/%d\t%s\n",
-                olsr_ip_to_string(&addrbuf, &tmp_net->A_network_addr),
-                tmp_net->prefixlen, olsr_ip_to_string(&mainaddrbuf, &tmp_hna->A_gateway_addr));
+      ipc_sendf("%s/%d\t%s\n", olsr_ip_to_string(&addrbuf, &tmp_net->A_network_addr), tmp_net->prefixlen,
+                olsr_ip_to_string(&mainaddrbuf, &tmp_hna->A_gateway_addr));
     }
   }
   OLSR_FOR_ALL_HNA_ENTRIES_END(tmp_hna);
index 899138c..55572da 100644 (file)
@@ -220,21 +220,17 @@ add_del_route(const struct rt_entry *rt, int add)
   OLSR_PRINTF(8, "\nWrote %d bytes to rts socket (FD=%d)\n", len, olsr_cnf->rts);
 
   if (0 != rtm->rtm_errno || len < rtm->rtm_msglen) {
-    fprintf(stderr,
-            "\nCannot write to routing socket: (rtm_errno= 0x%x) (last error message: %s)\n", rtm->rtm_errno, strerror(errno));
+    fprintf(stderr, "\nCannot write to routing socket: (rtm_errno= 0x%x) (last error message: %s)\n", rtm->rtm_errno,
+            strerror(errno));
   }
 
   OLSR_PRINTF(8,
-              "\nWriting the following information to routing socket (message header):"
-              "\n\trtm_msglen: %u" "\n\trtm_version: %u" "\n\trtm_type: %u"
-              "\n\trtm_index: %u" "\n\trtm_flags: 0x%x" "\n\trtm_addrs: %u"
-              "\n\trtm_pid: 0x%x" "\n\trtm_seq: %u" "\n\trtm_errno: 0x%x"
-              "\n\trtm_use %u" "\n\trtm_inits: %u\n",
-              (unsigned int)rtm->rtm_msglen,
-              (unsigned int)rtm->rtm_version, (unsigned int)rtm->rtm_type,
-              (unsigned int)rtm->rtm_index, (unsigned int)rtm->rtm_flags,
-              (unsigned int)rtm->rtm_addrs, (unsigned int)rtm->rtm_pid,
-              (unsigned int)rtm->rtm_seq, (unsigned int)rtm->rtm_errno, (unsigned int)rtm->rtm_use, (unsigned int)rtm->rtm_inits);
+              "\nWriting the following information to routing socket (message header):" "\n\trtm_msglen: %u" "\n\trtm_version: %u"
+              "\n\trtm_type: %u" "\n\trtm_index: %u" "\n\trtm_flags: 0x%x" "\n\trtm_addrs: %u" "\n\trtm_pid: 0x%x" "\n\trtm_seq: %u"
+              "\n\trtm_errno: 0x%x" "\n\trtm_use %u" "\n\trtm_inits: %u\n", (unsigned int)rtm->rtm_msglen,
+              (unsigned int)rtm->rtm_version, (unsigned int)rtm->rtm_type, (unsigned int)rtm->rtm_index,
+              (unsigned int)rtm->rtm_flags, (unsigned int)rtm->rtm_addrs, (unsigned int)rtm->rtm_pid, (unsigned int)rtm->rtm_seq,
+              (unsigned int)rtm->rtm_errno, (unsigned int)rtm->rtm_use, (unsigned int)rtm->rtm_inits);
 
   return 0;
 }
index 2933fe4..5edc973 100644 (file)
@@ -238,8 +238,8 @@ disable_redirects_global(int version)
 }
 
 int
-disable_redirects(const char *if_name
-                  __attribute__ ((unused)), struct interface *iface __attribute__ ((unused)), int version __attribute__ ((unused)))
+disable_redirects(const char *if_name __attribute__ ((unused)), struct interface *iface __attribute__ ((unused)), int version
+                  __attribute__ ((unused)))
 {
   /*
    *  this function gets called for each interface olsrd uses; however,
@@ -251,8 +251,8 @@ disable_redirects(const char *if_name
 }
 
 int
-deactivate_spoof(const char *if_name
-                 __attribute__ ((unused)), struct interface *iface __attribute__ ((unused)), int version __attribute__ ((unused)))
+deactivate_spoof(const char *if_name __attribute__ ((unused)), struct interface *iface __attribute__ ((unused)), int version
+                 __attribute__ ((unused)))
 {
   return 1;
 }
@@ -714,12 +714,9 @@ olsr_recvfrom(int s, void *buf, size_t len, int flags __attribute__ ((unused)),
   ifc = if_ifwithsock(s);
 
   sin6 = (struct sockaddr_in6 *)from;
-  OLSR_PRINTF(4,
-              "%d bytes from %s, socket associated %s really received on %s\n",
-              count, inet_ntop(olsr_cnf->ip_version,
-                               olsr_cnf->ip_version ==
-                               AF_INET6 ? (char *)&sin6->
-                               sin6_addr : (char *)&sin->sin_addr, addrstr, sizeof(addrstr)), ifc->int_name, iname);
+  OLSR_PRINTF(4, "%d bytes from %s, socket associated %s really received on %s\n", count,
+              inet_ntop(olsr_cnf->ip_version, olsr_cnf->ip_version == AF_INET6 ? (char *)&sin6->sin6_addr : (char *)&sin->sin_addr,
+                        addrstr, sizeof(addrstr)), ifc->int_name, iname);
 
   if (strcmp(ifc->int_name, iname) != 0) {
     return (0);
index 1f02ddd..7e6f829 100644 (file)
@@ -649,8 +649,8 @@ serialize_tc4(struct tc_message *message, struct interface *ifp)
   } else {
     if ((!partial_sent) && (!TIMED_OUT(send_empty_tc))) {
       if (!TIMED_OUT(send_empty_tc))
-        OLSR_PRINTF(1, "TC: Sending empty package - (%d/%d/%d/%d)\n",
-                    partial_sent, (int)send_empty_tc, (int)now_times, (int)((send_empty_tc) - now_times));
+        OLSR_PRINTF(1, "TC: Sending empty package - (%d/%d/%d/%d)\n", partial_sent, (int)send_empty_tc, (int)now_times,
+                    (int)((send_empty_tc) - now_times));
 
       m->v4.olsr_msgsize = htons(curr_size);
       m->v4.seqno = htons(get_msg_seqno());
index b1f009b..bc84041 100644 (file)
@@ -73,9 +73,8 @@ olsrd_write_cnf(struct olsrd_config *cnf, const char *fname)
 
   printf("Writing config to file \"%s\".... ", fname);
 
-  fprintf(fd,
-          "#\n# Configuration file for s%s\n# automatically generated by olsrd-cnf parser v. %s\n#\n\n",
-          olsrd_version, PARSER_VERSION);
+  fprintf(fd, "#\n# Configuration file for s%s\n# automatically generated by olsrd-cnf parser v. %s\n#\n\n", olsrd_version,
+          PARSER_VERSION);
 
   /* Debug level */
   fprintf(fd, "# Debug level(0-9)\n# If set to 0 the daemon runs in the background\n\nDebugLevel\t%d\n\n", cnf->debug_level);
@@ -84,14 +83,12 @@ olsrd_write_cnf(struct olsrd_config *cnf, const char *fname)
   fprintf(fd, "# IP version to use (4 or 6)\n\nIpVersion\t%d\n\n", cnf->ip_version == AF_INET ? 4 : 6);
 
   /* FIB Metric */
-  fprintf(fd,
-          "# FIBMetric (\"%s\", \"%s\", or \"%s\")\n\nFIBMetric\t\"%s\"\n\n",
-          CFG_FIBM_FLAT, CFG_FIBM_CORRECT, CFG_FIBM_APPROX,
+  fprintf(fd, "# FIBMetric (\"%s\", \"%s\", or \"%s\")\n\nFIBMetric\t\"%s\"\n\n", CFG_FIBM_FLAT, CFG_FIBM_CORRECT, CFG_FIBM_APPROX,
           FIBM_FLAT == cnf->fib_metric ? CFG_FIBM_FLAT : FIBM_CORRECT == cnf->fib_metric ? CFG_FIBM_CORRECT : CFG_FIBM_APPROX);
 
   /* HNA IPv4/IPv6 */
-  fprintf(fd, "# HNA IPv%d routes\n# syntax: netaddr/prefix\n\nHna%d {\n",
-          cnf->ip_version == AF_INET ? 4 : 6, cnf->ip_version == AF_INET ? 4 : 6);
+  fprintf(fd, "# HNA IPv%d routes\n# syntax: netaddr/prefix\n\nHna%d {\n", cnf->ip_version == AF_INET ? 4 : 6,
+          cnf->ip_version == AF_INET ? 4 : 6);
   while (h) {
     struct ipaddr_str strbuf;
     fprintf(fd, "    %s/%d\n", olsr_ip_to_string(&strbuf, &h->net.prefix), h->net.prefix_len);
@@ -299,8 +296,8 @@ olsrd_write_cnf(struct olsrd_config *cnf, const char *fname)
         fprintf(fd, "    #LinkQualityMult\tdefault 1.0\n");
       } else {
         while (mult != NULL) {
-          fprintf(fd, "    LinkQualityMult\t%s %0.2f\n",
-                  inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf, sizeof(ipv6_buf)), (float)(mult->value) / 65536.0);
+          fprintf(fd, "    LinkQualityMult\t%s %0.2f\n", inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf, sizeof(ipv6_buf)),
+                  (float)(mult->value) / 65536.0);
           mult = mult->next;
         }
       }
@@ -376,10 +373,8 @@ olsrd_write_cnf_buf(struct olsrd_config *cnf, char *buf, olsr_u32_t bufsize)
   WRITE_TO_BUF("# IP version to use (4 or 6)\n\nIpVersion\t%d\n\n", cnf->ip_version == AF_INET ? 4 : 6);
 
   /* FIB Metric */
-  WRITE_TO_BUF
-    ("# FIBMetric (\"%s\", \"%s\", or \"%s\")\n\nFIBMetric\t\"%s\"\n\n",
-     CFG_FIBM_FLAT, CFG_FIBM_CORRECT, CFG_FIBM_APPROX,
-     FIBM_FLAT == cnf->fib_metric ? CFG_FIBM_FLAT : FIBM_CORRECT == cnf->fib_metric ? CFG_FIBM_CORRECT : CFG_FIBM_APPROX);
+  WRITE_TO_BUF("# FIBMetric (\"%s\", \"%s\", or \"%s\")\n\nFIBMetric\t\"%s\"\n\n", CFG_FIBM_FLAT, CFG_FIBM_CORRECT, CFG_FIBM_APPROX,
+               FIBM_FLAT == cnf->fib_metric ? CFG_FIBM_FLAT : FIBM_CORRECT == cnf->fib_metric ? CFG_FIBM_CORRECT : CFG_FIBM_APPROX);
 
   /* HNA IPv4/IPv6 */
   WRITE_TO_BUF("# HNA IPv%1$d routes\n# syntax: netaddr netmask\n\nHna%1$d {\n", cnf->ip_version == AF_INET ? 4 : 6);
@@ -586,8 +581,8 @@ olsrd_write_cnf_buf(struct olsrd_config *cnf, char *buf, olsr_u32_t bufsize)
           WRITE_TO_BUF("    #LinkQualityMult\tdefault 1.0\n");
       } else {
         while (mult != NULL) {
-          WRITE_TO_BUF("    LinkQualityMult\t%s %0.2f\n",
-                       inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf, sizeof(ipv6_buf)), (float)(mult->value) / 65536.0);
+          WRITE_TO_BUF("    LinkQualityMult\t%s %0.2f\n", inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf, sizeof(ipv6_buf)),
+                       (float)(mult->value) / 65536.0);
           mult = mult->next;
         }
       }
index df96efd..c4bc281 100644 (file)
@@ -195,9 +195,8 @@ olsrd_sanity_check_cnf(struct olsrd_config *cnf)
     }
 
     if (cnf->hysteresis_param.thr_high <= cnf->hysteresis_param.thr_low) {
-      fprintf(stderr,
-              "Hyst upper(%0.2f) thr must be bigger than lower(%0.2f) threshold!\n",
-              cnf->hysteresis_param.thr_high, cnf->hysteresis_param.thr_low);
+      fprintf(stderr, "Hyst upper(%0.2f) thr must be bigger than lower(%0.2f) threshold!\n", cnf->hysteresis_param.thr_high,
+              cnf->hysteresis_param.thr_low);
       return -1;
     }
 
@@ -301,8 +300,8 @@ olsrd_sanity_check_cnf(struct olsrd_config *cnf)
     }
 
     if (io->hello_params.emission_interval < cnf->pollrate || io->hello_params.emission_interval > io->hello_params.validity_time) {
-      fprintf(stderr, "Bad HELLO parameters! (em: %0.2f, vt: %0.2f)\n",
-              io->hello_params.emission_interval, io->hello_params.validity_time);
+      fprintf(stderr, "Bad HELLO parameters! (em: %0.2f, vt: %0.2f)\n", io->hello_params.emission_interval,
+              io->hello_params.validity_time);
       return -1;
     }
 
@@ -314,15 +313,15 @@ olsrd_sanity_check_cnf(struct olsrd_config *cnf)
 
     /* MID interval */
     if (io->mid_params.emission_interval < cnf->pollrate || io->mid_params.emission_interval > io->mid_params.validity_time) {
-      fprintf(stderr, "Bad MID parameters! (em: %0.2f, vt: %0.2f)\n",
-              io->mid_params.emission_interval, io->mid_params.validity_time);
+      fprintf(stderr, "Bad MID parameters! (em: %0.2f, vt: %0.2f)\n", io->mid_params.emission_interval,
+              io->mid_params.validity_time);
       return -1;
     }
 
     /* HNA interval */
     if (io->hna_params.emission_interval < cnf->pollrate || io->hna_params.emission_interval > io->hna_params.validity_time) {
-      fprintf(stderr, "Bad HNA parameters! (em: %0.2f, vt: %0.2f)\n",
-              io->hna_params.emission_interval, io->hna_params.validity_time);
+      fprintf(stderr, "Bad HNA parameters! (em: %0.2f, vt: %0.2f)\n", io->hna_params.emission_interval,
+              io->hna_params.validity_time);
       return -1;
     }
 
@@ -559,17 +558,17 @@ olsrd_print_cnf(struct olsrd_config *cnf)
       printf("\tIPv6 multicast site/glbl : %s", inet_ntop(AF_INET6, &in->cnf->ipv6_multi_site.v6, ipv6_buf, sizeof(ipv6_buf)));
       printf("/%s\n", inet_ntop(AF_INET6, &in->cnf->ipv6_multi_glbl.v6, ipv6_buf, sizeof(ipv6_buf)));
 
-      printf("\tHELLO emission/validity  : %0.2f/%0.2f\n",
-             in->cnf->hello_params.emission_interval, in->cnf->hello_params.validity_time);
+      printf("\tHELLO emission/validity  : %0.2f/%0.2f\n", in->cnf->hello_params.emission_interval,
+             in->cnf->hello_params.validity_time);
       printf("\tTC emission/validity     : %0.2f/%0.2f\n", in->cnf->tc_params.emission_interval, in->cnf->tc_params.validity_time);
-      printf("\tMID emission/validity    : %0.2f/%0.2f\n",
-             in->cnf->mid_params.emission_interval, in->cnf->mid_params.validity_time);
-      printf("\tHNA emission/validity    : %0.2f/%0.2f\n",
-             in->cnf->hna_params.emission_interval, in->cnf->hna_params.validity_time);
+      printf("\tMID emission/validity    : %0.2f/%0.2f\n", in->cnf->mid_params.emission_interval,
+             in->cnf->mid_params.validity_time);
+      printf("\tHNA emission/validity    : %0.2f/%0.2f\n", in->cnf->hna_params.emission_interval,
+             in->cnf->hna_params.validity_time);
 
       for (mult = in->cnf->lq_mult; mult != NULL; mult = mult->next) {
-        printf("\tLinkQualityMult          : %s %0.2f\n",
-               inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf, sizeof(ipv6_buf)), (float)(mult->value) / 65536.0);
+        printf("\tLinkQualityMult          : %s %0.2f\n", inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf, sizeof(ipv6_buf)),
+               (float)(mult->value) / 65536.0);
       }
 
       printf("\tAutodetetc changes       : %s\n", in->cnf->autodetect_chg ? "yes" : "no");
index 20e0400..8c8ce2e 100644 (file)
@@ -57,8 +57,8 @@ olsr_init_duplicate_set(void)
 {
   avl_init(&duplicate_set, olsr_cnf->ip_version == AF_INET ? &avl_comp_ipv4 : &avl_comp_ipv6);
 
-  olsr_set_timer(&duplicate_cleanup_timer, DUPLICATE_CLEANUP_INTERVAL,
-                 DUPLICATE_CLEANUP_JITTER, OLSR_TIMER_PERIODIC, &olsr_cleanup_duplicate_entry, NULL, 0);
+  olsr_set_timer(&duplicate_cleanup_timer, DUPLICATE_CLEANUP_INTERVAL, DUPLICATE_CLEANUP_JITTER, OLSR_TIMER_PERIODIC,
+                 &olsr_cleanup_duplicate_entry, NULL, 0);
 }
 
 struct dup_entry *
@@ -186,14 +186,11 @@ olsr_print_duplicate_table(void)
   const int ipwidth = olsr_cnf->ip_version == AF_INET ? 15 : 30;
   struct ipaddr_str addrbuf;
 
-  OLSR_PRINTF(1,
-              "\n--- %s ------------------------------------------------- DUPLICATE SET\n\n"
-              "%-*s %8s %s\n", olsr_wallclock_string(), ipwidth, "Node IP", "DupArray", "VTime");
+  OLSR_PRINTF(1, "\n--- %s ------------------------------------------------- DUPLICATE SET\n\n" "%-*s %8s %s\n",
+              olsr_wallclock_string(), ipwidth, "Node IP", "DupArray", "VTime");
 
   OLSR_FOR_ALL_DUP_ENTRIES(entry) {
-    OLSR_PRINTF(1, "%-*s %08x %s\n", ipwidth,
-                olsr_ip_to_string(&addrbuf,
-                                  (union olsr_ip_addr *)(entry->avl.key)),
+    OLSR_PRINTF(1, "%-*s %08x %s\n", ipwidth, olsr_ip_to_string(&addrbuf, (union olsr_ip_addr *)(entry->avl.key)),
                 entry->processedArray, olsr_clock_string(entry->valid_until));
   } OLSR_FOR_ALL_DUP_ENTRIES_END(entry);
 #endif
index 8b9f772..d783d13 100644 (file)
@@ -209,8 +209,7 @@ olsr_expire_hna_net_entry(void *context)
   hna_gw = net_to_delete->hna_gw;
 
 #ifdef DEBUG
-  OLSR_PRINTF(5, "HNA: timeout %s/%u via hna-gw %s\n",
-              olsr_ip_to_string(&buf1, &net_to_delete->A_network_addr),
+  OLSR_PRINTF(5, "HNA: timeout %s/%u via hna-gw %s\n", olsr_ip_to_string(&buf1, &net_to_delete->A_network_addr),
               net_to_delete->prefixlen, olsr_ip_to_string(&buf2, &hna_gw->A_gateway_addr));
 #endif
 
@@ -271,8 +270,8 @@ olsr_update_hna_entry(const union olsr_ip_addr *gw, const union olsr_ip_addr *ne
   /*
    * Start, or refresh the timer, whatever is appropriate.
    */
-  olsr_set_timer(&net_entry->hna_net_timer, vtime, OLSR_HNA_NET_JITTER,
-                 OLSR_TIMER_ONESHOT, &olsr_expire_hna_net_entry, net_entry, hna_net_timer_cookie->ci_id);
+  olsr_set_timer(&net_entry->hna_net_timer, vtime, OLSR_HNA_NET_JITTER, OLSR_TIMER_ONESHOT, &olsr_expire_hna_net_entry, net_entry,
+                 hna_net_timer_cookie->ci_id);
 }
 
 /**
@@ -287,9 +286,8 @@ olsr_print_hna_set(void)
   /* The whole function doesn't do anything else. */
   int idx;
 
-  OLSR_PRINTF(1,
-              "\n--- %02d:%02d:%02d.%02d ------------------------------------------------- HNA SET\n\n",
-              nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec, (int)now.tv_usec / 10000);
+  OLSR_PRINTF(1, "\n--- %02d:%02d:%02d.%02d ------------------------------------------------- HNA SET\n\n", nowtm->tm_hour,
+              nowtm->tm_min, nowtm->tm_sec, (int)now.tv_usec / 10000);
 
   if (olsr_cnf->ip_version == AF_INET)
     OLSR_PRINTF(1, "IP net          netmask         GW IP\n");
@@ -370,8 +368,7 @@ olsr_input_hna(union olsr_message *m, struct interface *in_if __attribute__ ((un
   hnasize =
     olsr_msgsize - (olsr_cnf->ip_version == AF_INET ? offsetof(struct olsrmsg, message) : offsetof(struct olsrmsg6, message));
   if (hnasize < 0) {
-    OLSR_PRINTF(0, "message size %d too small (at least %lu)!\n",
-                olsr_msgsize,
+    OLSR_PRINTF(0, "message size %d too small (at least %lu)!\n", olsr_msgsize,
                 (unsigned long)(olsr_cnf->ip_version ==
                                 AF_INET ? offsetof(struct olsrmsg, message) : offsetof(struct olsrmsg6, message)));
     return;
index c54c3dd..1f640b7 100644 (file)
@@ -136,8 +136,8 @@ olsr_update_hysteresis_hello(struct link_entry *entry, olsr_reltime htime)
   struct ipaddr_str buf;
   OLSR_PRINTF(3, "HYST[%s]: HELLO update vtime %u ms\n", olsr_ip_to_string(&buf, &entry->neighbor_iface_addr), htime + htime / 2);
 
-  olsr_set_timer(&entry->link_hello_timer, htime + htime / 2,
-                 OLSR_LINK_HELLO_JITTER, OLSR_TIMER_PERIODIC, &olsr_expire_link_hello_timer, entry, 0);
+  olsr_set_timer(&entry->link_hello_timer, htime + htime / 2, OLSR_LINK_HELLO_JITTER, OLSR_TIMER_PERIODIC,
+                 &olsr_expire_link_hello_timer, entry, 0);
 
   return;
 }
index 1466f60..cd2130d 100644 (file)
@@ -102,8 +102,8 @@ ifinit(void)
   }
 
   /* Kick a periodic timer for the network interface update function */
-  olsr_start_timer((unsigned int)olsr_cnf->nic_chgs_pollrate * MSEC_PER_SEC,
-                   5, OLSR_TIMER_PERIODIC, &check_interface_updates, NULL, interface_poll_timer_cookie->ci_id);
+  olsr_start_timer((unsigned int)olsr_cnf->nic_chgs_pollrate * MSEC_PER_SEC, 5, OLSR_TIMER_PERIODIC, &check_interface_updates, NULL,
+                   interface_poll_timer_cookie->ci_id);
 
   return (ifnet == NULL) ? 0 : 1;
 }
index 8371593..69a871e 100644 (file)
@@ -211,8 +211,8 @@ ipc_input(int sock __attribute__ ((unused)))
  *@return negative on error
  */
 void
-frontend_msgparser(union olsr_message *msg, struct interface *in_if
-                   __attribute__ ((unused)), union olsr_ip_addr *from_addr __attribute__ ((unused)))
+frontend_msgparser(union olsr_message *msg, struct interface *in_if __attribute__ ((unused)), union olsr_ip_addr *from_addr
+                   __attribute__ ((unused)))
 {
   int size;
 
index ca49b71..df9d0ed 100644 (file)
@@ -69,9 +69,8 @@ signal_link_changes(olsr_bool val)
 
 /* Prototypes. */
 static int check_link_status(const struct hello_message *message, const struct interface *in_if);
-static struct link_entry *add_link_entry(const union olsr_ip_addr *,
-                                         const union olsr_ip_addr *,
-                                         const union olsr_ip_addr *, olsr_reltime, olsr_reltime, const struct interface *);
+static struct link_entry *add_link_entry(const union olsr_ip_addr *, const union olsr_ip_addr *, const union olsr_ip_addr *,
+                                         olsr_reltime, olsr_reltime, const struct interface *);
 static int get_neighbor_status(const union olsr_ip_addr *);
 
 void
@@ -478,9 +477,8 @@ olsr_set_link_timer(struct link_entry *link, unsigned int rel_timer)
  * @return the new link_entry
  */
 static struct link_entry *
-add_link_entry(const union olsr_ip_addr *local,
-               const union olsr_ip_addr *remote,
-               const union olsr_ip_addr *remote_main, olsr_reltime vtime, olsr_reltime htime, const struct interface *local_if)
+add_link_entry(const union olsr_ip_addr *local, const union olsr_ip_addr *remote, const union olsr_ip_addr *remote_main,
+               olsr_reltime vtime, olsr_reltime htime, const struct interface *local_if)
 {
   struct link_entry *new_link;
   struct neighbor_entry *neighbor;
@@ -546,8 +544,8 @@ add_link_entry(const union olsr_ip_addr *local,
   if (olsr_cnf->lq_level > 0) {
     new_link->loss_helloint = htime;
 
-    olsr_set_timer(&new_link->link_loss_timer, htime + htime / 2,
-                   OLSR_LINK_LOSS_JITTER, OLSR_TIMER_PERIODIC, &olsr_expire_link_loss_timer, new_link, 0);
+    olsr_set_timer(&new_link->link_loss_timer, htime + htime / 2, OLSR_LINK_LOSS_JITTER, OLSR_TIMER_PERIODIC,
+                   &olsr_expire_link_loss_timer, new_link, 0);
 
     set_loss_link_multiplier(new_link);
   }
@@ -642,8 +640,8 @@ lookup_link_entry(const union olsr_ip_addr *remote, const union olsr_ip_addr *re
  * @return the link_entry struct describing this link entry
  */
 struct link_entry *
-update_link_entry(const union olsr_ip_addr *local,
-                  const union olsr_ip_addr *remote, const struct hello_message *message, const struct interface *in_if)
+update_link_entry(const union olsr_ip_addr *local, const union olsr_ip_addr *remote, const struct hello_message *message,
+                  const struct interface *in_if)
 {
   struct link_entry *entry;
 
@@ -665,8 +663,8 @@ update_link_entry(const union olsr_ip_addr *local,
   case (ASYM_LINK):
 
     /* L_SYM_time = current time + validity time */
-    olsr_set_timer(&entry->link_sym_timer, message->vtime,
-                   OLSR_LINK_SYM_JITTER, OLSR_TIMER_ONESHOT, &olsr_expire_link_sym_timer, entry, 0);
+    olsr_set_timer(&entry->link_sym_timer, message->vtime, OLSR_LINK_SYM_JITTER, OLSR_TIMER_ONESHOT, &olsr_expire_link_sym_timer,
+                   entry, 0);
 
     /* L_time = L_SYM_time + NEIGHB_HOLD_TIME */
     olsr_set_link_timer(entry, message->vtime + NEIGHB_HOLD_TIME * MSEC_PER_SEC);
@@ -768,11 +766,9 @@ olsr_print_link_set(void)
 
     struct ipaddr_str buf;
     struct lqtextbuffer lqbuffer1, lqbuffer2;
-    OLSR_PRINTF(1, "%-*s  %5.3f  %-14s %s\n", addrsize,
-                olsr_ip_to_string(&buf, &walker->neighbor_iface_addr),
-                walker->L_link_quality, get_link_entry_text(walker, '/',
-                                                            &lqbuffer1),
-                get_linkcost_text(walker->linkcost, OLSR_FALSE, &lqbuffer2));
+    OLSR_PRINTF(1, "%-*s  %5.3f  %-14s %s\n", addrsize, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr),
+                walker->L_link_quality, get_link_entry_text(walker, '/', &lqbuffer1), get_linkcost_text(walker->linkcost,
+                                                                                                        OLSR_FALSE, &lqbuffer2));
   } OLSR_FOR_ALL_LINK_ENTRIES_END(walker);
 #endif
 }
@@ -793,9 +789,8 @@ olsr_update_packet_loss(struct link_entry *entry)
   olsr_update_packet_loss_worker(entry, OLSR_FALSE);
 
   /* timeout for the first lost packet is 1.5 x htime */
-  olsr_set_timer(&entry->link_loss_timer,
-                 entry->loss_helloint + entry->loss_helloint / 2,
-                 OLSR_LINK_LOSS_JITTER, OLSR_TIMER_PERIODIC, &olsr_expire_link_loss_timer, entry, 0);
+  olsr_set_timer(&entry->link_loss_timer, entry->loss_helloint + entry->loss_helloint / 2, OLSR_LINK_LOSS_JITTER,
+                 OLSR_TIMER_PERIODIC, &olsr_expire_link_loss_timer, entry, 0);
 }
 
 /*
index 7680b78..0bc3105 100644 (file)
@@ -130,8 +130,8 @@ struct link_entry *get_best_link_to_neighbor(const union olsr_ip_addr *);
 
 struct link_entry *lookup_link_entry(const union olsr_ip_addr *, const union olsr_ip_addr *remote_main, const struct interface *);
 
-struct link_entry *update_link_entry(const union olsr_ip_addr *,
-                                     const union olsr_ip_addr *, const struct hello_message *, const struct interface *);
+struct link_entry *update_link_entry(const union olsr_ip_addr *, const union olsr_ip_addr *, const struct hello_message *,
+                                     const struct interface *);
 
 int check_neighbor_link(const union olsr_ip_addr *);
 int replace_neighbor_link_set(const struct neighbor_entry *, struct neighbor_entry *);
index c6a85c0..6335c23 100644 (file)
@@ -134,9 +134,8 @@ apm_init(void)
 void
 apm_printinfo(struct olsr_apm_info *ainfo)
 {
-  OLSR_PRINTF(5,
-              "APM info:\n\tAC status %d\n\tBattery percentage %d%%\n\tBattery time left %d mins\n\n",
-              ainfo->ac_line_status, ainfo->battery_percentage, ainfo->battery_time_left);
+  OLSR_PRINTF(5, "APM info:\n\tAC status %d\n\tBattery percentage %d%%\n\tBattery time left %d mins\n\n", ainfo->ac_line_status,
+              ainfo->battery_percentage, ainfo->battery_time_left);
 
   ainfo = NULL;                 /* squelch compiler warnings */
 }
@@ -185,10 +184,9 @@ apm_read_apm(struct olsr_apm_info *ainfo)
   //printf("READ: %s\n", buffer);
 
   /* Get the info */
-  sscanf(buffer, "%s %d.%d %x %x %x %x %d%% %d %s\n", lainfo.driver_version,
-         &lainfo.apm_version_major, &lainfo.apm_version_minor,
-         &lainfo.apm_flags, &lainfo.ac_line_status, &lainfo.battery_status,
-         &lainfo.battery_flags, &lainfo.battery_percentage, &lainfo.battery_time, units);
+  sscanf(buffer, "%s %d.%d %x %x %x %x %d%% %d %s\n", lainfo.driver_version, &lainfo.apm_version_major, &lainfo.apm_version_minor,
+         &lainfo.apm_flags, &lainfo.ac_line_status, &lainfo.battery_status, &lainfo.battery_flags, &lainfo.battery_percentage,
+         &lainfo.battery_time, units);
 
   lainfo.using_minutes = strncmp(units, "min", 3) ? 0 : 1;
 
index a665249..5bddf9a 100644 (file)
@@ -145,8 +145,8 @@ olsr_netlink_route(const struct rt_entry *rt, olsr_u8_t family, olsr_u8_t rttabl
       }
     }
     if (0 <= ret && olsr_cnf->ipc_connections > 0) {
-      ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway,
-                             metric, RTM_NEWROUTE == cmd, if_ifwithindex_name(nexthop->iif_index));
+      ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway, metric, RTM_NEWROUTE == cmd,
+                             if_ifwithindex_name(nexthop->iif_index));
     }
   }
   return ret;
@@ -209,9 +209,8 @@ olsr_ioctl_add_route(const struct rt_entry *rt)
     /*
      * Send IPC route update message
      */
-    ipc_route_send_rtentry(&rt->rt_dst.prefix,
-                           &rt->rt_best->rtp_nexthop.gateway,
-                           rt->rt_best->rtp_metric.hops, 1, if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
+    ipc_route_send_rtentry(&rt->rt_dst.prefix, &rt->rt_best->rtp_nexthop.gateway, rt->rt_best->rtp_metric.hops, 1,
+                           if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
   }
 
   return rslt;
@@ -269,9 +268,8 @@ olsr_ioctl_add_route6(const struct rt_entry *rt)
     /*
      * Send IPC route update message
      */
-    ipc_route_send_rtentry(&rt->rt_dst.prefix,
-                           &rt->rt_best->rtp_nexthop.gateway,
-                           rt->rt_best->rtp_metric.hops, 1, if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
+    ipc_route_send_rtentry(&rt->rt_dst.prefix, &rt->rt_best->rtp_nexthop.gateway, rt->rt_best->rtp_metric.hops, 1,
+                           if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
   }
 
   return rslt;
index 70b4627..d0ff421 100644 (file)
@@ -320,13 +320,11 @@ poll_link_layer(void *foo)
         OLSR_PRINTF(1, ":%02x", (hwa[i].sa_data[j] % 0xffffff00));
       }
       if (!has_range)
-        OLSR_PRINTF(1,
-                    " : Quality:%d  Signal level:%d dBm  Noise level:%d dBm",
-                    qual[i].qual, qual[i].level - 0x100, qual[i].noise - 0x100);
+        OLSR_PRINTF(1, " : Quality:%d  Signal level:%d dBm  Noise level:%d dBm", qual[i].qual, qual[i].level - 0x100,
+                    qual[i].noise - 0x100);
       else
-        OLSR_PRINTF(1,
-                    " : Quality:%d/%d  Signal level:%d dBm  Noise level:%d dBm",
-                    qual[i].qual, range.max_qual.qual, qual[i].level - 0x100, qual[i].noise - 0x100);
+        OLSR_PRINTF(1, " : Quality:%d/%d  Signal level:%d dBm  Noise level:%d dBm", qual[i].qual, range.max_qual.qual,
+                    qual[i].level - 0x100, qual[i].noise - 0x100);
 
       OLSR_PRINTF(1, "\n");
 
index d0f8da5..6c0eb21 100644 (file)
@@ -596,17 +596,16 @@ get_ipv6_address(char *ifname, struct sockaddr_in6 *saddr6, int scope_in)
 
   if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
     while (fscanf
-           (f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
-            addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4],
+           (f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n", addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4],
             addr6p[5], addr6p[6], addr6p[7], &if_idx, &plen, &scope, &dad_status, devname) != EOF) {
       if (!strcmp(devname, ifname)) {
-        sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s", addr6p[0], addr6p[1],
-                addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+        sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s", addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6],
+                addr6p[7]);
         OLSR_PRINTF(5, "\tinet6 addr: %s\n", addr6);
         OLSR_PRINTF(5, "\tScope: %d\n", scope);
         if (scope == scope_in) {
-          OLSR_PRINTF(4, "Found addr: %s:%s:%s:%s:%s:%s:%s:%s\n",
-                      addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+          OLSR_PRINTF(4, "Found addr: %s:%s:%s:%s:%s:%s:%s:%s\n", addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5],
+                      addr6p[6], addr6p[7]);
           inet_pton(AF_INET6, addr6, &tmp_sockaddr6);
           memcpy(&saddr6->sin6_addr, &tmp_sockaddr6, sizeof(struct in6_addr));
           fclose(f);
index ab6e969..d5a26fc 100644 (file)
@@ -292,8 +292,8 @@ default_lq_print_ff(void *ptr, char separator, struct lqtextbuffer *buffer)
 {
   struct default_lq_ff *lq = ptr;
 
-  snprintf(buffer->buf, sizeof(buffer->buf), "%s%c%s",
-           fpmtoa(fpmidiv(itofpm((int)lq->valueLq), 255)), separator, fpmtoa(fpmidiv(itofpm((int)lq->valueNlq), 255)));
+  snprintf(buffer->buf, sizeof(buffer->buf), "%s%c%s", fpmtoa(fpmidiv(itofpm((int)lq->valueLq), 255)), separator,
+           fpmtoa(fpmidiv(itofpm((int)lq->valueNlq), 255)));
   return buffer->buf;
 }
 
index 3b79449..7ecd2c7 100644 (file)
@@ -225,8 +225,8 @@ default_lq_print_fpm(void *ptr, char separator, struct lqtextbuffer *buffer)
 {
   struct default_lq_fpm *lq = ptr;
 
-  snprintf(buffer->buf, sizeof(buffer->buf), "%0.3f%c%0.3f",
-           (float)(lq->valueLq) / 255.0, separator, (float)(lq->valueNlq) / 255.0);
+  snprintf(buffer->buf, sizeof(buffer->buf), "%0.3f%c%0.3f", (float)(lq->valueLq) / 255.0, separator,
+           (float)(lq->valueNlq) / 255.0);
   return buffer->buf;
 }
 
index 6d1019c..815117d 100644 (file)
@@ -257,8 +257,7 @@ insert_mid_alias(union olsr_ip_addr *main_add, const union olsr_ip_addr *alias,
    */
   ne_old = olsr_lookup_neighbor_table_alias(alias);
   if (ne_old != NULL) {
-    OLSR_PRINTF(2,
-                "Remote main address change detected. Mangling neighbortable to replace %s with %s.\n",
+    OLSR_PRINTF(2, "Remote main address change detected. Mangling neighbortable to replace %s with %s.\n",
                 olsr_ip_to_string(&buf1, alias), olsr_ip_to_string(&buf2, main_add));
     olsr_delete_neighbor_table(alias);
     ne_new = olsr_insert_neighbor_table(main_add);
index 9628488..f55083d 100644 (file)
--- a/src/mpr.c
+++ b/src/mpr.c
@@ -96,8 +96,8 @@ olsr_find_2_hop_neighbors_with_1_link(int willingness)
 
   for (index = 0; index < HASHSIZE; index++) {
 
-    for (two_hop_neighbor = two_hop_neighbortable[index].next;
-         two_hop_neighbor != &two_hop_neighbortable[index]; two_hop_neighbor = two_hop_neighbor->next) {
+    for (two_hop_neighbor = two_hop_neighbortable[index].next; two_hop_neighbor != &two_hop_neighbortable[index];
+         two_hop_neighbor = two_hop_neighbor->next) {
 
       //two_hop_neighbor->neighbor_2_state=0;
       //two_hop_neighbor->mpr_covered_count = 0;
@@ -154,8 +154,8 @@ olsr_chosen_mpr(struct neighbor_entry *one_hop_neighbor, olsr_u16_t * two_hop_co
 
   one_hop_neighbor->is_mpr = OLSR_TRUE; //NBS_MPR;
 
-  for (second_hop_entries = one_hop_neighbor->neighbor_2_list.next;
-       second_hop_entries != &one_hop_neighbor->neighbor_2_list; second_hop_entries = second_hop_entries->next) {
+  for (second_hop_entries = one_hop_neighbor->neighbor_2_list.next; second_hop_entries != &one_hop_neighbor->neighbor_2_list;
+       second_hop_entries = second_hop_entries->next) {
     dup_neighbor = olsr_lookup_neighbor_table(&second_hop_entries->neighbor_2->neighbor_2_addr);
 
     if ((dup_neighbor != NULL) && (dup_neighbor->status == SYM)) {
@@ -216,8 +216,7 @@ olsr_find_maximum_covered(int willingness)
   OLSR_FOR_ALL_NBR_ENTRIES(a_neighbor) {
 
 #if 0
-    printf("[%s] nocov: %d mpr: %d will: %d max: %d\n\n",
-           olsr_ip_to_string(&buf, &a_neighbor->neighbor_main_addr),
+    printf("[%s] nocov: %d mpr: %d will: %d max: %d\n\n", olsr_ip_to_string(&buf, &a_neighbor->neighbor_main_addr),
            a_neighbor->neighbor_2_nocov, a_neighbor->is_mpr, a_neighbor->willingness, maximum);
 #endif
 
@@ -251,8 +250,8 @@ olsr_clear_mprs(void)
     }
 
     /* Clear two hop neighbors coverage count/ */
-    for (two_hop_list = a_neighbor->neighbor_2_list.next;
-         two_hop_list != &a_neighbor->neighbor_2_list; two_hop_list = two_hop_list->next) {
+    for (two_hop_list = a_neighbor->neighbor_2_list.next; two_hop_list != &a_neighbor->neighbor_2_list;
+         two_hop_list = two_hop_list->next) {
       two_hop_list->neighbor_2->mpr_covered_count = 0;
     }
 
@@ -329,8 +328,8 @@ olsr_calculate_two_hop_neighbors(void)
       continue;
     }
 
-    for (twohop_neighbors = a_neighbor->neighbor_2_list.next;
-         twohop_neighbors != &a_neighbor->neighbor_2_list; twohop_neighbors = twohop_neighbors->next) {
+    for (twohop_neighbors = a_neighbor->neighbor_2_list.next; twohop_neighbors != &a_neighbor->neighbor_2_list;
+         twohop_neighbors = twohop_neighbors->next) {
 
       dup_neighbor = olsr_lookup_neighbor_table(&twohop_neighbors->neighbor_2->neighbor_2_addr);
 
@@ -486,8 +485,8 @@ olsr_optimize_mpr_set(void)
       if (a_neighbor->is_mpr) {
         remove = 1;
 
-        for (two_hop_list = a_neighbor->neighbor_2_list.next;
-             two_hop_list != &a_neighbor->neighbor_2_list; two_hop_list = two_hop_list->next) {
+        for (two_hop_list = a_neighbor->neighbor_2_list.next; two_hop_list != &a_neighbor->neighbor_2_list;
+             two_hop_list = two_hop_list->next) {
 
           dup_neighbor = olsr_lookup_neighbor_table(&two_hop_list->neighbor_2->neighbor_2_addr);
 
index ff90415..4e2b03d 100644 (file)
@@ -373,8 +373,8 @@ olsr_print_neighbor_table(void)
   int idx;
   OLSR_PRINTF(1,
               "\n--- %02d:%02d:%02d.%02d ------------------------------------------------ NEIGHBORS\n\n"
-              "%*s  LQ     NLQ    SYM   MPR   MPRS  will\n", nowtm->tm_hour,
-              nowtm->tm_min, nowtm->tm_sec, (int)now.tv_usec / 10000, iplen, "IP address");
+              "%*s  LQ     NLQ    SYM   MPR   MPRS  will\n", nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec, (int)now.tv_usec / 10000,
+              iplen, "IP address");
 
   for (idx = 0; idx < HASHSIZE; idx++) {
     struct neighbor_entry *neigh;
@@ -382,13 +382,10 @@ olsr_print_neighbor_table(void)
       struct link_entry *lnk = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
       if (lnk) {
         struct ipaddr_str buf;
-        OLSR_PRINTF(1, "%-*s  %5.3f  %5.3f  %s  %s  %s  %d\n", iplen,
-                    olsr_ip_to_string(&buf,
-                                      &neigh->neighbor_main_addr),
-                    lnk->loss_link_quality, lnk->neigh_link_quality,
-                    neigh->status == SYM ? "YES " : "NO  ",
-                    neigh->is_mpr ? "YES " : "NO  ",
-                    olsr_lookup_mprs_set(&neigh->neighbor_main_addr) == NULL ? "NO  " : "YES ", neigh->willingness);
+        OLSR_PRINTF(1, "%-*s  %5.3f  %5.3f  %s  %s  %s  %d\n", iplen, olsr_ip_to_string(&buf, &neigh->neighbor_main_addr),
+                    lnk->loss_link_quality, lnk->neigh_link_quality, neigh->status == SYM ? "YES " : "NO  ",
+                    neigh->is_mpr ? "YES " : "NO  ", olsr_lookup_mprs_set(&neigh->neighbor_main_addr) == NULL ? "NO  " : "YES ",
+                    neigh->willingness);
       }
     }
   }
index f28be53..0fa1a9e 100644 (file)
@@ -389,16 +389,16 @@ net_output(struct interface *ifp)
 
   if (olsr_cnf->ip_version == AF_INET) {
     /* IP version 4 */
-    if (olsr_sendto
-        (ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin, sizeof(*sin)) < 0) {
+    if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin, sizeof(*sin)) <
+        0) {
       perror("sendto(v4)");
       olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv4 %m");
       retval = -1;
     }
   } else {
     /* IP version 6 */
-    if (olsr_sendto
-        (ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6)) < 0) {
+    if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6))
+        < 0) {
       struct ipaddr_str buf;
       perror("sendto(v6)");
       olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m");
index 540c5c3..fa9bd6f 100644 (file)
@@ -268,8 +268,8 @@ olsr_init_tables(void)
 
   /* Start periodic SPF and RIB recalculation */
   if (olsr_cnf->lq_dinter > 0.0) {
-    olsr_start_timer((unsigned int)(olsr_cnf->lq_dinter * MSEC_PER_SEC),
-                     5, OLSR_TIMER_PERIODIC, &olsr_trigger_forced_update, NULL, 0);
+    olsr_start_timer((unsigned int)(olsr_cnf->lq_dinter * MSEC_PER_SEC), 5, OLSR_TIMER_PERIODIC, &olsr_trigger_forced_update, NULL,
+                     0);
   }
 }
 
index 79ac73a..3dc868d 100644 (file)
@@ -107,8 +107,8 @@ olsr_spf_add_cand_tree(struct avl_tree *tree, struct tc_entry *tc)
   tc->cand_tree_node.key = &tc->path_cost;
 
 #ifdef DEBUG
-  OLSR_PRINTF(2, "SPF: insert candidate %s, cost %s\n",
-              olsr_ip_to_string(&buf, &tc->addr), get_linkcost_text(tc->path_cost, OLSR_FALSE, &lqbuffer));
+  OLSR_PRINTF(2, "SPF: insert candidate %s, cost %s\n", olsr_ip_to_string(&buf, &tc->addr),
+              get_linkcost_text(tc->path_cost, OLSR_FALSE, &lqbuffer));
 #endif
 
   avl_insert(tree, &tc->cand_tree_node, AVL_DUP);
@@ -128,8 +128,8 @@ olsr_spf_del_cand_tree(struct avl_tree *tree, struct tc_entry *tc)
   struct ipaddr_str buf;
   struct lqtextbuffer lqbuffer;
 #endif
-  OLSR_PRINTF(2, "SPF: delete candidate %s, cost %s\n",
-              olsr_ip_to_string(&buf, &tc->addr), get_linkcost_text(tc->path_cost, OLSR_FALSE, &lqbuffer));
+  OLSR_PRINTF(2, "SPF: delete candidate %s, cost %s\n", olsr_ip_to_string(&buf, &tc->addr),
+              get_linkcost_text(tc->path_cost, OLSR_FALSE, &lqbuffer));
 #endif
 
   avl_delete(tree, &tc->cand_tree_node);
@@ -149,10 +149,10 @@ olsr_spf_add_path_list(struct list_node *head, int *path_count, struct tc_entry
 #endif
 
 #ifdef DEBUG
-  OLSR_PRINTF(2, "SPF: append path %s, cost %s, via %s\n",
-              olsr_ip_to_string(&pathbuf, &tc->addr),
-              get_linkcost_text(tc->path_cost, OLSR_FALSE, &lqbuffer),
-              tc->next_hop ? olsr_ip_to_string(&nbuf, &tc->next_hop->neighbor_iface_addr) : "-");
+  OLSR_PRINTF(2, "SPF: append path %s, cost %s, via %s\n", olsr_ip_to_string(&pathbuf, &tc->addr),
+              get_linkcost_text(tc->path_cost, OLSR_FALSE, &lqbuffer), tc->next_hop ? olsr_ip_to_string(&nbuf,
+                                                                                                        &tc->next_hop->
+                                                                                                        neighbor_iface_addr) : "-");
 #endif
 
   list_add_before(head, &tc->path_list_node);
@@ -190,8 +190,8 @@ olsr_spf_relax(struct avl_tree *cand_tree, struct tc_entry *tc)
   struct ipaddr_str buf, nbuf;
   struct lqtextbuffer lqbuffer;
 #endif
-  OLSR_PRINTF(2, "SPF: exploring node %s, cost %s\n",
-              olsr_ip_to_string(&buf, &tc->addr), get_linkcost_text(tc->path_cost, OLSR_FALSE, &lqbuffer));
+  OLSR_PRINTF(2, "SPF: exploring node %s, cost %s\n", olsr_ip_to_string(&buf, &tc->addr),
+              get_linkcost_text(tc->path_cost, OLSR_FALSE, &lqbuffer));
 #endif
 
   /*
@@ -222,8 +222,8 @@ olsr_spf_relax(struct avl_tree *cand_tree, struct tc_entry *tc)
     new_cost = tc->path_cost + tc_edge->cost;
 
 #ifdef DEBUG
-    OLSR_PRINTF(2, "SPF:   exploring edge %s, cost %s\n",
-                olsr_ip_to_string(&buf, &tc_edge->T_dest_addr), get_linkcost_text(new_cost, OLSR_TRUE, &lqbuffer));
+    OLSR_PRINTF(2, "SPF:   exploring edge %s, cost %s\n", olsr_ip_to_string(&buf, &tc_edge->T_dest_addr),
+                get_linkcost_text(new_cost, OLSR_TRUE, &lqbuffer));
 #endif
 
     /*
@@ -250,11 +250,10 @@ olsr_spf_relax(struct avl_tree *cand_tree, struct tc_entry *tc)
       new_tc->hops = tc->hops + 1;
 
 #ifdef DEBUG
-      OLSR_PRINTF(2,
-                  "SPF:   better path to %s, cost %s, via %s, hops %u\n",
-                  olsr_ip_to_string(&buf, &new_tc->addr),
-                  get_linkcost_text(new_cost, OLSR_TRUE, &lqbuffer),
-                  tc->next_hop ? olsr_ip_to_string(&nbuf, &tc->next_hop->neighbor_iface_addr)
+      OLSR_PRINTF(2, "SPF:   better path to %s, cost %s, via %s, hops %u\n", olsr_ip_to_string(&buf, &new_tc->addr),
+                  get_linkcost_text(new_cost, OLSR_TRUE, &lqbuffer), tc->next_hop ? olsr_ip_to_string(&nbuf,
+                                                                                                      &tc->next_hop->
+                                                                                                      neighbor_iface_addr)
                   : "<none>", new_tc->hops);
 #endif
 
@@ -503,10 +502,9 @@ olsr_calculate_routing_table(void)
   timersub(&t4, &t3, &route);
   timersub(&t5, &t4, &kernel);
   timersub(&t5, &t1, &total);
-  OLSR_PRINTF(1,
-              "\n--- SPF-stats for %d nodes, %d routes (total/init/run/route/kern): "
-              "%d, %d, %d, %d, %d\n", path_count, routingtree.count,
-              (int)total.tv_usec, (int)spf_init.tv_usec, (int)spf_run.tv_usec, (int)route.tv_usec, (int)kernel.tv_usec);
+  OLSR_PRINTF(1, "\n--- SPF-stats for %d nodes, %d routes (total/init/run/route/kern): " "%d, %d, %d, %d, %d\n", path_count,
+              routingtree.count, (int)total.tv_usec, (int)spf_init.tv_usec, (int)spf_run.tv_usec, (int)route.tv_usec,
+              (int)kernel.tv_usec);
 #endif
 }
 
index c0ffdb2..1d5c86e 100644 (file)
@@ -68,8 +68,8 @@ ohs_check_link(struct ohs_connection *oc, union olsr_ip_addr *dst)
 
     if (logbits & LOG_LINK) {
       struct ipaddr_str addrstr, dststr;
-      printf("%s -> %s Q: %d R: %d\n",
-             olsr_ip_to_string(&addrstr, &oc->ip_addr), olsr_ip_to_string(&dststr, dst), links->quality, r);
+      printf("%s -> %s Q: %d R: %d\n", olsr_ip_to_string(&addrstr, &oc->ip_addr), olsr_ip_to_string(&dststr, dst), links->quality,
+             r);
     }
     /* Random - based on quality */
     return links->quality > r ? 0 : 1;
index cf6d717..0cfe7e7 100644 (file)
@@ -250,8 +250,8 @@ ohs_route_data(struct ohs_connection *oc)
       /* Send data */
       if (logbits & LOG_FORWARD) {
         struct ipaddr_str addrstr, addrstr2;
-        printf("Sending %d bytes %s=>%s\n", (int)len,
-               olsr_ip_to_string(&addrstr, &oc->ip_addr), olsr_ip_to_string(&addrstr2, &ohs_cs->ip_addr));
+        printf("Sending %d bytes %s=>%s\n", (int)len, olsr_ip_to_string(&addrstr, &oc->ip_addr),
+               olsr_ip_to_string(&addrstr2, &ohs_cs->ip_addr));
       }
 
       sent = send(ohs_cs->socket, data_buffer, len, 0);
index 1b2f7d6..e93d7a8 100644 (file)
@@ -329,11 +329,8 @@ ohs_cmd_link(const char *args)
             inv_link->quality = qual;
           }
         }
-        printf("%s %sdirectional link(s) %s %c=> %s quality %d\n",
-               (qual == 100) ? "Removing" : "Setting",
-               bi ? "bi" : "uni", olsr_ip_to_string(&srcaddrstr,
-                                                    &src->ip_addr),
-               bi ? '<' : '=', olsr_ip_to_string(&dstaddrstr, &dst->ip_addr), qual);
+        printf("%s %sdirectional link(s) %s %c=> %s quality %d\n", (qual == 100) ? "Removing" : "Setting", bi ? "bi" : "uni",
+               olsr_ip_to_string(&srcaddrstr, &src->ip_addr), bi ? '<' : '=', olsr_ip_to_string(&dstaddrstr, &dst->ip_addr), qual);
       }
       if (wildc_dst) {
         dst = dst->next;
@@ -372,8 +369,8 @@ ohs_cmd_list(const char *args)
       struct ohs_ip_link *links = oc->links;
       while (links) {
         struct ipaddr_str addrstr, dststr;
-        printf("\t%s => %s Quality: %d\n",
-               olsr_ip_to_string(&addrstr, &oc->ip_addr), olsr_ip_to_string(&dststr, &links->dst), links->quality);
+        printf("\t%s => %s Quality: %d\n", olsr_ip_to_string(&addrstr, &oc->ip_addr), olsr_ip_to_string(&dststr, &links->dst),
+               links->quality);
 
         links = links->next;
       }
index 5b3beff..802b54e 100644 (file)
@@ -337,8 +337,8 @@ parse_packet(struct olsr *olsr, int size, struct interface *in_if, union olsr_ip
       /* IPv4 */
       if (m->v4.ttl <= 0 && olsr_cnf->lq_fish == 0) {
         struct ipaddr_str buf;
-        OLSR_PRINTF(2,
-                    "Dropping packet type %d from neigh %s with TTL 0\n", m->v4.olsr_msgtype, olsr_ip_to_string(&buf, from_addr));
+        OLSR_PRINTF(2, "Dropping packet type %d from neigh %s with TTL 0\n", m->v4.olsr_msgtype,
+                    olsr_ip_to_string(&buf, from_addr));
         continue;
       }
     } else {
@@ -392,8 +392,8 @@ parse_packet(struct olsr *olsr, int size, struct interface *in_if, union olsr_ip
       struct ipaddr_str buf;
       unk_chgestruct(&unkpacket, m);
 
-      OLSR_PRINTF(3, "Unknown type: %d, size %d, from %s\n",
-                  m->v4.olsr_msgtype, size, olsr_ip_to_string(&buf, &unkpacket.originator));
+      OLSR_PRINTF(3, "Unknown type: %d, size %d, from %s\n", m->v4.olsr_msgtype, size,
+                  olsr_ip_to_string(&buf, &unkpacket.originator));
 
       /* Cancel loop here, otherwise olsrd just hangs forever at this point */
       break;
@@ -473,8 +473,8 @@ olsr_input(int fd)
     if ((olsr_in_if = if_ifwithsock(fd)) == NULL) {
       struct ipaddr_str buf;
       OLSR_PRINTF(1, "Could not find input interface for message from %s size %d\n", olsr_ip_to_string(&buf, &from_addr), cc);
-      olsr_syslog(OLSR_LOG_ERR,
-                  "Could not find input interface for message from %s size %d\n", olsr_ip_to_string(&buf, &from_addr), cc);
+      olsr_syslog(OLSR_LOG_ERR, "Could not find input interface for message from %s size %d\n", olsr_ip_to_string(&buf, &from_addr),
+                  cc);
       return;
     }
     // call preprocessors
@@ -566,8 +566,8 @@ olsr_input_hostemu(int fd)
   if ((olsr_in_if = if_ifwithsock(fd)) == NULL) {
     struct ipaddr_str buf;
     OLSR_PRINTF(1, "Could not find input interface for message from %s size %d\n", olsr_ip_to_string(&buf, &from_addr), cc);
-    olsr_syslog(OLSR_LOG_ERR,
-                "Could not find input interface for message from %s size %d\n", olsr_ip_to_string(&buf, &from_addr), cc);
+    olsr_syslog(OLSR_LOG_ERR, "Could not find input interface for message from %s size %d\n", olsr_ip_to_string(&buf, &from_addr),
+                cc);
     return;
   }
   // call preprocessors
index 82da659..ab4d5ef 100644 (file)
@@ -173,8 +173,8 @@ olsr_add_dl(struct olsr_plugin *plugin)
     /* old plugin interface */
     OLSR_PRINTF(0,
                 "\nWARNING: YOU ARE USING AN OLD DEPRECATED PLUGIN INTERFACE!\n"
-                "DETECTED VERSION %d AND THE CURRENT VERSION IS %d\n"
-                "PLEASE UPGRADE YOUR PLUGIN!\n", plugin_interface_version, MOST_RECENT_PLUGIN_INTERFACE_VERSION);
+                "DETECTED VERSION %d AND THE CURRENT VERSION IS %d\n" "PLEASE UPGRADE YOUR PLUGIN!\n", plugin_interface_version,
+                MOST_RECENT_PLUGIN_INTERFACE_VERSION);
 #if SUPPORT_OLD_PLUGIN_VERSIONS
     OLSR_PRINTF(0, "WILL CONTINUE IN 5 SECONDS...\n\n");
     sleep(5);
@@ -186,10 +186,9 @@ olsr_add_dl(struct olsr_plugin *plugin)
   /* new plugin interface */
   if (plugin_interface_version < LAST_SUPPORTED_PLUGIN_INTERFACE_VERSION) {
     OLSR_PRINTF(0,
-                "\n\nWARNING: VERSION MISMATCH!\n"
-                "DETECTED %d AND LAST SUPPORTED VERSION IS %d\n"
-                "THIS CAN CAUSE UNEXPECTED BEHAVIOUR AND CRASHES!\n"
-                "WILL CONTINUE IN 5 SECONDS...\n\n", get_interface_version(), LAST_SUPPORTED_PLUGIN_INTERFACE_VERSION);
+                "\n\nWARNING: VERSION MISMATCH!\n" "DETECTED %d AND LAST SUPPORTED VERSION IS %d\n"
+                "THIS CAN CAUSE UNEXPECTED BEHAVIOUR AND CRASHES!\n" "WILL CONTINUE IN 5 SECONDS...\n\n", get_interface_version(),
+                LAST_SUPPORTED_PLUGIN_INTERFACE_VERSION);
     sleep(5);
   }
 #endif
@@ -257,10 +256,8 @@ init_olsr_plugin(struct olsr_plugin *entry)
             || 0 == strcasecmp(entry->plugin_parameters[i].name, params->key)) {
           /* we have found it! */
           rc =
-            entry->plugin_parameters[i].set_plugin_parameter(params->
-                                                             value,
-                                                             entry->
-                                                             plugin_parameters[i].data, 0 == entry->plugin_parameters[i].name[0]
+            entry->plugin_parameters[i].set_plugin_parameter(params->value, entry->plugin_parameters[i].data,
+                                                             0 == entry->plugin_parameters[i].name[0]
                                                              ? (set_plugin_parameter_addon)
                                                              params->key : entry->plugin_parameters[i].addon);
           if (rc != 0) {
index f516952..9a5374c 100644 (file)
@@ -70,8 +70,7 @@ print_olsr_serialized_packet(FILE * handle, union olsr_packet *pkt, olsr_u16_t s
   struct ipaddr_str buf;
 
   /* Print packet header (no IP4/6 difference) */
-  fprintf(handle,
-          "  ============== OLSR PACKET ==============\n   source: %s\n   length: %d bytes\n   seqno: %d\n\n",
+  fprintf(handle, "  ============== OLSR PACKET ==============\n   source: %s\n   length: %d bytes\n   seqno: %d\n\n",
           from_addr ? olsr_ip_to_string(&buf, from_addr) : "UNKNOWN", ntohs(pkt->v4.olsr_packlen), ntohs(pkt->v4.olsr_seqno));
 
   /* Check size */
@@ -100,44 +99,38 @@ print_olsr_serialized_message(FILE * handle, union olsr_message * msg)
 
   fprintf(handle, "   ------------ OLSR MESSAGE ------------\n");
   fprintf(handle, "    Sender main addr: %s\n", olsr_ip_to_string(&buf, (union olsr_ip_addr *)&msg->v4.originator));
-  fprintf(handle, "    Type: %s, size: %d, vtime: %u ms\n",
-          olsr_msgtype_to_string(msg->v4.olsr_msgtype), ntohs(msg->v4.olsr_msgsize), me_to_reltime(msg->v4.olsr_vtime));
-  fprintf(handle, "    TTL: %d, Hopcnt: %d, seqno: %d\n",
-          (olsr_cnf->ip_version == AF_INET) ? msg->v4.ttl : msg->v6.ttl,
-          (olsr_cnf->ip_version ==
-           AF_INET) ? msg->v4.hopcnt : msg->v6.hopcnt, ntohs((olsr_cnf->ip_version == AF_INET) ? msg->v4.seqno : msg->v6.seqno));
+  fprintf(handle, "    Type: %s, size: %d, vtime: %u ms\n", olsr_msgtype_to_string(msg->v4.olsr_msgtype),
+          ntohs(msg->v4.olsr_msgsize), me_to_reltime(msg->v4.olsr_vtime));
+  fprintf(handle, "    TTL: %d, Hopcnt: %d, seqno: %d\n", (olsr_cnf->ip_version == AF_INET) ? msg->v4.ttl : msg->v6.ttl,
+          (olsr_cnf->ip_version == AF_INET) ? msg->v4.hopcnt : msg->v6.hopcnt,
+          ntohs((olsr_cnf->ip_version == AF_INET) ? msg->v4.seqno : msg->v6.seqno));
 
   switch (msg->v4.olsr_msgtype) {
     /* Print functions for individual messagetypes */
   case (MID_MESSAGE):
-    print_midmsg(handle,
-                 (olsr_cnf->ip_version ==
-                  AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message, ntohs(msg->v4.olsr_msgsize));
+    print_midmsg(handle, (olsr_cnf->ip_version == AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message,
+                 ntohs(msg->v4.olsr_msgsize));
     break;
   case (HNA_MESSAGE):
-    print_hnamsg(handle,
-                 (olsr_cnf->ip_version ==
-                  AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message, ntohs(msg->v4.olsr_msgsize));
+    print_hnamsg(handle, (olsr_cnf->ip_version == AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message,
+                 ntohs(msg->v4.olsr_msgsize));
     break;
   case (TC_MESSAGE):
-    print_olsr_tcmsg(handle,
-                     (olsr_cnf->ip_version ==
-                      AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message, ntohs(msg->v4.olsr_msgsize));
+    print_olsr_tcmsg(handle, (olsr_cnf->ip_version == AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message,
+                     ntohs(msg->v4.olsr_msgsize));
     break;
   case (LQ_TC_MESSAGE):
     print_olsr_tcmsg_lq(handle,
-                        (olsr_cnf->ip_version ==
-                         AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message, ntohs(msg->v4.olsr_msgsize));
+                        (olsr_cnf->ip_version == AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message,
+                        ntohs(msg->v4.olsr_msgsize));
     break;
   case (HELLO_MESSAGE):
-    print_hellomsg(handle,
-                   (olsr_cnf->ip_version ==
-                    AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message, ntohs(msg->v4.olsr_msgsize));
+    print_hellomsg(handle, (olsr_cnf->ip_version == AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message,
+                   ntohs(msg->v4.olsr_msgsize));
     break;
   case (LQ_HELLO_MESSAGE):
-    print_hellomsg_lq(handle,
-                      (olsr_cnf->ip_version ==
-                       AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message, ntohs(msg->v4.olsr_msgsize));
+    print_hellomsg_lq(handle, (olsr_cnf->ip_version == AF_INET) ? (olsr_u8_t *) & msg->v4.message : (olsr_u8_t *) & msg->v6.message,
+                      ntohs(msg->v4.olsr_msgsize));
     break;
   default:
     print_messagedump(handle, (olsr_u8_t *) msg, ntohs(msg->v4.olsr_msgsize));
@@ -187,12 +180,11 @@ print_hellomsg(FILE * handle, olsr_u8_t * data, olsr_16_t totsize)
     for (hinf = h->hell_info; (char *)hinf < ((char *)data + hellosize);
          hinf = (struct hellinfo *)((char *)hinf + ntohs(hinf->size))) {
 
-      fprintf(handle, "    ++ Link: %s, Status: %s, Size: %d\n",
-              olsr_link_to_string(EXTRACT_LINK(hinf->link_code)),
+      fprintf(handle, "    ++ Link: %s, Status: %s, Size: %d\n", olsr_link_to_string(EXTRACT_LINK(hinf->link_code)),
               olsr_status_to_string(EXTRACT_STATUS(hinf->link_code)), ntohs(hinf->size));
 
-      for (haddr = (union olsr_ip_addr *)&hinf->neigh_addr;
-           (char *)haddr < (char *)hinf + ntohs(hinf->size); haddr = (union olsr_ip_addr *)&haddr->v6.s6_addr[4]) {
+      for (haddr = (union olsr_ip_addr *)&hinf->neigh_addr; (char *)haddr < (char *)hinf + ntohs(hinf->size);
+           haddr = (union olsr_ip_addr *)&haddr->v6.s6_addr[4]) {
         struct ipaddr_str buf;
         fprintf(handle, "    ++ %s\n", olsr_ip_to_string(&buf, haddr));
       }
@@ -205,10 +197,9 @@ print_hellomsg(FILE * handle, olsr_u8_t * data, olsr_16_t totsize)
 
     h6 = (struct hellomsg6 *)data;
 
-    for (hinf6 = h6->hell_info;
-         (char *)hinf6 < ((char *)data + (hellosize)); hinf6 = (struct hellinfo6 *)((char *)hinf6 + ntohs(hinf6->size))) {
-      fprintf(handle, "    ++ Link: %s, Status: %s, Size: %d\n",
-              olsr_link_to_string(EXTRACT_LINK(hinf6->link_code)),
+    for (hinf6 = h6->hell_info; (char *)hinf6 < ((char *)data + (hellosize));
+         hinf6 = (struct hellinfo6 *)((char *)hinf6 + ntohs(hinf6->size))) {
+      fprintf(handle, "    ++ Link: %s, Status: %s, Size: %d\n", olsr_link_to_string(EXTRACT_LINK(hinf6->link_code)),
               olsr_status_to_string(EXTRACT_STATUS(hinf6->link_code)), ntohs(hinf6->size));
 
       for (haddr = (union olsr_ip_addr *)hinf6->neigh_addr; (char *)haddr < (char *)hinf6 + ntohs(hinf6->size); haddr++) {
@@ -241,12 +232,11 @@ print_hellomsg_lq(FILE * handle, olsr_u8_t * data, olsr_16_t totsize)
     for (hinf = h->hell_info; (char *)hinf < ((char *)data + hellosize);
          hinf = (struct hellinfo *)((char *)hinf + ntohs(hinf->size))) {
 
-      fprintf(handle, "    ++ Link: %s, Status: %s, Size: %d\n",
-              olsr_link_to_string(EXTRACT_LINK(hinf->link_code)),
+      fprintf(handle, "    ++ Link: %s, Status: %s, Size: %d\n", olsr_link_to_string(EXTRACT_LINK(hinf->link_code)),
               olsr_status_to_string(EXTRACT_STATUS(hinf->link_code)), ntohs(hinf->size));
 
-      for (haddr = (union olsr_ip_addr *)&hinf->neigh_addr;
-           (char *)haddr < (char *)hinf + ntohs(hinf->size); haddr = (union olsr_ip_addr *)&haddr->v6.s6_addr[8]) {
+      for (haddr = (union olsr_ip_addr *)&hinf->neigh_addr; (char *)haddr < (char *)hinf + ntohs(hinf->size);
+           haddr = (union olsr_ip_addr *)&haddr->v6.s6_addr[8]) {
         struct ipaddr_str buf;
         olsr_u8_t *quality = (olsr_u8_t *) haddr + olsr_cnf->ipsize;
         fprintf(handle, "    ++ %s\n", olsr_ip_to_string(&buf, haddr));
@@ -261,10 +251,9 @@ print_hellomsg_lq(FILE * handle, olsr_u8_t * data, olsr_16_t totsize)
 
     h6 = (struct hellomsg6 *)data;
 
-    for (hinf6 = h6->hell_info;
-         (char *)hinf6 < ((char *)data + (hellosize)); hinf6 = (struct hellinfo6 *)((char *)hinf6 + ntohs(hinf6->size))) {
-      fprintf(handle, "    ++ Link: %s, Status: %s, Size: %d\n",
-              olsr_link_to_string(EXTRACT_LINK(hinf6->link_code)),
+    for (hinf6 = h6->hell_info; (char *)hinf6 < ((char *)data + (hellosize));
+         hinf6 = (struct hellinfo6 *)((char *)hinf6 + ntohs(hinf6->size))) {
+      fprintf(handle, "    ++ Link: %s, Status: %s, Size: %d\n", olsr_link_to_string(EXTRACT_LINK(hinf6->link_code)),
               olsr_status_to_string(EXTRACT_STATUS(hinf6->link_code)), ntohs(hinf6->size));
 
       for (haddr = (union olsr_ip_addr *)hinf6->neigh_addr; (char *)haddr < (char *)hinf6 + ntohs(hinf6->size) + 4; haddr++) {
index 4f45aa9..5035cc5 100644 (file)
@@ -105,8 +105,8 @@ process_message_neighbors(struct neighbor_entry *neighbor, const struct hello_me
 #endif
       if (two_hop_neighbor_yet != NULL) {
         /* Updating the holding time for this neighbor */
-        olsr_set_timer(&two_hop_neighbor_yet->nbr2_list_timer,
-                       message->vtime, OLSR_NBR2_LIST_JITTER, OLSR_TIMER_ONESHOT, &olsr_expire_nbr2_list, two_hop_neighbor_yet, 0);
+        olsr_set_timer(&two_hop_neighbor_yet->nbr2_list_timer, message->vtime, OLSR_NBR2_LIST_JITTER, OLSR_TIMER_ONESHOT,
+                       &olsr_expire_nbr2_list, two_hop_neighbor_yet, 0);
         two_hop_neighbor = two_hop_neighbor_yet->neighbor_2;
 
         /*
@@ -123,8 +123,8 @@ process_message_neighbors(struct neighbor_entry *neighbor, const struct hello_me
 
           struct neighbor_list_entry *walker;
 
-          for (walker = two_hop_neighbor->neighbor_2_nblist.next;
-               walker != &two_hop_neighbor->neighbor_2_nblist; walker = walker->next) {
+          for (walker = two_hop_neighbor->neighbor_2_nblist.next; walker != &two_hop_neighbor->neighbor_2_nblist;
+               walker = walker->next) {
             /*
              * have we found the one-hop neighbor that sent the
              * HELLO message that we're current processing?
@@ -212,8 +212,8 @@ process_message_neighbors(struct neighbor_entry *neighbor, const struct hello_me
          * 'two_hop_neighbor'
          */
 
-        for (walker = two_hop_neighbor->neighbor_2_nblist.next;
-             walker != &two_hop_neighbor->neighbor_2_nblist; walker = walker->next) {
+        for (walker = two_hop_neighbor->neighbor_2_nblist.next; walker != &two_hop_neighbor->neighbor_2_nblist;
+             walker = walker->next) {
           /*
            * have we found the one-hop neighbor that sent the
            * HELLO message that we're current processing?
@@ -312,8 +312,8 @@ lookup_mpr_status(const struct hello_message *message, const struct interface *i
 
   for (neighbors = message->neighbors; neighbors; neighbors = neighbors->next) {
     if (olsr_cnf->ip_version ==
-        AF_INET ? ip4equal(&neighbors->address.v4,
-                           &in_if->ip_addr.v4) : ip6equal(&neighbors->address.v6, &in_if->int6_addr.sin6_addr)) {
+        AF_INET ? ip4equal(&neighbors->address.v4, &in_if->ip_addr.v4) : ip6equal(&neighbors->address.v6,
+                                                                                  &in_if->int6_addr.sin6_addr)) {
 
       if (neighbors->link == SYM_LINK && neighbors->status == MPR_NEIGH) {
         return OLSR_TRUE;
@@ -453,8 +453,8 @@ olsr_hello_tap(struct hello_message *message, struct interface *in_if, const uni
   /* Check willingness */
   if (neighbor->willingness != message->willingness) {
     struct ipaddr_str buf;
-    OLSR_PRINTF(1, "Willingness for %s changed from %d to %d - UPDATING\n",
-                olsr_ip_to_string(&buf, &neighbor->neighbor_main_addr), neighbor->willingness, message->willingness);
+    OLSR_PRINTF(1, "Willingness for %s changed from %d to %d - UPDATING\n", olsr_ip_to_string(&buf, &neighbor->neighbor_main_addr),
+                neighbor->willingness, message->willingness);
     /*
      *If willingness changed - recalculate
      */
index 5559045..278fe54 100644 (file)
@@ -559,8 +559,8 @@ olsr_insert_routing_table(union olsr_ip_addr *dst, int plen, union olsr_ip_addr
       return NULL;
     }
 #ifdef DEBUG
-    OLSR_PRINTF(1, "RIB: add prefix %s/%u from %s\n",
-                olsr_ip_to_string(&dstbuf, dst), plen, olsr_ip_to_string(&origbuf, originator));
+    OLSR_PRINTF(1, "RIB: add prefix %s/%u from %s\n", olsr_ip_to_string(&dstbuf, dst), plen,
+                olsr_ip_to_string(&origbuf, originator));
 #endif
 
     /* overload the hna change bit for flagging a prefix change */
@@ -613,8 +613,8 @@ olsr_delete_routing_table(union olsr_ip_addr *dst, int plen, union olsr_ip_addr
     olsr_delete_rt_path(rtp);
 
 #ifdef DEBUG
-    OLSR_PRINTF(1, "RIB: del prefix %s/%u from %s\n",
-                olsr_ip_to_string(&dstbuf, dst), plen, olsr_ip_to_string(&origbuf, originator));
+    OLSR_PRINTF(1, "RIB: del prefix %s/%u from %s\n", olsr_ip_to_string(&dstbuf, dst), plen,
+                olsr_ip_to_string(&origbuf, originator));
 #endif
 
     /* overload the hna change bit for flagging a prefix change */
@@ -631,9 +631,8 @@ olsr_rt_to_string(const struct rt_entry *rt)
   static char buff[128];
   struct ipaddr_str prefixstr, gwstr;
 
-  snprintf(buff, sizeof(buff), "%s/%u via %s",
-           olsr_ip_to_string(&prefixstr, &rt->rt_dst.prefix),
-           rt->rt_dst.prefix_len, olsr_ip_to_string(&gwstr, &rt->rt_nexthop.gateway));
+  snprintf(buff, sizeof(buff), "%s/%u via %s", olsr_ip_to_string(&prefixstr, &rt->rt_dst.prefix), rt->rt_dst.prefix_len,
+           olsr_ip_to_string(&gwstr, &rt->rt_nexthop.gateway));
 
   return buff;
 }
@@ -649,13 +648,11 @@ olsr_rtp_to_string(const struct rt_path *rtp)
   struct rt_entry *rt = rtp->rtp_rt;
   struct lqtextbuffer lqbuffer;
 
-  snprintf(buff, sizeof(buff),
-           "%s/%u from %s via %s, " "cost %s, metric %u, v %u",
-           olsr_ip_to_string(&prefixstr, &rt->rt_dst.prefix),
-           rt->rt_dst.prefix_len, olsr_ip_to_string(&origstr,
-                                                    &rtp->rtp_originator),
-           olsr_ip_to_string(&gwstr, &rtp->rtp_nexthop.gateway),
-           get_linkcost_text(rtp->rtp_metric.cost, OLSR_TRUE, &lqbuffer), rtp->rtp_metric.hops, rtp->rtp_version);
+  snprintf(buff, sizeof(buff), "%s/%u from %s via %s, " "cost %s, metric %u, v %u",
+           olsr_ip_to_string(&prefixstr, &rt->rt_dst.prefix), rt->rt_dst.prefix_len, olsr_ip_to_string(&origstr,
+                                                                                                       &rtp->rtp_originator),
+           olsr_ip_to_string(&gwstr, &rtp->rtp_nexthop.gateway), get_linkcost_text(rtp->rtp_metric.cost, OLSR_TRUE, &lqbuffer),
+           rtp->rtp_metric.hops, rtp->rtp_version);
 
   return buff;
 }
@@ -680,20 +677,17 @@ olsr_print_routing_table(struct avl_tree *tree)
     struct rt_entry *rt = rt_tree2rt(rt_tree_node);
 
     /* first the route entry */
-    OLSR_PRINTF(6, "%s/%u, via %s, best-originator %s\n",
-                olsr_ip_to_string(&prefixstr, &rt->rt_dst.prefix),
-                rt->rt_dst.prefix_len, olsr_ip_to_string(&origstr,
-                                                         &rt->rt_nexthop.
-                                                         gateway), olsr_ip_to_string(&gwstr, &rt->rt_best->rtp_originator));
+    OLSR_PRINTF(6, "%s/%u, via %s, best-originator %s\n", olsr_ip_to_string(&prefixstr, &rt->rt_dst.prefix), rt->rt_dst.prefix_len,
+                olsr_ip_to_string(&origstr, &rt->rt_nexthop.gateway), olsr_ip_to_string(&gwstr, &rt->rt_best->rtp_originator));
 
     /* walk the per-originator path tree of routes */
     for (rtp_tree_node = avl_walk_first(&rt->rt_path_tree); rtp_tree_node != NULL; rtp_tree_node = avl_walk_next(rtp_tree_node)) {
       struct rt_path *rtp = rtp_tree2rtp(rtp_tree_node);
-      OLSR_PRINTF(6, "\tfrom %s, cost %s, metric %u, via %s, %s, v %u\n",
-                  olsr_ip_to_string(&origstr, &rtp->rtp_originator),
-                  get_linkcost_text(rtp->rtp_metric.cost, OLSR_TRUE,
-                                    &lqbuffer), rtp->rtp_metric.hops,
-                  olsr_ip_to_string(&gwstr, &rtp->rtp_nexthop.gateway),
+      OLSR_PRINTF(6, "\tfrom %s, cost %s, metric %u, via %s, %s, v %u\n", olsr_ip_to_string(&origstr, &rtp->rtp_originator),
+                  get_linkcost_text(rtp->rtp_metric.cost, OLSR_TRUE, &lqbuffer), rtp->rtp_metric.hops, olsr_ip_to_string(&gwstr,
+                                                                                                                         &rtp->
+                                                                                                                         rtp_nexthop.
+                                                                                                                         gateway),
                   if_ifwithindex_name(rt->rt_nexthop.iif_index), rtp->rtp_version);
     }
   }
index d096f40..33f9578 100644 (file)
@@ -376,10 +376,7 @@ olsr_walk_timers(clock_t * last_run)
       /* Ready to fire ? */
       if (TIMED_OUT(timer->timer_clock)) {
 
-        OLSR_PRINTF(3,
-                    "TIMER: fire %s timer %p, ctx %p, "
-                    "at clocktick %u (%s)\n",
-                    olsr_cookie_name(timer->timer_cookie), timer,
+        OLSR_PRINTF(3, "TIMER: fire %s timer %p, ctx %p, " "at clocktick %u (%s)\n", olsr_cookie_name(timer->timer_cookie), timer,
                     timer->timer_cb_context, (unsigned int)*last_run, olsr_wallclock_string());
 
         /* This timer is expired, call into the provided callback function */
@@ -421,9 +418,7 @@ olsr_walk_timers(clock_t * last_run)
   }
 
 #ifdef DEBUG
-  OLSR_PRINTF(3,
-              "TIMER: processed %4u/%u clockwheel slots, "
-              "timers walked %4u/%u, timers fired %u\n", wheel_slot_walks,
+  OLSR_PRINTF(3, "TIMER: processed %4u/%u clockwheel slots, " "timers walked %4u/%u, timers fired %u\n", wheel_slot_walks,
               TIMER_WHEEL_SLOTS, total_timers_walked, timers_running, total_timers_fired);
 #endif
 
@@ -544,8 +539,8 @@ olsr_clock_string(clock_t clock)
  * @return a pointer to the created entry
  */
 struct timer_entry *
-olsr_start_timer(unsigned int rel_time, olsr_u8_t jitter_pct,
-                 olsr_bool periodical, void (*timer_cb_function) (void *), void *context, olsr_cookie_t cookie)
+olsr_start_timer(unsigned int rel_time, olsr_u8_t jitter_pct, olsr_bool periodical, void (*timer_cb_function) (void *),
+                 void *context, olsr_cookie_t cookie)
 {
   struct timer_entry *timer;
 
@@ -576,8 +571,8 @@ olsr_start_timer(unsigned int rel_time, olsr_u8_t jitter_pct,
   timers_running++;
 
 #ifdef DEBUG
-  OLSR_PRINTF(3, "TIMER: start %s timer %p firing in %s, ctx %p\n",
-              olsr_cookie_name(timer->timer_cookie), timer, olsr_clock_string(timer->timer_clock), context);
+  OLSR_PRINTF(3, "TIMER: start %s timer %p firing in %s, ctx %p\n", olsr_cookie_name(timer->timer_cookie), timer,
+              olsr_clock_string(timer->timer_clock), context);
 #endif
 
   return timer;
@@ -647,8 +642,8 @@ olsr_change_timer(struct timer_entry *timer, unsigned int rel_time, olsr_u8_t ji
   list_add_before(&timer_wheel[timer->timer_clock & TIMER_WHEEL_MASK], &timer->timer_list);
 
 #ifdef DEBUG
-  OLSR_PRINTF(3, "TIMER: change %s timer %p, firing to %s, ctx %p\n",
-              olsr_cookie_name(timer->timer_cookie), timer, olsr_clock_string(timer->timer_clock), timer->timer_cb_context);
+  OLSR_PRINTF(3, "TIMER: change %s timer %p, firing to %s, ctx %p\n", olsr_cookie_name(timer->timer_cookie), timer,
+              olsr_clock_string(timer->timer_clock), timer->timer_cb_context);
 #endif
 }
 
@@ -659,8 +654,8 @@ olsr_change_timer(struct timer_entry *timer, unsigned int rel_time, olsr_u8_t ji
  * terminated.
  */
 void
-olsr_set_timer(struct timer_entry **timer_ptr, unsigned int rel_time,
-               olsr_u8_t jitter_pct, olsr_bool periodical, void (*timer_cb_function) (void *), void *context, olsr_cookie_t cookie)
+olsr_set_timer(struct timer_entry **timer_ptr, unsigned int rel_time, olsr_u8_t jitter_pct, olsr_bool periodical,
+               void (*timer_cb_function) (void *), void *context, olsr_cookie_t cookie)
 {
 
   if (!*timer_ptr) {
index daff247..4d104c5 100644 (file)
@@ -344,10 +344,9 @@ olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge)
   struct tc_entry *tc = tc_edge->tc;
   struct lqtextbuffer lqbuffer1, lqbuffer2;
 
-  snprintf(buf, sizeof(buf), "%s > %s, cost (%6s) %s",
-           olsr_ip_to_string(&addrbuf, &tc->addr),
-           olsr_ip_to_string(&dstbuf, &tc_edge->T_dest_addr),
-           get_tc_edge_entry_text(tc_edge, '/', &lqbuffer1), get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer2));
+  snprintf(buf, sizeof(buf), "%s > %s, cost (%6s) %s", olsr_ip_to_string(&addrbuf, &tc->addr),
+           olsr_ip_to_string(&dstbuf, &tc_edge->T_dest_addr), get_tc_edge_entry_text(tc_edge, '/', &lqbuffer1),
+           get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer2));
 
   return buf;
 }
@@ -552,8 +551,8 @@ olsr_delete_outdated_tc_edges(struct tc_entry *tc)
  * @return 1 if any destinations were deleted 0 if not
  */
 static int
-olsr_delete_revoked_tc_edges(struct tc_entry *tc, olsr_u16_t ansn,
-                             union olsr_ip_addr *lower_border, union olsr_ip_addr *upper_border)
+olsr_delete_revoked_tc_edges(struct tc_entry *tc, olsr_u16_t ansn, union olsr_ip_addr *lower_border,
+                             union olsr_ip_addr *upper_border)
 {
   struct tc_edge_entry *tc_edge;
   int retval = 0;
@@ -694,10 +693,8 @@ olsr_print_tc_table(void)
   struct tc_entry *tc;
   const int ipwidth = olsr_cnf->ip_version == AF_INET ? 15 : 30;
 
-  OLSR_PRINTF(1,
-              "\n--- %s ------------------------------------------------- TOPOLOGY\n\n"
-              "%-*s %-*s %-14s  %s\n", olsr_wallclock_string(), ipwidth,
-              "Source IP addr", ipwidth, "Dest IP addr", "      LQ      ", "ETX");
+  OLSR_PRINTF(1, "\n--- %s ------------------------------------------------- TOPOLOGY\n\n" "%-*s %-*s %-14s  %s\n",
+              olsr_wallclock_string(), ipwidth, "Source IP addr", ipwidth, "Dest IP addr", "      LQ      ", "ETX");
 
   OLSR_FOR_ALL_TC_ENTRIES(tc) {
     struct tc_edge_entry *tc_edge;
@@ -705,10 +702,9 @@ olsr_print_tc_table(void)
       struct ipaddr_str addrbuf, dstaddrbuf;
       struct lqtextbuffer lqbuffer1, lqbuffer2;
 
-      OLSR_PRINTF(1, "%-*s %-*s %-14s %s\n", ipwidth,
-                  olsr_ip_to_string(&addrbuf, &tc->addr), ipwidth,
-                  olsr_ip_to_string(&dstaddrbuf, &tc_edge->T_dest_addr),
-                  get_tc_edge_entry_text(tc_edge, '/', &lqbuffer1), get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer2));
+      OLSR_PRINTF(1, "%-*s %-*s %-14s %s\n", ipwidth, olsr_ip_to_string(&addrbuf, &tc->addr), ipwidth,
+                  olsr_ip_to_string(&dstaddrbuf, &tc_edge->T_dest_addr), get_tc_edge_entry_text(tc_edge, '/', &lqbuffer1),
+                  get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer2));
 
     } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
   } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
@@ -725,8 +721,8 @@ olsr_print_tc_table(void)
  * @result 1 if lower/upper border ip have been set
  */
 static int
-olsr_calculate_tc_border(olsr_u8_t lower_border,
-                         union olsr_ip_addr *lower_border_ip, olsr_u8_t upper_border, union olsr_ip_addr *upper_border_ip)
+olsr_calculate_tc_border(olsr_u8_t lower_border, union olsr_ip_addr *lower_border_ip, olsr_u8_t upper_border,
+                         union olsr_ip_addr *upper_border_ip)
 {
   if (lower_border == 0 && upper_border == 0) {
     return 0;
@@ -899,8 +895,8 @@ olsr_input_tc(union olsr_message *msg, struct interface *input_if __attribute__
   /*
    * Set or change the expiration timer accordingly.
    */
-  olsr_set_timer(&tc->validity_timer, vtime, OLSR_TC_VTIME_JITTER,
-                 OLSR_TIMER_ONESHOT, &olsr_expire_tc_entry, tc, tc_validity_timer_cookie->ci_id);
+  olsr_set_timer(&tc->validity_timer, vtime, OLSR_TC_VTIME_JITTER, OLSR_TIMER_ONESHOT, &olsr_expire_tc_entry, tc,
+                 tc_validity_timer_cookie->ci_id);
 
   if (borderSet) {
 
@@ -914,8 +910,8 @@ olsr_input_tc(union olsr_message *msg, struct interface *input_if __attribute__
      * Kick the the edge garbage collection timer. In the meantime hopefully
      * all edges belonging to a multipart neighbor set will arrive.
      */
-    olsr_set_timer(&tc->edge_gc_timer, OLSR_TC_EDGE_GC_TIME,
-                   OLSR_TC_EDGE_GC_JITTER, OLSR_TIMER_ONESHOT, &olsr_expire_tc_edge_gc, tc, tc_edge_gc_timer_cookie->ci_id);
+    olsr_set_timer(&tc->edge_gc_timer, OLSR_TC_EDGE_GC_TIME, OLSR_TC_EDGE_GC_JITTER, OLSR_TIMER_ONESHOT, &olsr_expire_tc_edge_gc,
+                   tc, tc_edge_gc_timer_cookie->ci_id);
   }
 }
 
index 6702879..5d1c947 100644 (file)
@@ -215,9 +215,8 @@ olsr_print_two_hop_neighbor_table(void)
   /* The whole function makes no sense without it. */
   int i;
 
-  OLSR_PRINTF(1,
-              "\n--- %s ----------------------- TWO-HOP NEIGHBORS\n\n"
-              "IP addr (2-hop)  IP addr (1-hop)  Total cost\n", olsr_wallclock_string());
+  OLSR_PRINTF(1, "\n--- %s ----------------------- TWO-HOP NEIGHBORS\n\n" "IP addr (2-hop)  IP addr (1-hop)  Total cost\n",
+              olsr_wallclock_string());
 
   for (i = 0; i < HASHSIZE; i++) {
     struct neighbor_2_entry *neigh2;
@@ -234,10 +233,8 @@ olsr_print_two_hop_neighbor_table(void)
         } else {
           OLSR_PRINTF(1, "                 ");
         }
-        OLSR_PRINTF(1, "%-15s  %s\n",
-                    olsr_ip_to_string(&buf,
-                                      &entry->neighbor->
-                                      neighbor_main_addr), get_linkcost_text(entry->path_linkcost, OLSR_FALSE, &lqbuffer));
+        OLSR_PRINTF(1, "%-15s  %s\n", olsr_ip_to_string(&buf, &entry->neighbor->neighbor_main_addr),
+                    get_linkcost_text(entry->path_linkcost, OLSR_FALSE, &lqbuffer));
       }
     }
   }
index a17bb43..cb6f324 100644 (file)
@@ -290,8 +290,8 @@ chk_if_changed(struct olsr_if *iface)
 #endif
 
     if (memcmp
-        (&((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr,
-         &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, olsr_cnf->ipsize) != 0) {
+        (&((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr,
+         olsr_cnf->ipsize) != 0) {
       /* New address */
       OLSR_PRINTF(1, "IPv4 address changed for %s\n", ifr.ifr_name);
       OLSR_PRINTF(1, "\tOld:%s\n", ip4_to_string(&buf, ifp->int_addr.sin_addr));
@@ -321,8 +321,8 @@ chk_if_changed(struct olsr_if *iface)
 #endif
 
     if (memcmp
-        (&((struct sockaddr_in *)&ifp->int_netmask)->sin_addr.s_addr,
-         &((struct sockaddr_in *)&ifr.ifr_netmask)->sin_addr.s_addr, olsr_cnf->ipsize) != 0) {
+        (&((struct sockaddr_in *)&ifp->int_netmask)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_netmask)->sin_addr.s_addr,
+         olsr_cnf->ipsize) != 0) {
       struct ipaddr_str buf;
       /* New address */
       OLSR_PRINTF(1, "IPv4 netmask changed for %s\n", ifr.ifr_name);
@@ -555,19 +555,17 @@ add_hemu_if(struct olsr_if *iface)
    */
 
   ifp->hello_gen_timer =
-    olsr_start_timer(iface->cnf->hello_params.emission_interval *
-                     MSEC_PER_SEC, HELLO_JITTER, OLSR_TIMER_PERIODIC,
+    olsr_start_timer(iface->cnf->hello_params.emission_interval * MSEC_PER_SEC, HELLO_JITTER, OLSR_TIMER_PERIODIC,
                      olsr_cnf->lq_level == 0 ? &generate_hello : &olsr_output_lq_hello, ifp, hello_gen_timer_cookie->ci_id);
   ifp->tc_gen_timer =
-    olsr_start_timer(iface->cnf->tc_params.emission_interval * MSEC_PER_SEC,
-                     TC_JITTER, OLSR_TIMER_PERIODIC,
+    olsr_start_timer(iface->cnf->tc_params.emission_interval * MSEC_PER_SEC, TC_JITTER, OLSR_TIMER_PERIODIC,
                      olsr_cnf->lq_level == 0 ? &generate_tc : &olsr_output_lq_tc, ifp, tc_gen_timer_cookie->ci_id);
   ifp->mid_gen_timer =
-    olsr_start_timer(iface->cnf->mid_params.emission_interval * MSEC_PER_SEC,
-                     MID_JITTER, OLSR_TIMER_PERIODIC, &generate_mid, ifp, mid_gen_timer_cookie->ci_id);
+    olsr_start_timer(iface->cnf->mid_params.emission_interval * MSEC_PER_SEC, MID_JITTER, OLSR_TIMER_PERIODIC, &generate_mid, ifp,
+                     mid_gen_timer_cookie->ci_id);
   ifp->hna_gen_timer =
-    olsr_start_timer(iface->cnf->hna_params.emission_interval * MSEC_PER_SEC,
-                     HNA_JITTER, OLSR_TIMER_PERIODIC, &generate_hna, ifp, hna_gen_timer_cookie->ci_id);
+    olsr_start_timer(iface->cnf->hna_params.emission_interval * MSEC_PER_SEC, HNA_JITTER, OLSR_TIMER_PERIODIC, &generate_hna, ifp,
+                     hna_gen_timer_cookie->ci_id);
 
   /* Recalculate max topology hold time */
   if (olsr_cnf->max_tc_vtime < iface->cnf->tc_params.emission_interval)
@@ -873,19 +871,17 @@ chk_if_up(struct olsr_if *iface, int debuglvl __attribute__ ((unused)))
    * Register functions for periodic message generation
    */
   ifp->hello_gen_timer =
-    olsr_start_timer(iface->cnf->hello_params.emission_interval *
-                     MSEC_PER_SEC, HELLO_JITTER, OLSR_TIMER_PERIODIC,
+    olsr_start_timer(iface->cnf->hello_params.emission_interval * MSEC_PER_SEC, HELLO_JITTER, OLSR_TIMER_PERIODIC,
                      olsr_cnf->lq_level == 0 ? &generate_hello : &olsr_output_lq_hello, ifp, hello_gen_timer_cookie->ci_id);
   ifp->tc_gen_timer =
-    olsr_start_timer(iface->cnf->tc_params.emission_interval * MSEC_PER_SEC,
-                     TC_JITTER, OLSR_TIMER_PERIODIC,
+    olsr_start_timer(iface->cnf->tc_params.emission_interval * MSEC_PER_SEC, TC_JITTER, OLSR_TIMER_PERIODIC,
                      olsr_cnf->lq_level == 0 ? &generate_tc : &olsr_output_lq_tc, ifp, tc_gen_timer_cookie->ci_id);
   ifp->mid_gen_timer =
-    olsr_start_timer(iface->cnf->mid_params.emission_interval * MSEC_PER_SEC,
-                     MID_JITTER, OLSR_TIMER_PERIODIC, &generate_mid, ifp, mid_gen_timer_cookie->ci_id);
+    olsr_start_timer(iface->cnf->mid_params.emission_interval * MSEC_PER_SEC, MID_JITTER, OLSR_TIMER_PERIODIC, &generate_mid, ifp,
+                     mid_gen_timer_cookie->ci_id);
   ifp->hna_gen_timer =
-    olsr_start_timer(iface->cnf->hna_params.emission_interval * MSEC_PER_SEC,
-                     HNA_JITTER, OLSR_TIMER_PERIODIC, &generate_hna, ifp, hna_gen_timer_cookie->ci_id);
+    olsr_start_timer(iface->cnf->hna_params.emission_interval * MSEC_PER_SEC, HNA_JITTER, OLSR_TIMER_PERIODIC, &generate_hna, ifp,
+                     hna_gen_timer_cookie->ci_id);
 
   /* Recalculate max topology hold time */
   if (olsr_cnf->max_tc_vtime < iface->cnf->tc_params.emission_interval) {
index 62b300f..9363570 100644 (file)
@@ -151,8 +151,8 @@ StrError(unsigned int ErrNo)
 #else
   short WideMsg[1000];
 
-  FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, ErrNo,
-                MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), WideMsg, sizeof(WideMsg) / 2, NULL);
+  FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, ErrNo, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), WideMsg, sizeof(WideMsg) / 2,
+                NULL);
 
   if (WideCharToMultiByte(CP_ACP, 0, WideMsg, -1, Msg, sizeof(Msg), NULL, NULL) == 0)
     strscpy(Msg, "[cannot convert string]", sizeof(Msg));
index 0aa720e..4c4b1a5 100644 (file)
@@ -100,8 +100,8 @@ struct MibIpInterfaceRow {
 
 typedef DWORD(__stdcall * GETIPINTERFACEENTRY) (struct MibIpInterfaceRow * Row);
 
-typedef DWORD(__stdcall * GETADAPTERSADDRESSES) (ULONG Family, DWORD Flags,
-                                                 PVOID Reserved, PIP_ADAPTER_ADDRESSES pAdapterAddresses, PULONG pOutBufLen);
+typedef DWORD(__stdcall * GETADAPTERSADDRESSES) (ULONG Family, DWORD Flags, PVOID Reserved, PIP_ADAPTER_ADDRESSES pAdapterAddresses,
+                                                 PULONG pOutBufLen);
 
 struct InterfaceInfo {
   unsigned int Index;
@@ -662,19 +662,17 @@ add_hemu_if(struct olsr_if *iface)
    * Register functions for periodic message generation
    */
   ifp->hello_gen_timer =
-    olsr_start_timer(iface->cnf->hello_params.emission_interval *
-                     MSEC_PER_SEC, HELLO_JITTER, OLSR_TIMER_PERIODIC,
+    olsr_start_timer(iface->cnf->hello_params.emission_interval * MSEC_PER_SEC, HELLO_JITTER, OLSR_TIMER_PERIODIC,
                      olsr_cnf->lq_level == 0 ? &generate_hello : &olsr_output_lq_hello, ifp, hello_gen_timer_cookie->ci_id);
   ifp->tc_gen_timer =
-    olsr_start_timer(iface->cnf->tc_params.emission_interval * MSEC_PER_SEC,
-                     TC_JITTER, OLSR_TIMER_PERIODIC,
+    olsr_start_timer(iface->cnf->tc_params.emission_interval * MSEC_PER_SEC, TC_JITTER, OLSR_TIMER_PERIODIC,
                      olsr_cnf->lq_level == 0 ? &generate_tc : &olsr_output_lq_tc, ifp, tc_gen_timer_cookie->ci_id);
   ifp->mid_gen_timer =
-    olsr_start_timer(iface->cnf->mid_params.emission_interval * MSEC_PER_SEC,
-                     MID_JITTER, OLSR_TIMER_PERIODIC, &generate_mid, ifp, mid_gen_timer_cookie->ci_id);
+    olsr_start_timer(iface->cnf->mid_params.emission_interval * MSEC_PER_SEC, MID_JITTER, OLSR_TIMER_PERIODIC, &generate_mid, ifp,
+                     mid_gen_timer_cookie->ci_id);
   ifp->hna_gen_timer =
-    olsr_start_timer(iface->cnf->hna_params.emission_interval * MSEC_PER_SEC,
-                     HNA_JITTER, OLSR_TIMER_PERIODIC, &generate_hna, ifp, hna_gen_timer_cookie->ci_id);
+    olsr_start_timer(iface->cnf->hna_params.emission_interval * MSEC_PER_SEC, HNA_JITTER, OLSR_TIMER_PERIODIC, &generate_hna, ifp,
+                     hna_gen_timer_cookie->ci_id);
 
   /* Recalculate max topology hold time */
   if (olsr_cnf->max_tc_vtime < iface->cnf->tc_params.emission_interval)
@@ -952,19 +950,17 @@ chk_if_up(struct olsr_if *IntConf, int DebugLevel __attribute__ ((unused)))
    * Register functions for periodic message generation
    */
   New->hello_gen_timer =
-    olsr_start_timer(IntConf->cnf->hello_params.emission_interval *
-                     MSEC_PER_SEC, HELLO_JITTER, OLSR_TIMER_PERIODIC,
+    olsr_start_timer(IntConf->cnf->hello_params.emission_interval * MSEC_PER_SEC, HELLO_JITTER, OLSR_TIMER_PERIODIC,
                      olsr_cnf->lq_level == 0 ? &generate_hello : &olsr_output_lq_hello, New, hello_gen_timer_cookie->ci_id);
   New->tc_gen_timer =
-    olsr_start_timer(IntConf->cnf->tc_params.emission_interval *
-                     MSEC_PER_SEC, TC_JITTER, OLSR_TIMER_PERIODIC,
+    olsr_start_timer(IntConf->cnf->tc_params.emission_interval * MSEC_PER_SEC, TC_JITTER, OLSR_TIMER_PERIODIC,
                      olsr_cnf->lq_level == 0 ? &generate_tc : &olsr_output_lq_tc, New, tc_gen_timer_cookie->ci_id);
   New->mid_gen_timer =
-    olsr_start_timer(IntConf->cnf->mid_params.emission_interval *
-                     MSEC_PER_SEC, MID_JITTER, OLSR_TIMER_PERIODIC, &generate_mid, New, mid_gen_timer_cookie->ci_id);
+    olsr_start_timer(IntConf->cnf->mid_params.emission_interval * MSEC_PER_SEC, MID_JITTER, OLSR_TIMER_PERIODIC, &generate_mid, New,
+                     mid_gen_timer_cookie->ci_id);
   New->hna_gen_timer =
-    olsr_start_timer(IntConf->cnf->hna_params.emission_interval *
-                     MSEC_PER_SEC, HNA_JITTER, OLSR_TIMER_PERIODIC, &generate_hna, New, hna_gen_timer_cookie->ci_id);
+    olsr_start_timer(IntConf->cnf->hna_params.emission_interval * MSEC_PER_SEC, HNA_JITTER, OLSR_TIMER_PERIODIC, &generate_hna, New,
+                     hna_gen_timer_cookie->ci_id);
 
   if (olsr_cnf->max_tc_vtime < IntConf->cnf->tc_params.emission_interval)
     olsr_cnf->max_tc_vtime = IntConf->cnf->tc_params.emission_interval;
index 7da38ac..b841408 100644 (file)
@@ -117,9 +117,8 @@ olsr_ioctl_add_route(const struct rt_entry *rt)
    * Send IPC route update message
    */
   if (olsr_cnf->ipc_connections > 0) {
-    ipc_route_send_rtentry(&rt->rt_dst.prefix,
-                           &rt->rt_best->rtp_nexthop.gateway,
-                           rt->rt_best->rtp_metric.hops, 1, if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
+    ipc_route_send_rtentry(&rt->rt_dst.prefix, &rt->rt_best->rtp_nexthop.gateway, rt->rt_best->rtp_metric.hops, 1,
+                           if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
   }
 
   return 0;
index ef4042c..f690c8a 100644 (file)
@@ -282,9 +282,8 @@ SetEnableRedirKey(unsigned long New)
   unsigned long Len;
   unsigned long Old;
 
-  if (RegOpenKeyEx
-      (HKEY_LOCAL_MACHINE,
-       "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", 0, KEY_READ | KEY_WRITE, &Key) != ERROR_SUCCESS)
+  if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", 0, KEY_READ | KEY_WRITE, &Key) !=
+      ERROR_SUCCESS)
     return -1;
 
   Len = sizeof(Old);