diff options
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_aspath.c | 6 | ||||
-rw-r--r-- | bgpd/bgp_aspath.h | 2 | ||||
-rw-r--r-- | bgpd/bgp_attr.c | 14 | ||||
-rw-r--r-- | bgpd/bgp_attr.h | 5 | ||||
-rw-r--r-- | bgpd/bgp_community.c | 2 | ||||
-rw-r--r-- | bgpd/bgp_damp.c | 6 | ||||
-rw-r--r-- | bgpd/bgp_damp.h | 5 | ||||
-rw-r--r-- | bgpd/bgp_debug.c | 28 | ||||
-rw-r--r-- | bgpd/bgp_debug.h | 4 | ||||
-rw-r--r-- | bgpd/bgp_ecommunity.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_ecommunity.h | 1 | ||||
-rw-r--r-- | bgpd/bgp_fsm.c | 2 | ||||
-rw-r--r-- | bgpd/bgp_main.c | 18 | ||||
-rw-r--r-- | bgpd/bgp_network.c | 11 | ||||
-rw-r--r-- | bgpd/bgp_open.c | 19 | ||||
-rw-r--r-- | bgpd/bgp_packet.c | 2 | ||||
-rw-r--r-- | bgpd/bgp_route.c | 13 | ||||
-rw-r--r-- | bgpd/bgpd.c | 12 | ||||
-rw-r--r-- | bgpd/bgpd.h | 2 |
19 files changed, 72 insertions, 84 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index d6fa6af5..e703941d 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -86,7 +86,7 @@ struct assegment_header }; /* Hash for aspath. This is the top level structure of AS path. */ -struct hash *ashash; +static struct hash *ashash; /* Stream for SNMP. See aspath_snmp_pathseg */ static struct stream *snmp_stream; @@ -482,6 +482,7 @@ aspath_has_as4 (struct aspath *aspath) return 0; } +#ifdef unused /* Return number of as numbers in in path */ unsigned int aspath_count_numas (struct aspath *aspath) @@ -497,6 +498,7 @@ aspath_count_numas (struct aspath *aspath) } return num; } +#endif /* Expand aspath string */ static char * @@ -1769,6 +1771,7 @@ aspath_init (void) ashash = hash_create_size (32767, aspath_key_make, aspath_cmp); } +#ifdef unused void aspath_finish (void) { @@ -1777,6 +1780,7 @@ aspath_finish (void) if (snmp_stream) stream_free (snmp_stream); } +#endif /* return and as path value */ const char * diff --git a/bgpd/bgp_aspath.h b/bgpd/bgp_aspath.h index 2b4625c8..8f8db9a6 100644 --- a/bgpd/bgp_aspath.h +++ b/bgpd/bgp_aspath.h @@ -64,7 +64,6 @@ struct aspath /* Prototypes. */ extern void aspath_init (void); -extern void aspath_finish (void); extern struct aspath *aspath_parse (struct stream *, size_t, int); extern struct aspath *aspath_dup (struct aspath *); extern struct aspath *aspath_aggregate (struct aspath *, struct aspath *); @@ -97,7 +96,6 @@ extern size_t aspath_put (struct stream *, struct aspath *, int); extern struct aspath *aspath_reconcile_as4 (struct aspath *, struct aspath *); extern unsigned int aspath_has_as4 (struct aspath *); -extern unsigned int aspath_count_numas (struct aspath *); /* For SNMP BGP4PATHATTRASPATHSEGMENT, might be useful for debug */ extern u_char *aspath_snmp_pathseg (struct aspath *, size_t *); diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index ed1e72b3..41e9c223 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -39,7 +39,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_ecommunity.h" /* Attribute strings for logging. */ -static struct message attr_str [] = +static const struct message attr_str [] = { { BGP_ATTR_ORIGIN, "ORIGIN" }, { BGP_ATTR_AS_PATH, "AS_PATH" }, @@ -61,9 +61,9 @@ static struct message attr_str [] = { BGP_ATTR_AS4_AGGREGATOR, "AS4_AGGREGATOR" }, { BGP_ATTR_AS_PATHLIMIT, "AS_PATHLIMIT" }, }; -int attr_str_max = sizeof(attr_str)/sizeof(attr_str[0]); +static const int attr_str_max = sizeof(attr_str)/sizeof(attr_str[0]); -struct hash *cluster_hash; +static struct hash *cluster_hash; static void * cluster_hash_alloc (void *p) @@ -202,7 +202,7 @@ cluster_init (void) } /* Unknown transit attribute. */ -struct hash *transit_hash; +static struct hash *transit_hash; static void transit_free (struct transit *transit) @@ -282,7 +282,7 @@ transit_init (void) } /* Attribute hash routines. */ -struct hash *attrhash; +static struct hash *attrhash; static struct attr_extra * bgp_attr_extra_new (void) @@ -1256,7 +1256,7 @@ bgp_attr_cluster_list (struct peer *peer, bgp_size_t length, } /* 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) { @@ -1387,7 +1387,7 @@ bgp_mp_reach_parse (struct peer *peer, bgp_size_t length, struct attr *attr, } /* Multiprotocol unreachable parse */ -int +static int bgp_mp_unreach_parse (struct peer *peer, bgp_size_t length, struct bgp_nlri *mp_withdraw) { diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h index 12149a17..c5ce7594 100644 --- a/bgpd/bgp_attr.h +++ b/bgpd/bgp_attr.h @@ -176,9 +176,4 @@ extern void cluster_unintern (struct cluster_list *); /* Transit attribute prototypes. */ void transit_unintern (struct transit *); -/* Exported for unit-test purposes only */ -extern int bgp_mp_reach_parse (struct peer *, bgp_size_t, struct attr *, - struct bgp_nlri *); -extern int bgp_mp_unreach_parse (struct peer *, bgp_size_t, struct bgp_nlri *); - #endif /* _QUAGGA_BGP_ATTR_H */ diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c index 45ab3d44..72bb88e6 100644 --- a/bgpd/bgp_community.c +++ b/bgpd/bgp_community.c @@ -26,7 +26,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_community.h" /* Hash of community attribute. */ -struct hash *comhash; +static struct hash *comhash; /* Allocate a new communities value. */ static struct community * diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index 3283d448..40edb646 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -36,7 +36,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA /* Global variable to access damping configuration */ struct bgp_damp_config bgp_damp_cfg; -struct bgp_damp_config *damp = &bgp_damp_cfg; +static struct bgp_damp_config *damp = &bgp_damp_cfg; /* Utility macro to add and delete BGP dampening information to no used list. */ @@ -541,7 +541,7 @@ bgp_config_write_damp (struct vty *vty) VTY_NEWLINE); } -char * +static const char * bgp_get_reuse_time (unsigned int penalty, char *buf, size_t len) { time_t reuse_time = 0; @@ -613,7 +613,7 @@ bgp_damp_info_vty (struct vty *vty, struct bgp_info *binfo) vty_out (vty, "%s", VTY_NEWLINE); } -char * +const char * bgp_damp_reuse_time_vty (struct vty *vty, struct bgp_info *binfo, char *timebuf, size_t len) { diff --git a/bgpd/bgp_damp.h b/bgpd/bgp_damp.h index 8c762960..0b388fbb 100644 --- a/bgpd/bgp_damp.h +++ b/bgpd/bgp_damp.h @@ -138,11 +138,10 @@ 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 void 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 *, - char *, size_t); +extern const char * bgp_damp_reuse_time_vty (struct vty *, struct bgp_info *, + char *, size_t); #endif /* _QUAGGA_BGP_DAMP_H */ diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index fa316c5e..c2077a59 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -57,7 +57,7 @@ unsigned long term_bgp_debug_normal; unsigned long term_bgp_debug_zebra; /* messages for BGP-4 status */ -struct message bgp_status_msg[] = +const struct message bgp_status_msg[] = { { Idle, "Idle" }, { Connect, "Connect" }, @@ -68,7 +68,7 @@ struct message bgp_status_msg[] = { Clearing, "Clearing" }, { Deleted, "Deleted" }, }; -int bgp_status_msg_max = BGP_STATUS_MAX; +const int bgp_status_msg_max = BGP_STATUS_MAX; /* BGP message type string. */ const char *bgp_type_str[] = @@ -83,7 +83,7 @@ const char *bgp_type_str[] = }; /* message for BGP-4 Notify */ -struct message bgp_notify_msg[] = +static const struct message bgp_notify_msg[] = { { BGP_NOTIFY_HEADER_ERR, "Message Header Error"}, { BGP_NOTIFY_OPEN_ERR, "OPEN Message Error"}, @@ -93,17 +93,17 @@ struct message bgp_notify_msg[] = { BGP_NOTIFY_CEASE, "Cease"}, { BGP_NOTIFY_CAPABILITY_ERR, "CAPABILITY Message Error"}, }; -int bgp_notify_msg_max = BGP_NOTIFY_MAX; +static const int bgp_notify_msg_max = BGP_NOTIFY_MAX; -struct message bgp_notify_head_msg[] = +static const struct message bgp_notify_head_msg[] = { { BGP_NOTIFY_HEADER_NOT_SYNC, "/Connection Not Synchronized"}, { BGP_NOTIFY_HEADER_BAD_MESLEN, "/Bad Message Length"}, { BGP_NOTIFY_HEADER_BAD_MESTYPE, "/Bad Message Type"} }; -int bgp_notify_head_msg_max = BGP_NOTIFY_HEADER_MAX; +static const int bgp_notify_head_msg_max = BGP_NOTIFY_HEADER_MAX; -struct message bgp_notify_open_msg[] = +static const struct message bgp_notify_open_msg[] = { { BGP_NOTIFY_OPEN_UNSUP_VERSION, "/Unsupported Version Number" }, { BGP_NOTIFY_OPEN_BAD_PEER_AS, "/Bad Peer AS"}, @@ -113,9 +113,9 @@ struct message bgp_notify_open_msg[] = { BGP_NOTIFY_OPEN_UNACEP_HOLDTIME, "/Unacceptable Hold Time"}, { BGP_NOTIFY_OPEN_UNSUP_CAPBL, "/Unsupported Capability"}, }; -int bgp_notify_open_msg_max = BGP_NOTIFY_OPEN_MAX; +static const int bgp_notify_open_msg_max = BGP_NOTIFY_OPEN_MAX; -struct message bgp_notify_update_msg[] = +static const struct message bgp_notify_update_msg[] = { { BGP_NOTIFY_UPDATE_MAL_ATTR, "/Malformed Attribute List"}, { BGP_NOTIFY_UPDATE_UNREC_ATTR, "/Unrecognized Well-known Attribute"}, @@ -129,9 +129,9 @@ struct message bgp_notify_update_msg[] = { BGP_NOTIFY_UPDATE_INVAL_NETWORK, "/Invalid Network Field"}, { BGP_NOTIFY_UPDATE_MAL_AS_PATH, "/Malformed AS_PATH"}, }; -int bgp_notify_update_msg_max = BGP_NOTIFY_UPDATE_MAX; +static const int bgp_notify_update_msg_max = BGP_NOTIFY_UPDATE_MAX; -struct message bgp_notify_cease_msg[] = +static const struct message bgp_notify_cease_msg[] = { { BGP_NOTIFY_CEASE_MAX_PREFIX, "/Maximum Number of Prefixes Reached"}, { BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN, "/Administratively Shutdown"}, @@ -142,15 +142,15 @@ struct message bgp_notify_cease_msg[] = { BGP_NOTIFY_CEASE_COLLISION_RESOLUTION, "/Connection collision resolution"}, { BGP_NOTIFY_CEASE_OUT_OF_RESOURCE, "/Out of Resource"}, }; -int bgp_notify_cease_msg_max = BGP_NOTIFY_CEASE_MAX; +static const int bgp_notify_cease_msg_max = BGP_NOTIFY_CEASE_MAX; -struct message bgp_notify_capability_msg[] = +static const struct message bgp_notify_capability_msg[] = { { BGP_NOTIFY_CAPABILITY_INVALID_ACTION, "/Invalid Action Value" }, { BGP_NOTIFY_CAPABILITY_INVALID_LENGTH, "/Invalid Capability Length"}, { BGP_NOTIFY_CAPABILITY_MALFORMED_CODE, "/Malformed Capability Value"}, }; -int bgp_notify_capability_msg_max = BGP_NOTIFY_CAPABILITY_MAX; +static const int bgp_notify_capability_msg_max = BGP_NOTIFY_CAPABILITY_MAX; /* Origin strings. */ const char *bgp_origin_str[] = {"i","e","?"}; diff --git a/bgpd/bgp_debug.h b/bgpd/bgp_debug.h index 71e110ce..ce8547b0 100644 --- a/bgpd/bgp_debug.h +++ b/bgpd/bgp_debug.h @@ -122,7 +122,7 @@ extern const char *bgp_type_str[]; 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; +extern const struct message bgp_status_msg[]; +extern const int bgp_status_msg_max; #endif /* _QUAGGA_BGP_DEBUG_H */ diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index f3bba9e3..d1aa0767 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -30,10 +30,10 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_aspath.h" /* Hash of community attribute. */ -struct hash *ecomhash; +static struct hash *ecomhash; /* Allocate a new ecommunities. */ -struct ecommunity * +static struct ecommunity * ecommunity_new (void) { return (struct ecommunity *) XCALLOC (MTYPE_ECOMMUNITY, diff --git a/bgpd/bgp_ecommunity.h b/bgpd/bgp_ecommunity.h index 278721c8..5c8deb56 100644 --- a/bgpd/bgp_ecommunity.h +++ b/bgpd/bgp_ecommunity.h @@ -67,7 +67,6 @@ struct ecommunity_val 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 *); diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 92485731..bf4b66b0 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -901,7 +901,7 @@ bgp_ignore (struct peer *peer) } /* Finite State Machine structure */ -struct { +static const struct { int (*func) (struct peer *); int next_state; } FSM [BGP_STATUS_MAX - 1][BGP_EVENTS_MAX - 1] = diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 2089c6b5..620ca128 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -37,7 +37,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_mplsvpn.h" /* bgpd options, we use GNU getopt library. */ -struct option longopts[] = +static const struct option longopts[] = { { "daemon", no_argument, NULL, 'd'}, { "config_file", required_argument, NULL, 'f'}, @@ -61,7 +61,7 @@ void sighup (void); void sigint (void); void sigusr1 (void); -struct quagga_signal_t bgp_signals[] = +static struct quagga_signal_t bgp_signals[] = { { .signal = SIGHUP, @@ -85,7 +85,7 @@ struct quagga_signal_t bgp_signals[] = char config_default[] = SYSCONFDIR BGP_DEFAULT_CONFIG; /* Route retain mode flag. */ -int retain_mode = 0; +static int retain_mode = 0; /* Master of threads. */ struct thread_master *master; @@ -94,14 +94,14 @@ struct thread_master *master; char *config_file = NULL; /* Process ID saved for use by init system */ -const char *pid_file = PATH_BGPD_PID; +static const char *pid_file = PATH_BGPD_PID; /* VTY port number and address. */ int vty_port = BGP_VTY_PORT; char *vty_addr = NULL; /* privileges */ -zebra_capabilities_t _caps_p [] = +static zebra_capabilities_t _caps_p [] = { ZCAP_BIND, ZCAP_NET_RAW, @@ -316,8 +316,12 @@ main (int argc, char **argv) return(0); /* Turn into daemon if daemon_mode is set. */ - if (daemon_mode) - daemon (0, 0); + if (daemon_mode && daemon (0, 0) < 0) + { + zlog_err("BGPd daemon failed: %s", strerror(errno)); + return (1); + } + /* Process ID file creation. */ pid_output (pid_file); diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index a7d75478..3cc55f24 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -371,17 +371,16 @@ int bgp_socket (struct bgp *bgp, unsigned short port, char *address) { int ret, en; - struct addrinfo req; struct addrinfo *ainfo; struct addrinfo *ainfo_save; + static const struct addrinfo req = { + .ai_family = AF_UNSPEC, + .ai_flags = AI_PASSIVE, + .ai_socktype = SOCK_STREAM, + }; int sock = 0; char port_str[BUFSIZ]; - memset (&req, 0, sizeof (struct addrinfo)); - - req.ai_flags = AI_PASSIVE; - req.ai_family = AF_UNSPEC; - req.ai_socktype = SOCK_STREAM; snprintf (port_str, sizeof(port_str), "%d", port); port_str[sizeof (port_str) - 1] = '\0'; diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 84d8191e..37595817 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -194,20 +194,22 @@ bgp_capability_orf_not_support (struct peer *peer, afi_t afi, safi_t safi, peer->host, afi, safi, type, mode); } -static struct message orf_type_str[] = +static const struct message orf_type_str[] = { { ORF_TYPE_PREFIX, "Prefixlist" }, { ORF_TYPE_PREFIX_OLD, "Prefixlist (old)" }, }; -static int orf_type_str_max = sizeof(orf_type_str)/sizeof(orf_type_str[0]); +static const int orf_type_str_max + = sizeof(orf_type_str)/sizeof(orf_type_str[0]); -static struct message orf_mode_str[] = +static const struct message orf_mode_str[] = { { ORF_MODE_RECEIVE, "Receive" }, { ORF_MODE_SEND, "Send" }, { ORF_MODE_BOTH, "Both" }, }; -static int orf_mode_str_max = sizeof(orf_mode_str)/sizeof(orf_mode_str[0]); +static const int orf_mode_str_max + = sizeof(orf_mode_str)/sizeof(orf_mode_str[0]); static int bgp_capability_orf_entry (struct peer *peer, struct capability_header *hdr) @@ -441,7 +443,7 @@ bgp_capability_as4 (struct peer *peer, struct capability_header *hdr) return as4; } -static struct message capcode_str[] = +static const struct message capcode_str[] = { { CAPABILITY_CODE_MP, "MultiProtocol Extensions" }, { CAPABILITY_CODE_REFRESH, "Route Refresh" }, @@ -452,10 +454,10 @@ static struct message capcode_str[] = { CAPABILITY_CODE_REFRESH_OLD, "Route Refresh (Old)" }, { CAPABILITY_CODE_ORF_OLD, "ORF (Old)" }, }; -int capcode_str_max = sizeof(capcode_str)/sizeof(capcode_str[0]); +static const int capcode_str_max = sizeof(capcode_str)/sizeof(capcode_str[0]); /* Minimum sizes for length field of each cap (so not inc. the header) */ -static size_t cap_minsizes[] = +static const size_t cap_minsizes[] = { [CAPABILITY_CODE_MP] = sizeof (struct capability_mp_data), [CAPABILITY_CODE_REFRESH] = CAPABILITY_CODE_REFRESH_LEN, @@ -529,7 +531,8 @@ bgp_capability_parse (struct peer *peer, size_t length, u_char **error) " expected at least %u", peer->host, LOOKUP (capcode_str, caphdr.code), - caphdr.length, cap_minsizes[caphdr.code]); + caphdr.length, + (unsigned) cap_minsizes[caphdr.code]); bgp_notify_send (peer, BGP_NOTIFY_CEASE, 0); return -1; } diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index e492c599..00ddae13 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -2211,7 +2211,7 @@ bgp_capability_msg_parse (struct peer *peer, u_char *pnt, bgp_size_t length) } /* Dynamic Capability is received. */ -int +static int bgp_capability_receive (struct peer *peer, bgp_size_t size) { u_char *pnt; diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 80ae0793..1e9c8dce 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2812,19 +2812,6 @@ bgp_clear_route (struct peer *peer, afi_t afi, safi_t safi) */ if (!peer->clear_node_queue->thread) bgp_clear_node_complete (peer->clear_node_queue); - else - { - /* clearing queue scheduled. Normal if in Established state - * (and about to transition out of it), but otherwise... - */ - if (peer->status != Established) - { - plog_err (peer->log, "%s [Error] State %s is not Established," - " but routes were cleared - bug!", - peer->host, LOOKUP (bgp_status_msg, peer->status)); - assert (peer->status == Established); - } - } } void diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 6f44f1fd..58ceef1b 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1047,7 +1047,7 @@ peer_deactivate (struct peer *peer, afi_t afi, safi_t safi) return 0; } -void +static void peer_nsf_stop (struct peer *peer) { afi_t afi; @@ -2157,7 +2157,7 @@ struct peer_flag_action u_char peer_down; }; -struct peer_flag_action peer_flag_action_list[] = +static const struct peer_flag_action peer_flag_action_list[] = { { PEER_FLAG_PASSIVE, 0, peer_change_reset }, { PEER_FLAG_SHUTDOWN, 0, peer_change_reset }, @@ -2169,7 +2169,7 @@ struct peer_flag_action peer_flag_action_list[] = { 0, 0, 0 } }; -struct peer_flag_action peer_af_flag_action_list[] = +static const struct peer_flag_action peer_af_flag_action_list[] = { { PEER_FLAG_NEXTHOP_SELF, 1, peer_change_reset_out }, { PEER_FLAG_SEND_COMMUNITY, 1, peer_change_reset_out }, @@ -2190,14 +2190,14 @@ struct peer_flag_action peer_af_flag_action_list[] = /* Proper action set. */ static int -peer_flag_action_set (struct peer_flag_action *action_list, int size, +peer_flag_action_set (const struct peer_flag_action *action_list, int size, struct peer_flag_action *action, u_int32_t flag) { int i; int found = 0; int reset_in = 0; int reset_out = 0; - struct peer_flag_action *match = NULL; + const struct peer_flag_action *match = NULL; /* Check peer's frag action. */ for (i = 0; i < size; i++) @@ -2951,12 +2951,14 @@ peer_port_set (struct peer *peer, u_int16_t port) return 0; } +#ifdef unused int peer_port_unset (struct peer *peer) { peer->port = BGP_PORT_DEFAULT; return 0; } +#endif /* neighbor weight. */ int diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 84164593..1e72b1c9 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1016,6 +1016,4 @@ extern int peer_maximum_prefix_unset (struct peer *, afi_t, safi_t); extern int peer_clear (struct peer *); extern int peer_clear_soft (struct peer *, afi_t, safi_t, enum bgp_clear_type); -extern void peer_nsf_stop (struct peer *); - #endif /* _QUAGGA_BGPD_H */ |