.min_tx_int = opts->min_tx_int ?: cf->min_tx_int,
.idle_tx_int = opts->idle_tx_int ?: cf->idle_tx_int,
.multiplier = opts->multiplier ?: cf->multiplier,
- .passive = opts->passive_set ? opts->passive : cf->passive
+ .passive = opts->passive_set ? opts->passive : cf->passive,
};
}
return;
- stop:
+stop:
tm_stop(s->tx_timer);
s->last_tx = 0;
}
.min_rx_int = BFD_DEFAULT_MIN_RX_INT,
.min_tx_int = BFD_DEFAULT_MIN_TX_INT,
.idle_tx_int = BFD_DEFAULT_IDLE_TX_INT,
- .multiplier = BFD_DEFAULT_MULTIPLIER
+ .multiplier = BFD_DEFAULT_MULTIPLIER,
};
static inline struct bfd_iface_config *
bfd_request_free,
bfd_request_dump,
NULL,
- NULL
+ NULL,
};
}
const u8 bfd_auth_type_to_hash_alg[] = {
- [BFD_AUTH_NONE] = ALG_UNDEFINED,
- [BFD_AUTH_SIMPLE] = ALG_UNDEFINED,
- [BFD_AUTH_KEYED_MD5] = ALG_MD5,
- [BFD_AUTH_METICULOUS_KEYED_MD5] = ALG_MD5,
- [BFD_AUTH_KEYED_SHA1] = ALG_SHA1,
- [BFD_AUTH_METICULOUS_KEYED_SHA1] = ALG_SHA1,
+ [BFD_AUTH_NONE] = ALG_UNDEFINED,
+ [BFD_AUTH_SIMPLE] = ALG_UNDEFINED,
+ [BFD_AUTH_KEYED_MD5] = ALG_MD5,
+ [BFD_AUTH_METICULOUS_KEYED_MD5] = ALG_MD5,
+ [BFD_AUTH_KEYED_SHA1] = ALG_SHA1,
+ [BFD_AUTH_METICULOUS_KEYED_SHA1] = ALG_SHA1,
};
uint hash_len = mac_type_length(pass->alg);
/* Increase CSN about one time per second */
- u32 new_time = (u64) current_time() >> 20;
+ u32 new_time = (u64) current_time() >> 20;
if ((new_time != s->tx_csn_time) || meticulous)
{
s->tx_csn++;
static int
bfd_rx_hook(sock *sk, uint len)
{
- struct bfd_proto *p = sk->data;
+ struct bfd_proto *p = sk->data;
struct bfd_ctl_packet *pkt = (struct bfd_ctl_packet *) sk->rbuf;
const char *err_dsc = NULL;
uint err_val = 0;
u32 old_tx_int = s->des_min_tx_int;
u32 old_rx_int = s->rem_min_rx_int;
- s->rem_id= ntohl(pkt->snd_id);
+ s->rem_id = ntohl(pkt->snd_id);
s->rem_state = bfd_pkt_get_state(pkt);
s->rem_diag = bfd_pkt_get_diag(pkt);
s->rem_demand_mode = pkt->flags & BFD_FLAG_DEMAND;
sk_start(sk);
return sk;
- err:
+err:
sk_log_error(sk, p->p.name);
rfree(sk);
return NULL;
sk_start(sk);
return sk;
- err:
+err:
sk_log_error(sk, p->p.name);
rfree(sk);
return NULL;
sk_start(sk);
return sk;
- err:
+err:
sk_log_error(sk, p->p.name);
rfree(sk);
return NULL;
bgp_connect(struct bgp_proto *p) /* Enter Connect state and start establishing connection */
{
struct bgp_conn *conn = &p->outgoing_conn;
- int hops = p->cf->multihop ? : 1;
+ int hops = p->cf->multihop ?: 1;
DBG("BGP: Connecting\n");
sock *s = sk_new(p->p.pool);
return 0;
}
- hops = p->cf->multihop ? : 1;
+ hops = p->cf->multihop ?: 1;
if (sk_set_ttl(sk, p->cf->ttl_security ? 255 : hops) < 0)
goto err;
return 1;
}
-#define TABLE(cf, NAME) ((cf)->NAME ? (cf)->NAME->table : NULL )
+#define TABLE(cf, NAME) ((cf)->NAME ? (cf)->NAME->table : NULL)
static int
bgp_channel_reconfigure(struct channel *C, struct channel_config *CC, int *import_changed, int *export_changed)
}
static char *bgp_state_names[] = { "Idle", "Connect", "Active", "OpenSent", "OpenConfirm", "Established", "Close" };
-static char *bgp_err_classes[] = { "", "Error: ", "Socket: ", "Received: ", "BGP Error: ", "Automatic shutdown: ", ""};
-static char *bgp_misc_errors[] = { "", "Neighbor lost", "Invalid next hop", "Kernel MD5 auth failed", "No listening socket", "Link down", "BFD session down", "Graceful restart"};
-static char *bgp_auto_errors[] = { "", "Route limit exceeded"};
-static char *bgp_gr_states[] = { "None", "Regular", "Long-lived"};
+static char *bgp_err_classes[] = { "", "Error: ", "Socket: ", "Received: ", "BGP Error: ", "Automatic shutdown: ", "" };
+static char *bgp_misc_errors[] = { "", "Neighbor lost", "Invalid next hop", "Kernel MD5 auth failed", "No listening socket", "Link down", "BFD session down", "Graceful restart" };
+static char *bgp_auto_errors[] = { "", "Route limit exceeded" };
+static char *bgp_gr_states[] = { "None", "Regular", "Long-lived" };
static const char *
bgp_last_errmsg(struct bgp_proto *p)
WALK_SLIST(en, p->lsal)
if ((en->lsa.age == LSA_MAXAGE) && (en->lsa_body != NULL) &&
lsa_flooding_allowed(en->lsa_type, en->domain, n->ifa) &&
- lsa_is_acceptable(en->lsa_type, n, p))
+ lsa_is_acceptable(en->lsa_type, n, p))
ospf_lsa_lsrt_up(en, n);
/* If we found any flushed LSA, we send them ASAP */
*/
#include <stdlib.h>
+
#include "rip.h"
.shutdown = rip_shutdown,
.reconfigure = rip_reconfigure,
.get_route_info = rip_get_route_info,
- .get_attr = rip_get_attr
+ .get_attr = rip_get_attr,
};
void