* (general) static/extern functions and definitions.
* rip_interface.h: new file, export the public functions from
rip_interface.c
+2005-10-26 Paul Jakma <paul.jakma@sun.com>
+
+ * (general) static/extern functions and definitions.
+ * rip_interface.h: new file, export the public functions from
+ rip_interface.c
+
2005-10-17 Vincent Jardin <vincent.jardin@6wind.com>
* ripd.c: rip_create_socket() for each packet, it does not bind to the
1
};
-int
+static int
config_write_debug (struct vty *vty)
{
int write = 0;
}
void
-rip_debug_reset ()
+rip_debug_reset (void)
{
rip_debug_event = 0;
rip_debug_packet = 0;
}
void
-rip_debug_init ()
+rip_debug_init (void)
{
rip_debug_event = 0;
rip_debug_packet = 0;
extern unsigned long rip_debug_packet;
extern unsigned long rip_debug_zebra;
-void rip_debug_init ();
-void rip_debug_reset ();
+extern void rip_debug_init (void);
+extern void rip_debug_reset (void);
#endif /* _ZEBRA_RIP_DEBUG_H */
#include "ripd/ripd.h"
#include "ripd/rip_debug.h"
-
-void rip_enable_apply (struct interface *);
-void rip_passive_interface_apply (struct interface *);
-int rip_if_down(struct interface *ifp);
-int rip_enable_if_lookup (const char *ifname);
-int rip_enable_network_lookup2 (struct connected *connected);
-void rip_enable_apply_all ();
-
-
+#include "ripd/rip_interface.h"
+\f
+/* static prototypes */
+static void rip_enable_apply (struct interface *);
+static void rip_passive_interface_apply (struct interface *);
+static int rip_if_down(struct interface *ifp);
+static int rip_enable_if_lookup (const char *ifname);
+static int rip_enable_network_lookup2 (struct connected *connected);
+static void rip_enable_apply_all (void);
+\f
struct message ri_version_msg[] =
{
{RI_RIP_VERSION_1, "1"},
vector Vrip_passive_nondefault;
\f
/* Join to the RIP version 2 multicast group. */
-int
+static int
ipv4_multicast_join (int sock,
struct in_addr group,
struct in_addr ifa,
}
/* Leave from the RIP version 2 multicast group. */
-int
+static int
ipv4_multicast_leave (int sock,
struct in_addr group,
struct in_addr ifa,
}
\f
/* Allocate new RIP's interface configuration. */
-struct rip_interface *
-rip_interface_new ()
+static struct rip_interface *
+rip_interface_new (void)
{
struct rip_interface *ri;
}
/* Send RIP request packet to specified interface. */
-void
+static void
rip_request_interface_send (struct interface *ifp, u_char version)
{
struct sockaddr_in to;
}
/* This will be executed when interface goes up. */
-void
+static void
rip_request_interface (struct interface *ifp)
{
struct rip_interface *ri;
}
/* Send RIP request to the neighbor. */
-void
+static void
rip_request_neighbor (struct in_addr addr)
{
struct sockaddr_in to;
}
/* Request routes at all interfaces. */
-void
-rip_request_neighbor_all ()
+static void
+rip_request_neighbor_all (void)
{
struct route_node *rp;
}
/* Multicast packet receive socket. */
-int
+static int
rip_multicast_join (struct interface *ifp, int sock)
{
struct listnode *cnode;
}
/* Leave from multicast group. */
-void
+static void
rip_multicast_leave (struct interface *ifp, int sock)
{
struct listnode *cnode;
}
/* Is there and address on interface that I could use ? */
-int
+static int
rip_if_ipv4_address_check (struct interface *ifp)
{
struct listnode *nn;
}
void
-rip_interface_clean ()
+rip_interface_clean (void)
{
struct listnode *node;
struct interface *ifp;
}
void
-rip_interface_reset ()
+rip_interface_reset (void)
{
struct listnode *node;
struct interface *ifp;
}
static void
-rip_apply_address_add (struct connected *ifc) {
+rip_apply_address_add (struct connected *ifc)
+{
struct prefix_ipv4 address;
struct prefix *p;
/* Check interface is enabled by network statement. */
/* Check wether the interface has at least a connected prefix that
* is within the ripng_enable_network table. */
-int
+static int
rip_enable_network_lookup_if (struct interface *ifp)
{
struct listnode *node, *nnode;
return -1;
}
/* Add RIP enable network. */
-int
+static int
rip_enable_network_add (struct prefix *p)
{
struct route_node *node;
}
/* Delete RIP enable network. */
-int
+static int
rip_enable_network_delete (struct prefix *p)
{
struct route_node *node;
}
/* Check interface is enabled by ifname statement. */
-int
+static int
rip_enable_if_lookup (const char *ifname)
{
unsigned int i;
}
/* Add interface to rip_enable_if. */
-int
+static int
rip_enable_if_add (const char *ifname)
{
int ret;
}
/* Delete interface from rip_enable_if. */
-int
+static int
rip_enable_if_delete (const char *ifname)
{
int index;
}
/* Join to multicast group and send request to the interface. */
-int
+static int
rip_interface_wakeup (struct thread *t)
{
struct interface *ifp;
int rip_redistribute_check (int);
-void
+static void
rip_connect_set (struct interface *ifp, int set)
{
struct listnode *node, *nnode;
}
/* Add new RIP neighbor to the neighbor tree. */
-int
+static int
rip_neighbor_add (struct prefix_ipv4 *p)
{
struct route_node *node;
}
/* Delete RIP neighbor from the neighbor tree. */
-int
+static int
rip_neighbor_delete (struct prefix_ipv4 *p)
{
struct route_node *node;
}
\f
/* Utility function for looking up passive interface settings. */
-int
+static int
rip_passive_nondefault_lookup (const char *ifname)
{
unsigned int i;
zlog_debug ("interface %s: passive = %d",ifp->name,ri->passive);
}
-void
-rip_passive_interface_apply_all ()
+static void
+rip_passive_interface_apply_all (void)
{
struct interface *ifp;
struct listnode *node, *nnode;
}
/* Passive interface. */
-int
+static int
rip_passive_nondefault_set (struct vty *vty, const char *ifname)
{
if (rip_passive_nondefault_lookup (ifname) >= 0)
return CMD_SUCCESS;
}
-int
+static int
rip_passive_nondefault_unset (struct vty *vty, const char *ifname)
{
int i;
/* Free all configured RIP passive-interface settings. */
void
-rip_passive_nondefault_clean ()
+rip_passive_nondefault_clean (void)
{
unsigned int i;
char *str;
}
\f
/* Write rip configuration of each interface. */
-int
+static int
rip_interface_config_write (struct vty *vty)
{
struct listnode *node;
};
/* Called when interface structure allocated. */
-int
+static int
rip_interface_new_hook (struct interface *ifp)
{
ifp->info = rip_interface_new ();
}
/* Called when interface structure deleted. */
-int
+static int
rip_interface_delete_hook (struct interface *ifp)
{
XFREE (MTYPE_RIP_INTERFACE, ifp->info);
/* Allocate and initialize interface vector. */
void
-rip_if_init ()
+rip_if_init (void)
{
/* Default initial size of interface vector. */
if_init();
--- /dev/null
+/* RIP interface routines
+ *
+ * This file is part of Quagga
+ *
+ * Quagga is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * Quagga is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Quagga; see the file COPYING. If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef _QUAGGA_RIP_INTERFACE_H
+#define _QUAGGA_RIP_INTERFACE_H
+
+extern int rip_interface_down (int , struct zclient *, zebra_size_t);
+extern int rip_interface_up (int , struct zclient *, zebra_size_t);
+extern int rip_interface_add (int , struct zclient *, zebra_size_t);
+extern int rip_interface_delete (int , struct zclient *, zebra_size_t);
+extern int rip_interface_address_add (int , struct zclient *, zebra_size_t);
+extern int rip_interface_address_delete (int , struct zclient *, zebra_size_t);
+
+#endif /* _QUAGGA_RIP_INTERFACE_H */
}
\f
/* SIGHUP handler. */
-void
+static void
sighup (void)
{
zlog_info ("SIGHUP received");
}
/* SIGINT handler. */
-void
+static void
sigint (void)
{
zlog_notice ("Terminating on signal");
}
/* SIGUSR1 handler. */
-void
+static void
sigusr1 (void)
{
zlog_rotate (NULL);
}
-struct quagga_signal_t ripd_signals[] =
+static struct quagga_signal_t ripd_signals[] =
{
{
.signal = SIGHUP,
#include "linklist.h"
#include "memory.h"
+#include "ripd/ripd.h"
+
#define RIP_OFFSET_LIST_IN 0
#define RIP_OFFSET_LIST_OUT 1
#define RIP_OFFSET_LIST_MAX 2
static struct list *rip_offset_list_master;
-int
+static int
strcmp_safe (const char *s1, const char *s2)
{
if (s1 == NULL && s2 == NULL)
return strcmp (s1, s2);
}
-struct rip_offset_list *
-rip_offset_list_new ()
+static struct rip_offset_list *
+rip_offset_list_new (void)
{
struct rip_offset_list *new;
return new;
}
-void
+static void
rip_offset_list_free (struct rip_offset_list *offset)
{
XFREE (MTYPE_RIP_OFFSET_LIST, offset);
}
-struct rip_offset_list *
+static struct rip_offset_list *
rip_offset_list_lookup (const char *ifname)
{
struct rip_offset_list *offset;
return NULL;
}
-struct rip_offset_list *
+static struct rip_offset_list *
rip_offset_list_get (const char *ifname)
{
struct rip_offset_list *offset;
return offset;
}
-int
+static int
rip_offset_list_set (struct vty *vty, const char *alist, const char *direct_str,
const char *metric_str, const char *ifname)
{
return CMD_SUCCESS;
}
-int
+static int
rip_offset_list_unset (struct vty *vty, const char *alist,
const char *direct_str, const char *metric_str,
const char *ifname)
return rip_offset_list_unset (vty, argv[0], argv[1], argv[2], argv[3]);
}
-int
+static int
offset_list_cmp (struct rip_offset_list *o1, struct rip_offset_list *o2)
{
return strcmp_safe (o1->ifname, o2->ifname);
}
-void
+static void
offset_list_del (struct rip_offset_list *offset)
{
if (OFFSET_LIST_IN_NAME (offset))
/* Linked list of RIP peer. */
struct list *peer_list;
\f
-struct rip_peer *
-rip_peer_new ()
+static struct rip_peer *
+rip_peer_new (void)
{
struct rip_peer *new;
return new;
}
-void
+static void
rip_peer_free (struct rip_peer *peer)
{
XFREE (MTYPE_RIP_PEER, peer);
}
/* RIP peer is timeout. */
-int
+static int
rip_peer_timeout (struct thread *t)
{
struct rip_peer *peer;
}
/* Get RIP peer. At the same time update timeout thread. */
-struct rip_peer *
+static struct rip_peer *
rip_peer_get (struct in_addr *addr)
{
struct rip_peer *peer;
}
/* Display peer uptime. */
-char *
+static char *
rip_peer_uptime (struct rip_peer *peer, char *buf, size_t len)
{
time_t uptime;
}
}
-int
+static int
rip_peer_list_cmp (struct rip_peer *p1, struct rip_peer *p2)
{
return htonl (p1->addr.s_addr) > htonl (p2->addr.s_addr);
}
void
-rip_peer_init ()
+rip_peer_init (void)
{
peer_list = list_new ();
peer_list->cmp = (int (*)(void *, void *)) rip_peer_list_cmp;
};
/* Add rip route map rule. */
-int
+static int
rip_route_match_add (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
}
/* Delete rip route map rule. */
-int
+static int
rip_route_match_delete (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
}
/* Add rip route map rule. */
-int
+static int
rip_route_set_add (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
}
/* Delete rip route map rule. */
-int
+static int
rip_route_set_delete (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
/* Hook function for updating route_map assignment. */
/* ARGSUSED */
-void
+static void
rip_route_map_update (const char *notused)
{
int i;
\f
/* `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)
{
}
/* Route map `match metric' match statement. `arg' is METRIC value */
-void *
+static void *
route_match_metric_compile (const char *arg)
{
u_int32_t *metric;
}
/* Free route map's compiled `match metric' value. */
-void
+static void
route_match_metric_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `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)
{
/* Route map `match interface' match statement. `arg' is IFNAME value */
/* XXX I don`t know if I need to check does interface exist? */
-void *
+static void *
route_match_interface_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
/* Free route map's compiled `match interface' value. */
-void
+static void
route_match_interface_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `match ip next-hop IP_ACCESS_LIST' */
/* Match function return 1 if match is success else return zero. */
-route_map_result_t
+static route_map_result_t
route_match_ip_next_hop (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
/* Route map `ip next-hop' match statement. `arg' should be
access-list name. */
-void *
+static void *
route_match_ip_next_hop_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
/* Free route map's compiled `. */
-void
+static void
route_match_ip_next_hop_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
/* Route map commands for ip next-hop matching. */
-struct route_map_rule_cmd route_match_ip_next_hop_cmd =
+static struct route_map_rule_cmd route_match_ip_next_hop_cmd =
{
"ip next-hop",
route_match_ip_next_hop,
\f
/* `match ip next-hop prefix-list PREFIX_LIST' */
-route_map_result_t
+static route_map_result_t
route_match_ip_next_hop_prefix_list (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_ip_next_hop_prefix_list_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
-void
+static void
route_match_ip_next_hop_prefix_list_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd =
+static struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd =
{
"ip next-hop prefix-list",
route_match_ip_next_hop_prefix_list,
/* Match function should return 1 if match is success else return
zero. */
-route_map_result_t
+static route_map_result_t
route_match_ip_address (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
/* Route map `ip address' match statement. `arg' should be
access-list name. */
-void *
+static void *
route_match_ip_address_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
/* Free route map's compiled `ip address' value. */
-void
+static void
route_match_ip_address_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
/* Route map commands for ip address matching. */
-struct route_map_rule_cmd route_match_ip_address_cmd =
+static struct route_map_rule_cmd route_match_ip_address_cmd =
{
"ip address",
route_match_ip_address,
\f
/* `match ip address prefix-list PREFIX_LIST' */
-route_map_result_t
+static route_map_result_t
route_match_ip_address_prefix_list (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_ip_address_prefix_list_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
-void
+static void
route_match_ip_address_prefix_list_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd =
+static struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd =
{
"ip address prefix-list",
route_match_ip_address_prefix_list,
/* `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)
{
}
/* Route map `match tag' match statement. `arg' is TAG value */
-void *
+static void *
route_match_tag_compile (const char *arg)
{
u_short *tag;
}
/* Free route map's compiled `match tag' value. */
-void
+static void
route_match_tag_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `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)
{
}
/* set metric compilation. */
-void *
+static void *
route_set_metric_compile (const char *arg)
{
int len;
}
/* Free route map's compiled `set metric' value. */
-void
+static void
route_set_metric_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
/* Set metric rule structure. */
-struct route_map_rule_cmd route_set_metric_cmd =
+static struct route_map_rule_cmd route_set_metric_cmd =
{
"metric",
route_set_metric,
/* `set ip next-hop IP_ADDRESS' */
/* Set nexthop to object. ojbect must be pointer to struct attr. */
-route_map_result_t
+static route_map_result_t
route_set_ip_nexthop (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
/* Route map `ip nexthop' compile function. Given string is converted
to struct in_addr structure. */
-void *
+static void *
route_set_ip_nexthop_compile (const char *arg)
{
int ret;
}
/* Free route map's compiled `ip nexthop' value. */
-void
+static void
route_set_ip_nexthop_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
}
/* Route map commands for ip nexthop set. */
-struct route_map_rule_cmd route_set_ip_nexthop_cmd =
+static struct route_map_rule_cmd route_set_ip_nexthop_cmd =
{
"ip next-hop",
route_set_ip_nexthop,
/* `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)
{
/* 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;
}
/* 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,
#include "log.h"
#include "ripd/ripd.h"
#include "ripd/rip_debug.h"
+#include "ripd/rip_interface.h"
/* All information about zebra. */
struct zclient *zclient = NULL;
-
-/* Callback prototypes for zebra client service. */
-int rip_interface_add (int, struct zclient *, zebra_size_t);
-int rip_interface_delete (int, struct zclient *, zebra_size_t);
-int rip_interface_address_add (int, struct zclient *, zebra_size_t);
-int rip_interface_address_delete (int, struct zclient *, zebra_size_t);
-int rip_interface_up (int, struct zclient *, zebra_size_t);
-int rip_interface_down (int, struct zclient *, zebra_size_t);
\f
/* RIPd to zebra command interface. */
void
}
/* Zebra route add and delete treatment. */
-int
+static int
rip_zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length)
{
struct stream *s;
}
void
-rip_zclient_reset ()
+rip_zclient_reset (void)
{
zclient_reset (zclient);
}
/* RIP route-map set for redistribution */
-void
+static void
rip_routemap_set (int type, const char *name)
{
if (rip->route_map[type].name)
rip->route_map[type].map = route_map_lookup_by_name (name);
}
-void
+static void
rip_redistribute_metric_set (int type, unsigned int metric)
{
rip->route_map[type].metric_config = 1;
rip->route_map[type].metric = metric;
}
-int
+static int
rip_metric_unset (int type, unsigned int metric)
{
#define DONT_CARE_METRIC_RIP 17
}
/* RIP route-map unset for redistribution */
-int
+static int
rip_routemap_unset (int type, const char *name)
{
if (! rip->route_map[type].name ||
return CMD_SUCCESS;
}
-int
+static int
rip_redistribute_set (int type)
{
if (zclient->redist[type])
return CMD_SUCCESS;
}
-int
+static int
rip_redistribute_unset (int type)
{
if (! zclient->redist[type])
}
void
-rip_redistribute_clean ()
+rip_redistribute_clean (void)
{
int i;
}
\f
/* RIP configuration write function. */
-int
+static int
config_write_zebra (struct vty *vty)
{
if (! zclient->enable)
long rip_global_queries = 0;
\f
/* Prototypes. */
-void rip_event (enum rip_event, int);
-
-void rip_output_process (struct connected *, struct sockaddr_in *, int, u_char);
-
+static void rip_event (enum rip_event, int);
+static void rip_output_process (struct connected *, struct sockaddr_in *, int, u_char);
+static int rip_triggered_update (struct thread *);
+static int rip_update_jitter (unsigned long);
+\f
/* RIP output routes type. */
enum
{
};
\f
/* Utility function to set boradcast option to the socket. */
-int
+static int
sockopt_broadcast (int sock)
{
int ret;
return 0;
}
-int
+static int
rip_route_rte (struct rip_info *rinfo)
{
return (rinfo->type == ZEBRA_ROUTE_RIP && rinfo->sub_type == RIP_ROUTE_RTE);
}
-struct rip_info *
+static struct rip_info *
rip_info_new ()
{
struct rip_info *new;
}
/* RIP route garbage collect timer. */
-int
+static int
rip_garbage_collect (struct thread *t)
{
struct rip_info *rinfo;
}
/* Timeout RIP routes. */
-int
+static int
rip_timeout (struct thread *t)
{
struct rip_info *rinfo;
return 0;
}
-void
+static void
rip_timeout_update (struct rip_info *rinfo)
{
if (rinfo->metric != RIP_METRIC_INFINITY)
}
}
-int
+static int
rip_incoming_filter (struct prefix_ipv4 *p, struct rip_interface *ri)
{
struct distribute *dist;
return 0;
}
-int
+static int
rip_outgoing_filter (struct prefix_ipv4 *p, struct rip_interface *ri)
{
struct distribute *dist;
}
/* RIP add route to routing table. */
-void
+static void
rip_rte_process (struct rte *rte, struct sockaddr_in *from,
struct interface *ifp)
{
}
/* Dump RIP packet */
-void
+static void
rip_packet_dump (struct rip_packet *packet, int size, const char *sndrcv)
{
caddr_t lim;
/* Check if the destination address is valid (unicast; not net 0
or 127) (RFC2453 Section 3.9.2 - Page 26). But we don't
check net 0 because we accept default route. */
-int
+static int
rip_destination_check (struct in_addr addr)
{
u_int32_t destination;
}
/* RIP version 2 authentication. */
-int
+static int
rip_auth_simple_password (struct rte *rte, struct sockaddr_in *from,
struct interface *ifp)
{
}
/* RIP version 2 authentication with MD5. */
-int
+static int
rip_auth_md5 (struct rip_packet *packet, struct sockaddr_in *from,
int length, struct interface *ifp)
{
}
/* RIP routing information. */
-void
+static void
rip_response_process (struct rip_packet *packet, int size,
struct sockaddr_in *from, struct connected *ifc)
{
* by connected argument. NULL to argument denotes destination should be
* should be RIP multicast group
*/
-int
+static int
rip_send_packet (u_char * buf, int size, struct sockaddr_in *to,
struct connected *ifc)
{
}
/* Response to request called from rip_read ().*/
-void
+static void
rip_request_process (struct rip_packet *packet, int size,
struct sockaddr_in *from, struct connected *ifc)
{
#endif /* RIP_RECVMSG */
/* First entry point of RIP packet. */
-int
+static int
rip_read (struct thread *t)
{
int sock;
/* Write routing table entry to the stream and return next index of
the routing table entry in the stream. */
-int
+static int
rip_write_rte (int num, struct stream *s, struct prefix_ipv4 *p,
u_char version, struct rip_info *rinfo)
{
/* this might need to made dynamic if RIP ever supported auth methods
with larger key string sizes */
char auth_str[RIP_AUTH_SIMPLE_SIZE];
- size_t doff; /* offset of digest offset field */
+ size_t doff = 0; /* offset of digest offset field */
int num = 0;
int rtemax;
int subnetted = 0;
}
/* Send RIP packet to the interface. */
-void
+static void
rip_update_interface (struct connected *ifc, u_char version, int route_type)
{
struct sockaddr_in to;
}
/* Update send to all interface and neighbor. */
-void
+static void
rip_update_process (int route_type)
{
struct listnode *node;
}
/* RIP's periodical timer. */
-int
+static int
rip_update (struct thread *t)
{
/* Clear timer pointer. */
}
/* Walk down the RIP routing table then clear changed flag. */
-void
+static void
rip_clear_changed_flag ()
{
struct route_node *rp;
}
/* Triggered update interval timer. */
-int
+static int
rip_triggered_interval (struct thread *t)
{
int rip_triggered_update (struct thread *);
}
/* Execute triggered update. */
-int
+static int
rip_triggered_update (struct thread *t)
{
int interval;
}
/* Create new RIP instance and set it to global variable. */
-int
-rip_create ()
+static int
+rip_create (void)
{
rip = XMALLOC (MTYPE_RIP, sizeof (struct rip));
memset (rip, 0, sizeof (struct rip));
return sizeof (rip_packet);
}
\f
-int
+static int
rip_update_jitter (unsigned long time)
{
#define JITTER_BOUND 4
return CMD_SUCCESS;
}
-void
+static void
rip_update_default_metric ()
{
struct route_node *np;
char *access_list;
};
-struct rip_distance *
+static struct rip_distance *
rip_distance_new ()
{
struct rip_distance *new;
return new;
}
-void
+static void
rip_distance_free (struct rip_distance *rdistance)
{
XFREE (MTYPE_RIP_DISTANCE, rdistance);
}
-int
+static int
rip_distance_set (struct vty *vty, const char *distance_str, const char *ip_str,
const char *access_list_str)
{
return CMD_SUCCESS;
}
-int
+static int
rip_distance_unset (struct vty *vty, const char *distance_str,
const char *ip_str, const char *access_list_str)
{
return CMD_SUCCESS;
}
-void
+static void
rip_distance_reset ()
{
struct route_node *rn;
return 0;
}
-void
+static void
rip_distance_show (struct vty *vty)
{
struct route_node *rn;
}
\f
/* Print out routes update time. */
-void
+static void
rip_vty_out_uptime (struct vty *vty, struct rip_info *rinfo)
{
struct timeval timer_now;
}
}
-const char *
+static const char *
rip_route_type_print (int sub_type)
{
switch (sub_type)
}
/* Return next event time. */
-int
+static int
rip_next_thread_timer (struct thread *thread)
{
struct timeval timer_now;
}
/* RIP configuration write function. */
-int
+static int
config_write_rip (struct vty *vty)
{
int write = 0;
};
\f
/* Distribute-list update functions. */
-void
+static void
rip_distribute_update (struct distribute *dist)
{
struct interface *ifp;
/* Update all interface's distribute list. */
/* ARGSUSED */
-void
+static void
rip_distribute_update_all (struct prefix_list *notused)
{
struct interface *ifp;
rip_distribute_update_interface (ifp);
}
/* ARGSUSED */
-void
+static void
rip_distribute_update_all_wrapper(struct access_list *notused)
{
rip_distribute_update_all(NULL);
rip_zclient_reset ();
}
-void
+static void
rip_if_rmap_update (struct if_rmap *if_rmap)
{
struct interface *ifp;
rip_if_rmap_update (if_rmap);
}
-void
+static void
rip_routemap_update_redistribute (void)
{
int i;
}
/* ARGSUSED */
-void
+static void
rip_routemap_update (const char *notused)
{
struct interface *ifp;
/* Allocate new rip structure and set default value. */
void
-rip_init ()
+rip_init (void)
{
/* Randomize for triggered update random(). */
srand (time (NULL));
} while (0)
/* Prototypes. */
-void rip_init ();
-void rip_reset ();
-void rip_clean ();
-void rip_clean_network ();
-void rip_interface_clean ();
-void rip_interface_reset ();
-void rip_passive_nondefault_clean ();
-void rip_if_init ();
-void rip_if_down_all ();
-void rip_route_map_init ();
-void rip_route_map_reset ();
-void rip_snmp_init ();
-void rip_zclient_init ();
-void rip_zclient_start ();
-void rip_zclient_reset ();
-void rip_offset_init ();
-int if_check_address (struct in_addr addr);
-int if_valid_neighbor (struct in_addr addr);
-
-int rip_request_send (struct sockaddr_in *, struct interface *, u_char,
+extern void rip_init (void);
+extern void rip_reset (void);
+extern void rip_clean (void);
+extern void rip_clean_network (void);
+extern void rip_interface_clean (void);
+extern void rip_interface_reset (void);
+extern void rip_passive_nondefault_clean (void);
+extern void rip_if_init (void);
+extern void rip_if_down_all (void);
+extern void rip_route_map_init (void);
+extern void rip_route_map_reset (void);
+extern void rip_snmp_init (void);
+extern void rip_zclient_init (void);
+extern void rip_zclient_start (void);
+extern void rip_zclient_reset (void);
+extern void rip_offset_init (void);
+extern int if_check_address (struct in_addr addr);
+extern int if_valid_neighbor (struct in_addr addr);
+
+extern int rip_request_send (struct sockaddr_in *, struct interface *, u_char,
struct connected *);
-int rip_neighbor_lookup (struct sockaddr_in *);
-void rip_redistribute_add (int, int, struct prefix_ipv4 *, unsigned int,
+extern int rip_neighbor_lookup (struct sockaddr_in *);
+extern void rip_redistribute_add (int, int, struct prefix_ipv4 *, unsigned int,
struct in_addr *, unsigned int, unsigned char);
-void rip_redistribute_delete (int, int, struct prefix_ipv4 *, unsigned int);
-void rip_redistribute_withdraw (int);
-void rip_zebra_ipv4_add (struct prefix_ipv4 *, struct in_addr *, u_int32_t, u_char);
-void rip_zebra_ipv4_delete (struct prefix_ipv4 *, struct in_addr *, u_int32_t);
-void rip_interface_multicast_set (int, struct connected *);
-void rip_distribute_update_interface (struct interface *);
-void rip_if_rmap_update_interface (struct interface *);
-
-int config_write_rip_network (struct vty *, int);
-int config_write_rip_offset_list (struct vty *);
-int config_write_rip_redistribute (struct vty *, int);
-
-void rip_peer_init ();
-void rip_peer_update (struct sockaddr_in *, u_char);
-void rip_peer_bad_route (struct sockaddr_in *);
-void rip_peer_bad_packet (struct sockaddr_in *);
-void rip_peer_display (struct vty *);
-struct rip_peer *rip_peer_lookup (struct in_addr *);
-struct rip_peer *rip_peer_lookup_next (struct in_addr *);
-
-int rip_offset_list_apply_in (struct prefix_ipv4 *, struct interface *, u_int32_t *);
-int rip_offset_list_apply_out (struct prefix_ipv4 *, struct interface *, u_int32_t *);
-void rip_offset_clean ();
-
-void rip_info_free (struct rip_info *);
-u_char rip_distance_apply (struct rip_info *);
-void rip_redistribute_clean ();
-void rip_ifaddr_add (struct interface *, struct connected *);
-void rip_ifaddr_delete (struct interface *, struct connected *);
+extern void rip_redistribute_delete (int, int, struct prefix_ipv4 *, unsigned int);
+extern void rip_redistribute_withdraw (int);
+extern void rip_zebra_ipv4_add (struct prefix_ipv4 *, struct in_addr *, u_int32_t, u_char);
+extern void rip_zebra_ipv4_delete (struct prefix_ipv4 *, struct in_addr *, u_int32_t);
+extern void rip_interface_multicast_set (int, struct connected *);
+extern void rip_distribute_update_interface (struct interface *);
+extern void rip_if_rmap_update_interface (struct interface *);
+
+extern int config_write_rip_network (struct vty *, int);
+extern int config_write_rip_offset_list (struct vty *);
+extern int config_write_rip_redistribute (struct vty *, int);
+
+extern void rip_peer_init (void);
+extern void rip_peer_update (struct sockaddr_in *, u_char);
+extern void rip_peer_bad_route (struct sockaddr_in *);
+extern void rip_peer_bad_packet (struct sockaddr_in *);
+extern void rip_peer_display (struct vty *);
+extern struct rip_peer *rip_peer_lookup (struct in_addr *);
+extern struct rip_peer *rip_peer_lookup_next (struct in_addr *);
+
+extern int rip_offset_list_apply_in (struct prefix_ipv4 *, struct interface *, u_int32_t *);
+extern int rip_offset_list_apply_out (struct prefix_ipv4 *, struct interface *, u_int32_t *);
+extern void rip_offset_clean (void);
+
+extern void rip_info_free (struct rip_info *);
+extern u_char rip_distance_apply (struct rip_info *);
+extern void rip_redistribute_clean (void);
+extern void rip_ifaddr_add (struct interface *, struct connected *);
+extern void rip_ifaddr_delete (struct interface *, struct connected *);
/* There is only one rip strucutre. */
extern struct rip *rip;
/* RIP statistics for SNMP. */
extern long rip_global_route_changes;
extern long rip_global_queries;
-
#endif /* _ZEBRA_RIP_H */