2005-10-26 Paul Jakma <paul.jakma@sun.com>

	* (general) static/extern functions and definitions.
	* rip_interface.h: new file, export the public functions from
	  rip_interface.c
diff --git a/ripd/ChangeLog b/ripd/ChangeLog
index 3399868..8e5ba39 100644
--- a/ripd/ChangeLog
+++ b/ripd/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-26 Paul Jakma <paul.jakma@sun.com>
+
+	* (general) static/extern functions and definitions.
+	* rip_interface.h: new file, export the public functions from
+	  rip_interface.c
+
 2005-10-17 Vincent Jardin <vincent.jardin@6wind.com>
 
 	* ripd.c: rip_create_socket() for each packet, it does not bind to the
diff --git a/ripd/rip_debug.c b/ripd/rip_debug.c
index fd735d0..d788ea7 100644
--- a/ripd/rip_debug.c
+++ b/ripd/rip_debug.c
@@ -210,7 +210,7 @@
   1
 };
 
-int
+static int
 config_write_debug (struct vty *vty)
 {
   int write = 0;
@@ -251,7 +251,7 @@
 }
 
 void
-rip_debug_reset ()
+rip_debug_reset (void)
 {
   rip_debug_event = 0;
   rip_debug_packet = 0;
@@ -259,7 +259,7 @@
 }
 
 void
-rip_debug_init ()
+rip_debug_init (void)
 {
   rip_debug_event = 0;
   rip_debug_packet = 0;
diff --git a/ripd/rip_debug.h b/ripd/rip_debug.h
index 3b44d0c..f3a07ee 100644
--- a/ripd/rip_debug.h
+++ b/ripd/rip_debug.h
@@ -48,7 +48,7 @@
 extern unsigned long rip_debug_packet;
 extern unsigned long rip_debug_zebra;
 
-void rip_debug_init ();
-void rip_debug_reset ();
+extern void rip_debug_init (void);
+extern void rip_debug_reset (void);
 
 #endif /* _ZEBRA_RIP_DEBUG_H */
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 765e59b..17b25ff 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -40,15 +40,16 @@
 
 #include "ripd/ripd.h"
 #include "ripd/rip_debug.h"
-
-void rip_enable_apply (struct interface *);
-void rip_passive_interface_apply (struct interface *);
-int rip_if_down(struct interface *ifp);
-int rip_enable_if_lookup (const char *ifname);
-int rip_enable_network_lookup2 (struct connected *connected);
-void rip_enable_apply_all ();
-
-
+#include "ripd/rip_interface.h"
+
+/* static prototypes */
+static void rip_enable_apply (struct interface *);
+static void rip_passive_interface_apply (struct interface *);
+static int rip_if_down(struct interface *ifp);
+static int rip_enable_if_lookup (const char *ifname);
+static int rip_enable_network_lookup2 (struct connected *connected);
+static void rip_enable_apply_all (void);
+
 struct message ri_version_msg[] = 
 {
   {RI_RIP_VERSION_1,       "1"},
@@ -70,7 +71,7 @@
 vector Vrip_passive_nondefault;
 
 /* Join to the RIP version 2 multicast group. */
-int
+static int
 ipv4_multicast_join (int sock, 
 		     struct in_addr group, 
 		     struct in_addr ifa,
@@ -92,7 +93,7 @@
 }
 
 /* Leave from the RIP version 2 multicast group. */
-int
+static int
 ipv4_multicast_leave (int sock, 
 		      struct in_addr group, 
 		      struct in_addr ifa,
@@ -113,8 +114,8 @@
 }
 
 /* Allocate new RIP's interface configuration. */
-struct rip_interface *
-rip_interface_new ()
+static struct rip_interface *
+rip_interface_new (void)
 {
   struct rip_interface *ri;
 
@@ -164,7 +165,7 @@
 }
 
 /* Send RIP request packet to specified interface. */
-void
+static void
 rip_request_interface_send (struct interface *ifp, u_char version)
 {
   struct sockaddr_in to;
@@ -214,7 +215,7 @@
 }
 
 /* This will be executed when interface goes up. */
-void
+static void
 rip_request_interface (struct interface *ifp)
 {
   struct rip_interface *ri;
@@ -244,7 +245,7 @@
 }
 
 /* Send RIP request to the neighbor. */
-void
+static void
 rip_request_neighbor (struct in_addr addr)
 {
   struct sockaddr_in to;
@@ -257,8 +258,8 @@
 }
 
 /* Request routes at all interfaces. */
-void
-rip_request_neighbor_all ()
+static void
+rip_request_neighbor_all (void)
 {
   struct route_node *rp;
 
@@ -275,7 +276,7 @@
 }
 
 /* Multicast packet receive socket. */
-int
+static int
 rip_multicast_join (struct interface *ifp, int sock)
 {
   struct listnode *cnode;
@@ -307,7 +308,7 @@
 }
 
 /* Leave from multicast group. */
-void
+static void
 rip_multicast_leave (struct interface *ifp, int sock)
 {
   struct listnode *cnode;
@@ -336,7 +337,7 @@
 }
 
 /* Is there and address on interface that I could use ? */
-int
+static int
 rip_if_ipv4_address_check (struct interface *ifp)
 {
   struct listnode *nn;
@@ -553,7 +554,7 @@
 }
 
 void
-rip_interface_clean ()
+rip_interface_clean (void)
 {
   struct listnode *node;
   struct interface *ifp;
@@ -576,7 +577,7 @@
 }
 
 void
-rip_interface_reset ()
+rip_interface_reset (void)
 {
   struct listnode *node;
   struct interface *ifp;
@@ -694,7 +695,8 @@
 }
 
 static void
-rip_apply_address_add (struct connected *ifc) {
+rip_apply_address_add (struct connected *ifc)
+{
   struct prefix_ipv4 address;
   struct prefix *p;
 
@@ -815,7 +817,7 @@
 /* Check interface is enabled by network statement. */
 /* Check wether the interface has at least a connected prefix that
  * is within the ripng_enable_network table. */
-int
+static int
 rip_enable_network_lookup_if (struct interface *ifp)
 {
   struct listnode *node, *nnode;
@@ -876,7 +878,7 @@
   return -1;
 }
 /* Add RIP enable network. */
-int
+static int
 rip_enable_network_add (struct prefix *p)
 {
   struct route_node *node;
@@ -898,7 +900,7 @@
 }
 
 /* Delete RIP enable network. */
-int
+static int
 rip_enable_network_delete (struct prefix *p)
 {
   struct route_node *node;
@@ -923,7 +925,7 @@
 }
 
 /* Check interface is enabled by ifname statement. */
-int
+static int
 rip_enable_if_lookup (const char *ifname)
 {
   unsigned int i;
@@ -937,7 +939,7 @@
 }
 
 /* Add interface to rip_enable_if. */
-int
+static int
 rip_enable_if_add (const char *ifname)
 {
   int ret;
@@ -954,7 +956,7 @@
 }
 
 /* Delete interface from rip_enable_if. */
-int
+static int
 rip_enable_if_delete (const char *ifname)
 {
   int index;
@@ -974,7 +976,7 @@
 }
 
 /* Join to multicast group and send request to the interface. */
-int
+static int
 rip_interface_wakeup (struct thread *t)
 {
   struct interface *ifp;
@@ -1004,7 +1006,7 @@
 
 int rip_redistribute_check (int);
 
-void
+static void
 rip_connect_set (struct interface *ifp, int set)
 {
   struct listnode *node, *nnode;
@@ -1140,7 +1142,7 @@
 }
 
 /* Add new RIP neighbor to the neighbor tree. */
-int
+static int
 rip_neighbor_add (struct prefix_ipv4 *p)
 {
   struct route_node *node;
@@ -1156,7 +1158,7 @@
 }
 
 /* Delete RIP neighbor from the neighbor tree. */
-int
+static int
 rip_neighbor_delete (struct prefix_ipv4 *p)
 {
   struct route_node *node;
@@ -1203,7 +1205,7 @@
 }
 
 /* Utility function for looking up passive interface settings. */
-int
+static int
 rip_passive_nondefault_lookup (const char *ifname)
 {
   unsigned int i;
@@ -1230,8 +1232,8 @@
     zlog_debug ("interface %s: passive = %d",ifp->name,ri->passive);
 }
 
-void
-rip_passive_interface_apply_all ()
+static void
+rip_passive_interface_apply_all (void)
 {
   struct interface *ifp;
   struct listnode *node, *nnode;
@@ -1241,7 +1243,7 @@
 }
 
 /* Passive interface. */
-int
+static int
 rip_passive_nondefault_set (struct vty *vty, const char *ifname)
 {
   if (rip_passive_nondefault_lookup (ifname) >= 0)
@@ -1254,7 +1256,7 @@
   return CMD_SUCCESS;
 }
 
-int
+static int
 rip_passive_nondefault_unset (struct vty *vty, const char *ifname)
 {
   int i;
@@ -1275,7 +1277,7 @@
 
 /* Free all configured RIP passive-interface settings. */
 void
-rip_passive_nondefault_clean ()
+rip_passive_nondefault_clean (void)
 {
   unsigned int i;
   char *str;
@@ -1968,7 +1970,7 @@
 }
 
 /* Write rip configuration of each interface. */
-int
+static int
 rip_interface_config_write (struct vty *vty)
 {
   struct listnode *node;
@@ -2109,7 +2111,7 @@
 };
 
 /* Called when interface structure allocated. */
-int
+static int
 rip_interface_new_hook (struct interface *ifp)
 {
   ifp->info = rip_interface_new ();
@@ -2117,7 +2119,7 @@
 }
 
 /* Called when interface structure deleted. */
-int
+static int
 rip_interface_delete_hook (struct interface *ifp)
 {
   XFREE (MTYPE_RIP_INTERFACE, ifp->info);
@@ -2127,7 +2129,7 @@
 
 /* Allocate and initialize interface vector. */
 void
-rip_if_init ()
+rip_if_init (void)
 {
   /* Default initial size of interface vector. */
   if_init();
diff --git a/ripd/rip_interface.h b/ripd/rip_interface.h
new file mode 100644
index 0000000..8926cce
--- /dev/null
+++ b/ripd/rip_interface.h
@@ -0,0 +1,31 @@
+/* RIP interface routines
+ *
+ * This file is part of Quagga
+ *
+ * Quagga is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * Quagga is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Quagga; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.  
+ */
+
+#ifndef _QUAGGA_RIP_INTERFACE_H
+#define _QUAGGA_RIP_INTERFACE_H
+
+extern int rip_interface_down (int , struct zclient *, zebra_size_t);
+extern int rip_interface_up (int , struct zclient *, zebra_size_t);
+extern int rip_interface_add (int , struct zclient *, zebra_size_t);
+extern int rip_interface_delete (int , struct zclient *, zebra_size_t);
+extern int rip_interface_address_add (int , struct zclient *, zebra_size_t);
+extern int rip_interface_address_delete (int , struct zclient *, zebra_size_t);
+
+#endif /* _QUAGGA_RIP_INTERFACE_H */
diff --git a/ripd/rip_main.c b/ripd/rip_main.c
index c9b45e8..88e6367 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -123,7 +123,7 @@
 }
 
 /* SIGHUP handler. */
-void 
+static void 
 sighup (void)
 {
   zlog_info ("SIGHUP received");
@@ -141,7 +141,7 @@
 }
 
 /* SIGINT handler. */
-void
+static void
 sigint (void)
 {
   zlog_notice ("Terminating on signal");
@@ -153,13 +153,13 @@
 }
 
 /* SIGUSR1 handler. */
-void
+static void
 sigusr1 (void)
 {
   zlog_rotate (NULL);
 }
 
-struct quagga_signal_t ripd_signals[] =
+static struct quagga_signal_t ripd_signals[] =
 {
   { 
     .signal = SIGHUP,
diff --git a/ripd/rip_offset.c b/ripd/rip_offset.c
index 61f1376..e7d71f6 100644
--- a/ripd/rip_offset.c
+++ b/ripd/rip_offset.c
@@ -28,6 +28,8 @@
 #include "linklist.h"
 #include "memory.h"
 
+#include "ripd/ripd.h"
+
 #define RIP_OFFSET_LIST_IN  0
 #define RIP_OFFSET_LIST_OUT 1
 #define RIP_OFFSET_LIST_MAX 2
@@ -46,7 +48,7 @@
 
 static struct list *rip_offset_list_master;
 
-int
+static int
 strcmp_safe (const char *s1, const char *s2)
 {
   if (s1 == NULL && s2 == NULL)
@@ -58,8 +60,8 @@
   return strcmp (s1, s2);
 }
 
-struct rip_offset_list *
-rip_offset_list_new ()
+static struct rip_offset_list *
+rip_offset_list_new (void)
 {
   struct rip_offset_list *new;
 
@@ -68,13 +70,13 @@
   return new;
 }
 
-void
+static void
 rip_offset_list_free (struct rip_offset_list *offset)
 {
   XFREE (MTYPE_RIP_OFFSET_LIST, offset);
 }
 
-struct rip_offset_list *
+static struct rip_offset_list *
 rip_offset_list_lookup (const char *ifname)
 {
   struct rip_offset_list *offset;
@@ -88,7 +90,7 @@
   return NULL;
 }
 
-struct rip_offset_list *
+static struct rip_offset_list *
 rip_offset_list_get (const char *ifname)
 {
   struct rip_offset_list *offset;
@@ -105,7 +107,7 @@
   return offset;
 }
 
-int
+static int
 rip_offset_list_set (struct vty *vty, const char *alist, const char *direct_str,
 		     const char *metric_str, const char *ifname)
 {
@@ -143,7 +145,7 @@
   return CMD_SUCCESS;
 }
 
-int
+static int
 rip_offset_list_unset (struct vty *vty, const char *alist,
 		       const char *direct_str, const char *metric_str,
 		       const char *ifname)
@@ -334,13 +336,13 @@
   return rip_offset_list_unset (vty, argv[0], argv[1], argv[2], argv[3]);
 }
 
-int
+static int
 offset_list_cmp (struct rip_offset_list *o1, struct rip_offset_list *o2)
 {
   return strcmp_safe (o1->ifname, o2->ifname);
 }
 
-void
+static void
 offset_list_del (struct rip_offset_list *offset)
 {
   if (OFFSET_LIST_IN_NAME (offset))
diff --git a/ripd/rip_peer.c b/ripd/rip_peer.c
index 51df568..e061789 100644
--- a/ripd/rip_peer.c
+++ b/ripd/rip_peer.c
@@ -33,8 +33,8 @@
 /* Linked list of RIP peer. */
 struct list *peer_list;
 
-struct rip_peer *
-rip_peer_new ()
+static struct rip_peer *
+rip_peer_new (void)
 {
   struct rip_peer *new;
 
@@ -43,7 +43,7 @@
   return new;
 }
 
-void
+static void
 rip_peer_free (struct rip_peer *peer)
 {
   XFREE (MTYPE_RIP_PEER, peer);
@@ -78,7 +78,7 @@
 }
 
 /* RIP peer is timeout. */
-int
+static int
 rip_peer_timeout (struct thread *t)
 {
   struct rip_peer *peer;
@@ -91,7 +91,7 @@
 }
 
 /* Get RIP peer.  At the same time update timeout thread. */
-struct rip_peer *
+static struct rip_peer *
 rip_peer_get (struct in_addr *addr)
 {
   struct rip_peer *peer;
@@ -145,7 +145,7 @@
 }
 
 /* Display peer uptime. */
-char *
+static char *
 rip_peer_uptime (struct rip_peer *peer, char *buf, size_t len)
 {
   time_t uptime;
@@ -197,14 +197,14 @@
     }
 }
 
-int
+static int
 rip_peer_list_cmp (struct rip_peer *p1, struct rip_peer *p2)
 {
   return htonl (p1->addr.s_addr) > htonl (p2->addr.s_addr);
 }
 
 void
-rip_peer_init ()
+rip_peer_init (void)
 {
   peer_list = list_new ();
   peer_list->cmp = (int (*)(void *, void *)) rip_peer_list_cmp;
diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c
index 2a2f264..9d6fd16 100644
--- a/ripd/rip_routemap.c
+++ b/ripd/rip_routemap.c
@@ -46,7 +46,7 @@
 };
 
 /* Add rip route map rule. */
-int
+static int
 rip_route_match_add (struct vty *vty, struct route_map_index *index,
 		     const char *command, const char *arg)
 {
@@ -69,7 +69,7 @@
 }
 
 /* Delete rip route map rule. */
-int
+static int
 rip_route_match_delete (struct vty *vty, struct route_map_index *index,
 			const char *command, const char *arg)
 {
@@ -92,7 +92,7 @@
 }
 
 /* Add rip route map rule. */
-int
+static int
 rip_route_set_add (struct vty *vty, struct route_map_index *index,
 		   const char *command, const char *arg)
 {
@@ -121,7 +121,7 @@
 }
 
 /* Delete rip route map rule. */
-int
+static int
 rip_route_set_delete (struct vty *vty, struct route_map_index *index,
 		      const char *command, const char *arg)
 {
@@ -145,7 +145,7 @@
 
 /* Hook function for updating route_map assignment. */
 /* ARGSUSED */
-void
+static void
 rip_route_map_update (const char *notused)
 {
   int i;
@@ -163,7 +163,7 @@
 
 /* `match metric METRIC' */
 /* Match function return 1 if match is success else return zero. */
-route_map_result_t
+static route_map_result_t
 route_match_metric (void *rule, struct prefix *prefix, 
 		    route_map_object_t type, void *object)
 {
@@ -189,7 +189,7 @@
 }
 
 /* Route map `match metric' match statement. `arg' is METRIC value */
-void *
+static void *
 route_match_metric_compile (const char *arg)
 {
   u_int32_t *metric;
@@ -205,7 +205,7 @@
 }
 
 /* Free route map's compiled `match metric' value. */
-void
+static void
 route_match_metric_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -222,7 +222,7 @@
 
 /* `match interface IFNAME' */
 /* Match function return 1 if match is success else return zero. */
-route_map_result_t
+static route_map_result_t
 route_match_interface (void *rule, struct prefix *prefix,
 		       route_map_object_t type, void *object)
 {
@@ -250,14 +250,14 @@
 
 /* Route map `match interface' match statement. `arg' is IFNAME value */
 /* XXX I don`t know if I need to check does interface exist? */
-void *
+static void *
 route_match_interface_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
 
 /* Free route map's compiled `match interface' value. */
-void
+static void
 route_match_interface_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -275,7 +275,7 @@
 /* `match ip next-hop IP_ACCESS_LIST' */
 
 /* Match function return 1 if match is success else return zero. */
-route_map_result_t
+static route_map_result_t
 route_match_ip_next_hop (void *rule, struct prefix *prefix,
 			route_map_object_t type, void *object)
 {
@@ -302,21 +302,21 @@
 
 /* Route map `ip next-hop' match statement.  `arg' should be
    access-list name. */
-void *
+static void *
 route_match_ip_next_hop_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
 
 /* Free route map's compiled `. */
-void
+static void
 route_match_ip_next_hop_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
 }
 
 /* Route map commands for ip next-hop matching. */
-struct route_map_rule_cmd route_match_ip_next_hop_cmd =
+static struct route_map_rule_cmd route_match_ip_next_hop_cmd =
 {
   "ip next-hop",
   route_match_ip_next_hop,
@@ -326,7 +326,7 @@
 
 /* `match ip next-hop prefix-list PREFIX_LIST' */
 
-route_map_result_t
+static route_map_result_t
 route_match_ip_next_hop_prefix_list (void *rule, struct prefix *prefix,
                                     route_map_object_t type, void *object)
 {
@@ -351,19 +351,19 @@
   return RMAP_NOMATCH;
 }
 
-void *
+static void *
 route_match_ip_next_hop_prefix_list_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
 
-void
+static void
 route_match_ip_next_hop_prefix_list_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
 }
 
-struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd =
+static struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd =
 {
   "ip next-hop prefix-list",
   route_match_ip_next_hop_prefix_list,
@@ -375,7 +375,7 @@
 
 /* Match function should return 1 if match is success else return
    zero. */
-route_map_result_t
+static route_map_result_t
 route_match_ip_address (void *rule, struct prefix *prefix, 
 			route_map_object_t type, void *object)
 {
@@ -395,21 +395,21 @@
 
 /* Route map `ip address' match statement.  `arg' should be
    access-list name. */
-void *
+static void *
 route_match_ip_address_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
 
 /* Free route map's compiled `ip address' value. */
-void
+static void
 route_match_ip_address_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
 }
 
 /* Route map commands for ip address matching. */
-struct route_map_rule_cmd route_match_ip_address_cmd =
+static struct route_map_rule_cmd route_match_ip_address_cmd =
 {
   "ip address",
   route_match_ip_address,
@@ -419,7 +419,7 @@
 
 /* `match ip address prefix-list PREFIX_LIST' */
 
-route_map_result_t
+static route_map_result_t
 route_match_ip_address_prefix_list (void *rule, struct prefix *prefix, 
 				    route_map_object_t type, void *object)
 {
@@ -437,19 +437,19 @@
   return RMAP_NOMATCH;
 }
 
-void *
+static void *
 route_match_ip_address_prefix_list_compile (const char *arg)
 {
   return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
 }
 
-void
+static void
 route_match_ip_address_prefix_list_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
 }
 
-struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd =
+static struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd =
 {
   "ip address prefix-list",
   route_match_ip_address_prefix_list,
@@ -459,7 +459,7 @@
 
 /* `match tag TAG' */
 /* Match function return 1 if match is success else return zero. */
-route_map_result_t
+static route_map_result_t
 route_match_tag (void *rule, struct prefix *prefix, 
 		    route_map_object_t type, void *object)
 {
@@ -481,7 +481,7 @@
 }
 
 /* Route map `match tag' match statement. `arg' is TAG value */
-void *
+static void *
 route_match_tag_compile (const char *arg)
 {
   u_short *tag;
@@ -493,7 +493,7 @@
 }
 
 /* Free route map's compiled `match tag' value. */
-void
+static void
 route_match_tag_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
@@ -511,7 +511,7 @@
 /* `set metric METRIC' */
 
 /* Set metric to attribute. */
-route_map_result_t
+static route_map_result_t
 route_set_metric (void *rule, struct prefix *prefix, 
 		  route_map_object_t type, void *object)
 {
@@ -541,7 +541,7 @@
 }
 
 /* set metric compilation. */
-void *
+static void *
 route_set_metric_compile (const char *arg)
 {
   int len;
@@ -592,14 +592,14 @@
 }
 
 /* Free route map's compiled `set metric' value. */
-void
+static void
 route_set_metric_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
 }
 
 /* Set metric rule structure. */
-struct route_map_rule_cmd route_set_metric_cmd = 
+static struct route_map_rule_cmd route_set_metric_cmd = 
 {
   "metric",
   route_set_metric,
@@ -610,7 +610,7 @@
 /* `set ip next-hop IP_ADDRESS' */
 
 /* Set nexthop to object.  ojbect must be pointer to struct attr. */
-route_map_result_t
+static route_map_result_t
 route_set_ip_nexthop (void *rule, struct prefix *prefix, 
 		      route_map_object_t type, void *object)
 {
@@ -632,7 +632,7 @@
 
 /* Route map `ip nexthop' compile function.  Given string is converted
    to struct in_addr structure. */
-void *
+static void *
 route_set_ip_nexthop_compile (const char *arg)
 {
   int ret;
@@ -652,14 +652,14 @@
 }
 
 /* Free route map's compiled `ip nexthop' value. */
-void
+static void
 route_set_ip_nexthop_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
 }
 
 /* Route map commands for ip nexthop set. */
-struct route_map_rule_cmd route_set_ip_nexthop_cmd =
+static struct route_map_rule_cmd route_set_ip_nexthop_cmd =
 {
   "ip next-hop",
   route_set_ip_nexthop,
@@ -670,7 +670,7 @@
 /* `set tag TAG' */
 
 /* Set tag to object.  ojbect must be pointer to struct attr. */
-route_map_result_t
+static route_map_result_t
 route_set_tag (void *rule, struct prefix *prefix, 
 		      route_map_object_t type, void *object)
 {
@@ -692,7 +692,7 @@
 
 /* Route map `tag' compile function.  Given string is converted
    to u_short. */
-void *
+static void *
 route_set_tag_compile (const char *arg)
 {
   u_short *tag;
@@ -704,14 +704,14 @@
 }
 
 /* Free route map's compiled `ip nexthop' value. */
-void
+static void
 route_set_tag_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
 }
 
 /* Route map commands for tag set. */
-struct route_map_rule_cmd route_set_tag_cmd =
+static struct route_map_rule_cmd route_set_tag_cmd =
 {
   "tag",
   route_set_tag,
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index d810a6b..44f407d 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -29,17 +29,10 @@
 #include "log.h"
 #include "ripd/ripd.h"
 #include "ripd/rip_debug.h"
+#include "ripd/rip_interface.h"
 
 /* All information about zebra. */
 struct zclient *zclient = NULL;
-
-/* Callback prototypes for zebra client service. */
-int rip_interface_add (int, struct zclient *, zebra_size_t);
-int rip_interface_delete (int, struct zclient *, zebra_size_t);
-int rip_interface_address_add (int, struct zclient *, zebra_size_t);
-int rip_interface_address_delete (int, struct zclient *, zebra_size_t);
-int rip_interface_up (int, struct zclient *, zebra_size_t);
-int rip_interface_down (int, struct zclient *, zebra_size_t);
 
 /* RIPd to zebra command interface. */
 void
@@ -97,7 +90,7 @@
 }
 
 /* Zebra route add and delete treatment. */
-int
+static int
 rip_zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length)
 {
   struct stream *s;
@@ -152,13 +145,13 @@
 }
 
 void
-rip_zclient_reset ()
+rip_zclient_reset (void)
 {
   zclient_reset (zclient);
 }
 
 /* RIP route-map set for redistribution */
-void
+static void
 rip_routemap_set (int type, const char *name)
 {
   if (rip->route_map[type].name)
@@ -168,14 +161,14 @@
   rip->route_map[type].map = route_map_lookup_by_name (name);
 }
 
-void
+static void
 rip_redistribute_metric_set (int type, unsigned int metric)
 {
   rip->route_map[type].metric_config = 1;
   rip->route_map[type].metric = metric;
 }
 
-int
+static int
 rip_metric_unset (int type, unsigned int metric)
 {
 #define DONT_CARE_METRIC_RIP 17  
@@ -188,7 +181,7 @@
 }
 
 /* RIP route-map unset for redistribution */
-int
+static int
 rip_routemap_unset (int type, const char *name)
 {
   if (! rip->route_map[type].name ||
@@ -240,7 +233,7 @@
   return CMD_SUCCESS;
 }
 
-int
+static int
 rip_redistribute_set (int type)
 {
   if (zclient->redist[type])
@@ -254,7 +247,7 @@
   return CMD_SUCCESS;
 }
 
-int
+static int
 rip_redistribute_unset (int type)
 {
   if (! zclient->redist[type])
@@ -278,7 +271,7 @@
 }
 
 void
-rip_redistribute_clean ()
+rip_redistribute_clean (void)
 {
   int i;
 
@@ -632,7 +625,7 @@
 }
 
 /* RIP configuration write function. */
-int
+static int
 config_write_zebra (struct vty *vty)
 {
   if (! zclient->enable)
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 3267e15..a7286d3 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -63,10 +63,11 @@
 long rip_global_queries = 0;
 
 /* Prototypes. */
-void rip_event (enum rip_event, int);
-
-void rip_output_process (struct connected *, struct sockaddr_in *, int, u_char);
-
+static void rip_event (enum rip_event, int);
+static void rip_output_process (struct connected *, struct sockaddr_in *, int, u_char);
+static int rip_triggered_update (struct thread *);
+static int rip_update_jitter (unsigned long);
+
 /* RIP output routes type. */
 enum
 {
@@ -87,7 +88,7 @@
 };
 
 /* Utility function to set boradcast option to the socket. */
-int
+static int
 sockopt_broadcast (int sock)
 {
   int ret;
@@ -102,13 +103,13 @@
   return 0;
 }
 
-int
+static int
 rip_route_rte (struct rip_info *rinfo)
 {
   return (rinfo->type == ZEBRA_ROUTE_RIP && rinfo->sub_type == RIP_ROUTE_RTE);
 }
 
-struct rip_info *
+static struct rip_info *
 rip_info_new ()
 {
   struct rip_info *new;
@@ -125,7 +126,7 @@
 }
 
 /* RIP route garbage collect timer. */
-int
+static int
 rip_garbage_collect (struct thread *t)
 {
   struct rip_info *rinfo;
@@ -151,7 +152,7 @@
 }
 
 /* Timeout RIP routes. */
-int
+static int
 rip_timeout (struct thread *t)
 {
   struct rip_info *rinfo;
@@ -183,7 +184,7 @@
   return 0;
 }
 
-void
+static void
 rip_timeout_update (struct rip_info *rinfo)
 {
   if (rinfo->metric != RIP_METRIC_INFINITY)
@@ -193,7 +194,7 @@
     }
 }
 
-int
+static int
 rip_incoming_filter (struct prefix_ipv4 *p, struct rip_interface *ri)
 {
   struct distribute *dist;
@@ -264,7 +265,7 @@
   return 0;
 }
 
-int
+static int
 rip_outgoing_filter (struct prefix_ipv4 *p, struct rip_interface *ri)
 {
   struct distribute *dist;
@@ -361,7 +362,7 @@
 }
 
 /* RIP add route to routing table. */
-void
+static void
 rip_rte_process (struct rte *rte, struct sockaddr_in *from,
                  struct interface *ifp)
 {
@@ -694,7 +695,7 @@
 }
 
 /* Dump RIP packet */
-void
+static void
 rip_packet_dump (struct rip_packet *packet, int size, const char *sndrcv)
 {
   caddr_t lim;
@@ -785,7 +786,7 @@
 /* Check if the destination address is valid (unicast; not net 0
    or 127) (RFC2453 Section 3.9.2 - Page 26).  But we don't
    check net 0 because we accept default route. */
-int
+static int
 rip_destination_check (struct in_addr addr)
 {
   u_int32_t destination;
@@ -812,7 +813,7 @@
 }
 
 /* RIP version 2 authentication. */
-int
+static int
 rip_auth_simple_password (struct rte *rte, struct sockaddr_in *from,
 			  struct interface *ifp)
 {
@@ -854,7 +855,7 @@
 }
 
 /* RIP version 2 authentication with MD5. */
-int
+static int
 rip_auth_md5 (struct rip_packet *packet, struct sockaddr_in *from,
               int length, struct interface *ifp)
 {
@@ -1105,7 +1106,7 @@
 }
 
 /* RIP routing information. */
-void
+static void
 rip_response_process (struct rip_packet *packet, int size, 
 		      struct sockaddr_in *from, struct connected *ifc)
 {
@@ -1409,7 +1410,7 @@
  * by connected argument. NULL to argument denotes destination should be
  * should be RIP multicast group
  */
-int
+static int
 rip_send_packet (u_char * buf, int size, struct sockaddr_in *to,
                  struct connected *ifc)
 {
@@ -1643,7 +1644,7 @@
 }
 
 /* Response to request called from rip_read ().*/
-void
+static void
 rip_request_process (struct rip_packet *packet, int size, 
 		     struct sockaddr_in *from, struct connected *ifc)
 {
@@ -1811,7 +1812,7 @@
 #endif /* RIP_RECVMSG */
 
 /* First entry point of RIP packet. */
-int
+static int
 rip_read (struct thread *t)
 {
   int sock;
@@ -2101,7 +2102,7 @@
 
 /* Write routing table entry to the stream and return next index of
    the routing table entry in the stream. */
-int
+static int
 rip_write_rte (int num, struct stream *s, struct prefix_ipv4 *p,
                u_char version, struct rip_info *rinfo)
 {
@@ -2149,7 +2150,7 @@
   /* this might need to made dynamic if RIP ever supported auth methods
      with larger key string sizes */
   char auth_str[RIP_AUTH_SIMPLE_SIZE];
-  size_t doff; /* offset of digest offset field */
+  size_t doff = 0; /* offset of digest offset field */
   int num = 0;
   int rtemax;
   int subnetted = 0;
@@ -2427,7 +2428,7 @@
 }
 
 /* Send RIP packet to the interface. */
-void
+static void
 rip_update_interface (struct connected *ifc, u_char version, int route_type)
 {
   struct sockaddr_in to;
@@ -2470,7 +2471,7 @@
 }
 
 /* Update send to all interface and neighbor. */
-void
+static void
 rip_update_process (int route_type)
 {
   struct listnode *node;
@@ -2572,7 +2573,7 @@
 }
 
 /* RIP's periodical timer. */
-int
+static int
 rip_update (struct thread *t)
 {
   /* Clear timer pointer. */
@@ -2600,7 +2601,7 @@
 }
 
 /* Walk down the RIP routing table then clear changed flag. */
-void
+static void
 rip_clear_changed_flag ()
 {
   struct route_node *rp;
@@ -2613,7 +2614,7 @@
 }
 
 /* Triggered update interval timer. */
-int
+static int
 rip_triggered_interval (struct thread *t)
 {
   int rip_triggered_update (struct thread *);
@@ -2629,7 +2630,7 @@
 }     
 
 /* Execute triggered update. */
-int
+static int
 rip_triggered_update (struct thread *t)
 {
   int interval;
@@ -2706,8 +2707,8 @@
 }
 
 /* Create new RIP instance and set it to global variable. */
-int
-rip_create ()
+static int
+rip_create (void)
 {
   rip = XMALLOC (MTYPE_RIP, sizeof (struct rip));
   memset (rip, 0, sizeof (struct rip));
@@ -2787,7 +2788,7 @@
   return sizeof (rip_packet);
 }
 
-int
+static int
 rip_update_jitter (unsigned long time)
 {
 #define JITTER_BOUND 4
@@ -2990,7 +2991,7 @@
   return CMD_SUCCESS;
 }
 
-void
+static void
 rip_update_default_metric ()
 {
   struct route_node *np;
@@ -3126,7 +3127,7 @@
   char *access_list;
 };
 
-struct rip_distance *
+static struct rip_distance *
 rip_distance_new ()
 {
   struct rip_distance *new;
@@ -3135,13 +3136,13 @@
   return new;
 }
 
-void
+static void
 rip_distance_free (struct rip_distance *rdistance)
 {
   XFREE (MTYPE_RIP_DISTANCE, rdistance);
 }
 
-int
+static int
 rip_distance_set (struct vty *vty, const char *distance_str, const char *ip_str,
 		  const char *access_list_str)
 {
@@ -3188,7 +3189,7 @@
   return CMD_SUCCESS;
 }
 
-int
+static int
 rip_distance_unset (struct vty *vty, const char *distance_str,
 		    const char *ip_str, const char *access_list_str)
 {
@@ -3227,7 +3228,7 @@
   return CMD_SUCCESS;
 }
 
-void
+static void
 rip_distance_reset ()
 {
   struct route_node *rn;
@@ -3288,7 +3289,7 @@
   return 0;
 }
 
-void
+static void
 rip_distance_show (struct vty *vty)
 {
   struct route_node *rn;
@@ -3387,7 +3388,7 @@
 }
 
 /* Print out routes update time. */
-void
+static void
 rip_vty_out_uptime (struct vty *vty, struct rip_info *rinfo)
 {
   struct timeval timer_now;
@@ -3415,7 +3416,7 @@
     }
 }
 
-const char *
+static const char *
 rip_route_type_print (int sub_type)
 {
   switch (sub_type)
@@ -3513,7 +3514,7 @@
 }
 
 /* Return next event time. */
-int
+static int
 rip_next_thread_timer (struct thread *thread)
 {
   struct timeval timer_now;
@@ -3629,7 +3630,7 @@
 }
 
 /* RIP configuration write function. */
-int
+static int
 config_write_rip (struct vty *vty)
 {
   int write = 0;
@@ -3722,7 +3723,7 @@
 };
 
 /* Distribute-list update functions. */
-void
+static void
 rip_distribute_update (struct distribute *dist)
 {
   struct interface *ifp;
@@ -3796,7 +3797,7 @@
 
 /* Update all interface's distribute list. */
 /* ARGSUSED */
-void
+static void
 rip_distribute_update_all (struct prefix_list *notused)
 {
   struct interface *ifp;
@@ -3806,7 +3807,7 @@
     rip_distribute_update_interface (ifp);
 }
 /* ARGSUSED */
-void
+static void
 rip_distribute_update_all_wrapper(struct access_list *notused)
 {
         rip_distribute_update_all(NULL);
@@ -3924,7 +3925,7 @@
   rip_zclient_reset ();
 }
 
-void
+static void
 rip_if_rmap_update (struct if_rmap *if_rmap)
 {
   struct interface *ifp;
@@ -3970,7 +3971,7 @@
     rip_if_rmap_update (if_rmap);
 }
 
-void
+static void
 rip_routemap_update_redistribute (void)
 {
   int i;
@@ -3987,7 +3988,7 @@
 }
 
 /* ARGSUSED */
-void
+static void
 rip_routemap_update (const char *notused)
 {
   struct interface *ifp;
@@ -4001,7 +4002,7 @@
 
 /* Allocate new rip structure and set default value. */
 void
-rip_init ()
+rip_init (void)
 {
   /* Randomize for triggered update random(). */
   srand (time (NULL));
diff --git a/ripd/ripd.h b/ripd/ripd.h
index 6ddd52d..cc4aef6 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -374,59 +374,59 @@
   } while (0)
 
 /* Prototypes. */
-void rip_init ();
-void rip_reset ();
-void rip_clean ();
-void rip_clean_network ();
-void rip_interface_clean ();
-void rip_interface_reset ();
-void rip_passive_nondefault_clean ();
-void rip_if_init ();
-void rip_if_down_all ();
-void rip_route_map_init ();
-void rip_route_map_reset ();
-void rip_snmp_init ();
-void rip_zclient_init ();
-void rip_zclient_start ();
-void rip_zclient_reset ();
-void rip_offset_init ();
-int if_check_address (struct in_addr addr);
-int if_valid_neighbor (struct in_addr addr);
+extern void rip_init (void);
+extern void rip_reset (void);
+extern void rip_clean (void);
+extern void rip_clean_network (void);
+extern void rip_interface_clean (void);
+extern void rip_interface_reset (void);
+extern void rip_passive_nondefault_clean (void);
+extern void rip_if_init (void);
+extern void rip_if_down_all (void);
+extern void rip_route_map_init (void);
+extern void rip_route_map_reset (void);
+extern void rip_snmp_init (void);
+extern void rip_zclient_init (void);
+extern void rip_zclient_start (void);
+extern void rip_zclient_reset (void);
+extern void rip_offset_init (void);
+extern int if_check_address (struct in_addr addr);
+extern int if_valid_neighbor (struct in_addr addr);
 
-int rip_request_send (struct sockaddr_in *, struct interface *, u_char,
+extern int rip_request_send (struct sockaddr_in *, struct interface *, u_char,
                       struct connected *);
-int rip_neighbor_lookup (struct sockaddr_in *);
-void rip_redistribute_add (int, int, struct prefix_ipv4 *, unsigned int, 
+extern int rip_neighbor_lookup (struct sockaddr_in *);
+extern void rip_redistribute_add (int, int, struct prefix_ipv4 *, unsigned int, 
 			   struct in_addr *, unsigned int, unsigned char);
-void rip_redistribute_delete (int, int, struct prefix_ipv4 *, unsigned int);
-void rip_redistribute_withdraw (int);
-void rip_zebra_ipv4_add (struct prefix_ipv4 *, struct in_addr *, u_int32_t, u_char);
-void rip_zebra_ipv4_delete (struct prefix_ipv4 *, struct in_addr *, u_int32_t);
-void rip_interface_multicast_set (int, struct connected *);
-void rip_distribute_update_interface (struct interface *);
-void rip_if_rmap_update_interface (struct interface *);
+extern void rip_redistribute_delete (int, int, struct prefix_ipv4 *, unsigned int);
+extern void rip_redistribute_withdraw (int);
+extern void rip_zebra_ipv4_add (struct prefix_ipv4 *, struct in_addr *, u_int32_t, u_char);
+extern void rip_zebra_ipv4_delete (struct prefix_ipv4 *, struct in_addr *, u_int32_t);
+extern void rip_interface_multicast_set (int, struct connected *);
+extern void rip_distribute_update_interface (struct interface *);
+extern void rip_if_rmap_update_interface (struct interface *);
 
-int config_write_rip_network (struct vty *, int);
-int config_write_rip_offset_list (struct vty *);
-int config_write_rip_redistribute (struct vty *, int);
+extern int config_write_rip_network (struct vty *, int);
+extern int config_write_rip_offset_list (struct vty *);
+extern int config_write_rip_redistribute (struct vty *, int);
 
-void rip_peer_init ();
-void rip_peer_update (struct sockaddr_in *, u_char);
-void rip_peer_bad_route (struct sockaddr_in *);
-void rip_peer_bad_packet (struct sockaddr_in *);
-void rip_peer_display (struct vty *);
-struct rip_peer *rip_peer_lookup (struct in_addr *);
-struct rip_peer *rip_peer_lookup_next (struct in_addr *);
+extern void rip_peer_init (void);
+extern void rip_peer_update (struct sockaddr_in *, u_char);
+extern void rip_peer_bad_route (struct sockaddr_in *);
+extern void rip_peer_bad_packet (struct sockaddr_in *);
+extern void rip_peer_display (struct vty *);
+extern struct rip_peer *rip_peer_lookup (struct in_addr *);
+extern struct rip_peer *rip_peer_lookup_next (struct in_addr *);
 
-int rip_offset_list_apply_in (struct prefix_ipv4 *, struct interface *, u_int32_t *);
-int rip_offset_list_apply_out (struct prefix_ipv4 *, struct interface *, u_int32_t *);
-void rip_offset_clean ();
+extern int rip_offset_list_apply_in (struct prefix_ipv4 *, struct interface *, u_int32_t *);
+extern int rip_offset_list_apply_out (struct prefix_ipv4 *, struct interface *, u_int32_t *);
+extern void rip_offset_clean (void);
 
-void rip_info_free (struct rip_info *);
-u_char rip_distance_apply (struct rip_info *);
-void rip_redistribute_clean ();
-void rip_ifaddr_add (struct interface *, struct connected *);
-void rip_ifaddr_delete (struct interface *, struct connected *);
+extern void rip_info_free (struct rip_info *);
+extern u_char rip_distance_apply (struct rip_info *);
+extern void rip_redistribute_clean (void);
+extern void rip_ifaddr_add (struct interface *, struct connected *);
+extern void rip_ifaddr_delete (struct interface *, struct connected *);
 
 /* There is only one rip strucutre. */
 extern struct rip *rip;
@@ -437,5 +437,4 @@
 /* RIP statistics for SNMP. */
 extern long rip_global_route_changes;
 extern long rip_global_queries;
-
 #endif /* _ZEBRA_RIP_H */