]> git.puffer.fish Git - mirror/frr.git/commitdiff
2004-06-11 Sowmini Varadhan <sowmini.varadhan@sun.com>
authorpaul <paul>
Fri, 11 Jun 2004 11:27:03 +0000 (11:27 +0000)
committerpaul <paul>
Fri, 11 Jun 2004 11:27:03 +0000 (11:27 +0000)
        * filter.c: (access_list_remark_cmd) buffer_putstr doesnt need cast
          to u_char. (ipv6_access_list_remark_cmd) ditto.
          if.c: ditto
        * network.c: (readn/writen) pointer arg should be type u_char.
        * plist.c: needs to include stream.h, not declare stream functions
          internally.
          (various) Add static qualifier to internal functions.
          (prefix_list_type_str) extraneous breaks in switch statement.
          (ip_prefix_list_description_cmd) buffer_putstr doesnt need cast
        * stream.h: depends on plist.h and export stream_put_prefix
        * vty.c: (vty_<telnet option build functions>) should use
          unsigned char, telnet options are 0 -> 255.
        * zclient.c: various u_char<->char type cleanups.
        * zebra.h: Having to define CMSG_* can apply to more than just
          BSDI_NRL.
        * ripd.c: (rip_distribute_update_all) distribute list hook
          function pointer prototype requires struct prefix_list * arg.
          (rip_distribute_update_all_wrapper) update to pass required arg,
          NULL.

12 files changed:
lib/ChangeLog
lib/filter.c
lib/if.c
lib/network.c
lib/network.h
lib/plist.c
lib/stream.h
lib/vty.c
lib/zclient.c
lib/zebra.h
ripd/ChangeLog
ripd/ripd.c

index 3573ac1224cf5077cc3930bd5cca22eed0564223..ab390734a4d266ae389929d3cdf4093525c22707 100644 (file)
@@ -1,3 +1,21 @@
+2004-06-11 Sowmini Varadhan <sowmini.varadhan@sun.com>
+
+       * filter.c: (access_list_remark_cmd) buffer_putstr doesnt need cast
+         to u_char. (ipv6_access_list_remark_cmd) ditto.
+         if.c: ditto
+       * network.c: (readn/writen) pointer arg should be type u_char.
+       * plist.c: needs to include stream.h, not declare stream functions
+         internally.
+         (various) Add static qualifier to internal functions.
+         (prefix_list_type_str) extraneous breaks in switch statement.
+         (ip_prefix_list_description_cmd) buffer_putstr doesnt need cast
+       * stream.h: depends on plist.h and export stream_put_prefix
+       * vty.c: (vty_<telnet option build functions>) should use 
+         unsigned char, telnet options are 0 -> 255.
+       * zclient.c: various u_char<->char type cleanups.
+       * zebra.h: Having to define CMSG_* can apply to more than just
+         BSDI_NRL. 
+         
 2004-06-09 Paul Jakma <paul@dishone.st>
 
        * config.h: __attribute__ is a gcc'ism
index a483ce2302ae0779706694efcafff4f66f56cc53..cd4bc0a5b1468299e8e6be1ed723ae53a7dff242 100644 (file)
@@ -1374,7 +1374,7 @@ DEFUN (access_list_remark,
   b = buffer_new (1024);
   for (i = 1; i < argc; i++)
     {
-      buffer_putstr (b, (u_char *)argv[i]);
+      buffer_putstr (b, argv[i]);
       buffer_putc (b, ' ');
     }
   buffer_putc (b, '\0');
@@ -1556,7 +1556,7 @@ DEFUN (ipv6_access_list_remark,
   b = buffer_new (1024);
   for (i = 1; i < argc; i++)
     {
-      buffer_putstr (b, (u_char *)argv[i]);
+      buffer_putstr (b, argv[i]);
       buffer_putc (b, ' ');
     }
   buffer_putc (b, '\0');
index e76f609231e1d75babbfe84a9896c6d27e26bfd5..ff5ec50aaca18c84eb38f36e5d224ba06ef684cb 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -462,7 +462,7 @@ DEFUN (interface_desc,
   b = buffer_new (1024);
   for (i = 0; i < argc; i++)
     {
-      buffer_putstr (b, (u_char *)argv[i]);
+      buffer_putstr (b, argv[i]);
       buffer_putc (b, ' ');
     }
   buffer_putc (b, '\0');
index b68761bcced4d2d0d8be5435c774ffab0abb51cb..d105db48d31bd179a3578b67b83e1624e54c8be4 100644 (file)
@@ -24,7 +24,7 @@
 
 /* Read nbytes from fd and store into ptr. */
 int
-readn (int fd, char *ptr, int nbytes)
+readn (int fd, u_char *ptr, int nbytes)
 {
   int nleft;
   int nread;
@@ -50,7 +50,7 @@ readn (int fd, char *ptr, int nbytes)
 
 /* Write nbytes from ptr to fd. */
 int
-writen(int fd, char *ptr, int nbytes)
+writen(int fd, u_char *ptr, int nbytes)
 {
   int nleft;
   int nwritten;
index a0212950733b2cfdd7f3518f648aec1a9440daf2..0544361fe82127a248d3d99367f881546b0ab605 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef _ZEBRA_NETWORK_H
 #define _ZEBRA_NETWORK_H
 
-int readn (int, char *, int);
-int writen (int, char *, int);
+int readn (int, u_char *, int);
+int writen (int, u_char *, int);
 
 #endif /* _ZEBRA_NETWORK_H */
index c2aeea5b899f01c2bcbfc0b5f8ae532c9594f676..4069f8618f5408dc9e971f56a46511407d605690 100644 (file)
@@ -27,6 +27,7 @@
 #include "plist.h"
 #include "sockunion.h"
 #include "buffer.h"
+#include "stream.h"
 
 /* Each prefix-list's entry. */
 struct prefix_list_entry
@@ -109,7 +110,7 @@ static struct prefix_master prefix_master_orf =
   NULL,
 };
 \f
-struct prefix_master *
+static struct prefix_master *
 prefix_master_get (afi_t afi)
 {
   if (afi == AFI_IP)
@@ -148,7 +149,7 @@ prefix_list_lookup (afi_t afi, char *name)
   return NULL;
 }
 
-struct prefix_list *
+static struct prefix_list *
 prefix_list_new ()
 {
   struct prefix_list *new;
@@ -157,13 +158,13 @@ prefix_list_new ()
   return new;
 }
 
-void
+static void
 prefix_list_free (struct prefix_list *plist)
 {
   XFREE (MTYPE_PREFIX_LIST, plist);
 }
 
-struct prefix_list_entry *
+static struct prefix_list_entry *
 prefix_list_entry_new ()
 {
   struct prefix_list_entry *new;
@@ -172,7 +173,7 @@ prefix_list_entry_new ()
   return new;
 }
 
-void
+static void
 prefix_list_entry_free (struct prefix_list_entry *pentry)
 {
   XFREE (MTYPE_PREFIX_LIST_ENTRY, pentry);
@@ -180,7 +181,7 @@ prefix_list_entry_free (struct prefix_list_entry *pentry)
 
 /* Insert new prefix list to list of prefix_list.  Each prefix_list
    is sorted by the name. */
-struct prefix_list *
+static struct prefix_list *
 prefix_list_insert (afi_t afi, char *name)
 {
   int i;
@@ -270,7 +271,7 @@ prefix_list_insert (afi_t afi, char *name)
   return plist;
 }
 
-struct prefix_list *
+static struct prefix_list *
 prefix_list_get (afi_t afi, char *name)
 {
   struct prefix_list *plist;
@@ -283,7 +284,7 @@ prefix_list_get (afi_t afi, char *name)
 }
 
 /* Delete prefix-list from prefix_list_master and free it. */
-void
+static void
 prefix_list_delete (struct prefix_list *plist)
 {
   struct prefix_list_list *list;
@@ -332,7 +333,7 @@ prefix_list_delete (struct prefix_list *plist)
     (*master->delete_hook) ();
 }
 
-struct prefix_list_entry *
+static struct prefix_list_entry *
 prefix_list_entry_make (struct prefix *prefix, enum prefix_list_type type,
                        int seq, int le, int ge, int any)
 {
@@ -373,7 +374,7 @@ prefix_list_delete_hook (void (*func) (struct prefix_list *plist))
 }
 
 /* Calculate new sequential number. */
-int
+static int
 prefix_new_seq_get (struct prefix_list *plist)
 {
   int maxseq;
@@ -394,7 +395,7 @@ prefix_new_seq_get (struct prefix_list *plist)
 }
 
 /* Return prefix list entry which has same seq number. */
-struct prefix_list_entry *
+static struct prefix_list_entry *
 prefix_seq_check (struct prefix_list *plist, int seq)
 {
   struct prefix_list_entry *pentry;
@@ -405,7 +406,7 @@ prefix_seq_check (struct prefix_list *plist, int seq)
   return NULL;
 }
 
-struct prefix_list_entry *
+static struct prefix_list_entry *
 prefix_list_entry_lookup (struct prefix_list *plist, struct prefix *prefix,
                          enum prefix_list_type type, int seq, int le, int ge)
 {
@@ -428,7 +429,7 @@ prefix_list_entry_lookup (struct prefix_list *plist, struct prefix *prefix,
   return NULL;
 }
 
-void
+static void
 prefix_list_entry_delete (struct prefix_list *plist, 
                          struct prefix_list_entry *pentry,
                          int update_list)
@@ -460,7 +461,7 @@ prefix_list_entry_delete (struct prefix_list *plist,
     }
 }
 
-void
+static void
 prefix_list_entry_add (struct prefix_list *plist,
                       struct prefix_list_entry *pentry)
 {
@@ -523,17 +524,14 @@ prefix_list_type_str (struct prefix_list_entry *pentry)
     {
     case PREFIX_PERMIT:
       return "permit";
-      break;
     case PREFIX_DENY:
       return "deny";
-      break;
     default:
       return "";
-      break;
     }
 }
 
-int
+static int
 prefix_list_entry_match (struct prefix_list_entry *pentry, struct prefix *p)
 {
   int ret;
@@ -624,7 +622,7 @@ prefix_list_print (struct prefix_list *plist)
 }
 \f
 /* Retrun 1 when plist already include pentry policy. */
-struct prefix_list_entry *
+static struct prefix_list_entry *
 prefix_entry_dup_check (struct prefix_list *plist,
                        struct prefix_list_entry *new)
 {
@@ -648,7 +646,7 @@ prefix_entry_dup_check (struct prefix_list *plist,
   return NULL;
 }
 
-int
+static int
 vty_invalid_prefix_range (struct vty *vty, char *prefix)
 {
   vty_out (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value%s",
@@ -656,7 +654,7 @@ vty_invalid_prefix_range (struct vty *vty, char *prefix)
   return CMD_WARNING;
 }
 
-int
+static int
 vty_prefix_list_install (struct vty *vty, afi_t afi,
                         char *name, char *seq, char *typestr,
                         char *prefix, char *ge, char *le)
@@ -775,7 +773,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi,
   return CMD_SUCCESS;
 }
 
-int
+static int
 vty_prefix_list_uninstall (struct vty *vty, afi_t afi,
                           char *name, char *seq, char *typestr,
                           char *prefix, char *ge, char *le)
@@ -879,7 +877,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi,
   return CMD_SUCCESS;
 }
 
-int
+static int
 vty_prefix_list_desc_unset (struct vty *vty, afi_t afi, char *name)
 {
   struct prefix_list *plist;
@@ -913,7 +911,7 @@ enum display_type
   first_match_display
 };
 
-void
+static void
 vty_show_prefix_entry (struct vty *vty, afi_t afi, struct prefix_list *plist,
                       struct prefix_master *master, enum display_type dtype,
                       int seqnum)
@@ -983,7 +981,7 @@ vty_show_prefix_entry (struct vty *vty, afi_t afi, struct prefix_list *plist,
     }
 }
 
-int
+static int
 vty_show_prefix_list (struct vty *vty, afi_t afi, char *name,
                      char *seq, enum display_type dtype)
 {
@@ -1027,7 +1025,7 @@ vty_show_prefix_list (struct vty *vty, afi_t afi, char *name,
   return CMD_SUCCESS;
 }
 
-int
+static int
 vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, char *name, 
                             char *prefix, enum display_type type)
 {
@@ -1099,7 +1097,7 @@ vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, char *name,
   return CMD_SUCCESS;
 }
 
-int
+static int
 vty_clear_prefix_list (struct vty *vty, afi_t afi, char *name, char *prefix)
 {
   struct prefix_master *master;
@@ -1577,7 +1575,7 @@ DEFUN (ip_prefix_list_description,
   b = buffer_new (1024);
   for (i = 1; i < argc; i++)
     {
-      buffer_putstr (b, (u_char *)argv[i]);
+      buffer_putstr (b, argv[i]);
       buffer_putc (b, ' ');
     }
   buffer_putc (b, '\0');
@@ -2187,7 +2185,7 @@ DEFUN (ipv6_prefix_list_description,
   b = buffer_new (1024);
   for (i = 1; i < argc; i++)
     {
-      buffer_putstr (b, (u_char *)argv[i]);
+      buffer_putstr (b, argv[i]);
       buffer_putc (b, ' ');
     }
   buffer_putc (b, '\0');
@@ -2374,7 +2372,7 @@ DEFUN (clear_ipv6_prefix_list_name_prefix,
 #endif /* HAVE_IPV6 */
 \f
 /* Configuration write function. */
-int
+static int
 config_write_prefix_afi (afi_t afi, struct vty *vty)
 {
   struct prefix_list *plist;
@@ -2481,10 +2479,6 @@ config_write_prefix_afi (afi_t afi, struct vty *vty)
   return write;
 }
 
-int stream_putc (struct stream *, u_char);
-int stream_putl (struct stream *, u_int32_t);
-int stream_put_prefix (struct stream *, struct prefix *);
-
 struct stream *
 prefix_bgp_orf_entry (struct stream *s, struct prefix_list *plist,
                      u_char init_flag, u_char permit_flag, u_char deny_flag)
@@ -2610,7 +2604,7 @@ prefix_bgp_show_prefix_list (struct vty *vty, afi_t afi, char *name)
   return plist->count;
 }
 
-void
+static void
 prefix_list_reset_orf ()
 {
   struct prefix_list *plist;
@@ -2651,13 +2645,13 @@ struct cmd_node prefix_node =
   1
 };
 
-int
+static int
 config_write_prefix_ipv4 (struct vty *vty)
 {
   return config_write_prefix_afi (AFI_IP, vty);
 }
 
-void
+static void
 prefix_list_reset_ipv4 ()
 {
   struct prefix_list *plist;
@@ -2689,7 +2683,7 @@ prefix_list_reset_ipv4 ()
   master->recent = NULL;
 }
 
-void
+static void
 prefix_list_init_ipv4 ()
 {
   install_node (&prefix_node, config_write_prefix_ipv4);
@@ -2760,13 +2754,13 @@ struct cmd_node prefix_ipv6_node =
   1
 };
 
-int
+static int
 config_write_prefix_ipv6 (struct vty *vty)
 {
   return config_write_prefix_afi (AFI_IP6, vty);
 }
 
-void
+static void
 prefix_list_reset_ipv6 ()
 {
   struct prefix_list *plist;
@@ -2798,7 +2792,7 @@ prefix_list_reset_ipv6 ()
   master->recent = NULL;
 }
 
-void
+static void
 prefix_list_init_ipv6 ()
 {
   install_node (&prefix_ipv6_node, config_write_prefix_ipv6);
index c6ef3c813491b690598e1b3284488fa859cf8353..f7a94ea3744f38d83e4476da9cb7b276e71fc49d 100644 (file)
@@ -23,6 +23,8 @@
 #ifndef _ZEBRA_STREAM_H
 #define _ZEBRA_STREAM_H
 
+#include "prefix.h"
+
 /* Stream buffer. */
 struct stream
 {
@@ -82,6 +84,7 @@ int stream_putl (struct stream *, u_int32_t);
 int stream_putl_at (struct stream *, unsigned long, u_int32_t);
 int stream_put_ipv4 (struct stream *, u_int32_t);
 int stream_put_in_addr (struct stream *, struct in_addr *);
+int stream_put_prefix (struct stream *, struct prefix *);
 
 void stream_get (void *, struct stream *, size_t);
 u_char stream_getc (struct stream *);
index 831660d980d5c4a8d394d1887fefbfcc0cc7687d..4b23487d8ed09e3e254cc77397ace43a1992dcad 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -221,7 +221,7 @@ vty_prompt (struct vty *vty)
 void
 vty_will_echo (struct vty *vty)
 {
-  char cmd[] = { IAC, WILL, TELOPT_ECHO, '\0' };
+  unsigned char cmd[] = { IAC, WILL, TELOPT_ECHO, '\0' };
   vty_out (vty, "%s", cmd);
 }
 
@@ -229,7 +229,7 @@ vty_will_echo (struct vty *vty)
 static void
 vty_will_suppress_go_ahead (struct vty *vty)
 {
-  char cmd[] = { IAC, WILL, TELOPT_SGA, '\0' };
+  unsigned char cmd[] = { IAC, WILL, TELOPT_SGA, '\0' };
   vty_out (vty, "%s", cmd);
 }
 
@@ -237,7 +237,7 @@ vty_will_suppress_go_ahead (struct vty *vty)
 static void
 vty_dont_linemode (struct vty *vty)
 {
-  char cmd[] = { IAC, DONT, TELOPT_LINEMODE, '\0' };
+  unsigned char cmd[] = { IAC, DONT, TELOPT_LINEMODE, '\0' };
   vty_out (vty, "%s", cmd);
 }
 
@@ -245,7 +245,7 @@ vty_dont_linemode (struct vty *vty)
 static void
 vty_do_window_size (struct vty *vty)
 {
-  char cmd[] = { IAC, DO, TELOPT_NAWS, '\0' };
+  unsigned char cmd[] = { IAC, DO, TELOPT_NAWS, '\0' };
   vty_out (vty, "%s", cmd);
 }
 
@@ -254,7 +254,7 @@ vty_do_window_size (struct vty *vty)
 static void
 vty_dont_lflow_ahead (struct vty *vty)
 {
-  char cmd[] = { IAC, DONT, TELOPT_LFLOW, '\0' };
+  unsigned char cmd[] = { IAC, DONT, TELOPT_LFLOW, '\0' };
   vty_out (vty, "%s", cmd);
 }
 #endif /* 0 */
index dcfa45f4577a0ea74f38a1903159a7172ce168ef..3b68338753e61ac68c658a4699f61654271473f4 100644 (file)
@@ -512,7 +512,7 @@ struct interface *
 zebra_interface_add_read (struct stream *s)
 {
   struct interface *ifp;
-  u_char ifname_tmp[INTERFACE_NAMSIZ];
+  char ifname_tmp[INTERFACE_NAMSIZ];
 
   /* Read interface name. */
   stream_get (ifname_tmp, s, INTERFACE_NAMSIZ);
@@ -556,7 +556,7 @@ struct interface *
 zebra_interface_state_read (struct stream *s)
 {
   struct interface *ifp;
-  u_char ifname_tmp[INTERFACE_NAMSIZ];
+  char ifname_tmp[INTERFACE_NAMSIZ];
 
   /* Read interface name. */
   stream_get (ifname_tmp, s, INTERFACE_NAMSIZ);
index ed3024db84983e48f4c14e5ce7e81c7197e14d4b..7ba01d5670d724bf8915bfe5ad94c96d808a005f 100644 (file)
@@ -207,14 +207,29 @@ typedef int socklen_t;
 
 #define IN6_ARE_ADDR_EQUAL IN6_IS_ADDR_EQUAL
 
-/* BSD/OS 4.0 has lost belows defines, it should appear at
-   /usr/include/sys/socket.h.  */
-#define CMSG_ALIGN(n)           (((n) + 3) & ~3)
-#define CMSG_SPACE(l)   (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(l))
-#define CMSG_LEN(l)     (CMSG_ALIGN(sizeof(struct cmsghdr)) + (l))
-
 #endif /* BSDI_NRL */
 
+/* 
+ * RFC 2553-bis defines not available on some systems.
+ */
+#ifndef _CMSG_DATA_ALIGN
+#define _CMSG_DATA_ALIGN(n)           (((n) + 3) & ~3)
+#endif /* _CMSG_DATA_ALIGN */
+
+#ifndef _CMSG_HDR_ALIGN
+#define _CMSG_HDR_ALIGN(n)            (((n) + 3) & ~3)
+#endif /* _CMSG_HDR_ALIGN */
+
+#ifndef CMSG_SPACE
+#define CMSG_SPACE(l)       (_CMSG_DATA_ALIGN(sizeof(struct cmsghdr)) + \
+                              _CMSG_HDR_ALIGN(l))
+#endif  /* CMSG_SPACE */
+
+
+#ifndef CMSG_LEN
+#define CMSG_LEN(l)         (_CMSG_DATA_ALIGN(sizeof(struct cmsghdr)) + (l))
+#endif /* CMSG_LEN */
+
 #if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5
 #define __attribute__(x)
 #endif  /* !__GNUC__ */
index 848efee41081c3ef9c8197c195db0d872b7cfc7c..2080333806088405a03fa45635c7f97746f1b378 100644 (file)
@@ -1,3 +1,10 @@
+2004-06-11 Sowmini Varadhan <sowmini.varadhan@sun.com>
+
+       * ripd.c: (rip_distribute_update_all) distribute list hook
+         function pointer prototype requires struct prefix_list * arg.
+         (rip_distribute_update_all_wrapper) update to pass required arg,
+         NULL.
+        
 2004-06-06 Paul Jakma <paul.jakma@sun.com>
 
        * ripd.h: Add define for the RIPv2 Authentication Data family
index 691482272946ccae71cb5e033be2c7dd6a0c18bd..8b76073c0251bb8fdc9f83efcba0023cb895cde1 100644 (file)
@@ -3745,8 +3745,9 @@ rip_distribute_update_interface (struct interface *ifp)
 }
 
 /* Update all interface's distribute list. */
+/* ARGSUSED */
 void
-rip_distribute_update_all ()
+rip_distribute_update_all (struct prefix_list *notused)
 {
   struct interface *ifp;
   listnode node;
@@ -3761,7 +3762,7 @@ rip_distribute_update_all ()
 void
 rip_distribute_update_all_wrapper(struct access_list *notused)
 {
-        rip_distribute_update_all();
+        rip_distribute_update_all(NULL);
 }
 \f
 /* Delete all added rip route. */