/*
* Prototypes
*/
-struct bfd_session *bs_peer_waiting_find(struct bfd_peer_cfg *);
+static struct bfd_session *bs_peer_waiting_find(struct bfd_peer_cfg *bpc);
static uint32_t ptm_bfd_gen_ID(void);
static void ptm_bfd_echo_xmt_TO(struct bfd_session *bfd);
static int bfd_session_update(struct bfd_session *bs, struct bfd_peer_cfg *bpc);
static const char *get_diag_str(int diag);
+static void bs_admin_down_handler(struct bfd_session *bs, int nstate);
+static void bs_down_handler(struct bfd_session *bs, int nstate);
+static void bs_init_handler(struct bfd_session *bs, int nstate);
+static void bs_up_handler(struct bfd_session *bs, int nstate);
+
/*
* Functions
*/
-struct bfd_session *bs_peer_waiting_find(struct bfd_peer_cfg *bpc)
+static struct bfd_session *bs_peer_waiting_find(struct bfd_peer_cfg *bpc)
{
struct bfd_session_observer *bso;
struct bfd_session *bs = NULL;
* transition mechanism. `<state>` is the current session state and
* the parameter `nstate` is the peer new state.
*/
-void bs_admin_down_handler(struct bfd_session *bs, int nstate);
-void bs_down_handler(struct bfd_session *bs, int nstate);
-void bs_init_handler(struct bfd_session *bs, int nstate);
-void bs_up_handler(struct bfd_session *bs, int nstate);
-
-void bs_admin_down_handler(struct bfd_session *bs __attribute__((__unused__)),
- int nstate __attribute__((__unused__)))
+static void bs_admin_down_handler(struct bfd_session *bs
+ __attribute__((__unused__)),
+ int nstate __attribute__((__unused__)))
{
/*
* We are administratively down, there is no state machine
*/
}
-void bs_down_handler(struct bfd_session *bs, int nstate)
+static void bs_down_handler(struct bfd_session *bs, int nstate)
{
switch (nstate) {
case PTM_BFD_ADM_DOWN:
}
}
-void bs_init_handler(struct bfd_session *bs, int nstate)
+static void bs_init_handler(struct bfd_session *bs, int nstate)
{
switch (nstate) {
case PTM_BFD_ADM_DOWN:
}
}
-void bs_up_handler(struct bfd_session *bs, int nstate)
+static void bs_up_handler(struct bfd_session *bs, int nstate)
{
switch (nstate) {
case PTM_BFD_ADM_DOWN:
int bp_udp_mhop(void);
int bp_udp6_shop(void);
int bp_udp6_mhop(void);
-int bp_peer_socket(const struct bfd_session *);
-int bp_peer_socketv6(const struct bfd_session *);
+int bp_peer_socket(const struct bfd_session *bs);
+int bp_peer_socketv6(const struct bfd_session *bs);
int bp_echo_socket(void);
int bp_echov6_socket(void);
*
* BFD protocol specific code.
*/
-int bfd_session_enable(struct bfd_session *);
-void bfd_session_disable(struct bfd_session *);
+int bfd_session_enable(struct bfd_session *bs);
+void bfd_session_disable(struct bfd_session *bs);
struct bfd_session *ptm_bfd_sess_new(struct bfd_peer_cfg *bpc);
int ptm_bfd_ses_del(struct bfd_peer_cfg *bpc);
void ptm_bfd_ses_dn(struct bfd_session *bfd, uint8_t diag);
void ptm_bfd_echo_start(struct bfd_session *bfd);
void ptm_bfd_xmt_TO(struct bfd_session *bfd, int fbit);
void ptm_bfd_start_xmt_timer(struct bfd_session *bfd, bool is_echo);
-struct bfd_session *ptm_bfd_sess_find(struct bfd_pkt *, struct sockaddr_any *,
- struct sockaddr_any *, ifindex_t,
- vrf_id_t, bool);
+struct bfd_session *ptm_bfd_sess_find(struct bfd_pkt *cp,
+ struct sockaddr_any *peer,
+ struct sockaddr_any *local,
+ ifindex_t ifindex, vrf_id_t vrfid,
+ bool is_mhop);
struct bfd_session *bs_peer_find(struct bfd_peer_cfg *bpc);
int bfd_session_update_label(struct bfd_session *bs, const char *nlabel);
void bfd_set_polling(struct bfd_session *bs);
-void bs_state_handler(struct bfd_session *, int);
-void bs_echo_timer_handler(struct bfd_session *);
-void bs_final_handler(struct bfd_session *);
+void bs_state_handler(struct bfd_session *bs, int nstate);
+void bs_echo_timer_handler(struct bfd_session *bs);
+void bs_final_handler(struct bfd_session *bs);
void bs_set_slow_timers(struct bfd_session *bs);
const char *satostr(struct sockaddr_any *sa);
const char *diag2str(uint8_t diag);
void integer2timestr(uint64_t time, char *buf, size_t buflen);
const char *bs_to_string(struct bfd_session *bs);
-int bs_observer_add(struct bfd_session *);
-void bs_observer_del(struct bfd_session_observer *);
+int bs_observer_add(struct bfd_session *bs);
+void bs_observer_del(struct bfd_session_observer *bso);
/* BFD hash data structures interface */
void bfd_initialize(void);