* (global) The great bgpd extern and static'ification.
* bgp_routemap.c: remove unused ROUTE_MATCH_ASPATH_OLD code
(route_set_metric_compile) fix u_int32_t to ULONG_MAX comparison
warnings.
* bgp_route.h: (bgp_process, bgp_withdraw, bgp_update) export these
used by various files which had their own private declarations,
in the case of mplsvpn - incorrect.
+2005-06-28 Paul Jakma <paul.jakma@sun.com>
+
+ * (global) The great bgpd extern and static'ification.
+ * bgp_routemap.c: remove unused ROUTE_MATCH_ASPATH_OLD code
+ (route_set_metric_compile) fix u_int32_t to ULONG_MAX comparison
+ warnings.
+ * bgp_route.h: (bgp_process, bgp_withdraw, bgp_update) export these
+ used by various files which had their own private declarations,
+ in the case of mplsvpn - incorrect.
+
2005-06-15 Paul Jakma <paul.jakma@sun.com>
* bgpd.c: (bgp_terminate) workqueue's are lazy allocated and its
XCALLOC (MTYPE_BGP_ADVERTISE, sizeof (struct bgp_advertise));
}
-void
+static void
bgp_advertise_free (struct bgp_advertise *adv)
{
if (adv->binfo)
XFREE (MTYPE_BGP_ADVERTISE, adv);
}
-void
+static void
bgp_advertise_add (struct bgp_advertise_attr *baa,
struct bgp_advertise *adv)
{
baa->adv = adv;
}
-void
+static void
bgp_advertise_delete (struct bgp_advertise_attr *baa,
struct bgp_advertise *adv)
{
return baa;
}
-void
+static void
bgp_advertise_unintern (struct hash *hash, struct bgp_advertise_attr *baa)
{
if (baa->refcnt)
}
\f
/* BGP adjacency keeps minimal advertisement information. */
-void
+static void
bgp_adj_out_free (struct bgp_adj_out *adj)
{
peer_unlock (adj->peer); /* adj_out peer reference */
#define BGP_ADJ_OUT_DEL(N,A) BGP_INFO_DEL(N,A,adj_out)
/* Prototypes. */
-void bgp_adj_out_set (struct bgp_node *, struct peer *, struct prefix *,
+extern void bgp_adj_out_set (struct bgp_node *, struct peer *, struct prefix *,
struct attr *, afi_t, safi_t, struct bgp_info *);
-void bgp_adj_out_unset (struct bgp_node *, struct peer *, struct prefix *,
+extern void bgp_adj_out_unset (struct bgp_node *, struct peer *, struct prefix *,
afi_t, safi_t);
-void bgp_adj_out_remove (struct bgp_node *, struct bgp_adj_out *,
+extern void bgp_adj_out_remove (struct bgp_node *, struct bgp_adj_out *,
struct peer *, afi_t, safi_t);
-int bgp_adj_out_lookup (struct peer *, struct prefix *, afi_t, safi_t,
+extern int bgp_adj_out_lookup (struct peer *, struct prefix *, afi_t, safi_t,
struct bgp_node *);
-void bgp_adj_in_set (struct bgp_node *, struct peer *, struct attr *);
-void bgp_adj_in_unset (struct bgp_node *, struct peer *);
-void bgp_adj_in_remove (struct bgp_node *, struct bgp_adj_in *);
+extern void bgp_adj_in_set (struct bgp_node *, struct peer *, struct attr *);
+extern void bgp_adj_in_unset (struct bgp_node *, struct peer *);
+extern void bgp_adj_in_remove (struct bgp_node *, struct bgp_adj_in *);
-struct bgp_advertise *
+extern struct bgp_advertise *
bgp_advertise_clean (struct peer *, struct bgp_adj_out *, afi_t, safi_t);
-void bgp_sync_init (struct peer *);
-void bgp_sync_delete (struct peer *);
+extern void bgp_sync_init (struct peer *);
+extern void bgp_sync_delete (struct peer *);
#endif /* _QUAGGA_BGP_ADVERTISE_H */
}
/* Convert aspath structure to string expression. */
-char *
+static char *
aspath_make_str_count (struct aspath *as)
{
int space;
return new;
}
-void *
+static void *
aspath_hash_alloc (struct aspath *arg)
{
struct aspath *aspath;
#define ASSEGMENT_SIZE(N) (AS_HEADER_SIZE + ((N) * AS_VALUE_SIZE))
-struct aspath *
+static struct aspath *
aspath_aggregate_segment_copy (struct aspath *aspath, struct assegment *seg,
int i)
{
return aspath;
}
-struct assegment *
+static struct assegment *
aspath_aggregate_as_set_add (struct aspath *aspath, struct assegment *asset,
as_t as)
{
}
/* Merge as1 to as2. as2 should be uninterned aspath. */
-struct aspath *
+static struct aspath *
aspath_merge (struct aspath *as1, struct aspath *as2)
{
caddr_t data;
}
/* Add new as value to as path structure. */
-void
+static void
aspath_as_add (struct aspath *as, as_t asno)
{
caddr_t pnt;
}
/* Add new as segment to the as path. */
-void
+static void
aspath_segment_add (struct aspath *as, int type)
{
struct assegment *assegment;
}
struct aspath *
-aspath_empty ()
+aspath_empty (void)
{
return aspath_parse (NULL, 0);
}
struct aspath *
-aspath_empty_get ()
+aspath_empty_get (void)
{
struct aspath *aspath;
};
/* Return next token and point for string parse. */
-const char *
+static const char *
aspath_gettoken (const char *buf, enum as_token *token, u_short *asno)
{
const char *p = buf;
}
/* If two aspath have same value then return 1 else return 0 */
-int
+static int
aspath_cmp (struct aspath *as1, struct aspath *as2)
{
if (as1->length == as2->length
/* AS path hash initialize. */
void
-aspath_init ()
+aspath_init (void)
{
ashash = hash_create_size (32767, aspath_key_make, aspath_cmp);
}
vty_out (vty, "%s", as->str);
}
-void
+static void
aspath_show_all_iterator (struct hash_backet *backet, struct vty *vty)
{
struct aspath *as;
#define ASPATH_STR_DEFAULT_LEN 32
/* Prototypes. */
-void aspath_init ();
-struct aspath *aspath_parse ();
-struct aspath *aspath_dup (struct aspath *);
-struct aspath *aspath_aggregate (struct aspath *, struct aspath *);
-struct aspath *aspath_prepend (struct aspath *, struct aspath *);
-struct aspath *aspath_add_seq (struct aspath *, as_t);
-struct aspath *aspath_add_confed_seq (struct aspath *, as_t);
-int aspath_cmp_left (struct aspath *, struct aspath *);
-int aspath_cmp_left_confed (struct aspath *, struct aspath *);
-struct aspath *aspath_delete_confed_seq (struct aspath *);
-struct aspath *aspath_empty ();
-struct aspath *aspath_empty_get ();
-struct aspath *aspath_str2aspath (const char *);
-void aspath_free (struct aspath *);
-struct aspath *aspath_intern (struct aspath *);
-void aspath_unintern (struct aspath *);
-const char *aspath_print (struct aspath *);
-void aspath_print_vty (struct vty *, struct aspath *);
-void aspath_print_all_vty (struct vty *);
-unsigned int aspath_key_make (struct aspath *);
-int aspath_loop_check (struct aspath *, as_t);
-int aspath_private_as_check (struct aspath *);
-int aspath_firstas_check (struct aspath *, as_t);
-unsigned long aspath_count ();
+extern void aspath_init (void);
+extern struct aspath *aspath_parse (caddr_t, int);
+extern struct aspath *aspath_dup (struct aspath *);
+extern struct aspath *aspath_aggregate (struct aspath *, struct aspath *);
+extern struct aspath *aspath_prepend (struct aspath *, struct aspath *);
+extern struct aspath *aspath_add_seq (struct aspath *, as_t);
+extern struct aspath *aspath_add_confed_seq (struct aspath *, as_t);
+extern int aspath_cmp_left (struct aspath *, struct aspath *);
+extern int aspath_cmp_left_confed (struct aspath *, struct aspath *);
+extern struct aspath *aspath_delete_confed_seq (struct aspath *);
+extern struct aspath *aspath_empty (void);
+extern struct aspath *aspath_empty_get (void);
+extern struct aspath *aspath_str2aspath (const char *);
+extern void aspath_free (struct aspath *);
+extern struct aspath *aspath_intern (struct aspath *);
+extern void aspath_unintern (struct aspath *);
+extern const char *aspath_print (struct aspath *);
+extern void aspath_print_vty (struct vty *, struct aspath *);
+extern void aspath_print_all_vty (struct vty *);
+extern unsigned int aspath_key_make (struct aspath *);
+extern int aspath_loop_check (struct aspath *, as_t);
+extern int aspath_private_as_check (struct aspath *);
+extern int aspath_firstas_check (struct aspath *, as_t);
+extern unsigned long aspath_count (void);
#endif /* _QUAGGA_BGP_ASPATH_H */
\f
struct hash *cluster_hash;
-void *
+static void *
cluster_hash_alloc (struct cluster_list *val)
{
struct cluster_list *cluster;
}
/* Cluster list related functions. */
-struct cluster_list *
+static struct cluster_list *
cluster_parse (struct in_addr * pnt, int length)
{
struct cluster_list tmp;
return 0;
}
-unsigned int
+static unsigned int
cluster_hash_key_make (struct cluster_list *cluster)
{
unsigned int key = 0;
return key;
}
-int
+static int
cluster_hash_cmp (struct cluster_list *cluster1, struct cluster_list *cluster2)
{
if (cluster1->length == cluster2->length &&
return 0;
}
-void
+static void
cluster_free (struct cluster_list *cluster)
{
if (cluster->list)
XFREE (MTYPE_CLUSTER, cluster);
}
-struct cluster_list *
+static struct cluster_list *
cluster_dup (struct cluster_list *cluster)
{
struct cluster_list *new;
return new;
}
-struct cluster_list *
+static struct cluster_list *
cluster_intern (struct cluster_list *cluster)
{
struct cluster_list *find;
}
}
-void
-cluster_init ()
+static void
+cluster_init (void)
{
cluster_hash = hash_create (cluster_hash_key_make, cluster_hash_cmp);
}
/* Unknown transit attribute. */
struct hash *transit_hash;
-void
+static void
transit_free (struct transit *transit)
{
if (transit->val)
XFREE (MTYPE_TRANSIT, transit);
}
-void *
+static void *
transit_hash_alloc (struct transit *transit)
{
/* Transit structure is already allocated. */
return transit;
}
-struct transit *
+static struct transit *
transit_intern (struct transit *transit)
{
struct transit *find;
}
}
-unsigned int
+static unsigned int
transit_hash_key_make (struct transit *transit)
{
unsigned int key = 0;
return key;
}
-int
+static int
transit_hash_cmp (struct transit *transit1, struct transit *transit2)
{
if (transit1->length == transit2->length &&
return 0;
}
-void
+static void
transit_init ()
{
transit_hash = hash_create (transit_hash_key_make, transit_hash_cmp);
return 0;
}
-void
+static void
attrhash_init ()
{
attrhash = hash_create (attrhash_key_make, attrhash_cmp);
}
-void
+static void
attr_show_all_iterator (struct hash_backet *backet, struct vty *vty)
{
struct attr *attr = backet->data;
vty);
}
-void *
+static void *
bgp_attr_hash_alloc (struct attr *val)
{
struct attr *attr;
}
/* Get origin attribute of the update message. */
-int
+static int
bgp_attr_origin (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag, u_char *startp)
{
/* Parse AS path information. This function is wrapper of
aspath_parse. */
-int
+static int
bgp_attr_aspath (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag, u_char *startp)
{
}
/* Nexthop attribute. */
-int
+static int
bgp_attr_nexthop (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag, u_char *startp)
{
}
/* MED atrribute. */
-int
+static int
bgp_attr_med (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag, u_char *startp)
{
}
/* Local preference attribute. */
-int
+static int
bgp_attr_local_pref (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag)
{
}
/* Atomic aggregate. */
-int
+static int
bgp_attr_atomic (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag)
{
}
/* Aggregator attribute */
-int
+static int
bgp_attr_aggregator (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag)
{
}
/* Community attribute. */
-int
+static int
bgp_attr_community (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag)
{
}
/* Originator ID attribute. */
-int
+static int
bgp_attr_originator_id (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag)
{
}
/* Cluster list attribute. */
-int
+static int
bgp_attr_cluster_list (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag)
{
}
/* Multiprotocol reachability information parse. */
-int
+static int
bgp_mp_reach_parse (struct peer *peer, bgp_size_t length, struct attr *attr,
struct bgp_nlri *mp_update)
{
}
/* Multiprotocol unreachable parse */
-int
+static int
bgp_mp_unreach_parse (struct peer *peer, int length,
struct bgp_nlri *mp_withdraw)
{
}
/* Extended Community attribute. */
-int
+static int
bgp_attr_ext_communities (struct peer *peer, bgp_size_t length,
struct attr *attr, u_char flag)
{
}
/* BGP unknown attribute treatment. */
-int
+static int
bgp_attr_unknown (struct peer *peer, struct attr *attr, u_char flag,
u_char type, bgp_size_t length, u_char *startp)
{
#define ATTR_FLAG_BIT(X) (1 << ((X) - 1))
/* Prototypes. */
-void bgp_attr_init ();
-int bgp_attr_parse (struct peer *, struct attr *, bgp_size_t,
+extern void bgp_attr_init (void);
+extern int bgp_attr_parse (struct peer *, struct attr *, bgp_size_t,
struct bgp_nlri *, struct bgp_nlri *);
-int bgp_attr_check (struct peer *, struct attr *);
-struct attr *bgp_attr_intern (struct attr *attr);
-void bgp_attr_unintern (struct attr *);
-void bgp_attr_flush (struct attr *);
-struct attr *bgp_attr_default_set (struct attr *attr, u_char);
-struct attr *bgp_attr_default_intern (u_char);
-struct attr *bgp_attr_aggregate_intern (struct bgp *, u_char,
+extern int bgp_attr_check (struct peer *, struct attr *);
+extern struct attr *bgp_attr_intern (struct attr *attr);
+extern void bgp_attr_unintern (struct attr *);
+extern void bgp_attr_flush (struct attr *);
+extern struct attr *bgp_attr_default_set (struct attr *attr, u_char);
+extern struct attr *bgp_attr_default_intern (u_char);
+extern struct attr *bgp_attr_aggregate_intern (struct bgp *, u_char,
struct aspath *,
struct community *, int as_set);
-bgp_size_t bgp_packet_attribute (struct bgp *bgp, struct peer *,
+extern bgp_size_t bgp_packet_attribute (struct bgp *bgp, struct peer *,
struct stream *, struct attr *,
struct prefix *, afi_t, safi_t,
struct peer *, struct prefix_rd *, char *);
-bgp_size_t bgp_packet_withdraw (struct peer *peer, struct stream *s,
+extern bgp_size_t bgp_packet_withdraw (struct peer *peer, struct stream *s,
struct prefix *p, afi_t, safi_t,
struct prefix_rd *, char *);
-void bgp_dump_routes_attr (struct stream *, struct attr *, struct prefix *);
-unsigned int attrhash_key_make (struct attr *);
-int attrhash_cmp (struct attr *, struct attr *);
-void attr_show_all (struct vty *);
+extern void bgp_dump_routes_attr (struct stream *, struct attr *,
+ struct prefix *);
+extern unsigned int attrhash_key_make (struct attr *);
+extern int attrhash_cmp (struct attr *, struct attr *);
+extern void attr_show_all (struct vty *);
/* Cluster list prototypes. */
-int cluster_loop_check (struct cluster_list *, struct in_addr);
-void cluster_unintern (struct cluster_list *);
+extern int cluster_loop_check (struct cluster_list *, struct in_addr);
+extern void cluster_unintern (struct cluster_list *);
/* Transit attribute prototypes. */
void transit_unintern (struct transit *);
}
/* Allocate a new community list entry. */
-struct community_entry *
+static struct community_entry *
community_entry_new ()
{
struct community_entry *new;
}
/* Free community list entry. */
-void
+static void
community_entry_free (struct community_entry *entry)
{
switch (entry->style)
}
/* Allocate a new community-list. */
-struct community_list *
+static struct community_list *
community_list_new ()
{
struct community_list *new;
}
/* Free community-list. */
-void
+static void
community_list_free (struct community_list *list)
{
if (list->name)
XFREE (MTYPE_COMMUNITY_LIST, list);
}
-struct community_list *
+static struct community_list *
community_list_insert (struct community_list_handler *ch,
const char *name, int master)
{
return NULL;
}
-struct community_list *
+static struct community_list *
community_list_get (struct community_list_handler *ch,
const char *name, int master)
{
return list;
}
-void
+static void
community_list_delete (struct community_list *list)
{
struct community_list_list *clist;
community_list_free (list);
}
-int
+static int
community_list_empty_p (struct community_list *list)
{
return (list->head == NULL && list->tail == NULL) ? 1 : 0;
/* To avoid duplicated entry in the community-list, this function
compares specified entry to existing entry. */
-int
+static int
community_list_dup_check (struct community_list *list,
struct community_entry *new)
{
/* Initializa community-list. Return community-list handler. */
struct community_list_handler *
-community_list_init ()
+community_list_init (void)
{
struct community_list_handler *ch;
ch = XCALLOC (MTYPE_COMMUNITY_LIST_HANDLER,
}
/* Terminate community-list. */
-void
+static void
community_list_terminate (struct community_list_handler *ch)
{
struct community_list_master *cm;
extern struct community_list_handler *bgp_clist;
/* Prototypes. */
-struct community_list_handler *community_list_init ();
-
-int community_list_set (struct community_list_handler *ch, const char *name,
- const char *str, int direct, int style);
-int community_list_unset (struct community_list_handler *ch, const char *name,
- const char *str, int direct, int style);
-int extcommunity_list_set (struct community_list_handler *ch, const char *name,
- const char *str, int direct, int style);
-int extcommunity_list_unset (struct community_list_handler *ch,
- const char *name, const char *str,
- int direct, int style);
-
-struct community_list_master *
+extern struct community_list_handler *community_list_init (void);
+
+extern int community_list_set (struct community_list_handler *ch,
+ const char *name, const char *str, int direct,
+ int style);
+extern int community_list_unset (struct community_list_handler *ch,
+ const char *name, const char *str,
+ int direct, int style);
+extern int extcommunity_list_set (struct community_list_handler *ch,
+ const char *name, const char *str,
+ int direct, int style);
+extern int extcommunity_list_unset (struct community_list_handler *ch,
+ const char *name, const char *str,
+ int direct, int style);
+
+extern struct community_list_master *
community_list_master_lookup (struct community_list_handler *, int);
-struct community_list *
+extern struct community_list *
community_list_lookup (struct community_list_handler *, const char *, int);
-int community_list_match (struct community *, struct community_list *);
-int ecommunity_list_match (struct ecommunity *, struct community_list *);
-int community_list_exact_match (struct community *, struct community_list *);
-struct community *
-community_list_match_delete (struct community *,
- struct community_list *);
+extern int community_list_match (struct community *, struct community_list *);
+extern int ecommunity_list_match (struct ecommunity *, struct community_list *);
+extern int community_list_exact_match (struct community *,
+ struct community_list *);
+extern struct community *
+community_list_match_delete (struct community *, struct community_list *);
#endif /* _QUAGGA_BGP_CLIST_H */
struct hash *comhash;
/* Allocate a new communities value. */
-struct community *
-community_new ()
+static struct community *
+community_new (void)
{
return (struct community *) XCALLOC (MTYPE_COMMUNITY,
sizeof (struct community));
}
/* Add one community value to the community. */
-void
+static void
community_add_val (struct community *com, u_int32_t val)
{
com->size++;
}
/* Callback function from qsort(). */
-int
+static int
community_compare (const void *a1, const void *a2)
{
u_int32_t v1;
return 0;
}
-u_int32_t
+static u_int32_t
community_val_get (struct community *com, int i)
{
u_char *p;
};
/* Get next community token from string. */
-const char *
+static const char *
community_gettoken (const char *buf, enum community_token *token,
u_int32_t *val)
{
/* Return communities hash. */
struct hash *
-community_hash ()
+community_hash (void)
{
return comhash;
}
/* Initialize comminity related hash. */
void
-community_init ()
+community_init (void)
{
comhash = hash_create (community_hash_make, community_cmp);
}
#define com_nthval(X,n) ((X)->val + (n))
/* Prototypes of communities attribute functions. */
-void community_init ();
-void community_free (struct community *);
-struct community *community_uniq_sort (struct community *);
-struct community *community_parse (u_int32_t *, u_short);
-struct community *community_intern (struct community *);
-void community_unintern (struct community *);
-char *community_str (struct community *);
-unsigned int community_hash_make (struct community *);
-struct community *community_str2com (const char *);
-int community_match (const struct community *, const struct community *);
-int community_cmp (const struct community *, const struct community *);
-struct community *community_merge (struct community *, struct community *);
-struct community *community_delete (struct community *, struct community *);
-struct community *community_dup (struct community *);
-int community_include (struct community *, u_int32_t);
-void community_del_val (struct community *, u_int32_t *);
-unsigned long community_count ();
-struct hash *community_hash ();
+extern void community_init (void);
+extern void community_free (struct community *);
+extern struct community *community_uniq_sort (struct community *);
+extern struct community *community_parse (u_int32_t *, u_short);
+extern struct community *community_intern (struct community *);
+extern void community_unintern (struct community *);
+extern char *community_str (struct community *);
+extern unsigned int community_hash_make (struct community *);
+extern struct community *community_str2com (const char *);
+extern int community_match (const struct community *, const struct community *);
+extern int community_cmp (const struct community *, const struct community *);
+extern struct community *community_merge (struct community *, struct community *);
+extern struct community *community_delete (struct community *, struct community *);
+extern struct community *community_dup (struct community *);
+extern int community_include (struct community *, u_int32_t);
+extern void community_del_val (struct community *, u_int32_t *);
+extern unsigned long community_count (void);
+extern struct hash *community_hash (void);
#endif /* _QUAGGA_BGP_COMMUNITY_H */
/* Handler of reuse timer event. Each route in the current reuse-list
is evaluated. RFC2439 Section 4.8.7. */
-int
+static int
bgp_reuse_timer (struct thread *t)
{
struct bgp_damp_info *bdi;
struct bgp_damp_info *next;
time_t t_now, t_diff;
struct bgp *bgp;
- int bgp_process (struct bgp *, struct bgp_node *, afi_t, safi_t);
-
+
damp->t_reuse = NULL;
damp->t_reuse =
thread_add_timer (master, bgp_reuse_timer, NULL, DELTA_REUSE);
XFREE (MTYPE_BGP_DAMP_INFO, bdi);
}
-void
+static void
bgp_damp_parameter_set (int hlife, int reuse, int sup, int maxsup)
{
double reuse_max_ratio;
return 0;
}
-void
+static void
bgp_damp_config_clean (struct bgp_damp_config *damp)
{
/* Free decay array */
/* Clean all the bgp_damp_info stored in reuse_list. */
void
-bgp_damp_info_clean ()
+bgp_damp_info_clean (void)
{
unsigned int i;
struct bgp_damp_info *bdi, *next;
#define REUSE_LIST_SIZE 256
#define REUSE_ARRAY_SIZE 1024
-int bgp_damp_enable (struct bgp *, afi_t, safi_t, time_t, unsigned int,
+extern int bgp_damp_enable (struct bgp *, afi_t, safi_t, time_t, unsigned int,
unsigned int, time_t);
-int bgp_damp_disable (struct bgp *, afi_t, safi_t);
-int bgp_damp_withdraw (struct bgp_info *, struct bgp_node *,
+extern int bgp_damp_disable (struct bgp *, afi_t, safi_t);
+extern int bgp_damp_withdraw (struct bgp_info *, struct bgp_node *,
afi_t, safi_t, int);
-int bgp_damp_update (struct bgp_info *, struct bgp_node *, afi_t, safi_t);
-int bgp_damp_scan (struct bgp_info *, afi_t, safi_t);
-void bgp_damp_info_free (struct bgp_damp_info *, int);
-void bgp_damp_info_clean ();
-char * bgp_get_reuse_time (unsigned int, char*, size_t);
-int bgp_damp_decay (time_t, int);
-int bgp_config_write_damp (struct vty *);
-void bgp_damp_info_vty (struct vty *, struct bgp_info *);
-char * bgp_damp_reuse_time_vty (struct vty *, struct bgp_info *);
+extern int bgp_damp_update (struct bgp_info *, struct bgp_node *, afi_t, safi_t);
+extern int bgp_damp_scan (struct bgp_info *, afi_t, safi_t);
+extern void bgp_damp_info_free (struct bgp_damp_info *, int);
+extern void bgp_damp_info_clean (void);
+extern char * bgp_get_reuse_time (unsigned int, char*, size_t);
+extern int bgp_damp_decay (time_t, int);
+extern int bgp_config_write_damp (struct vty *);
+extern void bgp_damp_info_vty (struct vty *, struct bgp_info *);
+extern char * bgp_damp_reuse_time_vty (struct vty *, struct bgp_info *);
#endif /* _QUAGGA_BGP_DAMP_H */
return CMD_SUCCESS;
}
-int
+static int
bgp_config_write_debug (struct vty *vty)
{
int write = 0;
};
void
-bgp_debug_init ()
+bgp_debug_init (void)
{
install_node (&debug_node, bgp_config_write_debug);
#define DETAIL 6
/* Prototypes. */
-void bgp_debug_init ();
-void bgp_packet_dump (struct stream *);
+extern void bgp_debug_init (void);
+extern void bgp_packet_dump (struct stream *);
-int debug (unsigned int option);
+extern int debug (unsigned int option);
extern unsigned long conf_bgp_debug_fsm;
extern unsigned long conf_bgp_debug_events;
const extern char *bgp_type_str[];
-int bgp_dump_attr (struct peer *, struct attr *, char *, size_t);
-void bgp_notify_print (struct peer *, struct bgp_notify *, const char *);
+extern int bgp_dump_attr (struct peer *, struct attr *, char *, size_t);
+extern void bgp_notify_print (struct peer *, struct bgp_notify *, const char *);
extern struct message bgp_status_msg[];
extern int bgp_status_msg_max;
struct thread *t_bgp_dump_routes;
\f
/* Some define for BGP packet dump. */
-FILE *
+static FILE *
bgp_dump_open_file (struct bgp_dump *bgp_dump)
{
int ret;
return bgp_dump->fp;
}
-int
+static int
bgp_dump_interval_add (struct bgp_dump *bgp_dump, int interval)
{
- int bgp_dump_interval_func (struct thread *);
+ static int bgp_dump_interval_func (struct thread *t);
int interval2, secs_into_day;
time_t t;
struct tm *tm;
}
/* Dump common header. */
-void
+static void
bgp_dump_header (struct stream *obuf, int type, int subtype)
{
time_t now;
stream_putl (obuf, 0); /* len */
}
-void
+static void
bgp_dump_set_size (struct stream *s, int type)
{
stream_putl_at (s, 8, stream_get_endp (s) - BGP_DUMP_HEADER_SIZE);
}
-void
+static void
bgp_dump_routes_entry (struct prefix *p, struct bgp_info *info, int afi,
int type, unsigned int seq)
{
}
/* Runs under child process. */
-void
+static void
bgp_dump_routes_func (int afi)
{
struct stream *obuf;
bgp_dump_routes_entry (&rn->p, info, afi, MSG_TABLE_DUMP, seq++);
}
-int
+static int
bgp_dump_interval_func (struct thread *t)
{
struct bgp_dump *bgp_dump;
}
/* Dump common information. */
-void
+static void
bgp_dump_common (struct stream *obuf, struct peer *peer)
{
char empty[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
fflush (bgp_dump_all.fp);
}
-void
+static void
bgp_dump_packet_func (struct bgp_dump *bgp_dump, struct peer *peer,
struct stream *packet)
{
bgp_dump_packet_func (&bgp_dump_updates, peer, packet);
}
\f
-unsigned int
+static unsigned int
bgp_dump_parse_time (const char *str)
{
int i;
return total + time;
}
-int
+static int
bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump, int type,
const char *path, const char *interval_str)
{
return CMD_SUCCESS;
}
-int
+static int
bgp_dump_unset (struct vty *vty, struct bgp_dump *bgp_dump)
{
/* Set file name. */
}
#endif
-int
+static int
config_write_bgp_dump (struct vty *vty)
{
if (bgp_dump_all.filename)
\f
/* Initialize BGP packet dump functionality. */
void
-bgp_dump_init ()
+bgp_dump_init (void)
{
memset (&bgp_dump_all, 0, sizeof (struct bgp_dump));
memset (&bgp_dump_updates, 0, sizeof (struct bgp_dump));
#define BGP_DUMP_HEADER_SIZE 12
#define BGP_DUMP_MSG_HEADER 40
-void bgp_dump_init ();
-void bgp_dump_state (struct peer *, int, int);
-void bgp_dump_packet (struct peer *, int, struct stream *);
+extern void bgp_dump_init (void);
+extern void bgp_dump_state (struct peer *, int, int);
+extern void bgp_dump_packet (struct peer *, int, struct stream *);
#endif /* _QUAGGA_BGP_DUMP_H */
/* This function takes pointer to Extended Communites strucutre then
create a new Extended Communities structure by uniq and sort each
Exteneded Communities value. */
-struct ecommunity *
+static struct ecommunity *
ecommunity_uniq_sort (struct ecommunity *ecom)
{
int i;
};
/* Get next Extended Communities token from the string. */
-const char *
+static const char *
ecommunity_gettoken (const char *str, struct ecommunity_val *eval,
enum ecommunity_token *token)
{
#define ecom_length(X) ((X)->size * ECOMMUNITY_SIZE)
-void ecommunity_init (void);
-void ecommunity_free (struct ecommunity *);
-struct ecommunity *ecommunity_new (void);
-struct ecommunity *ecommunity_parse (u_int8_t *, u_short);
-struct ecommunity *ecommunity_dup (struct ecommunity *);
-struct ecommunity *ecommunity_merge (struct ecommunity *, struct ecommunity *);
-struct ecommunity *ecommunity_intern (struct ecommunity *);
-int ecommunity_cmp (const struct ecommunity *, const struct ecommunity *);
-void ecommunity_unintern (struct ecommunity *);
-unsigned int ecommunity_hash_make (struct ecommunity *);
-struct ecommunity *ecommunity_str2com (const char *, int, int);
-char *ecommunity_ecom2str (struct ecommunity *, int);
-int ecommunity_match (const struct ecommunity *, const struct ecommunity *);
-char *ecommunity_str (struct ecommunity *);
+extern void ecommunity_init (void);
+extern void ecommunity_free (struct ecommunity *);
+extern struct ecommunity *ecommunity_new (void);
+extern struct ecommunity *ecommunity_parse (u_int8_t *, u_short);
+extern struct ecommunity *ecommunity_dup (struct ecommunity *);
+extern struct ecommunity *ecommunity_merge (struct ecommunity *, struct ecommunity *);
+extern struct ecommunity *ecommunity_intern (struct ecommunity *);
+extern int ecommunity_cmp (const struct ecommunity *, const struct ecommunity *);
+extern void ecommunity_unintern (struct ecommunity *);
+extern unsigned int ecommunity_hash_make (struct ecommunity *);
+extern struct ecommunity *ecommunity_str2com (const char *, int, int);
+extern char *ecommunity_ecom2str (struct ecommunity *, int);
+extern int ecommunity_match (const struct ecommunity *, const struct ecommunity *);
+extern char *ecommunity_str (struct ecommunity *);
#endif /* _QUAGGA_BGP_ECOMMUNITY_H */
};
/* Allocate new AS filter. */
-struct as_filter *
+static struct as_filter *
as_filter_new ()
{
struct as_filter *new;
}
/* Free allocated AS filter. */
-void
+static void
as_filter_free (struct as_filter *asfilter)
{
if (asfilter->reg)
}
/* Make new AS filter. */
-struct as_filter *
+static struct as_filter *
as_filter_make (regex_t *reg, const char *reg_str, enum as_filter_type type)
{
struct as_filter *asfilter;
return asfilter;
}
-struct as_filter *
+static struct as_filter *
as_filter_lookup (struct as_list *aslist, const char *reg_str,
enum as_filter_type type)
{
return NULL;
}
-void
+static void
as_list_filter_add (struct as_list *aslist, struct as_filter *asfilter)
{
asfilter->next = NULL;
return NULL;
}
-struct as_list *
+static struct as_list *
as_list_new ()
{
struct as_list *new;
return new;
}
-void
+static void
as_list_free (struct as_list *aslist)
{
XFREE (MTYPE_AS_LIST, aslist);
/* Insert new AS list to list of as_list. Each as_list is sorted by
the name. */
-struct as_list *
+static struct as_list *
as_list_insert (const char *name)
{
size_t i;
return aslist;
}
-struct as_list *
+static struct as_list *
as_list_get (const char *name)
{
struct as_list *aslist;
}
}
-void
+static void
as_list_delete (struct as_list *aslist)
{
struct as_list_list *list;
return 0;
}
-void
+static void
as_list_filter_delete (struct as_list *aslist, struct as_filter *asfilter)
{
if (asfilter->next)
as_list_master.delete_hook = func;
}
\f
-int
+static int
as_list_dup_check (struct as_list *aslist, struct as_filter *new)
{
struct as_filter *asfilter;
return CMD_SUCCESS;
}
-void
+static void
as_list_show (struct vty *vty, struct as_list *aslist)
{
struct as_filter *asfilter;
}
}
-void
+static void
as_list_show_all (struct vty *vty)
{
struct as_list *aslist;
return CMD_SUCCESS;
}
-int
+static int
config_write_as_list (struct vty *vty)
{
struct as_list *aslist;
/* Register functions. */
void
-bgp_filter_init ()
+bgp_filter_init (void)
{
install_node (&as_list_node, config_write_as_list);
AS_FILTER_PERMIT
};
-enum as_filter_type as_list_apply (struct as_list *, void *);
+extern void bgp_filter_init (void);
-struct as_list *as_list_lookup (const char *);
-void as_list_add_hook (void (*func) ());
-void as_list_delete_hook (void (*func) ());
+extern enum as_filter_type as_list_apply (struct as_list *, void *);
+
+extern struct as_list *as_list_lookup (const char *);
+extern void as_list_add_hook (void (*func) ());
+extern void as_list_delete_hook (void (*func) ());
#endif /* _QUAGGA_BGP_FILTER_H */
static int bgp_start (struct peer *);
/* BGP start timer jitter. */
-int
+static int
bgp_start_jitter (int time)
{
return ((rand () % (time + 1)) - (time / 2));
return 0;
}
-int
+static int
bgp_routeadv_timer (struct thread *thread)
{
struct peer *peer;
"NSF peer closed the session"
};
-int
+static int
bgp_graceful_restart_timer_expire (struct thread *thread)
{
struct peer *peer;
return 0;
}
-int
+static int
bgp_graceful_stale_timer_expire (struct thread *thread)
{
struct peer *peer;
}
/* BGP peer is stoped by the error. */
-int
+static int
bgp_stop_with_error (struct peer *peer)
{
/* Double start timer. */
/* TCP connection open. Next we send open message to remote peer. And
add read thread for reading open message. */
-int
+static int
bgp_connect_success (struct peer *peer)
{
char buf1[BUFSIZ];
}
/* TCP connect fail */
-int
+static int
bgp_connect_fail (struct peer *peer)
{
bgp_stop (peer);
}
/* Connect retry timer is expired when the peer status is Connect. */
-int
+static int
bgp_reconnect (struct peer *peer)
{
bgp_stop (peer);
return 0;
}
-int
+static int
bgp_fsm_open (struct peer *peer)
{
/* Send keepalive and make keepalive timer */
}
/* Keepalive send to peer. */
-int
+static int
bgp_fsm_keepalive_expire (struct peer *peer)
{
bgp_keepalive_send (peer);
/* Hold timer expire. This is error of BGP connection. So cut the
peer and change to Idle status. */
-int
+static int
bgp_fsm_holdtime_expire (struct peer *peer)
{
if (BGP_DEBUG (fsm, FSM))
/* Status goes to Established. Send keepalive packet then make first
update information. */
-int
+static int
bgp_establish (struct peer *peer)
{
struct bgp_notify *notify;
}
/* Keepalive packet is received. */
-int
+static int
bgp_fsm_keepalive (struct peer *peer)
{
/* peer count update */
}
/* Update packet is received. */
-int
+static int
bgp_fsm_update (struct peer *peer)
{
BGP_TIMER_OFF (peer->t_holdtime);
}
/* This is empty event. */
-int
+static int
bgp_ignore (struct peer *peer)
{
if (BGP_DEBUG (fsm, FSM))
#include "bgpd/bgp_attr.h"
#include "bgpd/bgp_mplsvpn.h"
-u_int16_t
+static u_int16_t
decode_rd_type (u_char *pnt)
{
u_int16_t v;
return l;
}
-void
+static void
decode_rd_as (u_char *pnt, struct rd_as *rd_as)
{
rd_as->as = (u_int16_t) *pnt++ << 8;
rd_as->val |= (u_int32_t) *pnt;
}
-void
+static void
decode_rd_ip (u_char *pnt, struct rd_ip *rd_ip)
{
memcpy (&rd_ip->ip, pnt, 4);
rd_ip->val |= (u_int16_t) *pnt;
}
-int bgp_update (struct peer *, struct prefix *, struct attr *,
- afi_t, safi_t, int, int, struct prefix_rd *, u_char *);
-
-int bgp_withdraw (struct peer *, struct prefix *, struct attr *,
- int, int, int, int, struct prefix_rd *, u_char *);
int
bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
struct bgp_nlri *packet)
if (attr)
bgp_update (peer, &p, attr, AFI_IP, SAFI_MPLS_VPN,
- ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, tagpnt);
+ ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, tagpnt, 0);
else
bgp_withdraw (peer, &p, attr, AFI_IP, SAFI_MPLS_VPN,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, tagpnt);
return bgp_static_unset_vpnv4 (vty, argv[0], argv[1], argv[2]);
}
-int
+static int
show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd)
{
struct bgp *bgp;
bgp_show_type_community_list_exact
};
-int
+static int
bgp_show_mpls_vpn (struct vty *vty, struct prefix_rd *prd, enum bgp_show_type type,
void *output_arg, int tags)
{
}
void
-bgp_mplsvpn_init ()
+bgp_mplsvpn_init (void)
{
install_element (BGP_VPNV4_NODE, &vpnv4_network_cmd);
install_element (BGP_VPNV4_NODE, &no_vpnv4_network_cmd);
u_int16_t val;
};
-void bgp_mplsvpn_init ();
-int bgp_nlri_parse_vpnv4 (struct peer *, struct attr *, struct bgp_nlri *);
-u_int32_t decode_label (u_char *);
-int str2prefix_rd (const char *, struct prefix_rd *);
-int str2tag (const char *, u_char *);
-char *prefix_rd2str (struct prefix_rd *, char *, size_t);
+extern void bgp_mplsvpn_init (void);
+extern int bgp_nlri_parse_vpnv4 (struct peer *, struct attr *, struct bgp_nlri *);
+extern u_int32_t decode_label (u_char *);
+extern int str2prefix_rd (const char *, struct prefix_rd *);
+extern int str2tag (const char *, u_char *);
+extern char *prefix_rd2str (struct prefix_rd *, char *, size_t);
#endif /* _QUAGGA_BGP_MPLSVPN_H */
}
/* BGP socket bind. */
-int
+static int
bgp_bind (struct peer *peer)
{
#ifdef SO_BINDTODEVICE
return 0;
}
-int
+static int
bgp_bind_address (int sock, struct in_addr *addr)
{
int ret;
return 0;
}
-struct in_addr *
+static struct in_addr *
bgp_update_address (struct interface *ifp)
{
struct prefix_ipv4 *p;
}
/* Update source selection. */
-void
+static void
bgp_update_source (struct peer *peer)
{
struct interface *ifp;
#ifndef _QUAGGA_BGP_NETWORK_H
#define _QUAGGA_BGP_NETWORK_H
-int bgp_socket (struct bgp *, unsigned short);
-int bgp_connect (struct peer *);
-void bgp_getsockname (struct peer *);
+extern int bgp_socket (struct bgp *, unsigned short);
+extern int bgp_connect (struct peer *);
+extern void bgp_getsockname (struct peer *);
#endif /* _QUAGGA_BGP_NETWORK_H */
/* BGP nexthop lookup query client. */
static struct zclient *zlookup = NULL;
-
-/* BGP process function. */
-int bgp_process (struct bgp *, struct bgp_node *, afi_t, safi_t);
\f
/* Add nexthop to the end of the list. */
-void
+static void
bnc_nexthop_add (struct bgp_nexthop_cache *bnc, struct nexthop *nexthop)
{
struct nexthop *last;
nexthop->prev = last;
}
-void
+static void
bnc_nexthop_free (struct bgp_nexthop_cache *bnc)
{
struct nexthop *nexthop;
}
}
-struct bgp_nexthop_cache *
+static struct bgp_nexthop_cache *
bnc_new ()
{
struct bgp_nexthop_cache *new;
return new;
}
-void
+static void
bnc_free (struct bgp_nexthop_cache *bnc)
{
bnc_nexthop_free (bnc);
XFREE (MTYPE_BGP_NEXTHOP_CACHE, bnc);
}
\f
-int
+static int
bgp_nexthop_same (struct nexthop *next1, struct nexthop *next2)
{
if (next1->type != next2->type)
return 1;
}
-int
+static int
bgp_nexthop_cache_changed (struct bgp_nexthop_cache *bnc1,
struct bgp_nexthop_cache *bnc2)
{
#ifdef HAVE_IPV6
/* Check specified next-hop is reachable or not. */
-int
+static int
bgp_nexthop_lookup_ipv6 (struct peer *peer, struct bgp_info *ri, int *changed,
int *metricchanged)
{
}
/* Reset and free all BGP nexthop cache. */
-void
+static void
bgp_nexthop_cache_reset (struct bgp_table *table)
{
struct bgp_node *rn;
}
}
-void
+static void
bgp_scan (afi_t afi, safi_t safi)
{
struct bgp_node *rn;
}
/* BGP scan thread. This thread check nexthop reachability. */
-int
+static int
bgp_scan_timer (struct thread *t)
{
bgp_scan_thread =
return 0;
}
\f
-struct bgp_nexthop_cache *
+static struct bgp_nexthop_cache *
zlookup_read ()
{
struct stream *s;
}
#ifdef HAVE_IPV6
-struct bgp_nexthop_cache *
+static struct bgp_nexthop_cache *
zlookup_read_ipv6 ()
{
struct stream *s;
}
#endif /* HAVE_IPV6 */
-int
-bgp_import_check (struct prefix *p, u_int32_t *igpmetric, struct in_addr *igpnexthop)
+static int
+bgp_import_check (struct prefix *p, u_int32_t *igpmetric,
+ struct in_addr *igpnexthop)
{
struct stream *s;
int ret;
/* Scan all configured BGP route then check the route exists in IGP or
not. */
-int
+static int
bgp_import (struct thread *t)
{
struct bgp *bgp;
}
/* Connect to zebra for nexthop lookup. */
-int
+static int
zlookup_connect (struct thread *t)
{
struct zclient *zlookup;
struct nexthop *nexthop;
};
-void bgp_scan_init ();
-int bgp_nexthop_lookup (afi_t, struct peer *peer, struct bgp_info *,
+extern void bgp_scan_init (void);
+extern int bgp_nexthop_lookup (afi_t, struct peer *peer, struct bgp_info *,
int *, int *);
-void bgp_connected_add (struct connected *c);
-void bgp_connected_delete (struct connected *c);
-int bgp_multiaccess_check_v4 (struct in_addr, char *);
-int bgp_config_write_scan_time (struct vty *);
-int bgp_nexthop_check_ebgp (afi_t, struct attr *);
-int bgp_nexthop_self (afi_t, struct attr *);
+extern void bgp_connected_add (struct connected *c);
+extern void bgp_connected_delete (struct connected *c);
+extern int bgp_multiaccess_check_v4 (struct in_addr, char *);
+extern int bgp_config_write_scan_time (struct vty *);
+extern int bgp_nexthop_check_ebgp (afi_t, struct attr *);
+extern int bgp_nexthop_self (afi_t, struct attr *);
#endif /* _QUAGGA_BGP_NEXTHOP_H */
}
/* Set negotiated capability value. */
-int
+static int
bgp_capability_mp (struct peer *peer, struct capability *cap)
{
if (ntohs (cap->mpc.afi) == AFI_IP)
return 0;
}
-void
+static void
bgp_capability_orf_not_support (struct peer *peer, afi_t afi, safi_t safi,
u_char type, u_char mode)
{
peer->host, afi, safi, type, mode);
}
-int
+static int
bgp_capability_orf (struct peer *peer, struct capability *cap,
u_char *pnt)
{
}
/* Parse given capability. */
-int
+static int
bgp_capability_parse (struct peer *peer, u_char *pnt, u_char length,
u_char **error)
{
return 0;
}
-int
+static int
bgp_auth_parse (struct peer *peer, u_char *pnt, size_t length)
{
bgp_notify_send (peer,
return -1;
}
-int
+static int
strict_capability_same (struct peer *peer)
{
int i, j;
return 0;
}
-void
+static void
bgp_open_capability_orf (struct stream *s, struct peer *peer,
afi_t afi, safi_t safi, u_char code)
{
#define RESTART_R_BIT 0x8000
#define RESTART_F_BIT 0x80
-int bgp_open_option_parse (struct peer *, u_char, int *);
-void bgp_open_capability (struct stream *, struct peer *);
-void bgp_capability_vty_out (struct vty *, struct peer *);
+extern int bgp_open_option_parse (struct peer *, u_char, int *);
+extern void bgp_open_capability (struct stream *, struct peer *);
+extern void bgp_capability_vty_out (struct vty *, struct peer *);
#endif /* _QUAGGA_BGP_OPEN_H */
}
/* Add new packet to the peer. */
-void
+static void
bgp_packet_add (struct peer *peer, struct stream *s)
{
/* Add packet to the end of list. */
}
/* Free first packet. */
-void
+static void
bgp_packet_delete (struct peer *peer)
{
stream_free (stream_fifo_pop (peer->obuf));
}
/* Make BGP update packet. */
-struct stream *
+static struct stream *
bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi)
{
struct stream *s;
return NULL;
}
-struct stream *
+static struct stream *
bgp_update_packet_eor (struct peer *peer, afi_t afi, safi_t safi)
{
struct stream *s;
}
/* Make BGP withdraw packet. */
-struct stream *
+static struct stream *
bgp_withdraw_packet (struct peer *peer, afi_t afi, safi_t safi)
{
struct stream *s;
}
/* Get next packet to be written. */
-struct stream *
+static struct stream *
bgp_write_packet (struct peer *peer)
{
afi_t afi;
/* Is there partially written packet or updates we can send right
now. */
-int
+static int
bgp_write_proceed (struct peer *peer)
{
afi_t afi;
}
/* This is only for sending NOTIFICATION message to neighbor. */
-int
+static int
bgp_write_notify (struct peer *peer)
{
int ret;
bgp_notify_send_with_data (peer, code, sub_code, NULL, 0);
}
-const char *
+static const char *
afi2str (afi_t afi)
{
if (afi == AFI_IP)
return "Unknown AFI";
}
-const char *
+static const char *
safi2str (safi_t safi)
{
if (safi == SAFI_UNICAST)
}
\f
/* RFC1771 6.8 Connection collision detection. */
-int
+static int
bgp_collision_detect (struct peer *new, struct in_addr remote_id)
{
struct peer *peer;
return 0;
}
-int
+static int
bgp_open_receive (struct peer *peer, bgp_size_t size)
{
int ret;
}
/* Parse BGP Update packet and make attribute object. */
-int
+static int
bgp_update_receive (struct peer *peer, bgp_size_t size)
{
int ret;
}
/* Notify message treatment function. */
-void
+static void
bgp_notify_receive (struct peer *peer, bgp_size_t size)
{
struct bgp_notify bgp_notify;
}
/* Keepalive treatment function -- get keepalive send keepalive */
-void
+static void
bgp_keepalive_receive (struct peer *peer, bgp_size_t size)
{
if (BGP_DEBUG (keepalive, KEEPALIVE))
}
/* Route refresh message is received. */
-void
+static void
bgp_route_refresh_receive (struct peer *peer, bgp_size_t size)
{
afi_t afi;
bgp_announce_route (peer, afi, safi);
}
-int
+static int
bgp_capability_msg_parse (struct peer *peer, u_char *pnt, bgp_size_t length)
{
u_char *end;
}
/* Dynamic Capability is received. */
-void
+static void
bgp_capability_receive (struct peer *peer, bgp_size_t size)
{
u_char *pnt;
}
\f
/* BGP read utility function. */
-int
+static int
bgp_read_packet (struct peer *peer)
{
int nbytes;
}
/* Marker check. */
-int
+static int
bgp_marker_all_one (struct stream *s, int length)
{
int i;
#define ORF_COMMON_PART_DENY 0x20
/* Packet send and receive function prototypes. */
-int bgp_read (struct thread *);
-int bgp_write (struct thread *);
+extern int bgp_read (struct thread *);
+extern int bgp_write (struct thread *);
-void bgp_keepalive_send (struct peer *);
-void bgp_open_send (struct peer *);
-void bgp_notify_send (struct peer *, u_int8_t, u_int8_t);
-void bgp_notify_send_with_data (struct peer *, u_int8_t, u_int8_t,
+extern void bgp_keepalive_send (struct peer *);
+extern void bgp_open_send (struct peer *);
+extern void bgp_notify_send (struct peer *, u_int8_t, u_int8_t);
+extern void bgp_notify_send_with_data (struct peer *, u_int8_t, u_int8_t,
u_int8_t *, size_t);
-void bgp_route_refresh_send (struct peer *, afi_t, safi_t, u_char, u_char, int);
-void bgp_capability_send (struct peer *, afi_t, safi_t, int, int);
-void bgp_default_update_send (struct peer *, struct attr *,
+extern void bgp_route_refresh_send (struct peer *, afi_t, safi_t, u_char, u_char, int);
+extern void bgp_capability_send (struct peer *, afi_t, safi_t, int, int);
+extern void bgp_default_update_send (struct peer *, struct attr *,
afi_t, safi_t, struct peer *);
-void bgp_default_withdraw_send (struct peer *, afi_t, safi_t);
+extern void bgp_default_withdraw_send (struct peer *, afi_t, safi_t);
#endif /* _QUAGGA_BGP_PACKET_H */
#include "regex-gnu.h"
#endif /* HAVE_GNU_REGEX */
-void bgp_regex_free (regex_t *regex);
-regex_t *bgp_regcomp (const char *str);
-int bgp_regexec (regex_t *regex, struct aspath *aspath);
+extern void bgp_regex_free (regex_t *regex);
+extern regex_t *bgp_regcomp (const char *str);
+extern int bgp_regexec (regex_t *regex, struct aspath *aspath);
#endif /* _QUAGGA_BGP_REGEX_H */
extern char *bgp_origin_str[];
extern char *bgp_origin_long_str[];
\f
-struct bgp_node *
+static struct bgp_node *
bgp_afi_node_get (struct bgp_table *table, afi_t afi, safi_t safi, struct prefix *p,
struct prefix_rd *prd)
{
/* Get MED value. If MED value is missing and "bgp bestpath
missing-as-worst" is specified, treat it as the worst value. */
-u_int32_t
+static u_int32_t
bgp_med_value (struct attr *attr, struct bgp *bgp)
{
if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))
}
/* Compare two bgp route entity. br is preferable then return 1. */
-int
+static int
bgp_info_cmp (struct bgp *bgp, struct bgp_info *new, struct bgp_info *exist)
{
u_int32_t new_pref;
return 1;
}
-enum filter_type
+static enum filter_type
bgp_input_filter (struct peer *peer, struct prefix *p, struct attr *attr,
afi_t afi, safi_t safi)
{
return FILTER_PERMIT;
}
-enum filter_type
+static enum filter_type
bgp_output_filter (struct peer *peer, struct prefix *p, struct attr *attr,
afi_t afi, safi_t safi)
{
}
/* If community attribute includes no_export then return 1. */
-int
+static int
bgp_community_filter (struct peer *peer, struct attr *attr)
{
if (attr->community)
return 0;
}
\f
-int
+static int
bgp_input_modifier (struct peer *peer, struct prefix *p, struct attr *attr,
afi_t afi, safi_t safi)
{
return RMAP_PERMIT;
}
\f
-int
+static int
bgp_export_modifier (struct peer *rsclient, struct peer *peer,
struct prefix *p, struct attr *attr, afi_t afi, safi_t safi)
{
return RMAP_PERMIT;
}
-int
+static int
bgp_import_modifier (struct peer *rsclient, struct peer *peer,
struct prefix *p, struct attr *attr, afi_t afi, safi_t safi)
{
return RMAP_PERMIT;
}
\f
-int
+static int
bgp_announce_check (struct bgp_info *ri, struct peer *peer, struct prefix *p,
struct attr *attr, afi_t afi, safi_t safi)
{
return 1;
}
-int
+static int
bgp_announce_check_rsclient (struct bgp_info *ri, struct peer *rsclient,
struct prefix *p, struct attr *attr, afi_t afi, safi_t safi)
{
struct bgp_info *new;
};
-void
+static void
bgp_best_selection (struct bgp *bgp, struct bgp_node *rn, struct bgp_info_pair *result)
{
struct bgp_info *new_select;
return;
}
-int
+static int
bgp_process_announce_selected (struct peer *peer, struct bgp_info *selected,
struct bgp_node *rn, struct attr *attr, afi_t afi, safi_t safi)
{
return;
}
-int
+static int
bgp_maximum_prefix_restart_timer (struct thread *thread)
{
struct peer *peer;
return 0;
}
-void
+static void
bgp_rib_remove (struct bgp_node *rn, struct bgp_info *ri, struct peer *peer,
afi_t afi, safi_t safi)
{
bgp_info_delete (rn, ri);
}
-void
+static void
bgp_rib_withdraw (struct bgp_node *rn, struct bgp_info *ri, struct peer *peer,
afi_t afi, safi_t safi, int force)
{
bgp_info_delete (rn, ri);
}
-void
+static void
bgp_update_rsclient (struct peer *rsclient, afi_t afi, safi_t safi,
struct attr *attr, struct peer *peer, struct prefix *p, int type,
int sub_type, struct prefix_rd *prd, u_char *tag)
return;
}
-void
+static void
bgp_withdraw_rsclient (struct peer *rsclient, afi_t afi, safi_t safi,
struct peer *peer, struct prefix *p, int type, int sub_type,
struct prefix_rd *prd, u_char *tag)
bgp_unlock_node (rn);
}
-int
+static int
bgp_update_main (struct peer *peer, struct prefix *p, struct attr *attr,
afi_t afi, safi_t safi, int type, int sub_type,
struct prefix_rd *prd, u_char *tag, int soft_reconfig)
int
bgp_withdraw (struct peer *peer, struct prefix *p, struct attr *attr,
- int afi, int safi, int type, int sub_type, struct prefix_rd *prd,
- u_char *tag)
+ afi_t afi, safi_t safi, int type, int sub_type,
+ struct prefix_rd *prd, u_char *tag)
{
struct bgp *bgp;
char buf[SU_ADDRSTRLEN];
}
static void
-bgp_clear_node_complete (struct workqueue *wq)
+bgp_clear_node_complete (struct work_queue *wq)
{
/* unplug the 2 processing queues */
if (bm->process_main_queue)
return 0;
}
\f
-struct bgp_static *
+static struct bgp_static *
bgp_static_new ()
{
struct bgp_static *new;
return new;
}
-void
+static void
bgp_static_free (struct bgp_static *bgp_static)
{
if (bgp_static->rmap.name)
XFREE (MTYPE_BGP_STATIC, bgp_static);
}
-void
+static void
bgp_static_withdraw_rsclient (struct bgp *bgp, struct peer *rsclient,
struct prefix *p, afi_t afi, safi_t safi)
{
bgp_unlock_node (rn);
}
-void
+static void
bgp_static_update_rsclient (struct peer *rsclient, struct prefix *p,
struct bgp_static *bgp_static, afi_t afi, safi_t safi)
{
aspath_unintern (attr.aspath);
}
-void
+static void
bgp_static_update_main (struct bgp *bgp, struct prefix *p,
struct bgp_static *bgp_static, afi_t afi, safi_t safi)
{
}
}
-void
+static void
bgp_static_update_vpnv4 (struct bgp *bgp, struct prefix *p, u_int16_t afi,
u_char safi, struct prefix_rd *prd, u_char *tag)
{
}
}
-void
+static void
bgp_static_withdraw_vpnv4 (struct bgp *bgp, struct prefix *p, u_int16_t afi,
u_char safi, struct prefix_rd *prd, u_char *tag)
{
/* Configure static BGP network. When user don't run zebra, static
route should be installed as valid. */
-int
+static int
bgp_static_set (struct vty *vty, struct bgp *bgp, const char *ip_str,
u_int16_t afi, u_char safi, const char *rmap, int backdoor)
{
}
/* Configure static BGP network. */
-int
+static int
bgp_static_unset (struct vty *vty, struct bgp *bgp, const char *ip_str,
u_int16_t afi, u_char safi)
{
safi_t safi;
};
-struct bgp_aggregate *
+static struct bgp_aggregate *
bgp_aggregate_new ()
{
struct bgp_aggregate *new;
return new;
}
-void
+static void
bgp_aggregate_free (struct bgp_aggregate *aggregate)
{
XFREE (MTYPE_BGP_AGGREGATE, aggregate);
}
-void
+static void
bgp_aggregate_route (struct bgp *bgp, struct prefix *p, struct bgp_info *rinew,
afi_t afi, safi_t safi, struct bgp_info *del,
struct bgp_aggregate *aggregate)
bgp_unlock_node (child);
}
-void
+static void
bgp_aggregate_add (struct bgp *bgp, struct prefix *p, afi_t afi, safi_t safi,
struct bgp_aggregate *aggregate)
{
#define AGGREGATE_SUMMARY_ONLY 1
#define AGGREGATE_AS_SET 1
-int
+static int
bgp_aggregate_set (struct vty *vty, const char *prefix_str,
afi_t afi, safi_t safi,
u_char summary_only, u_char as_set)
return CMD_SUCCESS;
}
-int
+static int
bgp_aggregate_unset (struct vty *vty, const char *prefix_str,
afi_t afi, safi_t safi)
{
}
\f
/* Static function to display route. */
-void
+static void
route_vty_out_route (struct prefix *p, struct vty *vty)
{
int len;
vty_out (vty, "%s", VTY_NEWLINE);
}
-void
+static void
route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
struct bgp_info *binfo, afi_t afi, safi_t safi)
{
}
/* Header of detailed BGP route information */
-void
+static void
route_vty_out_detail_header (struct vty *vty, struct bgp *bgp,
struct bgp_node *rn,
struct prefix_rd *prd, afi_t afi, safi_t safi)
}
/* Display specified route of BGP table. */
-int
+static int
bgp_show_route_in_table (struct vty *vty, struct bgp *bgp,
struct bgp_table *rib, const char *ip_str,
afi_t afi, safi_t safi, struct prefix_rd *prd,
}
/* Display specified route of Main RIB */
-int
+static int
bgp_show_route (struct vty *vty, const char *view_name, const char *ip_str,
afi_t afi, safi_t safi, struct prefix_rd *prd,
int prefix_check)
#endif
\f
-int
+static int
bgp_show_regexp (struct vty *vty, int argc, const char **argv, afi_t afi,
safi_t safi, enum bgp_show_type type)
{
}
#endif /* HAVE_IPV6 */
\f
-int
+static int
bgp_show_prefix_list (struct vty *vty, const char *prefix_list_str, afi_t afi,
safi_t safi, enum bgp_show_type type)
{
}
#endif /* HAVE_IPV6 */
\f
-int
+static int
bgp_show_filter_list (struct vty *vty, const char *filter, afi_t afi,
safi_t safi, enum bgp_show_type type)
{
}
#endif /* HAVE_IPV6 */
\f
-int
+static int
bgp_show_route_map (struct vty *vty, const char *rmap_str, afi_t afi,
safi_t safi, enum bgp_show_type type)
{
}
#endif /* HAVE_IPV6 */
\f
-int
+static int
bgp_show_community (struct vty *vty, int argc, const char **argv, int exact,
u_int16_t afi, u_char safi)
{
"Exact match of the communities")
#endif /* HAVE_IPV6 */
\f
-int
+static int
bgp_show_community_list (struct vty *vty, const char *com, int exact,
u_int16_t afi, u_char safi)
{
}
#endif /* HAVE_IPV6 */
\f
-int
+static int
bgp_show_prefix_longer (struct vty *vty, const char *prefix, afi_t afi,
safi_t safi, enum bgp_show_type type)
{
}
#endif /* HAVE_IPV6 */
-struct peer *
+static struct peer *
peer_lookup_in_view (struct vty *vty, const char *view_name,
const char *ip_str)
{
return peer;
}
-void
+static void
show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
int in)
{
VTY_NEWLINE, output_count, VTY_NEWLINE);
}
-int
+static int
peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, int in)
{
if (! peer || ! peer->afc[afi][safi])
"Display the prefixlist filter\n")
#endif /* HAVE_IPV6 */
\f
-int
+static int
bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
safi_t safi, enum bgp_show_type type)
{
char *access_list;
};
-struct bgp_distance *
+static struct bgp_distance *
bgp_distance_new ()
{
struct bgp_distance *new;
return new;
}
-void
+static void
bgp_distance_free (struct bgp_distance *bdistance)
{
XFREE (MTYPE_BGP_DISTANCE, bdistance);
}
-int
+static int
bgp_distance_set (struct vty *vty, const char *distance_str,
const char *ip_str, const char *access_list_str)
{
return CMD_SUCCESS;
}
-int
+static int
bgp_distance_unset (struct vty *vty, const char *distance_str,
const char *ip_str, const char *access_list_str)
{
return CMD_SUCCESS;
}
-void
+static void
bgp_distance_reset ()
{
struct bgp_node *rn;
}
\f
/* Display specified route of BGP table. */
-int
+static int
bgp_clear_damp_route (struct vty *vty, const char *view_name,
const char *ip_str, afi_t afi, safi_t safi,
struct prefix_rd *prd, int prefix_check)
SAFI_UNICAST, NULL, 0);
}
\f
-int
+static int
bgp_config_write_network_vpnv4 (struct vty *vty, struct bgp *bgp,
afi_t afi, safi_t safi, int *write)
{
#define UNSUPPRESS_MAP(F) ((F)->usmap.map)
/* Prototypes. */
-void bgp_route_init ();
-void bgp_cleanup_routes (void);
-void bgp_announce_route (struct peer *, afi_t, safi_t);
-void bgp_announce_route_all (struct peer *);
-void bgp_default_originate (struct peer *, afi_t, safi_t, int);
-void bgp_soft_reconfig_in (struct peer *, afi_t, safi_t);
-void bgp_soft_reconfig_rsclient (struct peer *, afi_t, safi_t);
-void bgp_check_local_routes_rsclient (struct peer *rsclient, afi_t afi, safi_t safi);
-void bgp_clear_route (struct peer *, afi_t, safi_t);
-void bgp_clear_route_all (struct peer *);
-void bgp_clear_adj_in (struct peer *, afi_t, safi_t);
-void bgp_clear_stale_route (struct peer *, afi_t, safi_t);
+extern void bgp_route_init (void);
+extern void bgp_cleanup_routes (void);
+extern void bgp_announce_route (struct peer *, afi_t, safi_t);
+extern void bgp_announce_route_all (struct peer *);
+extern void bgp_default_originate (struct peer *, afi_t, safi_t, int);
+extern void bgp_soft_reconfig_in (struct peer *, afi_t, safi_t);
+extern void bgp_soft_reconfig_rsclient (struct peer *, afi_t, safi_t);
+extern void bgp_check_local_routes_rsclient (struct peer *rsclient, afi_t afi, safi_t safi);
+extern void bgp_clear_route (struct peer *, afi_t, safi_t);
+extern void bgp_clear_route_all (struct peer *);
+extern void bgp_clear_adj_in (struct peer *, afi_t, safi_t);
+extern void bgp_clear_stale_route (struct peer *, afi_t, safi_t);
extern struct bgp_info *bgp_info_lock (struct bgp_info *);
extern struct bgp_info *bgp_info_unlock (struct bgp_info *);
extern void bgp_info_add (struct bgp_node *rn, struct bgp_info *ri);
extern void bgp_info_delete (struct bgp_node *rn, struct bgp_info *ri);
-int bgp_nlri_sanity_check (struct peer *, int, u_char *, bgp_size_t);
-int bgp_nlri_parse (struct peer *, struct attr *, struct bgp_nlri *);
+extern int bgp_nlri_sanity_check (struct peer *, int, u_char *, bgp_size_t);
+extern int bgp_nlri_parse (struct peer *, struct attr *, struct bgp_nlri *);
-int bgp_maximum_prefix_overflow (struct peer *, afi_t, safi_t, int);
+extern int bgp_maximum_prefix_overflow (struct peer *, afi_t, safi_t, int);
-void bgp_redistribute_add (struct prefix *, struct in_addr *, u_int32_t, u_char);
-void bgp_redistribute_delete (struct prefix *, u_char);
-void bgp_redistribute_withdraw (struct bgp *, afi_t, int);
+extern void bgp_redistribute_add (struct prefix *, struct in_addr *, u_int32_t, u_char);
+extern void bgp_redistribute_delete (struct prefix *, u_char);
+extern void bgp_redistribute_withdraw (struct bgp *, afi_t, int);
-void bgp_static_delete (struct bgp *);
-void bgp_static_update (struct bgp *, struct prefix *, struct bgp_static *,
+extern void bgp_static_delete (struct bgp *);
+extern void bgp_static_update (struct bgp *, struct prefix *, struct bgp_static *,
afi_t, safi_t);
-void bgp_static_withdraw (struct bgp *, struct prefix *, afi_t, safi_t);
+extern void bgp_static_withdraw (struct bgp *, struct prefix *, afi_t, safi_t);
-int bgp_static_set_vpnv4 (struct vty *vty, const char *,
+extern int bgp_static_set_vpnv4 (struct vty *vty, const char *,
const char *, const char *);
-int bgp_static_unset_vpnv4 (struct vty *, const char *,
+extern int bgp_static_unset_vpnv4 (struct vty *, const char *,
const char *, const char *);
-int bgp_config_write_network (struct vty *, struct bgp *, afi_t, safi_t, int *);
-int bgp_config_write_distance (struct vty *, struct bgp *);
+/* this is primarily for MPLS-VPN */
+extern int bgp_update (struct peer *, struct prefix *, struct attr *,
+ afi_t, safi_t, int, int, struct prefix_rd *,
+ u_char *, int);
+extern int bgp_withdraw (struct peer *, struct prefix *, struct attr *,
+ afi_t, safi_t, int, int, struct prefix_rd *, u_char *);
-void bgp_aggregate_increment (struct bgp *, struct prefix *, struct bgp_info *,
+/* for bgp_nexthop and bgp_damp */
+extern void bgp_process (struct bgp *, struct bgp_node *, afi_t, safi_t);
+
+extern int bgp_config_write_network (struct vty *, struct bgp *, afi_t, safi_t, int *);
+extern int bgp_config_write_distance (struct vty *, struct bgp *);
+
+extern void bgp_aggregate_increment (struct bgp *, struct prefix *, struct bgp_info *,
afi_t, safi_t);
-void bgp_aggregate_decrement (struct bgp *, struct prefix *, struct bgp_info *,
+extern void bgp_aggregate_decrement (struct bgp *, struct prefix *, struct bgp_info *,
afi_t, safi_t);
-u_char bgp_distance_apply (struct prefix *, struct bgp_info *, struct bgp *);
+extern u_char bgp_distance_apply (struct prefix *, struct bgp_info *, struct bgp *);
-afi_t bgp_node_afi (struct vty *);
-safi_t bgp_node_safi (struct vty *);
+extern afi_t bgp_node_afi (struct vty *);
+extern safi_t bgp_node_safi (struct vty *);
-void route_vty_out (struct vty *, struct prefix *, struct bgp_info *, int, safi_t);
-void route_vty_out_tag (struct vty *, struct prefix *, struct bgp_info *, int, safi_t);
-void route_vty_out_tmp (struct vty *, struct prefix *, struct attr *, safi_t);
+extern void route_vty_out (struct vty *, struct prefix *, struct bgp_info *, int, safi_t);
+extern void route_vty_out_tag (struct vty *, struct prefix *, struct bgp_info *, int, safi_t);
+extern void route_vty_out_tmp (struct vty *, struct prefix *, struct attr *, safi_t);
#endif /* _QUAGGA_BGP_ROUTE_H */
/* Compares the peer specified in the 'match peer' clause with the peer
received in bgp_info->peer. If it is the same, or if the peer structure
received is a peer_group containing it, returns RMAP_MATCH. */
-route_map_result_t
+static route_map_result_t
route_match_peer (void *rule, struct prefix *prefix, route_map_object_t type,
void *object)
{
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_peer_compile (const char *arg)
{
union sockunion *su;
}
/* Free route map's compiled `ip address' value. */
-void
+static void
route_match_peer_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* 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);
/* `match ip next-hop IP_ADDRESS' */
/* 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' is
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 `ip address' value. */
-void
+static void
route_match_ip_next_hop_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `match ip route-source 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_route_source (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
/* Route map `ip route-source' match statement. `arg' is
access-list name. */
-void *
+static void *
route_match_ip_route_source_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_route_source_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
\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);
\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);
\f
/* `match ip route-source prefix-list PREFIX_LIST' */
-route_map_result_t
+static route_map_result_t
route_match_ip_route_source_prefix_list (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_ip_route_source_prefix_list_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
-void
+static void
route_match_ip_route_source_prefix_list_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `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 MED value */
-void *
+static void *
route_match_metric_compile (const char *arg)
{
u_int32_t *med;
}
/* Free route map's compiled `match metric' value. */
-void
+static void
route_match_metric_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `match as-path ASPATH' */
/* Match function for as-path match. I assume given object is */
-route_map_result_t
+static route_map_result_t
route_match_aspath (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Compile function for as-path match. */
-void *
+static void *
route_match_aspath_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
/* Compile function for as-path match. */
-void
+static void
route_match_aspath_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
route_match_aspath_compile,
route_match_aspath_free
};
-
-#if ROUTE_MATCH_ASPATH_OLD
-/* `match as-path ASPATH' */
-
-/* Match function for as-path match. I assume given object is */
-int
-route_match_aspath (void *rule, struct prefix *prefix, void *object)
-{
- regex_t *regex;
- struct bgp_info *bgp_info;
-
- regex = rule;
- bgp_info = object;
-
- /* Perform match. */
- return bgp_regexec (regex, bgp_info->attr->aspath);
-}
-
-/* Compile function for as-path match. */
-void *
-route_match_aspath_compile (const char *arg)
-{
- regex_t *regex;
-
- regex = bgp_regcomp (arg);
- if (! regex)
- return NULL;
-
- return regex;
-}
-
-/* Compile function for as-path match. */
-void
-route_match_aspath_free (void *rule)
-{
- regex_t *regex = rule;
-
- bgp_regex_free (regex);
-}
-
-/* Route map commands for aspath matching. */
-struct route_map_rule_cmd route_match_aspath_cmd =
-{
- "as-path",
- route_match_aspath,
- route_match_aspath_compile,
- route_match_aspath_free
-};
-#endif /* ROUTE_MATCH_ASPATH_OLD */
\f
/* `match community COMMUNIY' */
struct rmap_community
};
/* Match function for community match. */
-route_map_result_t
+static route_map_result_t
route_match_community (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Compile function for community match. */
-void *
+static void *
route_match_community_compile (const char *arg)
{
struct rmap_community *rcom;
}
/* Compile function for community match. */
-void
+static void
route_match_community_free (void *rule)
{
struct rmap_community *rcom = rule;
};
\f
/* Match function for extcommunity match. */
-route_map_result_t
+static route_map_result_t
route_match_ecommunity (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Compile function for extcommunity match. */
-void *
+static void *
route_match_ecommunity_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
/* Compile function for extcommunity match. */
-void
+static void
route_match_ecommunity_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
and `address-family vpnv4'. */
\f
/* `match origin' */
-route_map_result_t
+static route_map_result_t
route_match_origin (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_origin_compile (const char *arg)
{
u_char *origin;
}
/* Free route map's compiled `ip address' value. */
-void
+static void
route_match_origin_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
int peer_address;
};
-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)
{
struct rmap_ip_nexthop_set *rins;
}
/* Free route map's compiled `ip nexthop' value. */
-void
+static void
route_set_ip_nexthop_free (void *rule)
{
struct rmap_ip_nexthop_set *rins = rule;
/* `set local-preference LOCAL_PREF' */
/* Set local preference. */
-route_map_result_t
+static route_map_result_t
route_set_local_pref (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* set local preference compilation. */
-void *
+static void *
route_set_local_pref_compile (const char *arg)
{
unsigned long tmp;
}
/* Free route map's local preference value. */
-void
+static void
route_set_local_pref_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `set weight WEIGHT' */
/* Set weight. */
-route_map_result_t
+static route_map_result_t
route_set_weight (void *rule, struct prefix *prefix, route_map_object_t type,
void *object)
{
}
/* set local preference compilation. */
-void *
+static void *
route_set_weight_compile (const char *arg)
{
unsigned long tmp;
}
/* Free route map's local preference value. */
-void
+static void
route_set_weight_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)
{
u_int32_t metric;
+ unsigned long larg;
char *endptr = NULL;
if (all_digit (arg))
{
/* set metric value check*/
- metric = strtoul (arg, &endptr, 10);
- if (*endptr != '\0' || metric == ULONG_MAX)
+ larg = strtoul (arg, &endptr, 10);
+ if (*endptr != '\0' || larg == ULONG_MAX || larg > UINT32_MAX)
return NULL;
+ metric = larg;
}
else
{
|| (! all_digit (arg+1)))
return NULL;
- metric = strtoul (arg+1, &endptr, 10);
- if (*endptr != '\0' || metric == ULONG_MAX)
+ larg = strtoul (arg+1, &endptr, 10);
+ if (*endptr != '\0' || larg == ULONG_MAX || larg > UINT32_MAX)
return NULL;
+ metric = larg;
}
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
/* Free route map's compiled `set metric' value. */
-void
+static void
route_set_metric_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `set as-path prepend ASPATH' */
/* For AS path prepend mechanism. */
-route_map_result_t
+static route_map_result_t
route_set_aspath_prepend (void *rule, struct prefix *prefix, route_map_object_t type, void *object)
{
struct aspath *aspath;
}
/* Compile function for as-path prepend. */
-void *
+static void *
route_set_aspath_prepend_compile (const char *arg)
{
struct aspath *aspath;
}
/* Compile function for as-path prepend. */
-void
+static void
route_set_aspath_prepend_free (void *rule)
{
struct aspath *aspath = rule;
};
/* For community set mechanism. */
-route_map_result_t
+static route_map_result_t
route_set_community (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Compile function for set community. */
-void *
+static void *
route_set_community_compile (const char *arg)
{
struct rmap_com_set *rcs;
}
/* Free function for set community. */
-void
+static void
route_set_community_free (void *rule)
{
struct rmap_com_set *rcs = rule;
/* `set comm-list (<1-99>|<100-500>|WORD) delete' */
/* For community set mechanism. */
-route_map_result_t
+static route_map_result_t
route_set_community_delete (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Compile function for set community. */
-void *
+static void *
route_set_community_delete_compile (const char *arg)
{
char *p;
}
/* Free function for set community. */
-void
+static void
route_set_community_delete_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `set extcommunity rt COMMUNITY' */
/* For community set mechanism. */
-route_map_result_t
+static route_map_result_t
route_set_ecommunity_rt (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Compile function for set community. */
-void *
+static void *
route_set_ecommunity_rt_compile (const char *arg)
{
struct ecommunity *ecom;
}
/* Free function for set community. */
-void
+static void
route_set_ecommunity_rt_free (void *rule)
{
struct ecommunity *ecom = rule;
/* `set extcommunity soo COMMUNITY' */
/* For community set mechanism. */
-route_map_result_t
+static route_map_result_t
route_set_ecommunity_soo (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Compile function for set community. */
-void *
+static void *
route_set_ecommunity_soo_compile (const char *arg)
{
struct ecommunity *ecom;
}
/* Free function for set community. */
-void
+static void
route_set_ecommunity_soo_free (void *rule)
{
struct ecommunity *ecom = rule;
/* `set origin ORIGIN' */
/* For origin set. */
-route_map_result_t
+static route_map_result_t
route_set_origin (void *rule, struct prefix *prefix, route_map_object_t type, void *object)
{
u_char *origin;
}
/* Compile function for origin set. */
-void *
+static void *
route_set_origin_compile (const char *arg)
{
u_char *origin;
}
/* Compile function for origin set. */
-void
+static void
route_set_origin_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `set atomic-aggregate' */
/* For atomic aggregate set. */
-route_map_result_t
+static route_map_result_t
route_set_atomic_aggregate (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
}
/* Compile function for atomic aggregate. */
-void *
+static void *
route_set_atomic_aggregate_compile (const char *arg)
{
return (void *)1;
}
/* Compile function for atomic aggregate. */
-void
+static void
route_set_atomic_aggregate_free (void *rule)
{
return;
struct in_addr address;
};
-route_map_result_t
+static route_map_result_t
route_set_aggregator_as (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
return RMAP_OKAY;
}
-void *
+static void *
route_set_aggregator_as_compile (const char *arg)
{
struct aggregator *aggregator;
return aggregator;
}
-void
+static void
route_set_aggregator_as_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
#ifdef HAVE_IPV6
/* `match ipv6 address IP_ACCESS_LIST' */
-route_map_result_t
+static route_map_result_t
route_match_ipv6_address (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_ipv6_address_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
-void
+static void
route_match_ipv6_address_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
\f
/* `match ipv6 next-hop IP_ADDRESS' */
-route_map_result_t
+static route_map_result_t
route_match_ipv6_next_hop (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_ipv6_next_hop_compile (const char *arg)
{
struct in6_addr *address;
return address;
}
-void
+static void
route_match_ipv6_next_hop_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
\f
/* `match ipv6 address prefix-list PREFIX_LIST' */
-route_map_result_t
+static route_map_result_t
route_match_ipv6_address_prefix_list (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
return RMAP_NOMATCH;
}
-void *
+static void *
route_match_ipv6_address_prefix_list_compile (const char *arg)
{
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
}
-void
+static void
route_match_ipv6_address_prefix_list_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `set ipv6 nexthop global 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_global (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
/* Route map `ip next-hop' compile function. Given string is converted
to struct in_addr structure. */
-void *
+static void *
route_set_ipv6_nexthop_global_compile (const char *arg)
{
int ret;
}
/* Free route map's compiled `ip next-hop' value. */
-void
+static void
route_set_ipv6_nexthop_global_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `set ipv6 nexthop 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)
{
/* Route map `ip nexthop' compile function. Given string is converted
to struct in_addr structure. */
-void *
+static void *
route_set_ipv6_nexthop_local_compile (const char *arg)
{
int ret;
}
/* Free route map's compiled `ip nexthop' value. */
-void
+static void
route_set_ipv6_nexthop_local_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
\f
/* `set vpnv4 nexthop A.B.C.D' */
-route_map_result_t
+static route_map_result_t
route_set_vpnv4_nexthop (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
return RMAP_OKAY;
}
-void *
+static void *
route_set_vpnv4_nexthop_compile (const char *arg)
{
int ret;
return address;
}
-void
+static void
route_set_vpnv4_nexthop_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
/* `set originator-id' */
/* For origin set. */
-route_map_result_t
+static route_map_result_t
route_set_originator_id (void *rule, struct prefix *prefix, route_map_object_t type, void *object)
{
struct in_addr *address;
}
/* Compile function for originator-id set. */
-void *
+static void *
route_set_originator_id_compile (const char *arg)
{
int ret;
}
/* Compile function for originator_id set. */
-void
+static void
route_set_originator_id_free (void *rule)
{
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
};
\f
/* Add bgp route map rule. */
-int
+static int
bgp_route_match_add (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
}
/* Delete bgp route map rule. */
-int
+static int
bgp_route_match_delete (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
}
/* Add bgp route map rule. */
-int
+static int
bgp_route_set_add (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
}
/* Delete bgp route map rule. */
-int
+static int
bgp_route_set_delete (struct vty *vty, struct route_map_index *index,
const char *command, const char *arg)
{
}
/* Hook function for updating route_map assignment. */
-void
+static void
bgp_route_map_update (const char *unused)
{
int i;
return bgp_route_set_add (vty, vty->index, "ip next-hop", "peer-address");
}
-DEFUN (no_set_ip_nexthop_peer,
+DEFUN_DEPRECATED (no_set_ip_nexthop_peer,
no_set_ip_nexthop_peer_cmd,
"no set ip next-hop peer-address",
NO_STR
\f
/* Initialization of route map. */
void
-bgp_route_map_init ()
+bgp_route_map_init (void)
{
route_map_init ();
route_map_init_vty ();
#ifndef _QUAGGA_BGP_SNMP_H
#define _QUAGGA_BGP_SNMP_H
-void bgp_snmp_init ();
-void bgpTrapEstablished (struct peer *);
-void bgpTrapBackwardTransition (struct peer *);
+extern void bgp_snmp_init (void);
+extern void bgpTrapEstablished (struct peer *);
+extern void bgpTrapBackwardTransition (struct peer *);
#endif /* _QUAGGA_BGP_SNMP_H */
bgp_table_free (rt);
}
-struct bgp_node *
+static struct bgp_node *
bgp_node_create ()
{
struct bgp_node *rn;
}
/* Allocate new route node with prefix set. */
-struct bgp_node *
+static struct bgp_node *
bgp_node_set (struct bgp_table *table, struct prefix *prefix)
{
struct bgp_node *node;
}
/* Free route node. */
-void
+static void
bgp_node_free (struct bgp_node *node)
{
XFREE (MTYPE_BGP_NODE, node);
#define BGP_NODE_PROCESS_SCHEDULED (1 << 0)
};
-struct bgp_table *bgp_table_init (void);
-void bgp_table_finish (struct bgp_table *);
-void bgp_unlock_node (struct bgp_node *node);
-void bgp_node_delete (struct bgp_node *node);
-struct bgp_node *bgp_table_top (struct bgp_table *);
-struct bgp_node *bgp_route_next (struct bgp_node *);
-struct bgp_node *bgp_route_next_until (struct bgp_node *, struct bgp_node *);
-struct bgp_node *bgp_node_get (struct bgp_table *, struct prefix *);
-struct bgp_node *bgp_node_lookup (struct bgp_table *, struct prefix *);
-struct bgp_node *bgp_lock_node (struct bgp_node *node);
-struct bgp_node *bgp_node_match (struct bgp_table *, struct prefix *);
-struct bgp_node *bgp_node_match_ipv4 (struct bgp_table *,
+extern struct bgp_table *bgp_table_init (void);
+extern void bgp_table_finish (struct bgp_table *);
+extern void bgp_unlock_node (struct bgp_node *node);
+extern void bgp_node_delete (struct bgp_node *node);
+extern struct bgp_node *bgp_table_top (struct bgp_table *);
+extern struct bgp_node *bgp_route_next (struct bgp_node *);
+extern struct bgp_node *bgp_route_next_until (struct bgp_node *, struct bgp_node *);
+extern struct bgp_node *bgp_node_get (struct bgp_table *, struct prefix *);
+extern struct bgp_node *bgp_node_lookup (struct bgp_table *, struct prefix *);
+extern struct bgp_node *bgp_lock_node (struct bgp_node *node);
+extern struct bgp_node *bgp_node_match (struct bgp_table *, struct prefix *);
+extern struct bgp_node *bgp_node_match_ipv4 (struct bgp_table *,
struct in_addr *);
#ifdef HAVE_IPV6
-struct bgp_node *bgp_node_match_ipv6 (struct bgp_table *,
+extern struct bgp_node *bgp_node_match_ipv6 (struct bgp_table *,
struct in6_addr *);
#endif /* HAVE_IPV6 */
#include "bgpd/bgp_route.h"
#include "bgpd/bgp_zebra.h"
#include "bgpd/bgp_table.h"
+#include "bgpd/bgp_vty.h"
extern struct in_addr router_id_zebra;
return SAFI_UNICAST;
}
-int
+static int
peer_address_self_check (union sockunion *su)
{
struct interface *ifp = NULL;
}
/* Utility function for looking up peer from VTY. */
-struct peer *
+static struct peer *
peer_lookup_vty (struct vty *vty, const char *ip_str)
{
int ret;
}
/* Utility function for looking up peer or peer group. */
-struct peer *
+static struct peer *
peer_and_group_lookup_vty (struct vty *vty, const char *peer_str)
{
int ret;
return NULL;
}
-int
+static int
bgp_vty_return (struct vty *vty, int ret)
{
const char *str = NULL;
return bgp_vty_return (vty, ret);
}
\f
-int
+static int
peer_flag_modify_vty (struct vty *vty, const char *ip_str,
u_int16_t flag, int set)
{
return bgp_vty_return (vty, ret);
}
-int
+static int
peer_flag_set_vty (struct vty *vty, const char *ip_str, u_int16_t flag)
{
return peer_flag_modify_vty (vty, ip_str, flag, 1);
}
-int
+static int
peer_flag_unset_vty (struct vty *vty, const char *ip_str, u_int16_t flag)
{
return peer_flag_modify_vty (vty, ip_str, flag, 0);
return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY);
}
\f
-int
+static int
peer_af_flag_modify_vty (struct vty *vty, const char *peer_str, afi_t afi,
safi_t safi, u_int32_t flag, int set)
{
return bgp_vty_return (vty, ret);
}
-int
+static int
peer_af_flag_set_vty (struct vty *vty, const char *peer_str, afi_t afi,
safi_t safi, u_int32_t flag)
{
return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 1);
}
-int
+static int
peer_af_flag_unset_vty (struct vty *vty, const char *peer_str, afi_t afi,
safi_t safi, u_int32_t flag)
{
PEER_FLAG_REFLECTOR_CLIENT);
}
\f
-int
+static int
peer_rsclient_set_vty (struct vty *vty, const char *peer_str,
int afi, int safi)
{
return CMD_SUCCESS;
}
-int
+static int
peer_rsclient_unset_vty (struct vty *vty, const char *peer_str,
int afi, int safi)
{
}
\f
/* EBGP multihop configuration. */
-int
+static int
peer_ebgp_multihop_set_vty (struct vty *vty, const char *ip_str,
const char *ttl_str)
{
return CMD_SUCCESS;
}
-int
+static int
peer_ebgp_multihop_unset_vty (struct vty *vty, const char *ip_str)
{
struct peer *peer;
"Up to 80 characters describing this neighbor\n")
\f
/* Neighbor update-source. */
-int
+static int
peer_update_source_vty (struct vty *vty, const char *peer_str,
const char *source_str)
{
return peer_update_source_vty (vty, argv[0], NULL);
}
\f
-int
+static int
peer_default_originate_set_vty (struct vty *vty, const char *peer_str,
afi_t afi, safi_t safi,
const char *rmap, int set)
"route-map name\n")
\f
/* Set neighbor's BGP port. */
-int
+static int
peer_port_vty (struct vty *vty, const char *ip_str, int afi,
const char *port_str)
{
"TCP port number\n")
\f
/* neighbor weight. */
-int
+static int
peer_weight_set_vty (struct vty *vty, const char *ip_str,
const char *weight_str)
{
return CMD_SUCCESS;
}
-int
+static int
peer_weight_unset_vty (struct vty *vty, const char *ip_str)
{
struct peer *peer;
return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH);
}
\f
-int
+static int
peer_timers_set_vty (struct vty *vty, const char *ip_str,
const char *keep_str, const char *hold_str)
{
return bgp_vty_return (vty, ret);
}
\f
-int
+static int
peer_timers_unset_vty (struct vty *vty, const char *ip_str)
{
int ret;
return peer_timers_unset_vty (vty, argv[0]);
}
\f
-int
+static int
peer_timers_connect_set_vty (struct vty *vty, const char *ip_str,
const char *time_str)
{
return CMD_SUCCESS;
}
-int
+static int
peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str)
{
int ret;
"BGP connect timer\n"
"Connect timer\n")
\f
-int
+static int
peer_advertise_interval_vty (struct vty *vty, const char *ip_str,
const char *time_str, int set)
{
"time in seconds\n")
\f
/* neighbor interface */
-int
+static int
peer_interface_vty (struct vty *vty, const char *ip_str, const char *str)
{
int ret;
}
\f
/* Set distribute list to the peer. */
-int
+static int
peer_distribute_set_vty (struct vty *vty, const char *ip_str,
afi_t afi, safi_t safi,
const char *name_str, const char *direct_str)
return bgp_vty_return (vty, ret);
}
-int
+static int
peer_distribute_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
safi_t safi, const char *direct_str)
{
}
\f
/* Set prefix list to the peer. */
-int
+static int
peer_prefix_list_set_vty (struct vty *vty, const char *ip_str, afi_t afi,
safi_t safi, const char *name_str,
const char *direct_str)
return bgp_vty_return (vty, ret);
}
-int
+static int
peer_prefix_list_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
safi_t safi, const char *direct_str)
{
bgp_node_safi (vty), argv[2]);
}
\f
-int
+static int
peer_aslist_set_vty (struct vty *vty, const char *ip_str,
afi_t afi, safi_t safi,
const char *name_str, const char *direct_str)
return bgp_vty_return (vty, ret);
}
-int
+static int
peer_aslist_unset_vty (struct vty *vty, const char *ip_str,
afi_t afi, safi_t safi,
const char *direct_str)
}
\f
/* Set route-map to the peer. */
-int
+static int
peer_route_map_set_vty (struct vty *vty, const char *ip_str,
afi_t afi, safi_t safi,
const char *name_str, const char *direct_str)
return bgp_vty_return (vty, ret);
}
-int
+static int
peer_route_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
safi_t safi, const char *direct_str)
{
}
\f
/* Set unsuppress-map to the peer. */
-int
+static int
peer_unsuppress_map_set_vty (struct vty *vty, const char *ip_str, afi_t afi,
safi_t safi, const char *name_str)
{
}
/* Unset route-map from the peer. */
-int
+static int
peer_unsuppress_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
safi_t safi)
{
bgp_node_safi (vty));
}
\f
-int
+static int
peer_maximum_prefix_set_vty (struct vty *vty, const char *ip_str, afi_t afi,
safi_t safi, const char *num_str,
const char *threshold_str, int warning,
return bgp_vty_return (vty, ret);
}
-int
+static int
peer_maximum_prefix_unset_vty (struct vty *vty, const char *ip_str, afi_t afi,
safi_t safi)
{
clear_as
};
-void
+static void
bgp_clear_vty_error (struct vty *vty, struct peer *peer, afi_t afi,
safi_t safi, int error)
{
}
/* `clear ip bgp' functions. */
-int
+static int
bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
enum clear_sort sort,enum bgp_clear_type stype, const char *arg)
{
return 0;
}
-int
+static int
bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi,
enum clear_sort sort, enum bgp_clear_type stype,
const char *arg)
/* Show BGP peer's summary information. */
-int
+static int
bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi)
{
struct peer *peer;
return CMD_SUCCESS;
}
-int
+static int
bgp_show_summary_vty (struct vty *vty, const char *name,
afi_t afi, safi_t safi)
{
show_peer
};
-void
+static void
bgp_show_peer_afi_orf_cap (struct vty *vty, struct peer *p,
afi_t afi, safi_t safi,
u_int16_t adv_smcap, u_int16_t adv_rmcap,
}
}
-void
+static void
bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi)
{
struct bgp_filter *filter;
vty_out (vty, "%s", VTY_NEWLINE);
}
-void
+static void
bgp_show_peer (struct vty *vty, struct peer *p)
{
struct bgp *bgp;
vty_out (vty, "%s", VTY_NEWLINE);
}
-int
+static int
bgp_show_neighbor (struct vty *vty, struct bgp *bgp,
enum show_type type, union sockunion *su)
{
return CMD_SUCCESS;
}
-int
+static int
bgp_show_neighbor_vty (struct vty *vty, const char *name,
enum show_type type, const char *ip_str)
{
\f
#include "hash.h"
-void
+static void
community_show_all_iterator (struct hash_backet *backet, struct vty *vty)
{
struct community *com;
return CMD_SUCCESS;
}
\f
-int
+static int
bgp_write_rsclient_summary (struct vty *vty, struct peer *rsclient,
afi_t afi, safi_t safi)
{
return 1;
}
-int
+static int
bgp_show_rsclient_summary (struct vty *vty, struct bgp *bgp,
afi_t afi, safi_t safi)
{
return CMD_SUCCESS;
}
-int
+static int
bgp_show_rsclient_summary_vty (struct vty *vty, const char *name,
afi_t afi, safi_t safi)
{
};
\f
void
-bgp_vty_init ()
+bgp_vty_init (void)
{
- int bgp_config_write (struct vty *);
- void community_list_vty ();
+ static void community_list_vty (void);
/* Install bgp top node. */
install_node (&bgp_node, bgp_config_write);
/* VTY functions. */
/* Direction value to string conversion. */
-const char *
+static const char *
community_direct_str (int direct)
{
switch (direct)
}
/* Display error string. */
-void
+static void
community_list_perror (struct vty *vty, int ret)
{
switch (ret)
}
/* VTY interface for community_set() function. */
-int
+static int
community_list_set_vty (struct vty *vty, int argc, const char **argv,
int style, int reject_all_digit_name)
{
}
/* Communiyt-list entry delete. */
-int
+static int
community_list_unset_vty (struct vty *vty, int argc, const char **argv,
int style)
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
}
-void
+static void
community_list_show (struct vty *vty, struct community_list *list)
{
struct community_entry *entry;
return CMD_SUCCESS;
}
\f
-int
+static int
extcommunity_list_set_vty (struct vty *vty, int argc, const char **argv,
int style, int reject_all_digit_name)
{
return CMD_SUCCESS;
}
-int
+static int
extcommunity_list_unset_vty (struct vty *vty, int argc, const char **argv,
int style)
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
}
-void
+static void
extcommunity_list_show (struct vty *vty, struct community_list *list)
{
struct community_entry *entry;
}
/* Display community-list and extcommunity-list configuration. */
-int
+static int
community_list_config_write (struct vty *vty)
{
struct community_list *list;
1 /* Export to vtysh. */
};
-void
-community_list_vty ()
+static void
+community_list_vty (void)
{
install_node (&community_list_node, community_list_config_write);
#ifndef _QUAGGA_BGP_VTY_H
#define _QUAGGA_BGP_VTY_H
-void bgp_vty_init ();
-char *afi_safi_print (afi_t, safi_t);
+extern void bgp_vty_init (void);
+extern const char *afi_safi_print (afi_t, safi_t);
#endif /* _QUAGGA_BGP_VTY_H */
struct in_addr router_id_zebra;
/* Router-id update message from zebra. */
-int
+static int
bgp_router_id_update (int command, struct zclient *zclient, zebra_size_t length)
{
struct prefix router_id;
}
/* Inteface addition message from zebra. */
-int
+static int
bgp_interface_add (int command, struct zclient *zclient, zebra_size_t length)
{
struct interface *ifp;
return 0;
}
-int
+static int
bgp_interface_delete (int command, struct zclient *zclient,
zebra_size_t length)
{
return 0;
}
-int
+static int
bgp_interface_up (int command, struct zclient *zclient, zebra_size_t length)
{
struct stream *s;
return 0;
}
-int
+static int
bgp_interface_down (int command, struct zclient *zclient, zebra_size_t length)
{
struct stream *s;
return 0;
}
-int
+static int
bgp_interface_address_add (int command, struct zclient *zclient,
zebra_size_t length)
{
return 0;
}
-int
+static int
bgp_interface_address_delete (int command, struct zclient *zclient,
zebra_size_t length)
{
}
/* Zebra route add and delete treatment. */
-int
+static int
zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length)
{
struct stream *s;
#ifdef HAVE_IPV6
/* Zebra route add and delete treatment. */
-int
+static int
zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length)
{
struct stream *s;
return NULL;
}
-int
+static int
if_get_ipv6_global (struct interface *ifp, struct in6_addr *addr)
{
struct listnode *cnode;
return 0;
}
-int
+static int
if_get_ipv6_local (struct interface *ifp, struct in6_addr *addr)
{
struct listnode *cnode;
}
#ifdef HAVE_IPV6
-unsigned int
+static unsigned int
bgp_ifindex_by_nexthop (struct in6_addr *addr)
{
struct listnode *ifnode;
}
\f
void
-bgp_zclient_reset ()
+bgp_zclient_reset (void)
{
zclient_reset (zclient);
}
void
-bgp_zebra_init (int enable)
+bgp_zebra_init (void)
{
/* Set default values. */
zclient = zclient_new ();
#ifndef _QUAGGA_BGP_ZEBRA_H
#define _QUAGGA_BGP_ZEBRA_H
-int bgp_if_update_all ();
-int bgp_config_write_redistribute (struct vty *, struct bgp *, afi_t, safi_t,
+extern void bgp_zebra_init (void);
+extern int bgp_if_update_all (void);
+extern int bgp_config_write_redistribute (struct vty *, struct bgp *, afi_t, safi_t,
int *);
-void bgp_zebra_announce (struct prefix *, struct bgp_info *, struct bgp *);
-void bgp_zebra_withdraw (struct prefix *, struct bgp_info *);
-
-int bgp_redistribute_set (struct bgp *, afi_t, int);
-int bgp_redistribute_rmap_set (struct bgp *, afi_t, int, const char *);
-int bgp_redistribute_metric_set (struct bgp *, afi_t, int, u_int32_t);
-int bgp_redistribute_unset (struct bgp *, afi_t, int);
-int bgp_redistribute_routemap_unset (struct bgp *, afi_t, int);
-int bgp_redistribute_metric_unset (struct bgp *, afi_t, int);
-
-struct interface *if_lookup_by_ipv4 (struct in_addr *);
-struct interface *if_lookup_by_ipv4_exact (struct in_addr *);
+extern void bgp_zebra_announce (struct prefix *, struct bgp_info *, struct bgp *);
+extern void bgp_zebra_withdraw (struct prefix *, struct bgp_info *);
+
+extern int bgp_redistribute_set (struct bgp *, afi_t, int);
+extern int bgp_redistribute_rmap_set (struct bgp *, afi_t, int, const char *);
+extern int bgp_redistribute_metric_set (struct bgp *, afi_t, int, u_int32_t);
+extern int bgp_redistribute_unset (struct bgp *, afi_t, int);
+extern int bgp_redistribute_routemap_unset (struct bgp *, afi_t, int);
+extern int bgp_redistribute_metric_unset (struct bgp *, afi_t, int);
+
+extern struct interface *if_lookup_by_ipv4 (struct in_addr *);
+extern struct interface *if_lookup_by_ipv4_exact (struct in_addr *);
#ifdef HAVE_IPV6
-struct interface *if_lookup_by_ipv6 (struct in6_addr *);
-struct interface *if_lookup_by_ipv6_exact (struct in6_addr *);
+extern struct interface *if_lookup_by_ipv6 (struct in6_addr *);
+extern struct interface *if_lookup_by_ipv6_exact (struct in6_addr *);
#endif /* HAVE_IPV6 */
#endif /* _QUAGGA_BGP_ZEBRA_H */
}
/* peer global config reset */
-void
+static void
peer_global_config_reset (struct peer *peer)
{
peer->weight = 0;
}
/* Create new BGP peer. */
-struct peer *
+static struct peer *
peer_create (union sockunion *su, struct bgp *bgp, as_t local_as,
as_t remote_as, afi_t afi, safi_t safi)
{
}
/* Change peer's AS number. */
-void
+static void
peer_as_change (struct peer *peer, as_t as)
{
int type;
return 0;
}
\f
-int
+static int
peer_group_cmp (struct peer_group *g1, struct peer_group *g2)
{
return strcmp (g1->name, g2->name);
}
/* If peer is configured at least one address family return 1. */
-int
+static int
peer_group_active (struct peer *peer)
{
if (peer->af_group[AFI_IP][SAFI_UNICAST]
sizeof (struct peer_group));
}
-void
+static void
peer_group_free (struct peer_group *group)
{
XFREE (MTYPE_PEER_GROUP, group);
return 0;
}
-void
+static void
peer_group2peer_config_copy (struct peer_group *group, struct peer *peer,
afi_t afi, safi_t safi)
{
}
\f
/* BGP instance creation by `router bgp' commands. */
-struct bgp *
+static struct bgp *
bgp_create (as_t *as, const char *name)
{
struct bgp *bgp;
/* Return first entry of BGP. */
struct bgp *
-bgp_get_default ()
+bgp_get_default (void)
{
if (bm->bgp->head)
return (listgetdata (listhead (bm->bgp)));
peer_change_reset_out,
};
-void
+static void
peer_change_action (struct peer *peer, afi_t afi, safi_t safi,
enum peer_change_type type)
{
};
/* Proper action set. */
-int
+static int
peer_flag_action_set (struct peer_flag_action *action_list, int size,
struct peer_flag_action *action, u_int32_t flag)
{
return found;
}
-void
+static void
peer_flag_modify_action (struct peer *peer, u_int32_t flag)
{
if (flag == PEER_FLAG_SHUTDOWN)
}
/* Change specified peer flag. */
-int
+static int
peer_flag_modify (struct peer *peer, u_int32_t flag, int set)
{
int found;
return peer_flag_modify (peer, flag, 0);
}
-int
+static int
peer_is_group_member (struct peer *peer, afi_t afi, safi_t safi)
{
if (peer->af_group[afi][safi])
return 0;
}
-int
+static int
peer_af_flag_modify (struct peer *peer, afi_t afi, safi_t safi, u_int32_t flag,
int set)
{
}
/* Update distribute list. */
-void
+static void
peer_distribute_update (struct access_list *access)
{
afi_t afi;
}
/* Update prefix-list list. */
-void
+static void
peer_prefix_list_update (struct prefix_list *plist)
{
struct listnode *mnode, *mnnode;
return 0;
}
-void
+static void
peer_aslist_update ()
{
afi_t afi;
return buf;
}
\f
-void
+static void
bgp_config_write_filter (struct vty *vty, struct peer *peer,
afi_t afi, safi_t safi)
{
}
/* BGP peer configuration display function. */
-void
+static void
bgp_config_write_peer (struct vty *vty, struct bgp *bgp,
struct peer *peer, afi_t afi, safi_t safi)
{
}
/* Address family based peer configuration display. */
-int
+static int
bgp_config_write_family (struct vty *vty, struct bgp *bgp, afi_t afi,
safi_t safi)
{
}
void
-bgp_master_init ()
+bgp_master_init (void)
{
memset (&bgp_master, 0, sizeof (struct bgp_master));
\f
void
-bgp_init ()
+bgp_init (void)
{
- void bgp_zebra_init ();
- void bgp_route_map_init ();
- void bgp_filter_init ();
-
/* BGP VTY commands installation. */
bgp_vty_init ();
extern struct thread_master *master;
/* Prototypes. */
-void bgp_terminate (void);
-void bgp_reset (void);
-void bgp_zclient_reset ();
-int bgp_nexthop_set (union sockunion *, union sockunion *,
+extern void bgp_terminate (void);
+extern void bgp_reset (void);
+extern void bgp_zclient_reset (void);
+extern int bgp_nexthop_set (union sockunion *, union sockunion *,
struct bgp_nexthop *, struct peer *);
-struct bgp *bgp_get_default ();
-struct bgp *bgp_lookup (as_t, const char *);
-struct bgp *bgp_lookup_by_name (const char *);
-struct peer *peer_lookup (struct bgp *, union sockunion *);
-struct peer_group *peer_group_lookup (struct bgp *, const char *);
-struct peer_group *peer_group_get (struct bgp *, const char *);
-struct peer *peer_lookup_with_open (union sockunion *, as_t, struct in_addr *,
+extern struct bgp *bgp_get_default (void);
+extern struct bgp *bgp_lookup (as_t, const char *);
+extern struct bgp *bgp_lookup_by_name (const char *);
+extern struct peer *peer_lookup (struct bgp *, union sockunion *);
+extern struct peer_group *peer_group_lookup (struct bgp *, const char *);
+extern struct peer_group *peer_group_get (struct bgp *, const char *);
+extern struct peer *peer_lookup_with_open (union sockunion *, as_t, struct in_addr *,
int *);
extern struct peer *peer_lock (struct peer *);
extern struct peer *peer_unlock (struct peer *);
-int peer_sort (struct peer *peer);
-int peer_active (struct peer *);
-int peer_active_nego (struct peer *);
-struct peer *peer_create_accept (struct bgp *);
-char *peer_uptime (time_t, char *, size_t);
-void bgp_config_write_family_header (struct vty *, afi_t, safi_t, int *);
+extern int peer_sort (struct peer *peer);
+extern int peer_active (struct peer *);
+extern int peer_active_nego (struct peer *);
+extern struct peer *peer_create_accept (struct bgp *);
+extern char *peer_uptime (time_t, char *, size_t);
+extern int bgp_config_write (struct vty *);
+extern void bgp_config_write_family_header (struct vty *, afi_t, safi_t, int *);
\f
-void bgp_master_init ();
+extern void bgp_master_init (void);
-void bgp_init ();
+extern void bgp_init (void);
+extern void bgp_route_map_init (void);
-int bgp_option_set (int);
-int bgp_option_unset (int);
-int bgp_option_check (int);
+extern int bgp_option_set (int);
+extern int bgp_option_unset (int);
+extern int bgp_option_check (int);
-int bgp_get (struct bgp **, as_t *, const char *);
-int bgp_delete (struct bgp *);
+extern int bgp_get (struct bgp **, as_t *, const char *);
+extern int bgp_delete (struct bgp *);
-int bgp_flag_set (struct bgp *, int);
-int bgp_flag_unset (struct bgp *, int);
-int bgp_flag_check (struct bgp *, int);
+extern int bgp_flag_set (struct bgp *, int);
+extern int bgp_flag_unset (struct bgp *, int);
+extern int bgp_flag_check (struct bgp *, int);
-int bgp_router_id_set (struct bgp *, struct in_addr *);
-int bgp_router_id_unset (struct bgp *);
+extern int bgp_router_id_set (struct bgp *, struct in_addr *);
+extern int bgp_router_id_unset (struct bgp *);
-int bgp_cluster_id_set (struct bgp *, struct in_addr *);
-int bgp_cluster_id_unset (struct bgp *);
+extern int bgp_cluster_id_set (struct bgp *, struct in_addr *);
+extern int bgp_cluster_id_unset (struct bgp *);
-int bgp_confederation_id_set (struct bgp *, as_t);
-int bgp_confederation_id_unset (struct bgp *);
-int bgp_confederation_peers_check (struct bgp *, as_t);
+extern int bgp_confederation_id_set (struct bgp *, as_t);
+extern int bgp_confederation_id_unset (struct bgp *);
+extern int bgp_confederation_peers_check (struct bgp *, as_t);
-int bgp_confederation_peers_add (struct bgp *, as_t);
-int bgp_confederation_peers_remove (struct bgp *, as_t);
+extern int bgp_confederation_peers_add (struct bgp *, as_t);
+extern int bgp_confederation_peers_remove (struct bgp *, as_t);
-int bgp_timers_set (struct bgp *, u_int32_t, u_int32_t);
-int bgp_timers_unset (struct bgp *);
+extern int bgp_timers_set (struct bgp *, u_int32_t, u_int32_t);
+extern int bgp_timers_unset (struct bgp *);
-int bgp_default_local_preference_set (struct bgp *, u_int32_t);
-int bgp_default_local_preference_unset (struct bgp *);
+extern int bgp_default_local_preference_set (struct bgp *, u_int32_t);
+extern int bgp_default_local_preference_unset (struct bgp *);
-int peer_rsclient_active (struct peer *);
+extern int peer_rsclient_active (struct peer *);
-int peer_remote_as (struct bgp *, union sockunion *, as_t *, afi_t, safi_t);
-int peer_group_remote_as (struct bgp *, const char *, as_t *);
-int peer_delete (struct peer *peer);
-int peer_group_delete (struct peer_group *);
-int peer_group_remote_as_delete (struct peer_group *);
+extern int peer_remote_as (struct bgp *, union sockunion *, as_t *, afi_t, safi_t);
+extern int peer_group_remote_as (struct bgp *, const char *, as_t *);
+extern int peer_delete (struct peer *peer);
+extern int peer_group_delete (struct peer_group *);
+extern int peer_group_remote_as_delete (struct peer_group *);
-int peer_activate (struct peer *, afi_t, safi_t);
-int peer_deactivate (struct peer *, afi_t, safi_t);
+extern int peer_activate (struct peer *, afi_t, safi_t);
+extern int peer_deactivate (struct peer *, afi_t, safi_t);
-int peer_group_bind (struct bgp *, union sockunion *, struct peer_group *,
+extern int peer_group_bind (struct bgp *, union sockunion *, struct peer_group *,
afi_t, safi_t, as_t *);
-int peer_group_unbind (struct bgp *, struct peer *, struct peer_group *,
+extern int peer_group_unbind (struct bgp *, struct peer *, struct peer_group *,
afi_t, safi_t);
-int peer_flag_set (struct peer *, u_int32_t);
-int peer_flag_unset (struct peer *, u_int32_t);
+extern int peer_flag_set (struct peer *, u_int32_t);
+extern int peer_flag_unset (struct peer *, u_int32_t);
-int peer_af_flag_set (struct peer *, afi_t, safi_t, u_int32_t);
-int peer_af_flag_unset (struct peer *, afi_t, safi_t, u_int32_t);
-int peer_af_flag_check (struct peer *, afi_t, safi_t, u_int32_t);
+extern int peer_af_flag_set (struct peer *, afi_t, safi_t, u_int32_t);
+extern int peer_af_flag_unset (struct peer *, afi_t, safi_t, u_int32_t);
+extern int peer_af_flag_check (struct peer *, afi_t, safi_t, u_int32_t);
-int peer_ebgp_multihop_set (struct peer *, int);
-int peer_ebgp_multihop_unset (struct peer *);
+extern int peer_ebgp_multihop_set (struct peer *, int);
+extern int peer_ebgp_multihop_unset (struct peer *);
-int peer_description_set (struct peer *, char *);
-int peer_description_unset (struct peer *);
+extern int peer_description_set (struct peer *, char *);
+extern int peer_description_unset (struct peer *);
-int peer_update_source_if_set (struct peer *, const char *);
-int peer_update_source_addr_set (struct peer *, union sockunion *);
-int peer_update_source_unset (struct peer *);
+extern int peer_update_source_if_set (struct peer *, const char *);
+extern int peer_update_source_addr_set (struct peer *, union sockunion *);
+extern int peer_update_source_unset (struct peer *);
-int peer_default_originate_set (struct peer *, afi_t, safi_t, const char *);
-int peer_default_originate_unset (struct peer *, afi_t, safi_t);
+extern int peer_default_originate_set (struct peer *, afi_t, safi_t, const char *);
+extern int peer_default_originate_unset (struct peer *, afi_t, safi_t);
-int peer_port_set (struct peer *, u_int16_t);
-int peer_port_unset (struct peer *);
+extern int peer_port_set (struct peer *, u_int16_t);
+extern int peer_port_unset (struct peer *);
-int peer_weight_set (struct peer *, u_int16_t);
-int peer_weight_unset (struct peer *);
+extern int peer_weight_set (struct peer *, u_int16_t);
+extern int peer_weight_unset (struct peer *);
-int peer_timers_set (struct peer *, u_int32_t, u_int32_t);
-int peer_timers_unset (struct peer *);
+extern int peer_timers_set (struct peer *, u_int32_t, u_int32_t);
+extern int peer_timers_unset (struct peer *);
-int peer_timers_connect_set (struct peer *, u_int32_t);
-int peer_timers_connect_unset (struct peer *);
+extern int peer_timers_connect_set (struct peer *, u_int32_t);
+extern int peer_timers_connect_unset (struct peer *);
-int peer_advertise_interval_set (struct peer *, u_int32_t);
-int peer_advertise_interval_unset (struct peer *);
+extern int peer_advertise_interval_set (struct peer *, u_int32_t);
+extern int peer_advertise_interval_unset (struct peer *);
-int peer_interface_set (struct peer *, const char *);
-int peer_interface_unset (struct peer *);
+extern int peer_interface_set (struct peer *, const char *);
+extern int peer_interface_unset (struct peer *);
-int peer_distribute_set (struct peer *, afi_t, safi_t, int, const char *);
-int peer_distribute_unset (struct peer *, afi_t, safi_t, int);
+extern int peer_distribute_set (struct peer *, afi_t, safi_t, int, const char *);
+extern int peer_distribute_unset (struct peer *, afi_t, safi_t, int);
-int peer_allowas_in_set (struct peer *, afi_t, safi_t, int);
-int peer_allowas_in_unset (struct peer *, afi_t, safi_t);
+extern int peer_allowas_in_set (struct peer *, afi_t, safi_t, int);
+extern int peer_allowas_in_unset (struct peer *, afi_t, safi_t);
-int peer_local_as_set (struct peer *, as_t, int);
-int peer_local_as_unset (struct peer *);
+extern int peer_local_as_set (struct peer *, as_t, int);
+extern int peer_local_as_unset (struct peer *);
-int peer_prefix_list_set (struct peer *, afi_t, safi_t, int, const char *);
-int peer_prefix_list_unset (struct peer *, afi_t, safi_t, int);
+extern int peer_prefix_list_set (struct peer *, afi_t, safi_t, int, const char *);
+extern int peer_prefix_list_unset (struct peer *, afi_t, safi_t, int);
-int peer_aslist_set (struct peer *, afi_t, safi_t, int, const char *);
-int peer_aslist_unset (struct peer *,afi_t, safi_t, int);
+extern int peer_aslist_set (struct peer *, afi_t, safi_t, int, const char *);
+extern int peer_aslist_unset (struct peer *,afi_t, safi_t, int);
-int peer_route_map_set (struct peer *, afi_t, safi_t, int, const char *);
-int peer_route_map_unset (struct peer *, afi_t, safi_t, int);
+extern int peer_route_map_set (struct peer *, afi_t, safi_t, int, const char *);
+extern int peer_route_map_unset (struct peer *, afi_t, safi_t, int);
-int peer_unsuppress_map_set (struct peer *, afi_t, safi_t, const char *);
-int peer_unsuppress_map_unset (struct peer *, afi_t, safi_t);
+extern int peer_unsuppress_map_set (struct peer *, afi_t, safi_t, const char *);
+extern int peer_unsuppress_map_unset (struct peer *, afi_t, safi_t);
-int peer_maximum_prefix_set (struct peer *, afi_t, safi_t, u_int32_t, u_char, int, u_int16_t);
-int peer_maximum_prefix_unset (struct peer *, afi_t, safi_t);
+extern int peer_maximum_prefix_set (struct peer *, afi_t, safi_t, u_int32_t, u_char, int, u_int16_t);
+extern int peer_maximum_prefix_unset (struct peer *, afi_t, safi_t);
-int peer_clear (struct peer *);
-int peer_clear_soft (struct peer *, afi_t, safi_t, enum bgp_clear_type);
+extern int peer_clear (struct peer *);
+extern int peer_clear_soft (struct peer *, afi_t, safi_t, enum bgp_clear_type);
-void peer_nsf_stop (struct peer *);
+extern void peer_nsf_stop (struct peer *);
#endif /* _QUAGGA_BGPD_H */