Fix compiler warnings, strictly use long int and %lx for options.
authorGuus Sliepen <guus@tinc-vpn.org>
Fri, 22 Mar 2002 13:31:18 +0000 (13:31 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Fri, 22 Mar 2002 13:31:18 +0000 (13:31 +0000)
src/connection.c
src/edge.c
src/node.c
src/protocol.c
src/protocol_auth.c
src/protocol_edge.c
src/protocol_key.c
src/protocol_subnet.c

index 8620e4a..391982a 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: connection.c,v 1.1.2.28 2002/02/18 16:25:16 guus Exp $
+    $Id: connection.c,v 1.1.2.29 2002/03/22 13:31:18 guus Exp $
 */
 
 #include "config.h"
 */
 
 #include "config.h"
@@ -116,7 +116,7 @@ cp
   for(node = connection_tree->head; node; node = node->next)
     {
       c = (connection_t *)node->data;
   for(node = connection_tree->head; node; node = node->next)
     {
       c = (connection_t *)node->data;
-      syslog(LOG_DEBUG, _(" %s at %s options %ld socket %d status %04x"),
+      syslog(LOG_DEBUG, _(" %s at %s options %lx socket %d status %04x"),
              c->name, c->hostname, c->options, c->socket, c->status);
     }
     
              c->name, c->hostname, c->options, c->socket, c->status);
     }
     
index f0337e1..da1cdb4 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: edge.c,v 1.1.2.8 2002/03/22 11:43:46 guus Exp $
+    $Id: edge.c,v 1.1.2.9 2002/03/22 13:31:18 guus Exp $
 */
 
 #include "config.h"
 */
 
 #include "config.h"
@@ -201,7 +201,7 @@ cp
       from_udp = sockaddr2hostname(&e->from.udpaddress);
 //      to_tcp = sockaddr2hostname(&e->to.tcpaddress);
       to_udp = sockaddr2hostname(&e->to.udpaddress);
       from_udp = sockaddr2hostname(&e->from.udpaddress);
 //      to_tcp = sockaddr2hostname(&e->to.tcpaddress);
       to_udp = sockaddr2hostname(&e->to.udpaddress);
-      syslog(LOG_DEBUG, _(" %s at %s - %s at %s options %ld weight %d"),
+      syslog(LOG_DEBUG, _(" %s at %s - %s at %s options %lx weight %d"),
              e->from.node->name, from_udp,
             e->to.node->name, to_udp,
             e->options, e->weight);
              e->from.node->name, from_udp,
             e->to.node->name, to_udp,
             e->options, e->weight);
index 6e3b0f9..e4581cc 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: node.c,v 1.1.2.10 2002/02/18 16:25:16 guus Exp $
+    $Id: node.c,v 1.1.2.11 2002/03/22 13:31:18 guus Exp $
 */
 
 #include "config.h"
 */
 
 #include "config.h"
@@ -163,7 +163,7 @@ cp
   for(node = node_tree->head; node; node = node->next)
     {
       n = (node_t *)node->data;
   for(node = node_tree->head; node; node = node->next)
     {
       n = (node_t *)node->data;
-      syslog(LOG_DEBUG, _(" %s at %s cipher %d digest %d maclength %d compression %d options %ld status %04x nexthop %s via %s"),
+      syslog(LOG_DEBUG, _(" %s at %s cipher %d digest %d maclength %d compression %d options %lx status %04x nexthop %s via %s"),
              n->name, n->hostname, n->cipher?n->cipher->nid:0, n->digest?n->digest->type:0, n->maclength, n->compression, n->options,
              n->status, n->nexthop?n->nexthop->name:"-", n->via?n->via->name:"-");
     }
              n->name, n->hostname, n->cipher?n->cipher->nid:0, n->digest?n->digest->type:0, n->maclength, n->compression, n->options,
              n->status, n->nexthop?n->nexthop->name:"-", n->via?n->via->name:"-");
     }
index 9125cf6..9f8be7e 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol.c,v 1.28.4.125 2002/03/22 11:43:48 guus Exp $
+    $Id: protocol.c,v 1.28.4.126 2002/03/22 13:31:18 guus Exp $
 */
 
 #include "config.h"
 */
 
 #include "config.h"
@@ -74,7 +74,7 @@ cp
 
   if(len < 0 || len > MAXBUFSIZE-1)
     {
 
   if(len < 0 || len > MAXBUFSIZE-1)
     {
-      syslog(LOG_ERR, _("Output buffer overflow while sending request to %s (%s)"), request_name[request], c->name, c->hostname);
+      syslog(LOG_ERR, _("Output buffer overflow while sending request to %s (%s)"), c->name, c->hostname);
       return -1;
     }
 
       return -1;
     }
 
index 92e076a..cbe0958 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_auth.c,v 1.1.4.4 2002/03/22 11:43:48 guus Exp $
+    $Id: protocol_auth.c,v 1.1.4.5 2002/03/22 13:31:18 guus Exp $
 */
 
 #include "config.h"
 */
 
 #include "config.h"
@@ -473,7 +473,7 @@ cp
   gettimeofday(&now, NULL);
   c->estimated_weight = (now.tv_sec - c->start.tv_sec) * 1000 + (now.tv_usec - c->start.tv_usec) / 1000;
   sockaddr2str(&c->address, &address, &port);
   gettimeofday(&now, NULL);
   c->estimated_weight = (now.tv_sec - c->start.tv_sec) * 1000 + (now.tv_usec - c->start.tv_usec) / 1000;
   sockaddr2str(&c->address, &address, &port);
-  x = send_request(c, "%d %s %s %s %d %d", ACK, myport, address, port, c->estimated_weight, c->options);
+  x = send_request(c, "%d %s %s %s %d %lx", ACK, myport, address, port, c->estimated_weight, c->options);
   free(address);
   free(port);
 cp
   free(address);
   free(port);
 cp
@@ -519,12 +519,12 @@ int ack_h(connection_t *c)
   char hisport[MAX_STRING_SIZE];
   char *hisaddress, *dummy;
   int weight;
   char hisport[MAX_STRING_SIZE];
   char *hisaddress, *dummy;
   int weight;
-  int options;
+  long int options;
   node_t *n;
   connection_t *other;
   avl_node_t *node;
 cp
   node_t *n;
   connection_t *other;
   avl_node_t *node;
 cp
-  if(sscanf(c->buffer, "%*d "MAX_STRING" "MAX_STRING" %d %d", hisport, myaddress, &weight, &options) != 4)
+  if(sscanf(c->buffer, "%*d "MAX_STRING" "MAX_STRING" %d %lx", hisport, myaddress, &weight, &options) != 4)
     {
        syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "ACK", c->name, c->hostname);
        return -1;
     {
        syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "ACK", c->name, c->hostname);
        return -1;
index d6b55b0..7760eea 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_edge.c,v 1.1.4.5 2002/03/22 12:41:54 guus Exp $
+    $Id: protocol_edge.c,v 1.1.4.6 2002/03/22 13:31:18 guus Exp $
 */
 
 #include "config.h"
 */
 
 #include "config.h"
@@ -90,7 +90,7 @@ int add_edge_h(connection_t *c)
   int weight;
   avl_node_t *node;
 cp
   int weight;
   avl_node_t *node;
 cp
-  if(sscanf(c->buffer, "%*d %*lx "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" %lx %d",
+  if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" %lx %d",
             from_name, from_address, from_udpport,
            to_name, to_address, to_udpport,
            &options, &weight) != 8)
             from_name, from_address, from_udpport,
            to_name, to_address, to_udpport,
            &options, &weight) != 8)
@@ -226,7 +226,7 @@ int del_edge_h(connection_t *c)
   connection_t *other;
   avl_node_t *node;
 cp
   connection_t *other;
   avl_node_t *node;
 cp
-  if(sscanf(c->buffer, "%*d %*lx "MAX_STRING" "MAX_STRING"", from_name, to_name) != 2)
+  if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING"", from_name, to_name) != 2)
     {
       syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_EDGE",
              c->name, c->hostname);
     {
       syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_EDGE",
              c->name, c->hostname);
index dc44b53..016fbff 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_key.c,v 1.1.4.5 2002/03/21 23:11:53 guus Exp $
+    $Id: protocol_key.c,v 1.1.4.6 2002/03/22 13:31:18 guus Exp $
 */
 
 #include "config.h"
 */
 
 #include "config.h"
@@ -75,7 +75,7 @@ int key_changed_h(connection_t *c)
   connection_t *other;
   node_t *n;
 cp
   connection_t *other;
   node_t *n;
 cp
-  if(sscanf(c->buffer, "%*d %*lx "MAX_STRING, name) != 1)
+  if(sscanf(c->buffer, "%*d %*x "MAX_STRING, name) != 1)
     {
       syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "KEY_CHANGED",
              c->name, c->hostname);
     {
       syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "KEY_CHANGED",
              c->name, c->hostname);
index 3cea347..7f6cfc1 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_subnet.c,v 1.1.4.2 2002/03/21 23:11:53 guus Exp $
+    $Id: protocol_subnet.c,v 1.1.4.3 2002/03/22 13:31:18 guus Exp $
 */
 
 #include "config.h"
 */
 
 #include "config.h"
@@ -66,7 +66,7 @@ int add_subnet_h(connection_t *c)
   subnet_t *s;
   avl_node_t *node;
 cp
   subnet_t *s;
   avl_node_t *node;
 cp
-  if(sscanf(c->buffer, "%*d %*lx "MAX_STRING" "MAX_STRING, name, subnetstr) != 2)
+  if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING, name, subnetstr) != 2)
     {
       syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "ADD_SUBNET", c->name, c->hostname);
       return -1;
     {
       syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "ADD_SUBNET", c->name, c->hostname);
       return -1;
@@ -158,7 +158,7 @@ int del_subnet_h(connection_t *c)
   subnet_t *s, *find;
   avl_node_t *node;
 cp
   subnet_t *s, *find;
   avl_node_t *node;
 cp
-  if(sscanf(c->buffer, "%*d %*lx "MAX_STRING" "MAX_STRING, name, subnetstr) != 2)
+  if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING, name, subnetstr) != 2)
     {
       syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_SUBNET", c->name, c->hostname);
       return -1;
     {
       syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_SUBNET", c->name, c->hostname);
       return -1;