Index: lib/network.c =================================================================== RCS file: /var/cvsroot/quagga/lib/network.c,v retrieving revision 1.1.1.1 diff -u -w -b -r1.1.1.1 network.c --- lib/network.c 13 Dec 2002 20:15:29 -0000 1.1.1.1 +++ lib/network.c 9 Jun 2004 11:50:37 -0000 @@ -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 @@ /* 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: lib/network.h =================================================================== RCS file: /var/cvsroot/quagga/lib/network.h,v retrieving revision 1.1.1.1 diff -u -w -b -r1.1.1.1 network.h --- lib/network.h 13 Dec 2002 20:15:29 -0000 1.1.1.1 +++ lib/network.h 9 Jun 2004 11:50:37 -0000 @@ -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: lib/plist.c =================================================================== RCS file: /var/cvsroot/quagga/lib/plist.c,v retrieving revision 1.1.1.1 diff -u -w -b -r1.1.1.1 plist.c --- lib/plist.c 13 Dec 2002 20:15:29 -0000 1.1.1.1 +++ lib/plist.c 9 Jun 2004 11:50:38 -0000 @@ -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 @@ NULL, }; -struct prefix_master * +static struct prefix_master * prefix_master_get (afi_t afi) { if (afi == AFI_IP) @@ -148,7 +149,7 @@ return NULL; } -struct prefix_list * +static struct prefix_list * prefix_list_new () { struct prefix_list *new; @@ -157,13 +158,13 @@ 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 @@ return new; } -void +static void prefix_list_entry_free (struct prefix_list_entry *pentry) { XFREE (MTYPE_PREFIX_LIST_ENTRY, pentry); @@ -180,7 +181,7 @@ /* 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 @@ 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 @@ } /* 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 @@ (*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 @@ } /* Calculate new sequential number. */ -int +static int prefix_new_seq_get (struct prefix_list *plist) { int maxseq; @@ -394,7 +395,7 @@ } /* 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 @@ 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 @@ 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 @@ } } -void +static void prefix_list_entry_add (struct prefix_list *plist, struct prefix_list_entry *pentry) { @@ -523,17 +524,14 @@ { 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 @@ } /* 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } } -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 @@ 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 @@ return CMD_SUCCESS; } -int +static int vty_clear_prefix_list (struct vty *vty, afi_t afi, char *name, char *prefix) { struct prefix_master *master; @@ -2374,7 +2372,7 @@ #endif /* HAVE_IPV6 */ /* Configuration write function. */ -int +static int config_write_prefix_afi (afi_t afi, struct vty *vty) { struct prefix_list *plist; @@ -2481,10 +2479,6 @@ 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 @@ return plist->count; } -void +static void prefix_list_reset_orf () { struct prefix_list *plist; @@ -2651,13 +2645,13 @@ 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 @@ master->recent = NULL; } -void +static void prefix_list_init_ipv4 () { install_node (&prefix_node, config_write_prefix_ipv4); @@ -2760,13 +2754,13 @@ 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 @@ master->recent = NULL; } -void +static void prefix_list_init_ipv6 () { install_node (&prefix_ipv6_node, config_write_prefix_ipv6); Index: lib/stream.h =================================================================== RCS file: /var/cvsroot/quagga/lib/stream.h,v retrieving revision 1.1.1.1 diff -u -w -b -r1.1.1.1 stream.h --- lib/stream.h 13 Dec 2002 20:15:29 -0000 1.1.1.1 +++ lib/stream.h 9 Jun 2004 11:50:38 -0000 @@ -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_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: lib/zebra.h =================================================================== RCS file: /var/cvsroot/quagga/lib/zebra.h,v retrieving revision 1.16 diff -u -w -b -r1.16 zebra.h --- lib/zebra.h 9 Jun 2004 10:36:05 -0000 1.16 +++ lib/zebra.h 9 Jun 2004 11:50:38 -0000 @@ -207,13 +207,28 @@ #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) Index: ripd/ripd.c =================================================================== RCS file: /var/cvsroot/quagga/ripd/ripd.c,v retrieving revision 1.24 diff -u -w -b -r1.24 ripd.c --- ripd/ripd.c 6 Jun 2004 22:06:33 -0000 1.24 +++ ripd/ripd.c 9 Jun 2004 11:50:41 -0000 @@ -3745,8 +3745,9 @@ } /* 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 @@ void rip_distribute_update_all_wrapper(struct access_list *notused) { - rip_distribute_update_all(); + rip_distribute_update_all(NULL); } /* Delete all added rip route. */