]> git.proxmox.com Git - mirror_frr.git/commitdiff
2005-06-28 Paul Jakma <paul.jakma@sun.com>
authorpaul <paul>
Tue, 28 Jun 2005 17:17:12 +0000 (17:17 +0000)
committerpaul <paul>
Tue, 28 Jun 2005 17:17:12 +0000 (17:17 +0000)
* (global) Extern and static'ification, with related fixups
  of declarations, ensuring files include their own headers, etc.
  if_ioctl.c: (interface_info_ioctl) fix obvious arg mis-order in
  list loop

27 files changed:
zebra/ChangeLog
zebra/connected.c
zebra/connected.h
zebra/debug.c
zebra/debug.h
zebra/if_ioctl.c
zebra/interface.c
zebra/interface.h
zebra/ioctl.c
zebra/ioctl.h
zebra/ipforward.h
zebra/ipforward_proc.c
zebra/ipforward_solaris.c
zebra/ipforward_sysctl.c
zebra/main.c
zebra/redistribute.h
zebra/rib.h
zebra/router-id.c
zebra/rt.h
zebra/rt_ioctl.c
zebra/rtadv.c
zebra/rtadv.h
zebra/rtread_proc.c
zebra/zebra_rib.c
zebra/zebra_vty.c
zebra/zserv.c
zebra/zserv.h

index 677643ee9f4d84cb8aa5d997263a5a427761a97f..f215266c46735bfc070ba8b2fac3bb5b80569589 100644 (file)
@@ -1,3 +1,11 @@
+2005-06-28 Paul Jakma <paul.jakma@sun.com>
+
+       * (global) Extern and static'ification, with related fixups
+         of declarations, ensuring files include their own headers, etc.
+         if_ioctl.c: (interface_info_ioctl) fix obvious arg mis-order in
+         list loop
+         
+
 2005-06-14 Paul Jakma <paul.jakma@sun.com>
 
        * kernel_socket.c: consolidate the IFAM{ADDR,MASK}GET and 
index 3ce59530f30e6ac910732a1f724da7c86f5daae3..46d2aab9271d0a1329a48279401d05aa300c0511 100644 (file)
@@ -33,6 +33,7 @@
 #include "zebra/zserv.h"
 #include "zebra/redistribute.h"
 #include "zebra/interface.h"
+#include "zebra/connected.h"
 \f
 /* If same interface address is already exist... */
 struct connected *
@@ -88,7 +89,7 @@ connected_up_ipv4 (struct interface *ifp, struct connected *ifc)
 /* Add connected IPv4 route to the interface. */
 void
 connected_add_ipv4 (struct interface *ifp, int flags, struct in_addr *addr, 
-                   int prefixlen, struct in_addr *broad, char *label)
+                   u_char prefixlen, struct in_addr *broad, char *label)
 {
   struct prefix_ipv4 *p;
   struct connected *ifc;
@@ -226,7 +227,7 @@ connected_down_ipv4 (struct interface *ifp, struct connected *ifc)
 /* Delete connected IPv4 route to the interface. */
 void
 connected_delete_ipv4 (struct interface *ifp, int flags, struct in_addr *addr,
-                      int prefixlen, struct in_addr *broad, char *label)
+                      u_char prefixlen, struct in_addr *broad, char *label)
 {
   struct prefix_ipv4 p;
   struct connected *ifc;
index 7bf13baf67045141683ba164a12ac78be53fbda6..726092aec47adfb1316174eb222f91e6fb270b27 100644 (file)
 #ifndef _ZEBRA_CONNECTED_H
 #define _ZEBRA_CONNECTED_H
 
-struct connected *
+extern struct connected *
 connected_check_ipv4 (struct interface *ifp, struct prefix *p);
 
-void
+extern void
 connected_add_ipv4 (struct interface *ifp, int flags, struct in_addr *addr, 
-                   int prefixlen, struct in_addr *broad, char *label);
+                   u_char prefixlen, struct in_addr *broad, char *label);
 
-void
+extern void
 connected_delete_ipv4 (struct interface *ifp, int flags, struct in_addr *addr,
-                      int prefixlen, struct in_addr *broad, char *label);
+                      u_char prefixlen, struct in_addr *broad, char *label);
 
-void
-connected_up_ipv4 (struct interface *, struct connected *);
-void
-connected_down_ipv4 (struct interface *, struct connected *);
+extern void connected_up_ipv4 (struct interface *, struct connected *);
+extern void connected_down_ipv4 (struct interface *, struct connected *);
 
 #ifdef HAVE_IPV6
-struct connected *
+extern struct connected *
 connected_check_ipv6 (struct interface *ifp, struct prefix *p);
 
-void
+extern void
 connected_add_ipv6 (struct interface *ifp, struct in6_addr *address,
-                   int prefixlen, struct in6_addr *broad);
-void
+                   u_char prefixlen, struct in6_addr *broad);
+extern void
 connected_delete_ipv6 (struct interface *ifp, struct in6_addr *address,
-                      int prefixlen, struct in6_addr *broad);
-void
-connected_up_ipv6 (struct interface *, struct connected *);
+                      u_char prefixlen, struct in6_addr *broad);
 
-void
-connected_down_ipv6 (struct interface *ifp, struct connected *);
+extern void connected_up_ipv6 (struct interface *, struct connected *);
+extern void connected_down_ipv6 (struct interface *ifp, struct connected *);
 
 #endif /* HAVE_IPV6 */
 
index fc99623a18115f8326595f620d663fc60aed8a20..8575a6640ea836506073c9db00e789436b307399 100644 (file)
@@ -201,7 +201,7 @@ struct cmd_node debug_node =
   1
 };
 
-int
+static int
 config_write_debug (struct vty *vty)
 {
   int write = 0;
@@ -242,7 +242,7 @@ config_write_debug (struct vty *vty)
 }
 
 void
-zebra_debug_init ()
+zebra_debug_init (void)
 {
   zebra_debug_event = 0;
   zebra_debug_packet = 0;
index 6eaa9572b5e86ddd9cb7dd68b772009765551c2e..96b7d8fcc26029684b97c38ecd2733dabaf0816d 100644 (file)
@@ -47,6 +47,6 @@ extern unsigned long zebra_debug_event;
 extern unsigned long zebra_debug_packet;
 extern unsigned long zebra_debug_kernel;
 
-void zebra_debug_init ();
+extern void zebra_debug_init (void);
 
 #endif /* _ZEBRA_DEBUG_H */
index 24c4cd746a749f6c39261dad0a0c50ba00f489dd..66d8327dd24580588c76e04bb10293a73d6fcdae 100644 (file)
@@ -33,8 +33,8 @@
 #include "zebra/interface.h"
 
 /* Interface looking up using infamous SIOCGIFCONF. */
-int
-interface_list_ioctl ()
+static int
+interface_list_ioctl (void)
 {
   int ret;
   int sock;
@@ -131,7 +131,7 @@ interface_list_ioctl ()
 }
 
 /* Get interface's index by ioctl. */
-int
+static int
 if_get_index (struct interface *ifp)
 {
 #if defined(HAVE_IF_NAMETOINDEX)
@@ -176,7 +176,7 @@ if_get_index (struct interface *ifp)
 }
 
 #ifdef SIOCGIFHWADDR
-int
+static int
 if_get_hwaddr (struct interface *ifp)
 {
   int ret;
@@ -210,8 +210,8 @@ if_get_hwaddr (struct interface *ifp)
 #ifdef HAVE_GETIFADDRS
 #include <ifaddrs.h>
 
-int
-if_getaddrs ()
+static int
+if_getaddrs (void)
 {
   int ret;
   struct ifaddrs *ifap;
@@ -412,7 +412,7 @@ interface_info_ioctl ()
   struct listnode *node, *nnode;
   struct interface *ifp;
   
-  for (ALL_LIST_ELEMENTS (iflist, ifp, node, nnode))
+  for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
     {
       if_get_index (ifp);
 #ifdef SIOCGIFHWADDR
index bd31fb40eb1733f46f21a1fed236e2038bb36df1..8032614fa3cc7087cc097dd52ae7f269627f378a 100644 (file)
@@ -43,7 +43,7 @@
 
 
 /* Called when new interface is added. */
-int
+static int
 if_zebra_new_hook (struct interface *ifp)
 {
   struct zebra_if *zebra_if;
@@ -89,7 +89,7 @@ if_zebra_new_hook (struct interface *ifp)
 }
 
 /* Called when interface is deleted. */
-int
+static int
 if_zebra_delete_hook (struct interface *ifp)
 {
   struct zebra_if *zebra_if;
@@ -189,7 +189,7 @@ if_subnet_delete (struct interface *ifp, struct connected *ifc)
 
 /* Wake up configured address if it is not in current kernel
    address. */
-void
+static void
 if_addr_wakeup (struct interface *ifp)
 {
   struct listnode *node, *nnode;
@@ -490,7 +490,7 @@ if_refresh (struct interface *ifp)
 }
 
 /* Printout flag information into vty */
-void
+static void
 if_flag_dump_vty (struct vty *vty, unsigned long flag)
 {
   int separator = 0;
@@ -530,7 +530,7 @@ if_flag_dump_vty (struct vty *vty, unsigned long flag)
 }
 
 /* Output prefix string to vty. */
-int
+static int
 prefix_vty_out (struct vty *vty, struct prefix *p)
 {
   char str[INET6_ADDRSTRLEN];
@@ -541,7 +541,7 @@ prefix_vty_out (struct vty *vty, struct prefix *p)
 }
 
 /* Dump if address information to vty. */
-void
+static void
 connected_dump_vty (struct vty *vty, struct connected *connected)
 {
   struct prefix *p;
@@ -585,7 +585,7 @@ connected_dump_vty (struct vty *vty, struct connected *connected)
 
 #ifdef RTADV
 /* Dump interface ND information to vty. */
-void
+static void
 nd_dump_vty (struct vty *vty, struct interface *ifp)
 {
   struct zebra_if *zif;
@@ -630,7 +630,7 @@ nd_dump_vty (struct vty *vty, struct interface *ifp)
 #endif /* RTADV */
 
 /* Interface's information print out to vty interface. */
-void
+static void
 if_dump_vty (struct vty *vty, struct interface *ifp)
 {
 #ifdef HAVE_SOCKADDR_DL
@@ -813,7 +813,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp)
 }
 
 /* Check supported address family. */
-int
+static int
 if_supported_family (int family)
 {
   if (family == AF_INET)
@@ -1141,7 +1141,7 @@ ALIAS (no_bandwidth_if,
        "Set bandwidth informational parameter\n"
        "Bandwidth in kilobits\n")
 \f
-int
+static int
 ip_address_install (struct vty *vty, struct interface *ifp,
                    const char *addr_str, const char *peer_str,
                    const char *label)
@@ -1226,7 +1226,7 @@ ip_address_install (struct vty *vty, struct interface *ifp,
   return CMD_SUCCESS;
 }
 
-int
+static int
 ip_address_uninstall (struct vty *vty, struct interface *ifp,
                      const char *addr_str, const char *peer_str,
                      const char *label)
@@ -1337,7 +1337,7 @@ DEFUN (no_ip_address_label,
 #endif /* HAVE_NETLINK */
 
 #ifdef HAVE_IPV6
-int
+static int
 ipv6_address_install (struct vty *vty, struct interface *ifp,
                      const char *addr_str, const char *peer_str,
                      const char *label, int secondary)
@@ -1415,7 +1415,7 @@ ipv6_address_install (struct vty *vty, struct interface *ifp,
   return CMD_SUCCESS;
 }
 
-int
+static int
 ipv6_address_uninstall (struct vty *vty, struct interface *ifp,
                        const char *addr_str, const char *peer_str,
                        const char *label, int secondry)
@@ -1497,7 +1497,7 @@ DEFUN (no_ipv6_address,
 }
 #endif /* HAVE_IPV6 */
 
-int
+static int
 if_config_write (struct vty *vty)
 {
   struct listnode *node;
@@ -1571,7 +1571,7 @@ if_config_write (struct vty *vty)
 
 /* Allocate and initialize interface vector. */
 void
-zebra_if_init ()
+zebra_if_init (void)
 {
   /* Initialize interface and new hook. */
   if_init ();
index 0033f7d573962e10fdfb354d1698703db2c30dc6..0083cbabef607645a2e01fafd599aceb3cd9c9fb 100644 (file)
@@ -203,30 +203,30 @@ struct zebra_if
 
 };
 
-void if_delete_update (struct interface *ifp);
-void if_add_update (struct interface *ifp);
-void if_up (struct interface *);
-void if_down (struct interface *);
-void if_refresh (struct interface *);
-int if_subnet_add (struct interface *, struct connected *);
-int if_subnet_delete (struct interface *, struct connected *);
+extern void if_delete_update (struct interface *ifp);
+extern void if_add_update (struct interface *ifp);
+extern void if_up (struct interface *);
+extern void if_down (struct interface *);
+extern void if_refresh (struct interface *);
+extern int if_subnet_add (struct interface *, struct connected *);
+extern int if_subnet_delete (struct interface *, struct connected *);
 
 #ifdef HAVE_PROC_NET_DEV
-int ifstat_update_proc ();
+extern int ifstat_update_proc (void);
 #endif /* HAVE_PROC_NET_DEV */
 #ifdef HAVE_NET_RT_IFLIST
-void ifstat_update_sysctl ();
+extern void ifstat_update_sysctl (void);
 
 #endif /* HAVE_NET_RT_IFLIST */
 #ifdef HAVE_PROC_NET_DEV
-int interface_list_proc ();
+extern int interface_list_proc (void);
 #endif /* HAVE_PROC_NET_DEV */
 #ifdef HAVE_PROC_NET_IF_INET6
-int ifaddr_proc_ipv6 ();
+extern int ifaddr_proc_ipv6 (void);
 #endif /* HAVE_PROC_NET_IF_INET6 */
 
 #ifdef BSDI
-int if_kvm_get_mtu (struct interface *);
+extern int if_kvm_get_mtu (struct interface *);
 #endif /* BSDI */
 
 #endif /* _ZEBRA_INTERFACE_H */
index 56de810c2b6778aa7249ffbf099ce4cc28260c19..4137acfafe85a1c10748e18a2a6faacc31b0954d 100644 (file)
@@ -75,7 +75,7 @@ if_ioctl (u_long request, caddr_t buffer)
 }
 
 #ifdef HAVE_IPV6
-int
+static int
 if_ioctl_ipv6 (u_long request, caddr_t buffer)
 {
   int sock;
index a82c3125e0604fbd5d5a41a6261c8795c4485b2b..5d9e09f03c40dc173f8fbb237bbcf9a3cc55df1e 100644 (file)
 #define _ZEBRA_IOCTL_H
 
 /* Prototypes. */
-void ifreq_set_name (struct ifreq *, struct interface *);
-int if_ioctl (u_long, caddr_t);
+extern void ifreq_set_name (struct ifreq *, struct interface *);
+extern int if_ioctl (u_long, caddr_t);
 
-int if_set_flags (struct interface *, unsigned long);
-int if_unset_flags (struct interface *, unsigned long);
-void if_get_flags (struct interface *);
+extern int if_set_flags (struct interface *, unsigned long);
+extern int if_unset_flags (struct interface *, unsigned long);
+extern void if_get_flags (struct interface *);
 
-int if_set_prefix (struct interface *, struct connected *);
-int if_unset_prefix (struct interface *, struct connected *);
+extern int if_set_prefix (struct interface *, struct connected *);
+extern int if_unset_prefix (struct interface *, struct connected *);
 
-void if_get_metric (struct interface *);
-void if_get_mtu (struct interface *);
+extern void if_get_metric (struct interface *);
+extern void if_get_mtu (struct interface *);
 
 #ifdef HAVE_IPV6
-int if_prefix_add_ipv6 (struct interface *, struct connected *);
-int if_prefix_delete_ipv6 (struct interface *, struct connected *);
+extern int if_prefix_add_ipv6 (struct interface *, struct connected *);
+extern int if_prefix_delete_ipv6 (struct interface *, struct connected *);
 #endif /* HAVE_IPV6 */
 
 #ifdef SOLARIS_IPV6
-int if_ioctl_ipv6(u_long, caddr_t);
-struct connected *if_lookup_linklocal( struct interface *);
+extern int if_ioctl_ipv6(u_long, caddr_t);
+extern struct connected *if_lookup_linklocal( struct interface *);
 
 #define AF_IOCTL(af, request, buffer) \
         ((af) == AF_INET? if_ioctl(request, buffer) : \
index a772337b7c1d0081b7dc133cd4ad390fb0bd65bd..8a935c139f616512c2045f12ac1f71f22eed413a 100644 (file)
 #ifndef _ZEBRA_IPFORWARD_H
 #define _ZEBRA_IPFORWARD_H
 
-int ipforward ();
-int ipforward_on ();
-int ipforward_off ();
+extern int ipforward (void);
+extern int ipforward_on (void);
+extern int ipforward_off (void);
 
 #ifdef HAVE_IPV6
-int ipforward_ipv6 ();
-int ipforward_ipv6_on ();
-int ipforward_ipv6_off ();
+extern int ipforward_ipv6 (void);
+extern int ipforward_ipv6_on (void);
+extern int ipforward_ipv6_off (void);
 #endif /* HAVE_IPV6 */
 
 #endif /* _ZEBRA_IPFORWARD_H */
index f83d88c3322c55e4406e02047e9987af4861e8c5..73846137a8b8188f5a9dd48e46dbb70af100530a 100644 (file)
@@ -25,6 +25,8 @@
 #include "log.h"
 #include "privs.h"
 
+#include "zebra/ipforward.h"
+
 extern struct zebra_privs_t zserv_privs;
 
 char proc_net_snmp[] = "/proc/net/snmp";
@@ -39,7 +41,7 @@ dropline (FILE *fp)
 }
 
 int
-ipforward ()
+ipforward (void)
 {
   FILE *fp;
   int ipforwarding = 0;
@@ -72,7 +74,7 @@ ipforward ()
 char proc_ipv4_forwarding[] = "/proc/sys/net/ipv4/ip_forward";
 
 int
-ipforward_on ()
+ipforward_on (void)
 {
   FILE *fp;
   
@@ -98,7 +100,7 @@ ipforward_on ()
 }
 
 int
-ipforward_off ()
+ipforward_off (void)
 {
   FILE *fp;
 
@@ -127,7 +129,7 @@ ipforward_off ()
 char proc_ipv6_forwarding[] = "/proc/sys/net/ipv6/conf/all/forwarding";
 
 int
-ipforward_ipv6 ()
+ipforward_ipv6 (void)
 {
   FILE *fp;
   char buf[5];
@@ -146,7 +148,7 @@ ipforward_ipv6 ()
 }
 
 int
-ipforward_ipv6_on ()
+ipforward_ipv6_on (void)
 {
   FILE *fp;
 
@@ -172,7 +174,7 @@ ipforward_ipv6_on ()
 }
 
 int
-ipforward_ipv6_off ()
+ipforward_ipv6_off (void)
 {
   FILE *fp;
 
index 3ad2c400d41a494820fba73076f8e995a337724e..4aa1b797afcf87e656d8aaf73d66af6e430bfb6e 100644 (file)
@@ -25,6 +25,7 @@
 #include "prefix.h"
 
 #include "privs.h"
+#include "zebra/ipforward.h"
 
 /*
 ** Solaris should define IP_DEV_NAME in <inet/ip.h>, but we'll save
@@ -126,37 +127,37 @@ solaris_nd_get(const char* parameter) {
   return solaris_nd(ND_GET, parameter, 0);
 }
 int
-ipforward()
+ipforward(void)
 {
   return solaris_nd_get("ip_forwarding");
 }
 
 int
-ipforward_on ()
+ipforward_on (void)
 {
   (void) solaris_nd_set("ip_forwarding", 1);
   return ipforward();
 }
 
 int
-ipforward_off ()
+ipforward_off (void)
 {
   (void) solaris_nd_set("ip_forwarding", 0);
   return ipforward();
 }
 #ifdef HAVE_IPV6
-int ipforward_ipv6()
+int ipforward_ipv6(void)
 {
   return solaris_nd_get("ip6_forwarding");
 }
 int
-ipforward_ipv6_on ()
+ipforward_ipv6_on (void)
 {
   (void) solaris_nd_set("ip6_forwarding", 1);
   return ipforward_ipv6();
 }
 int
-ipforward_ipv6_off ()
+ipforward_ipv6_off (void)
 {
   (void) solaris_nd_set("ip6_forwarding", 0);
   return ipforward_ipv6();
index a8d0d8cbc58074fed03e59cf63dc52d7dee09bb3..185aee3ee0994f0cce24e33d9e24b326672d9a58 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <zebra.h>
 #include "privs.h"
+#include "zebra/ipforward.h"
 
 #ifdef NRL
 #include <netinet6/in6.h>
@@ -42,7 +43,7 @@ int mib[MIB_SIZ] =
 };
 
 int
-ipforward ()
+ipforward (void)
 {
   size_t len;
   int ipforwarding = 0;
@@ -57,7 +58,7 @@ ipforward ()
 }
 
 int
-ipforward_on ()
+ipforward_on (void)
 {
   size_t len;
   int ipforwarding = 1;
@@ -78,7 +79,7 @@ ipforward_on ()
 }
 
 int
-ipforward_off ()
+ipforward_off (void)
 {
   size_t len;
   int ipforwarding = 0;
@@ -115,7 +116,7 @@ int mib_ipv6[MIB_SIZ] =
 }; 
 
 int
-ipforward_ipv6 ()
+ipforward_ipv6 (void)
 {
   size_t len;
   int ip6forwarding = 0;
@@ -136,7 +137,7 @@ ipforward_ipv6 ()
 }
 
 int
-ipforward_ipv6_on ()
+ipforward_ipv6_on (void)
 {
   size_t len;
   int ip6forwarding = 1;
@@ -157,7 +158,7 @@ ipforward_ipv6_on ()
 }
 
 int
-ipforward_ipv6_off ()
+ipforward_ipv6_off (void)
 {
   size_t len;
   int ip6forwarding = 0;
index 540bf3160a07a99bc619244872f2b2056fc8609a..acfde80aea790972762b960ec99403e713320c61 100644 (file)
@@ -37,6 +37,7 @@
 #include "zebra/debug.h"
 #include "zebra/router-id.h"
 #include "zebra/irdp.h"
+#include "zebra/rtadv.h"
 
 /* Zebra instance */
 struct zebra_t zebrad =
@@ -149,7 +150,7 @@ usage (char *progname, int status)
 }
 \f
 /* SIGHUP handler. */
-void 
+static void 
 sighup (void)
 {
   zlog_info ("SIGHUP received");
@@ -159,7 +160,7 @@ sighup (void)
 }
 
 /* SIGINT handler. */
-void
+static void
 sigint (void)
 {
   /* Decrared in rib.c */
@@ -177,7 +178,7 @@ sigint (void)
 }
 
 /* SIGUSR1 handler. */
-void
+static void
 sigusr1 (void)
 {
   zlog_rotate (NULL);
@@ -215,8 +216,6 @@ main (int argc, char **argv)
   char *config_file = NULL;
   char *progname;
   struct thread thread;
-  void rib_weed_tables ();
-  void zebra_vty_init ();
 
   /* Set umask before anything for security */
   umask (0027);
index 14b92b0d5c9295b70830012221706c657c396cff..9e78dfdee812cc7c4a03f2706f125116b30c00b7 100644 (file)
 #include "table.h"
 #include "zserv.h"
 
-void zebra_redistribute_add (int, struct zserv *, int);
-void zebra_redistribute_delete (int, struct zserv *, int);
+extern void zebra_redistribute_add (int, struct zserv *, int);
+extern void zebra_redistribute_delete (int, struct zserv *, int);
 
-void zebra_redistribute_default_add (int, struct zserv *, int);
-void zebra_redistribute_default_delete (int, struct zserv *, int);
+extern void zebra_redistribute_default_add (int, struct zserv *, int);
+extern void zebra_redistribute_default_delete (int, struct zserv *, int);
 
-void redistribute_add (struct prefix *, struct rib *);
-void redistribute_delete (struct prefix *, struct rib *);
+extern void redistribute_add (struct prefix *, struct rib *);
+extern void redistribute_delete (struct prefix *, struct rib *);
 
-void zebra_interface_up_update (struct interface *);
-void zebra_interface_down_update (struct interface *);
+extern void zebra_interface_up_update (struct interface *);
+extern void zebra_interface_down_update (struct interface *);
 
-void zebra_interface_add_update (struct interface *);
-void zebra_interface_delete_update (struct interface *);
+extern void zebra_interface_add_update (struct interface *);
+extern void zebra_interface_delete_update (struct interface *);
 
-void zebra_interface_address_add_update (struct interface *,
-                                        struct connected *);
-void zebra_interface_address_delete_update (struct interface *,
-                                           struct connected *c);
+extern void zebra_interface_address_add_update (struct interface *,
+                                               struct connected *);
+extern void zebra_interface_address_delete_update (struct interface *,
+                                                  struct connected *c);
 
 #endif /* _ZEBRA_REDISTRIBUTE_H */
 
index 1e6393e6ae13bb49e0bde1d15363981f50b7a733..dbd2a6b15a48832949cef63b3caee1ad957ec50d 100644 (file)
@@ -201,70 +201,67 @@ struct vrf
   struct route_table *stable[AFI_MAX][SAFI_MAX];
 };
 
-struct nexthop *nexthop_ifindex_add (struct rib *, unsigned int);
-struct nexthop *nexthop_ifname_add (struct rib *, char *);
-struct nexthop *nexthop_blackhole_add (struct rib *);
-struct nexthop *nexthop_ipv4_add (struct rib *, struct in_addr *);
+extern struct nexthop *nexthop_ifindex_add (struct rib *, unsigned int);
+extern struct nexthop *nexthop_ifname_add (struct rib *, char *);
+extern struct nexthop *nexthop_blackhole_add (struct rib *);
+extern struct nexthop *nexthop_ipv4_add (struct rib *, struct in_addr *);
 #ifdef HAVE_IPV6
-struct nexthop *nexthop_ipv6_add (struct rib *, struct in6_addr *);
+extern struct nexthop *nexthop_ipv6_add (struct rib *, struct in6_addr *);
 #endif /* HAVE_IPV6 */
 
-struct vrf *vrf_lookup (u_int32_t);
-struct route_table *vrf_table (afi_t afi, safi_t safi, u_int32_t id);
-struct route_table *vrf_static_table (afi_t afi, safi_t safi, u_int32_t id);
+extern struct vrf *vrf_lookup (u_int32_t);
+extern struct route_table *vrf_table (afi_t afi, safi_t safi, u_int32_t id);
+extern struct route_table *vrf_static_table (afi_t afi, safi_t safi, u_int32_t id);
 
-int
-rib_add_ipv4 (int type, int flags, struct prefix_ipv4 *p, 
-             struct in_addr *gate, unsigned int ifindex, u_int32_t vrf_id,
-             u_int32_t, u_char);
+extern int rib_add_ipv4 (int type, int flags, struct prefix_ipv4 *p, 
+                        struct in_addr *gate, unsigned int ifindex, 
+                        u_int32_t vrf_id, u_int32_t, u_char);
 
-int
-rib_add_ipv4_multipath (struct prefix_ipv4 *, struct rib *);
+extern int rib_add_ipv4_multipath (struct prefix_ipv4 *, struct rib *);
 
-int
-rib_delete_ipv4 (int type, int flags, struct prefix_ipv4 *p,
-                struct in_addr *gate, unsigned int ifindex, u_int32_t);
+extern int rib_delete_ipv4 (int type, int flags, struct prefix_ipv4 *p,
+                           struct in_addr *gate, unsigned int ifindex, 
+                           u_int32_t);
 
-struct rib *
-rib_match_ipv4 (struct in_addr);
+extern struct rib *rib_match_ipv4 (struct in_addr);
 
-struct rib *
-rib_lookup_ipv4 (struct prefix_ipv4 *);
+extern struct rib *rib_lookup_ipv4 (struct prefix_ipv4 *);
 
-void rib_update ();
-void rib_sweep_route ();
-void rib_close ();
-void rib_init ();
+extern void rib_update (void);
+extern void rib_weed_tables (void);
+extern void rib_sweep_route (void);
+extern void rib_close (void);
+extern void rib_init (void);
 
-int
+extern int
 static_add_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
        u_char flags, u_char distance, u_int32_t vrf_id);
 
-int
+extern int
 static_delete_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
                    u_char distance, u_int32_t vrf_id);
 
 #ifdef HAVE_IPV6
-int
+extern int
 rib_add_ipv6 (int type, int flags, struct prefix_ipv6 *p,
              struct in6_addr *gate, unsigned int ifindex, u_int32_t vrf_id);
 
-int
+extern int
 rib_delete_ipv6 (int type, int flags, struct prefix_ipv6 *p,
                 struct in6_addr *gate, unsigned int ifindex, u_int32_t vrf_id);
 
-struct rib *rib_lookup_ipv6 (struct in6_addr *);
+extern struct rib *rib_lookup_ipv6 (struct in6_addr *);
 
-struct rib *rib_match_ipv6 (struct in6_addr *);
+extern struct rib *rib_match_ipv6 (struct in6_addr *);
 
 extern struct route_table *rib_table_ipv6;
 
-int
+extern int
 static_add_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
                 const char *ifname, u_char flags, u_char distance,
                 u_int32_t vrf_id);
 
-int
+extern int
 static_delete_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
                    const char *ifname, u_char distance, u_int32_t vrf_id);
 
index 6194582e069f4f60a1c30a3fc4528b11a89e2fc9..c73b65b5d7a377ec955dba0363005a493a7cd6e7 100644 (file)
@@ -38,6 +38,7 @@
 #include "rib.h"
 
 #include "zebra/zserv.h"
+#include "zebra/router-id.h"
 
 static struct list rid_all_sorted_list;
 static struct list rid_lo_sorted_list;
@@ -228,7 +229,7 @@ DEFUN (no_router_id,
   return CMD_SUCCESS;
 }
 
-int
+static int
 router_id_cmp (void *a, void *b)
 {
   unsigned int A, B;
index faaddab93f0be708816e7edcc64faeff3c63f1fe..e902b21091e40e8f5410ca5cfe7dfa2c6c76d706 100644 (file)
 #ifndef _ZEBRA_RT_H
 #define _ZEBRA_RT_H
 
-int kernel_add_ipv4 (struct prefix *, struct rib *);
-int kernel_delete_ipv4 (struct prefix *, struct rib *);
-int kernel_add_route (struct prefix_ipv4 *, struct in_addr *, int, int);
-int kernel_address_add_ipv4 (struct interface *, struct connected *);
-int kernel_address_delete_ipv4 (struct interface *, struct connected *);
+extern int kernel_add_ipv4 (struct prefix *, struct rib *);
+extern int kernel_delete_ipv4 (struct prefix *, struct rib *);
+extern int kernel_add_route (struct prefix_ipv4 *, struct in_addr *, int, int);
+extern int kernel_address_add_ipv4 (struct interface *, struct connected *);
+extern int kernel_address_delete_ipv4 (struct interface *, struct connected *);
 
 #ifdef HAVE_IPV6
-int kernel_add_ipv6 (struct prefix *, struct rib *);
-int kernel_delete_ipv6 (struct prefix *, struct rib *);
-int kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate,
-                           unsigned int index, int flags, int table);
+extern int kernel_add_ipv6 (struct prefix *, struct rib *);
+extern int kernel_delete_ipv6 (struct prefix *, struct rib *);
+extern int kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate,
+                                 unsigned int index, int flags, int table);
 
 #endif /* HAVE_IPV6 */
 
index a8e9e5213e69d0f7184d3de9ffb3a5a8f2e2a8a3..f4997e22465ebe3a152a43eb202d3023b6084468 100644 (file)
 #include "log.h"
 #include "if.h"
 
+#include "zebra/zserv.h"
 #include "zebra/rib.h"
 #include "zebra/debug.h"
+#include "zebra/rt.h"
 
 /* Initialize of kernel interface.  There is no kernel communication
    support under ioctl().  So this is dummy stub function. */
 void
-kernel_init ()
+kernel_init (void)
 {
   return;
 }
 
 /* Dummy function of routing socket. */
-void
+static void
 kernel_read (int sock)
 {
   return;
@@ -160,7 +162,7 @@ kernel_add_route (struct prefix_ipv4 *dest, struct in_addr *gate,
 }
 
 /* Interface to ioctl route message. */
-int
+static int
 kernel_ioctl_ipv4 (u_long cmd, struct prefix *p, struct rib *rib, int family)
 {
   int ret;
@@ -360,7 +362,7 @@ kernel_delete_ipv4 (struct prefix *p, struct rib *rib)
 #include <linux/ipv6_route.h>
 #endif
 
-int
+static int
 kernel_ioctl_ipv6 (u_long type, struct prefix_ipv6 *dest, struct in6_addr *gate,
                   int index, int flags)
 {
@@ -421,7 +423,7 @@ kernel_ioctl_ipv6 (u_long type, struct prefix_ipv6 *dest, struct in6_addr *gate,
   return ret;
 }
 
-int
+static int
 kernel_ioctl_ipv6_multipath (u_long cmd, struct prefix *p, struct rib *rib,
                             int family)
 {
@@ -551,7 +553,7 @@ kernel_delete_ipv6 (struct prefix *p, struct rib *rib)
 /* Delete IPv6 route from the kernel. */
 int
 kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate,
-                   int index, int flags, int table)
+                   unsigned int index, int flags, int table)
 {
   return kernel_ioctl_ipv6 (SIOCDELRT, dest, gate, index, flags);
 }
index 3e22398574cfa82fd6212e53abf56a459e7a8164..83c3e777a23cc903df7b2fd8d771df49f3378fb7 100644 (file)
@@ -62,10 +62,10 @@ extern struct zebra_t zebrad;
 enum rtadv_event {RTADV_START, RTADV_STOP, RTADV_TIMER, 
                  RTADV_TIMER_MSEC, RTADV_READ};
 
-void rtadv_event (enum rtadv_event, int);
+static void rtadv_event (enum rtadv_event, int);
 
-int if_join_all_router (int, struct interface *);
-int if_leave_all_router (int, struct interface *);
+static int if_join_all_router (int, struct interface *);
+static int if_leave_all_router (int, struct interface *);
 \f
 /* Structure which hold status of router advertisement. */
 struct rtadv
@@ -81,8 +81,8 @@ struct rtadv
 
 struct rtadv *rtadv = NULL;
 \f
-struct rtadv *
-rtadv_new ()
+static struct rtadv *
+rtadv_new (void)
 {
   struct rtadv *new;
   new = XMALLOC (MTYPE_TMP, sizeof (struct rtadv));
@@ -90,13 +90,13 @@ rtadv_new ()
   return new;
 }
 
-void
+static void
 rtadv_free (struct rtadv *rtadv)
 {
   XFREE (MTYPE_TMP, rtadv);
 }
 
-int
+static int
 rtadv_recv_packet (int sock, u_char *buf, int buflen,
                   struct sockaddr_in6 *from, unsigned int *ifindex,
                   int *hoplimit)
@@ -149,7 +149,7 @@ rtadv_recv_packet (int sock, u_char *buf, int buflen,
 #define RTADV_MSG_SIZE 4096
 
 /* Send router advertisement packet. */
-void
+static void
 rtadv_send_packet (int sock, struct interface *ifp)
 {
   struct msghdr msg;
@@ -333,7 +333,7 @@ rtadv_send_packet (int sock, struct interface *ifp)
     }
 }
 
-int
+static int
 rtadv_timer (struct thread *thread)
 {
   struct listnode *node, *nnode;
@@ -373,7 +373,7 @@ rtadv_timer (struct thread *thread)
   return 0;
 }
 
-void
+static void
 rtadv_process_solicit (struct interface *ifp)
 {
   zlog_info ("Router solicitation received on %s", ifp->name);
@@ -381,13 +381,13 @@ rtadv_process_solicit (struct interface *ifp)
   rtadv_send_packet (rtadv->sock, ifp);
 }
 
-void
-rtadv_process_advert ()
+static void
+rtadv_process_advert (void)
 {
   zlog_info ("Router advertisement received");
 }
 
-void
+static void
 rtadv_process_packet (u_char *buf, unsigned int len, unsigned int ifindex, int hoplimit)
 {
   struct icmp6_hdr *icmph;
@@ -444,7 +444,7 @@ rtadv_process_packet (u_char *buf, unsigned int len, unsigned int ifindex, int h
   return;
 }
 
-int
+static int
 rtadv_read (struct thread *thread)
 {
   int sock;
@@ -473,7 +473,7 @@ rtadv_read (struct thread *thread)
   return 0;
 }
 
-int
+static int
 rtadv_make_socket (void)
 {
   int sock;
@@ -526,7 +526,7 @@ rtadv_make_socket (void)
   return sock;
 }
 \f
-struct rtadv_prefix *
+static struct rtadv_prefix *
 rtadv_prefix_new ()
 {
   struct rtadv_prefix *new;
@@ -537,13 +537,13 @@ rtadv_prefix_new ()
   return new;
 }
 
-void
+static void
 rtadv_prefix_free (struct rtadv_prefix *rtadv_prefix)
 {
   XFREE (MTYPE_RTADV_PREFIX, rtadv_prefix);
 }
 
-struct rtadv_prefix *
+static struct rtadv_prefix *
 rtadv_prefix_lookup (struct list *rplist, struct prefix *p)
 {
   struct listnode *node;
@@ -555,7 +555,7 @@ rtadv_prefix_lookup (struct list *rplist, struct prefix *p)
   return NULL;
 }
 
-struct rtadv_prefix *
+static struct rtadv_prefix *
 rtadv_prefix_get (struct list *rplist, struct prefix *p)
 {
   struct rtadv_prefix *rprefix;
@@ -571,7 +571,7 @@ rtadv_prefix_get (struct list *rplist, struct prefix *p)
   return rprefix;
 }
 
-void
+static void
 rtadv_prefix_set (struct zebra_if *zif, struct rtadv_prefix *rp)
 {
   struct rtadv_prefix *rprefix;
@@ -586,7 +586,7 @@ rtadv_prefix_set (struct zebra_if *zif, struct rtadv_prefix *rp)
   rprefix->AdvRouterAddressFlag = rp->AdvRouterAddressFlag;
 }
 
-int
+static int
 rtadv_prefix_reset (struct zebra_if *zif, struct rtadv_prefix *rp)
 {
   struct rtadv_prefix *rprefix;
@@ -1448,7 +1448,7 @@ rtadv_config_write (struct vty *vty, struct interface *ifp)
 }
 
 
-void
+static void
 rtadv_event (enum rtadv_event event, int val)
 {
   switch (event)
@@ -1493,7 +1493,7 @@ rtadv_event (enum rtadv_event event, int val)
 }
 
 void
-rtadv_init ()
+rtadv_init (void)
 {
   int sock;
 
@@ -1542,7 +1542,7 @@ rtadv_init ()
   install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_cmd);
 }
 
-int
+static int
 if_join_all_router (int sock, struct interface *ifp)
 {
   int ret;
@@ -1563,7 +1563,7 @@ if_join_all_router (int sock, struct interface *ifp)
   return 0;
 }
 
-int
+static int
 if_leave_all_router (int sock, struct interface *ifp)
 {
   int ret;
@@ -1586,7 +1586,7 @@ if_leave_all_router (int sock, struct interface *ifp)
 
 #else
 void
-rtadv_init ()
+rtadv_init (void)
 {
   /* Empty.*/;
 }
index d52c2c0862d46aa907d43430e0d63cea2b5e73a1..c2855a30634281b4438c03663124d661a45f5c7c 100644 (file)
@@ -52,7 +52,8 @@ struct rtadv_prefix
 
 };
 
-void rtadv_config_write (struct vty *, struct interface *);
+extern void rtadv_config_write (struct vty *, struct interface *);
+extern void rtadv_init (void);
 
 /* draft-ietf-mip6-mipext-advapi-03 */
 
index 491fc98784312541d5c3d9e2e813288977cdb4a6..ab3891a315f940163b54094670e8d5cfb18dcd68 100644 (file)
@@ -27,6 +27,9 @@
 #include "if.h"
 #include "rib.h"
 
+#include "zebra/zserv.h"
+#include "zebra/rt.h"
+
 /* Proc file system to read IPv4 routing table. */
 #ifndef _PATH_PROCNET_ROUTE
 #define _PATH_PROCNET_ROUTE      "/proc/net/route"
@@ -44,8 +47,8 @@
 #define RT_BUFSIZ 1024
 
 /* Kernel routing table read up by /proc filesystem. */
-int
-proc_route_read ()
+static int
+proc_route_read (void)
 {
   FILE *fp;
   char buf[RT_BUFSIZ];
@@ -101,7 +104,7 @@ proc_route_read ()
 }
 
 #ifdef HAVE_IPV6
-int
+static int
 proc_ipv6_route_read ()
 {
   FILE *fp;
@@ -162,7 +165,7 @@ proc_ipv6_route_read ()
 #endif /* HAVE_IPV6 */
 
 void
-route_read ()
+route_read (void)
 {
   proc_route_read ();
 #ifdef HAVE_IPV6
index a8aaef3eb665c7e71726032596c5e733f662ed4b..da6a3a8eadb0e9d727bb5b8d503c3f6d3b96ba39 100644 (file)
@@ -71,7 +71,7 @@ struct zebra_queue_node_t
 vector vrf_vector;
 
 /* Allocate new VRF.  */
-struct vrf *
+static struct vrf *
 vrf_alloc (const char *name)
 {
   struct vrf *vrf;
@@ -92,7 +92,7 @@ vrf_alloc (const char *name)
 }
 
 /* Free VRF.  */
-void
+static void
 vrf_free (struct vrf *vrf)
 {
   if (vrf->name)
@@ -108,7 +108,7 @@ vrf_lookup (u_int32_t id)
 }
 
 /* Lookup VRF by name.  */
-struct vrf *
+static struct vrf *
 vrf_lookup_by_name (char *name)
 {
   unsigned int i;
@@ -122,8 +122,8 @@ vrf_lookup_by_name (char *name)
 }
 
 /* Initialize VRF.  */
-void
-vrf_init ()
+static void
+vrf_init (void)
 {
   struct vrf *default_table;
 
@@ -164,7 +164,7 @@ vrf_static_table (afi_t afi, safi_t safi, u_int32_t id)
 }
 \f
 /* Add nexthop to the end of the list.  */
-void
+static void
 nexthop_add (struct rib *rib, struct nexthop *nexthop)
 {
   struct nexthop *last;
@@ -181,7 +181,7 @@ nexthop_add (struct rib *rib, struct nexthop *nexthop)
 }
 
 /* Delete specified nexthop from the list. */
-void
+static void
 nexthop_delete (struct rib *rib, struct nexthop *nexthop)
 {
   if (nexthop->next)
@@ -194,7 +194,7 @@ nexthop_delete (struct rib *rib, struct nexthop *nexthop)
 }
 
 /* Free nexthop. */
-void
+static void
 nexthop_free (struct nexthop *nexthop)
 {
   if (nexthop->ifname)
@@ -247,7 +247,7 @@ nexthop_ipv4_add (struct rib *rib, struct in_addr *ipv4)
   return nexthop;
 }
 
-struct nexthop *
+static struct nexthop *
 nexthop_ipv4_ifindex_add (struct rib *rib, struct in_addr *ipv4, 
                          unsigned int ifindex)
 {
@@ -280,7 +280,7 @@ nexthop_ipv6_add (struct rib *rib, struct in6_addr *ipv6)
   return nexthop;
 }
 
-struct nexthop *
+static struct nexthop *
 nexthop_ipv6_ifname_add (struct rib *rib, struct in6_addr *ipv6,
                         char *ifname)
 {
@@ -297,7 +297,7 @@ nexthop_ipv6_ifname_add (struct rib *rib, struct in6_addr *ipv6,
   return nexthop;
 }
 
-struct nexthop *
+static struct nexthop *
 nexthop_ipv6_ifindex_add (struct rib *rib, struct in6_addr *ipv6,
                          unsigned int ifindex)
 {
@@ -332,7 +332,7 @@ nexthop_blackhole_add (struct rib *rib)
 
 /* If force flag is not set, do not modify falgs at all for uninstall
    the route from FIB. */
-int
+static int
 nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
                     struct route_node *top)
 {
@@ -429,7 +429,7 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
 #ifdef HAVE_IPV6
 /* If force flag is not set, do not modify falgs at all for uninstall
    the route from FIB. */
-int
+static int
 nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set,
                     struct route_node *top)
 {
@@ -685,7 +685,7 @@ rib_match_ipv6 (struct in6_addr *addr)
 }
 #endif /* HAVE_IPV6 */
 
-int
+static int
 nexthop_active_check (struct route_node *rn, struct rib *rib,
                      struct nexthop *nexthop, int set)
 {
@@ -757,7 +757,7 @@ nexthop_active_check (struct route_node *rn, struct rib *rib,
   return CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
 }
 
-int
+static int
 nexthop_active_update (struct route_node *rn, struct rib *rib, int set)
 {
   struct nexthop *nexthop;
@@ -816,7 +816,7 @@ rib_unlock (struct rib *rib)
   return rib;
 }
 
-void
+static void
 rib_install_kernel (struct route_node *rn, struct rib *rib)
 {
   int ret = 0;
@@ -842,7 +842,7 @@ rib_install_kernel (struct route_node *rn, struct rib *rib)
 }
 
 /* Uninstall the route from kernel. */
-int
+static int
 rib_uninstall_kernel (struct route_node *rn, struct rib *rib)
 {
   int ret = 0;
@@ -867,7 +867,7 @@ rib_uninstall_kernel (struct route_node *rn, struct rib *rib)
 }
 
 /* Uninstall the route from kernel. */
-void
+static void
 rib_uninstall (struct route_node *rn, struct rib *rib)
 {
   if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
@@ -880,7 +880,7 @@ rib_uninstall (struct route_node *rn, struct rib *rib)
 }
 
 /* Core function for processing routing information base. */
-wq_item_status
+static wq_item_status
 rib_process (struct zebra_queue_node_t *qnode)
 {
   struct rib *rib;
@@ -999,7 +999,7 @@ rib_process (struct zebra_queue_node_t *qnode)
 }
 
 /* Add work queue item to work queue and schedule processing */
-void
+static void
 rib_queue_add_qnode (struct zebra_t *zebra, struct zebra_queue_node_t *qnode)
 {
   route_lock_node (qnode->node);
@@ -1025,7 +1025,7 @@ rib_queue_add_qnode (struct zebra_t *zebra, struct zebra_queue_node_t *qnode)
 }
 
 /* Add route node and rib to work queue and schedule processing */
-void
+static void
 rib_queue_add (struct zebra_t *zebra, struct route_node *rn, struct rib *del)
 {
  struct zebra_queue_node_t *qnode;
@@ -1051,7 +1051,7 @@ rib_queue_add (struct zebra_t *zebra, struct route_node *rn, struct rib *del)
 }
 
 /* free zebra_queue_node_t */
-void
+static void
 rib_queue_qnode_del (struct zebra_queue_node_t *qnode)
 {
   route_unlock_node (qnode->node);
@@ -1063,7 +1063,7 @@ rib_queue_qnode_del (struct zebra_queue_node_t *qnode)
 }
 
 /* initialise zebra rib work queue */
-void
+static void
 rib_queue_init (struct zebra_t *zebra)
 {
   assert (zebra);
@@ -1088,7 +1088,7 @@ rib_queue_init (struct zebra_t *zebra)
 }
 
 /* Add RIB to head of the route node. */
-void
+static void
 rib_addnode (struct route_node *rn, struct rib *rib)
 {
   struct rib *head;
@@ -1105,7 +1105,7 @@ rib_addnode (struct route_node *rn, struct rib *rib)
   rn->info = rib;
 }
 
-void
+static void
 rib_delnode (struct route_node *rn, struct rib *rib)
 {
   assert (rn && rib);
@@ -1418,7 +1418,7 @@ rib_delete_ipv4 (int type, int flags, struct prefix_ipv4 *p,
 }
 \f
 /* Install static route into rib. */
-void
+static void
 static_install_ipv4 (struct prefix *p, struct static_ipv4 *si)
 {
   struct rib *rib;
@@ -1489,7 +1489,7 @@ static_install_ipv4 (struct prefix *p, struct static_ipv4 *si)
     }
 }
 
-int
+static int
 static_ipv4_nexthop_same (struct nexthop *nexthop, struct static_ipv4 *si)
 {
   if (nexthop->type == NEXTHOP_TYPE_IPV4
@@ -1507,7 +1507,7 @@ static_ipv4_nexthop_same (struct nexthop *nexthop, struct static_ipv4 *si)
 }
 
 /* Uninstall static route from RIB. */
-void
+static void
 static_uninstall_ipv4 (struct prefix *p, struct static_ipv4 *si)
 {
   struct route_node *rn;
@@ -1725,7 +1725,7 @@ static_delete_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
 
 \f
 #ifdef HAVE_IPV6
-int
+static int
 rib_bogus_ipv6 (int type, struct prefix_ipv6 *p,
                struct in6_addr *gate, unsigned int ifindex, int table)
 {
@@ -1967,7 +1967,7 @@ rib_delete_ipv6 (int type, int flags, struct prefix_ipv6 *p,
 }
 \f
 /* Install static route into rib. */
-void
+static void
 static_install_ipv6 (struct prefix *p, struct static_ipv6 *si)
 {
   struct rib *rib;
@@ -2039,7 +2039,7 @@ static_install_ipv6 (struct prefix *p, struct static_ipv6 *si)
     }
 }
 
-int
+static int
 static_ipv6_nexthop_same (struct nexthop *nexthop, struct static_ipv6 *si)
 {
   if (nexthop->type == NEXTHOP_TYPE_IPV6
@@ -2058,7 +2058,7 @@ static_ipv6_nexthop_same (struct nexthop *nexthop, struct static_ipv6 *si)
   return 0;;
 }
 
-void
+static void
 static_uninstall_ipv6 (struct prefix *p, struct static_ipv6 *si)
 {
   struct route_table *table;
@@ -2250,7 +2250,7 @@ static_delete_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
 \f
 /* RIB update function. */
 void
-rib_update ()
+rib_update (void)
 {
   struct route_node *rn;
   struct route_table *table;
@@ -2269,21 +2269,21 @@ rib_update ()
 }
 
 /* Interface goes up. */
-void
+static void
 rib_if_up (struct interface *ifp)
 {
   rib_update ();
 }
 
 /* Interface goes down. */
-void
+static void
 rib_if_down (struct interface *ifp)
 {
   rib_update ();
 }
 \f
 /* Remove all routes which comes from non main table.  */
-void
+static void
 rib_weed_table (struct route_table *table)
 {
   struct route_node *rn;
@@ -2304,14 +2304,14 @@ rib_weed_table (struct route_table *table)
 
 /* Delete all routes from non main table. */
 void
-rib_weed_tables ()
+rib_weed_tables (void)
 {
   rib_weed_table (vrf_table (AFI_IP, SAFI_UNICAST, 0));
   rib_weed_table (vrf_table (AFI_IP6, SAFI_UNICAST, 0));
 }
 \f
 /* Delete self installed routes after zebra is relaunched.  */
-void
+static void
 rib_sweep_table (struct route_table *table)
 {
   struct route_node *rn;
@@ -2337,14 +2337,14 @@ rib_sweep_table (struct route_table *table)
 
 /* Sweep all RIB tables.  */
 void
-rib_sweep_route ()
+rib_sweep_route (void)
 {
   rib_sweep_table (vrf_table (AFI_IP, SAFI_UNICAST, 0));
   rib_sweep_table (vrf_table (AFI_IP6, SAFI_UNICAST, 0));
 }
 \f
 /* Close RIB and clean up kernel routes. */
-void
+static void
 rib_close_table (struct route_table *table)
 {
   struct route_node *rn;
@@ -2360,7 +2360,7 @@ rib_close_table (struct route_table *table)
 
 /* Close all RIB tables.  */
 void
-rib_close ()
+rib_close (void)
 {
   rib_close_table (vrf_table (AFI_IP, SAFI_UNICAST, 0));
   rib_close_table (vrf_table (AFI_IP6, SAFI_UNICAST, 0));
@@ -2368,7 +2368,7 @@ rib_close ()
 \f
 /* Routing information base initialize. */
 void
-rib_init ()
+rib_init (void)
 {
   rib_queue_init (&zebrad);
   /* VRF initialization.  */
index 9830e5b1e1dfba1a0329f946fef420ecb3100325..ad91d959ced9419f34947847478bdd1bf879732d 100644 (file)
 #include "table.h"
 #include "rib.h"
 
+#include "zebra/zserv.h"
+
 /* Return route type string for VTY output.  */
-const char *
+static const char *
 route_type_str (u_char type)
 {
   switch (type)
@@ -59,7 +61,7 @@ route_type_str (u_char type)
 };
 
 /* Return route type string for VTY output.  */
-char
+static const char
 route_type_char (u_char type)
 {
   switch (type)
@@ -90,7 +92,7 @@ route_type_char (u_char type)
 };
 \f
 /* General fucntion for static route. */
-int
+static int
 zebra_static_ipv4 (struct vty *vty, int add_cmd, const char *dest_str,
                   const char *mask_str, const char *gate_str,
                   const char *flag_str, const char *distance_str)
@@ -535,7 +537,7 @@ DEFUN (no_ip_route_mask_flags_distance2,
 }
 
 /* New RIB.  Detailed information for IPv4 route. */
-void
+static void
 vty_show_ip_route_detail (struct vty *vty, struct route_node *rn)
 {
   struct rib *rib;
@@ -641,7 +643,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn)
     }
 }
 
-void
+static void
 vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib)
 {
   struct nexthop *nexthop;
@@ -1008,7 +1010,7 @@ DEFUN (show_ip_route_prefix,
   return CMD_SUCCESS;
 }
 
-void
+static void
 zebra_show_ip_route (struct vty *vty, struct vrf *vrf)
 {
   vty_out (vty, "IP routing table name is %s(%d)%s",
@@ -1059,7 +1061,7 @@ DEFUN (show_ip_route_summary,
 }
 
 /* Write IPv4 static route configuration. */
-int
+static int
 static_config_ipv4 (struct vty *vty)
 {
   struct route_node *rn;
@@ -1115,7 +1117,7 @@ static_config_ipv4 (struct vty *vty)
 \f
 #ifdef HAVE_IPV6
 /* General fucntion for IPv6 static route. */
-int
+static int
 static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
                  const char *gate_str, const char *ifname,
                  const char *flag_str, const char *distance_str)
@@ -1420,7 +1422,7 @@ DEFUN (no_ipv6_route_ifname_flags_pref,
 }
 
 /* New RIB.  Detailed information for IPv6 route. */
-void
+static void
 vty_show_ipv6_route_detail (struct vty *vty, struct route_node *rn)
 {
   struct rib *rib;
@@ -1535,7 +1537,7 @@ vty_show_ipv6_route_detail (struct vty *vty, struct route_node *rn)
     }
 }
 
-void
+static void
 vty_show_ipv6_route (struct vty *vty, struct route_node *rn,
                     struct rib *rib)
 {
@@ -1867,7 +1869,7 @@ DEFUN (show_ipv6_route_prefix,
 
 
 /* Write IPv6 static route configuration. */
-int
+static int
 static_config_ipv6 (struct vty *vty)
 {
   struct route_node *rn;
@@ -1921,7 +1923,7 @@ static_config_ipv6 (struct vty *vty)
 #endif /* HAVE_IPV6 */
 
 /* Static ip route configuration write function. */
-int
+static int
 zebra_ip_config (struct vty *vty)
 {
   int write = 0;
@@ -1939,7 +1941,7 @@ struct cmd_node ip_node = { IP_NODE,  "",  1 };
 
 /* Route VTY.  */
 void
-zebra_vty_route_init ()
+zebra_vty_init (void)
 {
   install_node (&ip_node, zebra_ip_config);
 
@@ -2014,9 +2016,3 @@ zebra_vty_route_init ()
   install_element (ENABLE_NODE, &show_ipv6_route_prefix_longer_cmd);
 #endif /* HAVE_IPV6 */
 }
-
-void
-zebra_vty_init ()
-{
-  zebra_vty_route_init ();
-}
index 17e7888d18507429d459d0cc593799f40d05c79d..f08f7ce8f5f7c513827be4b3d61790efbc1846c8 100644 (file)
@@ -1729,7 +1729,7 @@ struct cmd_node forwarding_node =
 \f
 /* Initialisation of zebra and installation of commands. */
 void
-zebra_init ()
+zebra_init (void)
 {
   /* Client list init. */
   zebrad.client_list = list_new ();
index 66270157de2e9bdba078e4e134a192e20a26518a..8e67c605c90cdf8d40762fc34ce2802ab3cc6ddd 100644 (file)
@@ -85,25 +85,26 @@ struct zebra_t
 #define PSIZE(a) (((a) + 7) / (8))
 
 /* Prototypes. */
-void zebra_init ();
-void zebra_if_init ();
-void hostinfo_get ();
-void rib_init ();
-void interface_list ();
-void kernel_init ();
-void route_read ();
-void rtadv_init ();
-void zebra_snmp_init ();
-
-int zsend_interface_add (struct zserv *, struct interface *);
+extern void zebra_init (void);
+extern void zebra_if_init (void);
+extern void hostinfo_get (void);
+extern void rib_init (void);
+extern void interface_list (void);
+extern void kernel_init (void);
+extern void route_read (void);
+extern void zebra_snmp_init (void);
+extern void zebra_vty_init (void);
+
+extern int zsend_interface_add (struct zserv *, struct interface *);
 #if (defined(RTM_IFANNOUNCE) || defined(HAVE_NETLINK))
-int zsend_interface_delete (struct zserv *, struct interface *);
+extern int zsend_interface_delete (struct zserv *, struct interface *);
 #endif
-int zsend_interface_address (int, struct zserv *, struct interface *,
-                             struct connected *);
-int zsend_interface_update (int, struct zserv *, struct interface *);
-int zsend_route_multipath (int, struct zserv *, struct prefix *, struct rib *);
-int zsend_router_id_update(struct zserv *, struct prefix *);
+extern int zsend_interface_address (int, struct zserv *, struct interface *,
+                                    struct connected *);
+extern int zsend_interface_update (int, struct zserv *, struct interface *);
+extern int zsend_route_multipath (int, struct zserv *, struct prefix *, 
+                                  struct rib *);
+extern int zsend_router_id_update(struct zserv *, struct prefix *);
 
 extern pid_t pid;
 extern pid_t old_pid;