diff options
Diffstat (limited to 'ripngd')
-rw-r--r-- | ripngd/.gitignore | 17 | ||||
-rw-r--r-- | ripngd/ChangeLog | 388 | ||||
-rw-r--r-- | ripngd/Makefile.am | 3 | ||||
-rw-r--r-- | ripngd/ripng_debug.c | 2 | ||||
-rw-r--r-- | ripngd/ripng_debug.h | 4 | ||||
-rw-r--r-- | ripngd/ripng_interface.c | 65 | ||||
-rw-r--r-- | ripngd/ripng_main.c | 6 | ||||
-rw-r--r-- | ripngd/ripng_nexthop.h | 13 | ||||
-rw-r--r-- | ripngd/ripng_offset.c | 24 | ||||
-rw-r--r-- | ripngd/ripng_peer.c | 14 | ||||
-rw-r--r-- | ripngd/ripng_route.c | 4 | ||||
-rw-r--r-- | ripngd/ripng_route.h | 17 | ||||
-rw-r--r-- | ripngd/ripng_routemap.c | 56 | ||||
-rw-r--r-- | ripngd/ripng_zebra.c | 16 | ||||
-rw-r--r-- | ripngd/ripngd.c | 60 | ||||
-rw-r--r-- | ripngd/ripngd.h | 130 |
16 files changed, 234 insertions, 585 deletions
diff --git a/ripngd/.gitignore b/ripngd/.gitignore new file mode 100644 index 00000000..e871fae3 --- /dev/null +++ b/ripngd/.gitignore @@ -0,0 +1,17 @@ +Makefile +Makefile.in +*.o +ripngd +ripngd.conf +tags +TAGS +.deps +.nfs* +*.lo +*.la +*.libs +.arch-inventory +.arch-ids +*~ +*.loT +*.a diff --git a/ripngd/ChangeLog b/ripngd/ChangeLog deleted file mode 100644 index b8c24c6a..00000000 --- a/ripngd/ChangeLog +++ /dev/null @@ -1,388 +0,0 @@ -2007-04-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * ripngd.c: (ripng_vty_out_uptime) Remove unused variable timer_now. - -2007-04-12 Emmanuel Vize <emmanuel.vize@6wind.com> - - * ripngd.c: (ripng_vty_out_uptime and show_ipv6_ripng_status) - Use new thread_timer_remain_second to display properly the timers - (reported patch from Andrew J. Schorr in ripd.c) - -2006-05-11 Paul Jakma <paul.jakma@sun.com> - - * ripng_interface.c: (ripng_interface_address_add) Remove - unneeded NULL check, Coverity CID #72. - -2006-05-08 Paul Jakma <paul.jakma@sun.com> - - * ripng_routemap.c: (route_set_ipv6_nexthop_local_compile) bug - #242, s/in_addr/in6_addr to fix crash. - Thanks to jithinvachery+quagga@gmail.com. - -2006-01-19 Paul Jakma <paul.jakma@sun.com> - - * (general) various miscellaneous compiler warning fixes. - Remove redundant break statements from switch clauses - which return. - return from main, not exit, cause it annoys SOS. - Remove stray semi-colons which cause empty-statement - warnings. - -2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded - table str[]. Replace str[i] with new library function - zebra_route_string(i). - * ripngd.c: Remove local hard-coded table route_info[]. - (show_ipv6_ripng) Use new library function zebra_route_char() instead - of table route_info[]. - -2005-08-27 Hasso Tepper <hasso at quagga.net> - - * ripng_zebra.c, ripngd.[ch]: Pass metric info to the zebra daemon. - -2005-04-11 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * ripng_zebra.c (ripng_redistribute_unset, ripng_redistribute_clean): - Change 2nd arg to zebra_redistribute_send from zclient->sock - to zclient. - -2005-04-08 Hasso Tepper <hasso at quagga.net> - - * ripngd.[hc], ripng_interface.c, ripng_peer.c: inet6_ntoa() takes - argument now by value. - -2005-04-05 Hasso Tepper <hasso at quagga.net> - - * ripngd.[hc]: Remove inet6_ntop() and any usage of it. inet6_ntoa() - from lib is used now. - * ripng_interface.c: inet6_ntop() -> inet6_ntoa(). - * ripng_peer.c: inet6_ntop() -> inet6_ntoa(). - -2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * ripng_interface.c: (ripng_interface_delete) After deleting, set - ifp->ifindex to IFINDEX_INTERNAL. - -2005-01-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * ripng_interface.c: (ripng_multicast_join) Save errno before calling - ripngd_privs.change. - -2005-01-04 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * ripngd.c: (ripng_recv_packet) Use ZCMSG_FIRSTHDR instead of - CMSG_FIRSTHDR. - -2004-12-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * ripng_nexthop.c: Replace NEXTHOP_OUT macro with NEXTHOP_OUT_PTR, - since it's not really OK to take the address of a ternary expression. - (_ripng_rte_cmp,ripng_rte_send) Use new NEXTHOP_OUT_PTR macro - instead of NEXTHOP_OUT. - -2004-12-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * *.c: Change level of debug messages to LOG_DEBUG. - -2004-12-07 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * ripng_main.c: (main) The 2nd argument to openzlog has been removed. - -2004-12-03 Andrew J. Schorr <ajschorr@alumni.princeton.edu> - - * ripng_main.c: (sighup) Remove spurious terminating message. - (sigint) Use zlog_notice for termination message. - (main) Issue a startup announcement using zlog_notice. - -2004-11-25 Hasso Tepper <hasso at quagga.net> - - * ripng_main.c: Make group to run as configurable. - -2004-10-26 Hasso Tepper <hasso at quagga.net> - - * ripng_debug.c: Fix help of "show debugging ripng" command. - -2004-10-11 Hasso Tepper <hasso at quagga.net> - - * *.c: Make more strings const. - -2004-10-08 Hasso Tepper <hasso at quagga.net> - - * *.[c|h]: Fix compiler warnings: make strings const, signed -> - unsigned etc. - -2004-09-26 Hasso Tepper <hasso at quagga.net> - - * ripingd.c: Access list hook argument function must have struct - access_list * argument. Solution taken from ripd. - * ripngd.c, ripnf_nexthop.c: Fix compiler warnings. - -2004-09-23 Hasso Tepper <hasso at quagga.net> - - * *.[c|h]: list -> struct list *, listnode -> struct listnode *. - -2004-09-17 Paul Jakma <paul@dishone.st> - - * ripngd.c: move setsockopt_so_recvbuf to lib. - -2004-07-23 Hasso Tepper <hasso@estpak.ee> - - * ripng_interface.c, ripng_nexthop.c: use ifp->mtu6 instead of - ifp->mtu. - -2004-07-01 Greg Troxel <gdt@fnord.ir.bbn.com> - - * ripng_interface.c (ripng_multicast_join): Use privs to do join, - to work around bug on gif(4) on NetBSD 1.6.2. - -2004-05-11 Paul Jakma <paul@dishone.st> - - * ripng_nexthop.h: SUNOS_5 does not define s6_addr32 - catch ifndef(s6_addr32) && defined(SUNOS_5) and define - it ourselves based on the S10 _KERNEL guarded define. - -2004-05-08 Paul Jakma <paul@dishone.st> - - * ripng_{interface,zebra}.c: sync with zclient changes - -2004-01-03 Greg Troxel <gdt@ahi.ir.bbn.com> - - * ripng_interface.c (ripng_multicast_join): If IPV6_JOIN_GROUP - returns EADDRINUSE, consider the join successful. This happens - when an interface goes down and comes back because - ripng_multicast_leave does not invoke the LEAVE_GROUP operation if - the interface is down. Solves problem of ripng stopping working - on an interface which goes down and then comes back up (on NetBSD). - -2003-05-25 Hasso Tepper <hasso@estpak.ee> - - * Revert ripng_ifrmap stuff because ripd uses it now as well. - * Merge ripngd part of 6Wind patch from Vincent Jardin - <vjardin@wanadoo.fr>. - -2003-04-23 Hasso Tepper <hasso@estpak.ee> - - * {ripng_ifrmap,ripngd}.c: fix "router xxx" node commands in vtysh - -2003-04-19 Hasso Tepper <hasso@estpak.ee> - - * rip_routemap.c: sync daemon's route-map commands to have same - syntax - -2002-07-07 Kunihiro Ishiguro <kunihiro@ipinfusion.com> - - * zebra-0.93 released. - -2001-08-28 NOGUCHI Kay <kay@v6.access.co.jp> - - * ripngd.c (no_ripng_route): route_unlock_node () is not needed. - -2001-08-26 NOGUCHI Kay <kay@v6.access.co.jp> - - * ripngd.h (struct ripng_interface): Add passive interface option. - -2001-08-19 Kunihiro Ishiguro <kunihiro@ipinfusion.com> - - * zebra-0.92a released. - -2001-08-15 Kunihiro Ishiguro <kunihiro@ipinfusion.com> - - * zebra-0.92 released. - -2001-08-07 Akira Kato <kato@wide.ad.jp> - - * ripngd.c (ripng_timers): "timers basic" argument is fixed. - -2001-02-01 Kunihiro Ishiguro <kunihiro@zebra.org> - - * zebra-0.91 is released. - -2001-01-09 Kunihiro Ishiguro <kunihiro@zebra.org> - - * zebra-0.90 is released. - -2001-01-01 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.h (RIPNG_VTYSH_PATH): Change "/tmp/ripngd" to - "/tmp/.ripngd". - -2000-10-02 Kunihiro Ishiguro <kunihiro@zebra.org> - - * zebra-0.89 is released. - -2000-09-20 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_send_packet): Use CMSG_SPACE instead of sizeof - hack. Revert privious alignment patch. - -2000-09-20 URA Hiroshi <ura@hiru.aoba.yokohama.jp> - - * ripngd.c (ripng_send_packet): Fix an alignment bug. Thus ripngd - can't send packets. - -2000-09-10 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripng_interface.c (ripng_interface_address_delete): Connected - address delete treatment added. - -2000-08-22 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripng_routemap.c (route_set_metric_compile): When checking '-' - character, argv[1] should be argv[0]. Reported by SHIRASAKI - Yasuhiro <yasuhiro@ocn.v6.ntt.net>. - -2000-08-17 Kunihiro Ishiguro <kunihiro@zebra.org> - - * zebra-0.88 is released. - -2000-06-06 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_route_process): Clear prefix_ipv6 before using - it. - (ripng_redistribute_delete): Fix bug of missing - route_unlock_node() when redistribute route is not found. - (ripng_redistribute_delete): Make it sure that timers are off. - (ripng_redistribute_delete): Likewise. - -2000-01-19 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_route_process): Fix bug of mis-checking of same - route. - (show_ipv6_ripng): Include ifindex to "show ipv6 ripng" output. - -1999-11-12 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_output_process): Use MINMTU when mtu value is - not available. - -1999-11-05 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_output_process): Calculate max RTE count from - interface MTU value. - -1999-09-29 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_distribute_update): Fix bug of updating - access-list and prefix-list. - -1999-09-07 URA Hiroshi <ura@hiru.aoba.yokohama.jp> - - * ripngd.c (ripng_recv_packet): Change CMSG_DATA cast from (u_char - *) to (int *). (u_char *) does not work for NetBSD-currnet on - SparcStation 10. - -1999-08-15 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_request_process): When request packet comes, - check RIPng process is enabled on the interface. - (ripng_redistribute_withdraw): Delete routes when `no - redistribute' is executed. - -1999-08-13 Yasuhiro Ohara <yasu@sfc.wide.ad.jp> - - * ripng_zebra.c (ripng_redistribute_ospf6_cmd): Add OSPF6 - redistribute command. - -1999-07-21 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (default_information_originate): Add - default-information command. - -1999-07-19 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_route_process): rip_add_route() and - rip_delete_route() are deleted. Both functions are integrated - into ripng_route_process(). - (ripng_request_process): Proper reply for request message. - - * ripng_routemap.c: New file added. - -1999-07-18 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_nexthop_rte): RIPng next hop routine is - rewritten. - (show_ipv6_ripng): Change `show ip ripng' to `show ipv6 ripng'. - (ripng_response_process): RIPng incoming packet's hop count check - added. - (ripng_response_process): Add strict RTE checking. - -1999-07-03 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_add_route): Fix metric compare bug. - -1999-06-25 itojun@iijlab.net - - * ripngd.c (ripng_distribute_in): "distribute in" filter in ripngd - actually work. - -1999-05-25 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_zebra): Send each ripng information by separate - zebra packet. - -1999-05-15 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripng_interface.c (if_add_multicast): Change log to zlog. - -1999-05-10 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripng_interface.c (ripng_zebra_get_interface): Add function. - - * ripng_zebra.c (redistribute_ripng): Delete function because - redistirbute the routes to the zebra daemon is now default - behavior. - -1999-05-09 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.conf.sample: Change network to route statement. - -1999-03-25 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c: Old non Advanced API version ripng_send_packet and - ripng_recv_packet is removed. - * ripng_radix.c: File removed. - -1998-12-15 Kunihiro Ishiguro <kunihiro@zebra.org> - - * Now I assume KAME support Advanced API and use sendmsg/recvmsg. - -1998-12-13 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripng_interface.c: Delete old ifa (interface address) related - functions. - -1998-12-10 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripng_debug.[ch]: New file. - - * ripngd.c (ripng_supply): Do not send header only RIPng packet. - Change `network' statement to `route' statement. - (ripng_request_process): Reply to RIPng REQUEST packet. - -1998-12-09 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripngd.c (ripng_config_write): Delete vector v argument. - * ripng_zebra.c (zebra_config_write): Likewise. - * ripng_interface.c (interface_config_write): Likewise. - -1998-12-07 Kunihiro Ishiguro <kunihiro@zebra.org> - - * ripng_route.h: New file. - - * ripng_interface.c: Delete #include <linux/in6.h>. - ripng_main.c: likewise. - ripng_radix.c: likewise. - ripng_route.c: likewise. - ripng_zebra.c: likewise. - ripngd.c: likewise. - -1998-12-06 Yasuhiro Ohara <yasu@sfc.wide.ad.jp> - - * ripngd.h (IPV6_ADD_MEMBERSHIP): If IPV6_ADD_MEMBERSHIP is not - defined. Define IPV6_ADD_MEMBERSHIP as IPV6_JOIN_GROUP. - -1998-09-15 HEO SeonMeyong <seirios@matrix.iri.co.jp> - - * all Hydrangea define is changed to KAME. - diff --git a/ripngd/Makefile.am b/ripngd/Makefile.am index ad1e2788..c6bd4868 100644 --- a/ripngd/Makefile.am +++ b/ripngd/Makefile.am @@ -4,6 +4,9 @@ INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib @SNMP_INCLUDES@ DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" INSTALL_SDATA=@INSTALL@ -m 600 +AM_CFLAGS = $(PICFLAGS) +AM_LDFLAGS = $(PILDFLAGS) + noinst_LIBRARIES = libripng.a sbin_PROGRAMS = ripngd diff --git a/ripngd/ripng_debug.c b/ripngd/ripng_debug.c index aac254d4..78f13a71 100644 --- a/ripngd/ripng_debug.c +++ b/ripngd/ripng_debug.c @@ -211,7 +211,7 @@ static struct cmd_node debug_node = 1 /* VTYSH */ }; -int +static int config_write_debug (struct vty *vty) { int write = 0; diff --git a/ripngd/ripng_debug.h b/ripngd/ripng_debug.h index 617a07de..f5ed6eab 100644 --- a/ripngd/ripng_debug.h +++ b/ripngd/ripng_debug.h @@ -47,7 +47,7 @@ extern unsigned long ripng_debug_event; extern unsigned long ripng_debug_packet; extern unsigned long ripng_debug_zebra; -void ripng_debug_init (); -void ripng_debug_reset (); +extern void ripng_debug_init (void); +extern void ripng_debug_reset (void); #endif /* _ZEBRA_RIPNG_DEBUG_H */ diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index 06df6a10..ae0ba9b5 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -52,12 +52,12 @@ extern struct zebra_privs_t ripngd_privs; /* Static utility function. */ static void ripng_enable_apply (struct interface *); static void ripng_passive_interface_apply (struct interface *); -int ripng_enable_if_lookup (const char *ifname); -int ripng_enable_network_lookup2 (struct connected *connected); -void ripng_enable_apply_all (); +static int ripng_enable_if_lookup (const char *); +static int ripng_enable_network_lookup2 (struct connected *); +static void ripng_enable_apply_all (void); /* Join to the all rip routers multicast group. */ -int +static int ripng_multicast_join (struct interface *ifp) { int ret; @@ -109,7 +109,7 @@ ripng_multicast_join (struct interface *ifp) } /* Leave from the all rip routers multicast group. */ -int +static int ripng_multicast_leave (struct interface *ifp) { int ret; @@ -137,7 +137,7 @@ ripng_multicast_leave (struct interface *ifp) } /* How many link local IPv6 address could be used on the interface ? */ -int +static int ripng_if_ipv6_lladdress_check (struct interface *ifp) { struct listnode *nn; @@ -158,8 +158,8 @@ ripng_if_ipv6_lladdress_check (struct interface *ifp) } /* Check max mtu size. */ -unsigned int -ripng_check_max_mtu () +static unsigned int +ripng_check_max_mtu (void) { struct listnode *node; struct interface *ifp; @@ -173,7 +173,7 @@ ripng_check_max_mtu () return mtu; } -int +static int ripng_if_down (struct interface *ifp) { struct route_node *rp; @@ -339,7 +339,7 @@ ripng_interface_delete (int command, struct zclient *zclient, } void -ripng_interface_clean () +ripng_interface_clean (void) { struct listnode *node, *nnode; struct interface *ifp; @@ -362,7 +362,8 @@ ripng_interface_clean () } void -ripng_interface_reset () { +ripng_interface_reset (void) +{ struct listnode *node; struct interface *ifp; struct ripng_interface *ri; @@ -530,7 +531,7 @@ struct route_table *ripng_enable_network; /* Lookup RIPng enable network. */ /* Check wether the interface has at least a connected prefix that * is within the ripng_enable_network table. */ -int +static int ripng_enable_network_lookup_if (struct interface *ifp) { struct listnode *node; @@ -563,7 +564,7 @@ ripng_enable_network_lookup_if (struct interface *ifp) } /* Check wether connected is within the ripng_enable_network table. */ -int +static int ripng_enable_network_lookup2 (struct connected *connected) { struct prefix_ipv6 address; @@ -592,7 +593,7 @@ ripng_enable_network_lookup2 (struct connected *connected) } /* Add RIPng enable network. */ -int +static int ripng_enable_network_add (struct prefix *p) { struct route_node *node; @@ -614,7 +615,7 @@ ripng_enable_network_add (struct prefix *p) } /* Delete RIPng enable network. */ -int +static int ripng_enable_network_delete (struct prefix *p) { struct route_node *node; @@ -636,7 +637,7 @@ ripng_enable_network_delete (struct prefix *p) } /* Lookup function. */ -int +static int ripng_enable_if_lookup (const char *ifname) { unsigned int i; @@ -650,7 +651,7 @@ ripng_enable_if_lookup (const char *ifname) } /* Add interface to ripng_enable_if. */ -int +static int ripng_enable_if_add (const char *ifname) { int ret; @@ -667,7 +668,7 @@ ripng_enable_if_add (const char *ifname) } /* Delete interface from ripng_enable_if. */ -int +static int ripng_enable_if_delete (const char *ifname) { int index; @@ -687,7 +688,7 @@ ripng_enable_if_delete (const char *ifname) } /* Wake up interface. */ -int +static int ripng_interface_wakeup (struct thread *t) { struct interface *ifp; @@ -714,9 +715,7 @@ ripng_interface_wakeup (struct thread *t) return 0; } -int ripng_redistribute_check (int); - -void +static void ripng_connect_set (struct interface *ifp, int set) { struct listnode *node, *nnode; @@ -820,8 +819,8 @@ ripng_enable_apply (struct interface *ifp) } /* Set distribute list to all interfaces. */ -void -ripng_enable_apply_all () +static void +ripng_enable_apply_all (void) { struct interface *ifp; struct listnode *node; @@ -857,7 +856,7 @@ ripng_clean_network () vector Vripng_passive_interface; /* Utility function for looking up passive interface settings. */ -int +static int ripng_passive_interface_lookup (const char *ifname) { unsigned int i; @@ -885,7 +884,7 @@ ripng_passive_interface_apply (struct interface *ifp) ri->passive = 1; } -void +static void ripng_passive_interface_apply_all (void) { struct interface *ifp; @@ -896,7 +895,7 @@ ripng_passive_interface_apply_all (void) } /* Passive interface. */ -int +static int ripng_passive_interface_set (struct vty *vty, const char *ifname) { if (ripng_passive_interface_lookup (ifname) >= 0) @@ -909,7 +908,7 @@ ripng_passive_interface_set (struct vty *vty, const char *ifname) return CMD_SUCCESS; } -int +static int ripng_passive_interface_unset (struct vty *vty, const char *ifname) { int i; @@ -1121,8 +1120,8 @@ DEFUN (no_ripng_passive_interface, return ripng_passive_interface_unset (vty, argv[0]); } -struct ripng_interface * -ri_new () +static struct ripng_interface * +ri_new (void) { struct ripng_interface *ri; ri = XCALLOC (MTYPE_IF, sizeof (struct ripng_interface)); @@ -1137,7 +1136,7 @@ ri_new () return ri; } -int +static int ripng_if_new_hook (struct interface *ifp) { ifp->info = ri_new (); @@ -1145,7 +1144,7 @@ ripng_if_new_hook (struct interface *ifp) } /* Called when interface structure deleted. */ -int +static int ripng_if_delete_hook (struct interface *ifp) { XFREE (MTYPE_IF, ifp->info); @@ -1154,7 +1153,7 @@ ripng_if_delete_hook (struct interface *ifp) } /* Configuration write function for ripngd. */ -int +static int interface_config_write (struct vty *vty) { struct listnode *node; diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c index a18ce9de..48774852 100644 --- a/ripngd/ripng_main.c +++ b/ripngd/ripng_main.c @@ -129,7 +129,7 @@ Report bugs to %s\n", progname, ZEBRA_BUG_ADDRESS); } /* SIGHUP handler. */ -void +static void sighup (void) { zlog_info ("SIGHUP received"); @@ -145,7 +145,7 @@ sighup (void) } /* SIGINT handler. */ -void +static void sigint (void) { zlog_notice ("Terminating on signal"); @@ -157,7 +157,7 @@ sigint (void) } /* SIGUSR1 handler. */ -void +static void sigusr1 (void) { zlog_rotate (NULL); diff --git a/ripngd/ripng_nexthop.h b/ripngd/ripng_nexthop.h index 50a86ad0..7c041059 100644 --- a/ripngd/ripng_nexthop.h +++ b/ripngd/ripng_nexthop.h @@ -27,12 +27,13 @@ #include "ripngd/ripng_route.h" #include "ripngd/ripngd.h" -struct list * ripng_rte_new(void); -void ripng_rte_free(struct list *ripng_rte_list); -void ripng_rte_add(struct list *ripng_rte_list, struct prefix_ipv6 *p, - struct ripng_info *rinfo, struct ripng_aggregate *aggregate); -void ripng_rte_send(struct list *ripng_rte_list, struct interface *ifp, - struct sockaddr_in6 *to); +extern struct list * ripng_rte_new(void); +extern void ripng_rte_free(struct list *ripng_rte_list); +extern void ripng_rte_add(struct list *ripng_rte_list, struct prefix_ipv6 *p, + struct ripng_info *rinfo, + struct ripng_aggregate *aggregate); +extern void ripng_rte_send(struct list *ripng_rte_list, struct interface *ifp, + struct sockaddr_in6 *to); /*** * 1 if A > B diff --git a/ripngd/ripng_offset.c b/ripngd/ripng_offset.c index 31d78ba8..5bc2568e 100644 --- a/ripngd/ripng_offset.c +++ b/ripngd/ripng_offset.c @@ -32,6 +32,8 @@ #include "linklist.h" #include "memory.h" +#include "ripngd/ripngd.h" + #define RIPNG_OFFSET_LIST_IN 0 #define RIPNG_OFFSET_LIST_OUT 1 #define RIPNG_OFFSET_LIST_MAX 2 @@ -50,7 +52,7 @@ struct ripng_offset_list static struct list *ripng_offset_list_master; -int +static int strcmp_safe (const char *s1, const char *s2) { if (s1 == NULL && s2 == NULL) @@ -62,7 +64,7 @@ strcmp_safe (const char *s1, const char *s2) return strcmp (s1, s2); } -struct ripng_offset_list * +static struct ripng_offset_list * ripng_offset_list_new () { struct ripng_offset_list *new; @@ -71,13 +73,13 @@ ripng_offset_list_new () return new; } -void +static void ripng_offset_list_free (struct ripng_offset_list *offset) { XFREE (MTYPE_RIPNG_OFFSET_LIST, offset); } -struct ripng_offset_list * +static struct ripng_offset_list * ripng_offset_list_lookup (const char *ifname) { struct ripng_offset_list *offset; @@ -91,7 +93,7 @@ ripng_offset_list_lookup (const char *ifname) return NULL; } -struct ripng_offset_list * +static struct ripng_offset_list * ripng_offset_list_get (const char *ifname) { struct ripng_offset_list *offset; @@ -108,7 +110,7 @@ ripng_offset_list_get (const char *ifname) return offset; } -int +static int ripng_offset_list_set (struct vty *vty, const char *alist, const char *direct_str, const char *metric_str, const char *ifname) @@ -147,7 +149,7 @@ ripng_offset_list_set (struct vty *vty, const char *alist, return CMD_SUCCESS; } -int +static int ripng_offset_list_unset (struct vty *vty, const char *alist, const char *direct_str, const char *metric_str, const char *ifname) @@ -338,13 +340,13 @@ DEFUN (no_ripng_offset_list_ifname, return ripng_offset_list_unset (vty, argv[0], argv[1], argv[2], argv[3]); } -int +static int offset_list_cmp (struct ripng_offset_list *o1, struct ripng_offset_list *o2) { return strcmp_safe (o1->ifname, o2->ifname); } -void +static void offset_list_del (struct ripng_offset_list *offset) { if (OFFSET_LIST_IN_NAME (offset)) @@ -357,7 +359,7 @@ offset_list_del (struct ripng_offset_list *offset) } void -ripng_offset_init () +ripng_offset_init (void) { ripng_offset_list_master = list_new (); ripng_offset_list_master->cmp = (int (*)(void *, void *)) offset_list_cmp; @@ -370,7 +372,7 @@ ripng_offset_init () } void -ripng_offset_clean () +ripng_offset_clean (void) { list_delete (ripng_offset_list_master); diff --git a/ripngd/ripng_peer.c b/ripngd/ripng_peer.c index 0438b4bf..c04456b8 100644 --- a/ripngd/ripng_peer.c +++ b/ripngd/ripng_peer.c @@ -39,13 +39,13 @@ /* Linked list of RIPng peer. */ struct list *peer_list; -struct ripng_peer * -ripng_peer_new () +static struct ripng_peer * +ripng_peer_new (void) { return XCALLOC (MTYPE_RIPNG_PEER, sizeof (struct ripng_peer)); } -void +static void ripng_peer_free (struct ripng_peer *peer) { XFREE (MTYPE_RIPNG_PEER, peer); @@ -82,7 +82,7 @@ ripng_peer_lookup_next (struct in6_addr *addr) /* RIPng peer is timeout. * Garbage collector. **/ -int +static int ripng_peer_timeout (struct thread *t) { struct ripng_peer *peer; @@ -95,7 +95,7 @@ ripng_peer_timeout (struct thread *t) } /* Get RIPng peer. At the same time update timeout thread. */ -struct ripng_peer * +static struct ripng_peer * ripng_peer_get (struct in6_addr *addr) { struct ripng_peer *peer; @@ -149,7 +149,7 @@ ripng_peer_bad_packet (struct sockaddr_in6 *from) } /* Display peer uptime. */ -char * +static char * ripng_peer_uptime (struct ripng_peer *peer, char *buf, size_t len) { time_t uptime; @@ -202,7 +202,7 @@ ripng_peer_display (struct vty *vty) } } -int +static int ripng_peer_list_cmp (struct ripng_peer *p1, struct ripng_peer *p2) { return addr6_cmp(&p1->addr, &p2->addr) > 0; diff --git a/ripngd/ripng_route.c b/ripngd/ripng_route.c index 9c3c4f99..d4bf0262 100644 --- a/ripngd/ripng_route.c +++ b/ripngd/ripng_route.c @@ -31,7 +31,7 @@ #include "ripngd/ripngd.h" #include "ripngd/ripng_route.h" -struct ripng_aggregate * +static struct ripng_aggregate * ripng_aggregate_new () { struct ripng_aggregate *new; @@ -40,7 +40,7 @@ ripng_aggregate_new () return new; } -void +static void ripng_aggregate_free (struct ripng_aggregate *aggregate) { XFREE (MTYPE_RIPNG_AGGREGATE, aggregate); diff --git a/ripngd/ripng_route.h b/ripngd/ripng_route.h index db53f148..2f5b7575 100644 --- a/ripngd/ripng_route.h +++ b/ripngd/ripng_route.h @@ -44,16 +44,11 @@ struct ripng_aggregate u_short tag_out; }; -void -ripng_aggregate_increment (struct route_node *rp, struct ripng_info *rinfo); - -void -ripng_aggregate_decrement (struct route_node *rp, struct ripng_info *rinfo); - -int -ripng_aggregate_add (struct prefix *p); - -int -ripng_aggregate_delete (struct prefix *p); +extern void ripng_aggregate_increment (struct route_node *rp, + struct ripng_info *rinfo); +extern void ripng_aggregate_decrement (struct route_node *rp, + struct ripng_info *rinfo); +extern int ripng_aggregate_add (struct prefix *p); +extern int ripng_aggregate_delete (struct prefix *p); #endif /* _ZEBRA_RIPNG_ROUTE_H */ diff --git a/ripngd/ripng_routemap.c b/ripngd/ripng_routemap.c index 1570c78b..0f5cca35 100644 --- a/ripngd/ripng_routemap.c +++ b/ripngd/ripng_routemap.c @@ -43,7 +43,7 @@ struct rip_metric_modifier }; -int +static int ripng_route_match_add (struct vty *vty, struct route_map_index *index, const char *command, const char *arg) { @@ -65,7 +65,7 @@ ripng_route_match_add (struct vty *vty, struct route_map_index *index, return CMD_SUCCESS; } -int +static int ripng_route_match_delete (struct vty *vty, struct route_map_index *index, const char *command, const char *arg) { @@ -87,7 +87,7 @@ ripng_route_match_delete (struct vty *vty, struct route_map_index *index, return CMD_SUCCESS; } -int +static int ripng_route_set_add (struct vty *vty, struct route_map_index *index, const char *command, const char *arg) { @@ -109,7 +109,7 @@ ripng_route_set_add (struct vty *vty, struct route_map_index *index, return CMD_SUCCESS; } -int +static int ripng_route_set_delete (struct vty *vty, struct route_map_index *index, const char *command, const char *arg) { @@ -133,7 +133,7 @@ ripng_route_set_delete (struct vty *vty, struct route_map_index *index, /* `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) { @@ -154,7 +154,7 @@ route_match_metric (void *rule, struct prefix *prefix, } /* Route map `match metric' match statement. `arg' is METRIC value */ -void * +static void * route_match_metric_compile (const char *arg) { u_int32_t *metric; @@ -170,14 +170,14 @@ route_match_metric_compile (const char *arg) } /* Free route map's compiled `match metric' value. */ -void +static void route_match_metric_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); } /* Route map commands for metric matching. */ -struct route_map_rule_cmd route_match_metric_cmd = +static struct route_map_rule_cmd route_match_metric_cmd = { "metric", route_match_metric, @@ -187,7 +187,7 @@ struct route_map_rule_cmd route_match_metric_cmd = /* `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) { @@ -214,19 +214,19 @@ route_match_interface (void *rule, struct prefix *prefix, } /* Route map `match interface' match statement. `arg' is IFNAME value */ -void * +static void * route_match_interface_compile (const char *arg) { return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg); } -void +static void route_match_interface_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); } -struct route_map_rule_cmd route_match_interface_cmd = +static struct route_map_rule_cmd route_match_interface_cmd = { "interface", route_match_interface, @@ -236,7 +236,7 @@ struct route_map_rule_cmd route_match_interface_cmd = /* `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) { @@ -258,7 +258,7 @@ route_match_tag (void *rule, struct prefix *prefix, } /* Route map `match tag' match statement. `arg' is TAG value */ -void * +static void * route_match_tag_compile (const char *arg) { u_short *tag; @@ -270,14 +270,14 @@ route_match_tag_compile (const char *arg) } /* Free route map's compiled `match tag' value. */ -void +static void route_match_tag_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); } /* Route map commands for tag matching. */ -struct route_map_rule_cmd route_match_tag_cmd = +static struct route_map_rule_cmd route_match_tag_cmd = { "tag", route_match_tag, @@ -288,7 +288,7 @@ struct route_map_rule_cmd route_match_tag_cmd = /* `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) { @@ -318,7 +318,7 @@ route_set_metric (void *rule, struct prefix *prefix, } /* set metric compilation. */ -void * +static void * route_set_metric_compile (const char *arg) { int len; @@ -371,13 +371,13 @@ route_set_metric_compile (const char *arg) } /* Free route map's compiled `set metric' value. */ -void +static void route_set_metric_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); } -struct route_map_rule_cmd route_set_metric_cmd = +static struct route_map_rule_cmd route_set_metric_cmd = { "metric", route_set_metric, @@ -388,7 +388,7 @@ struct route_map_rule_cmd route_set_metric_cmd = /* `set ipv6 next-hop local IP_ADDRESS' */ /* Set nexthop to object. ojbect must be pointer to struct attr. */ -route_map_result_t +static route_map_result_t route_set_ipv6_nexthop_local (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { @@ -410,7 +410,7 @@ route_set_ipv6_nexthop_local (void *rule, struct prefix *prefix, /* Route map `ipv6 nexthop local' compile function. Given string is converted to struct in6_addr structure. */ -void * +static void * route_set_ipv6_nexthop_local_compile (const char *arg) { int ret; @@ -430,14 +430,14 @@ route_set_ipv6_nexthop_local_compile (const char *arg) } /* Free route map's compiled `ipv6 nexthop local' value. */ -void +static void route_set_ipv6_nexthop_local_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); } /* Route map commands for ipv6 nexthop local set. */ -struct route_map_rule_cmd route_set_ipv6_nexthop_local_cmd = +static struct route_map_rule_cmd route_set_ipv6_nexthop_local_cmd = { "ipv6 next-hop local", route_set_ipv6_nexthop_local, @@ -448,7 +448,7 @@ struct route_map_rule_cmd route_set_ipv6_nexthop_local_cmd = /* `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) { @@ -470,7 +470,7 @@ route_set_tag (void *rule, struct prefix *prefix, /* 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; @@ -482,14 +482,14 @@ route_set_tag_compile (const char *arg) } /* 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/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c index c624454e..4c444550 100644 --- a/ripngd/ripng_zebra.c +++ b/ripngd/ripng_zebra.c @@ -89,7 +89,7 @@ ripng_zebra_ipv6_delete (struct prefix_ipv6 *p, struct in6_addr *nexthop, } /* Zebra route add and delete treatment. */ -int +static int ripng_zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length) { @@ -143,12 +143,12 @@ ripng_zebra_read_ipv6 (int command, struct zclient *zclient, } void -ripng_zclient_reset () +ripng_zclient_reset (void) { zclient_reset (zclient); } -int +static int ripng_redistribute_unset (int type) { if (! zclient->redist[type]) @@ -170,14 +170,14 @@ ripng_redistribute_check (int type) return (zclient->redist[type]); } -void +static void ripng_redistribute_metric_set (int type, int metric) { ripng->route_map[type].metric_config = 1; ripng->route_map[type].metric = metric; } -int +static int ripng_redistribute_metric_unset (int type) { ripng->route_map[type].metric_config = 0; @@ -185,7 +185,7 @@ ripng_redistribute_metric_unset (int type) return 0; } -void +static void ripng_redistribute_routemap_set (int type, const char *name) { if (ripng->route_map[type].name) @@ -195,7 +195,7 @@ ripng_redistribute_routemap_set (int type, const char *name) ripng->route_map[type].map = route_map_lookup_by_name (name); } -void +static void ripng_redistribute_routemap_unset (int type) { if (ripng->route_map[type].name) @@ -520,7 +520,7 @@ ripng_redistribute_write (struct vty *vty, int config_mode) } /* RIPng configuration write function. */ -int +static int zebra_config_write (struct vty *vty) { if (! zclient->enable) diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 9bf40dff..9deac032 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -73,7 +73,7 @@ struct ripng_nexthop struct in6_addr address; }; -int +static int ripng_route_rte (struct ripng_info *rinfo) { return (rinfo->type == ZEBRA_ROUTE_RIPNG && rinfo->sub_type == RIPNG_ROUTE_RTE); @@ -97,7 +97,7 @@ ripng_info_free (struct ripng_info *rinfo) } /* Create ripng socket. */ -int +static int ripng_make_socket (void) { int ret; @@ -222,7 +222,7 @@ ripng_send_packet (caddr_t buf, int bufsize, struct sockaddr_in6 *to, } /* Receive UDP RIPng packet from socket. */ -int +static int ripng_recv_packet (int sock, u_char *buf, int bufsize, struct sockaddr_in6 *from, unsigned int *ifindex, int *hoplimit) @@ -318,7 +318,7 @@ ripng_packet_dump (struct ripng_packet *packet, int size, const char *sndrcv) } /* RIPng next hop address RTE (Route Table Entry). */ -void +static void ripng_nexthop_rte (struct rte *rte, struct sockaddr_in6 *from, struct ripng_nexthop *nexthop) @@ -377,7 +377,7 @@ ripng_nexthop_rte (struct rte *rte, } /* If ifp has same link-local address then return 1. */ -int +static int ripng_lladdr_check (struct interface *ifp, struct in6_addr *addr) { struct listnode *node; @@ -397,7 +397,7 @@ ripng_lladdr_check (struct interface *ifp, struct in6_addr *addr) } /* RIPng route garbage collect timer. */ -int +static int ripng_garbage_collect (struct thread *t) { struct ripng_info *rinfo; @@ -423,7 +423,7 @@ ripng_garbage_collect (struct thread *t) } /* Timeout RIPng routes. */ -int +static int ripng_timeout (struct thread *t) { struct ripng_info *rinfo; @@ -460,7 +460,7 @@ ripng_timeout (struct thread *t) return 0; } -void +static void ripng_timeout_update (struct ripng_info *rinfo) { if (rinfo->metric != RIPNG_METRIC_INFINITY) @@ -470,7 +470,7 @@ ripng_timeout_update (struct ripng_info *rinfo) } } -int +static int ripng_incoming_filter (struct prefix_ipv6 *p, struct ripng_interface *ri) { struct distribute *dist; @@ -541,7 +541,7 @@ ripng_incoming_filter (struct prefix_ipv6 *p, struct ripng_interface *ri) return 0; } -int +static int ripng_outgoing_filter (struct prefix_ipv6 *p, struct ripng_interface *ri) { struct distribute *dist; @@ -612,7 +612,7 @@ ripng_outgoing_filter (struct prefix_ipv6 *p, struct ripng_interface *ri) } /* Process RIPng route according to RFC2080. */ -void +static void ripng_route_process (struct rte *rte, struct sockaddr_in6 *from, struct ripng_nexthop *ripng_nexthop, struct interface *ifp) @@ -1100,7 +1100,7 @@ ripng_redistribute_withdraw (int type) } /* RIP routing information. */ -void +static void ripng_response_process (struct ripng_packet *packet, int size, struct sockaddr_in6 *from, struct interface *ifp, int hoplimit) @@ -1233,7 +1233,7 @@ ripng_response_process (struct ripng_packet *packet, int size, } /* Response to request message. */ -void +static void ripng_request_process (struct ripng_packet *packet,int size, struct sockaddr_in6 *from, struct interface *ifp) { @@ -1320,7 +1320,7 @@ ripng_request_process (struct ripng_packet *packet,int size, } /* First entry point of reading RIPng packet. */ -int +static int ripng_read (struct thread *thread) { int len; @@ -1410,8 +1410,8 @@ ripng_read (struct thread *thread) } /* Walk down the RIPng routing table then clear changed flag. */ -void -ripng_clear_changed_flag () +static void +ripng_clear_changed_flag (void) { struct route_node *rp; struct ripng_info *rinfo; @@ -1424,7 +1424,7 @@ ripng_clear_changed_flag () /* Regular update of RIPng route. Send all routing formation to RIPng enabled interface. */ -int +static int ripng_update (struct thread *t) { struct listnode *node; @@ -1484,7 +1484,7 @@ ripng_update (struct thread *t) } /* Triggered update interval timer. */ -int +static int ripng_triggered_interval (struct thread *t) { ripng->t_triggered_interval = NULL; @@ -1813,8 +1813,8 @@ ripng_output_process (struct interface *ifp, struct sockaddr_in6 *to, } /* Create new RIPng instance and set it to global variable. */ -int -ripng_create () +static int +ripng_create (void) { /* ripng should be NULL. */ assert (ripng == NULL); @@ -1879,7 +1879,7 @@ ripng_request (struct interface *ifp) } -int +static int ripng_update_jitter (int time) { return ((rand () % (time + 1)) - (time / 2)); @@ -1948,7 +1948,7 @@ ripng_vty_out_uptime (struct vty *vty, struct ripng_info *rinfo) } } -char * +static char * ripng_route_subtype_print (struct ripng_info *rinfo) { static char str[3]; @@ -2101,8 +2101,6 @@ DEFUN (show_ipv6_ripng_status, { struct listnode *node; struct interface *ifp; - int ripng_network_write (struct vty *, int); - void ripng_redistribute_write (struct vty *, int); if (! ripng) return CMD_SUCCESS; @@ -2606,7 +2604,7 @@ DEFUN (no_ripng_default_information_originate, } /* RIPng configuration write function. */ -int +static int ripng_config_write (struct vty *vty) { int ripng_network_write (struct vty *, int); @@ -2691,7 +2689,7 @@ static struct cmd_node cmd_ripng_node = 1, }; -void +static void ripng_distribute_update (struct distribute *dist) { struct interface *ifp; @@ -2764,7 +2762,7 @@ ripng_distribute_update_interface (struct interface *ifp) } /* Update all interface's distribute list. */ -void +static void ripng_distribute_update_all (struct prefix_list *notused) { struct interface *ifp; @@ -2774,7 +2772,7 @@ ripng_distribute_update_all (struct prefix_list *notused) ripng_distribute_update_interface (ifp); } -void +static void ripng_distribute_update_all_wrapper (struct access_list *notused) { ripng_distribute_update_all(NULL); @@ -2877,7 +2875,7 @@ ripng_reset () ripng_zclient_reset (); } -void +static void ripng_if_rmap_update (struct if_rmap *if_rmap) { struct interface *ifp; @@ -2923,7 +2921,7 @@ ripng_if_rmap_update_interface (struct interface *ifp) ripng_if_rmap_update (if_rmap); } -void +static void ripng_routemap_update_redistribute (void) { int i; @@ -2939,7 +2937,7 @@ ripng_routemap_update_redistribute (void) } } -void +static void ripng_routemap_update (const char *unused) { struct interface *ifp; diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h index b478e9bc..ab06d81b 100644 --- a/ripngd/ripngd.h +++ b/ripngd/ripngd.h @@ -23,6 +23,9 @@ #ifndef _ZEBRA_RIPNG_RIPNGD_H #define _ZEBRA_RIPNG_RIPNGD_H +#include <zclient.h> +#include <vty.h> + /* RIPng version and port number. */ #define RIPNG_V1 1 #define RIPNG_PORT_DEFAULT 521 @@ -340,60 +343,79 @@ extern struct ripng *ripng; extern struct thread_master *master; /* Prototypes. */ -void ripng_init (); -void ripng_reset (); -void ripng_clean (); -void ripng_clean_network (); -void ripng_interface_clean (); -void ripng_interface_reset (); -void ripng_passive_interface_clean (); -void ripng_if_init (); -void ripng_route_map_init (); -void ripng_route_map_reset (); -void ripng_terminate (); +extern void ripng_init (void); +extern void ripng_reset (void); +extern void ripng_clean (void); +extern void ripng_clean_network (void); +extern void ripng_interface_clean (void); +extern void ripng_interface_reset (void); +extern void ripng_passive_interface_clean (void); +extern void ripng_if_init (void); +extern void ripng_route_map_init (void); +extern void ripng_route_map_reset (void); +extern void ripng_terminate (void); /* zclient_init() is done by ripng_zebra.c:zebra_init() */ -void zebra_init (); -void ripng_zclient_start (); -void ripng_zclient_reset (); -void ripng_offset_init (); - -int config_write_ripng_offset_list (struct vty *); - -void ripng_peer_init (); -void ripng_peer_update (struct sockaddr_in6 *, u_char); -void ripng_peer_bad_route (struct sockaddr_in6 *); -void ripng_peer_bad_packet (struct sockaddr_in6 *); -void ripng_peer_display (struct vty *); -struct ripng_peer *ripng_peer_lookup (struct in6_addr *); -struct ripng_peer *ripng_peer_lookup_next (struct in6_addr *); - -int ripng_offset_list_apply_in (struct prefix_ipv6 *, struct interface *, u_char *); -int ripng_offset_list_apply_out (struct prefix_ipv6 *, struct interface *, u_char *); -void ripng_offset_clean (); - -struct ripng_info * ripng_info_new (); -void ripng_info_free (struct ripng_info *rinfo); -void ripng_event (enum ripng_event, int); -int ripng_request (struct interface *ifp); -void ripng_redistribute_add (int, int, struct prefix_ipv6 *, unsigned int, - struct in6_addr *); -void ripng_redistribute_delete (int, int, struct prefix_ipv6 *, unsigned int); -void ripng_redistribute_withdraw (int type); - -void ripng_distribute_update_interface (struct interface *); -void ripng_if_rmap_update_interface (struct interface *); - -void ripng_zebra_ipv6_add (struct prefix_ipv6 *p, struct in6_addr *nexthop, unsigned int ifindex, u_char metric); -void ripng_zebra_ipv6_delete (struct prefix_ipv6 *p, struct in6_addr *nexthop, unsigned int ifindex); - -void ripng_redistribute_clean (); - -int ripng_write_rte (int num, struct stream *s, struct prefix_ipv6 *p, - struct in6_addr *nexthop, u_int16_t tag, u_char metric); -int ripng_send_packet (caddr_t buf, int bufsize, struct sockaddr_in6 *to, - struct interface *ifp); - -void ripng_packet_dump (struct ripng_packet *packet, int size, const char *sndrcv); - +extern void zebra_init (void); +extern void ripng_zclient_start (void); +extern void ripng_zclient_reset (void); +extern void ripng_offset_init (void); + +extern int config_write_ripng_offset_list (struct vty *); + +extern void ripng_peer_init (void); +extern void ripng_peer_update (struct sockaddr_in6 *, u_char); +extern void ripng_peer_bad_route (struct sockaddr_in6 *); +extern void ripng_peer_bad_packet (struct sockaddr_in6 *); +extern void ripng_peer_display (struct vty *); +extern struct ripng_peer *ripng_peer_lookup (struct in6_addr *); +extern struct ripng_peer *ripng_peer_lookup_next (struct in6_addr *); + +extern int ripng_offset_list_apply_in (struct prefix_ipv6 *, + struct interface *, u_char *); +extern int ripng_offset_list_apply_out (struct prefix_ipv6 *, + struct interface *, u_char *); +extern void ripng_offset_clean (void); + +extern struct ripng_info * ripng_info_new (void); +extern void ripng_info_free (struct ripng_info *rinfo); +extern void ripng_event (enum ripng_event, int); +extern int ripng_request (struct interface *ifp); +extern void ripng_redistribute_add (int, int, struct prefix_ipv6 *, + unsigned int, struct in6_addr *); +extern void ripng_redistribute_delete (int, int, struct prefix_ipv6 *, + unsigned int); +extern void ripng_redistribute_withdraw (int type); + +extern void ripng_distribute_update_interface (struct interface *); +extern void ripng_if_rmap_update_interface (struct interface *); + +extern void ripng_zebra_ipv6_add (struct prefix_ipv6 *p, + struct in6_addr *nexthop, + unsigned int ifindex, u_char metric); +extern void ripng_zebra_ipv6_delete (struct prefix_ipv6 *p, + struct in6_addr *nexthop, + unsigned int ifindex); + +extern void ripng_redistribute_clean (void); +extern int ripng_redistribute_check (int); +extern void ripng_redistribute_write (struct vty *, int); + +extern int ripng_write_rte (int num, struct stream *s, struct prefix_ipv6 *p, + struct in6_addr *nexthop, + u_int16_t tag, u_char metric); +extern int ripng_send_packet (caddr_t buf, int bufsize, + struct sockaddr_in6 *to, struct interface *ifp); + +extern void ripng_packet_dump (struct ripng_packet *packet, int size, + const char *sndrcv); + +extern int ripng_interface_up (int command, struct zclient *, zebra_size_t); +extern int ripng_interface_down (int command, struct zclient *, zebra_size_t); +extern int ripng_interface_add (int command, struct zclient *, zebra_size_t); +extern int ripng_interface_delete (int command, struct zclient *, zebra_size_t); +extern int ripng_interface_address_add (int command, struct zclient *, zebra_size_t); +extern int ripng_interface_address_delete (int command, struct zclient *, zebra_size_t); + +extern int ripng_network_write (struct vty *, int); #endif /* _ZEBRA_RIPNG_RIPNGD_H */ |