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.
* 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.
diff --git a/lib/plist.c b/lib/plist.c
index c2aeea5..4069f86 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -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;
@@ -1577,7 +1575,7 @@
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 @@
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 @@
#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);