}
}
-int bgp_addpath_capability_action(enum bgp_addpath_strat addpath_type,
- uint8_t paths)
+int bgp_addpath_capability_action(enum bgp_addpath_strat addpath_type, uint16_t paths)
{
int action = CAPABILITY_ACTION_UNSET;
* change take effect.
*/
void bgp_addpath_set_peer_type(struct peer *peer, afi_t afi, safi_t safi,
- enum bgp_addpath_strat addpath_type,
- uint8_t paths)
+ enum bgp_addpath_strat addpath_type, uint16_t paths)
{
struct bgp *bgp = peer->bgp;
enum bgp_addpath_strat old_type;
* Change the type of addpath used for a peer.
*/
void bgp_addpath_set_peer_type(struct peer *peer, afi_t afi, safi_t safi,
- enum bgp_addpath_strat addpath_type,
- uint8_t paths);
+ enum bgp_addpath_strat addpath_type, uint16_t paths);
void bgp_addpath_update_ids(struct bgp *bgp, struct bgp_dest *dest, afi_t afi,
safi_t safi);
void bgp_addpath_type_changed(struct bgp *bgp);
-extern int bgp_addpath_capability_action(enum bgp_addpath_strat addpath_type,
- uint8_t paths);
+extern int bgp_addpath_capability_action(enum bgp_addpath_strat addpath_type, uint16_t paths);
#endif
uint32_t metric;
/* Nexthop number and nexthop linked list.*/
- uint8_t nexthop_num;
+ uint16_t nexthop_num;
/* This flag is set to TRUE for a bnc that is gateway IP overlay index
* nexthop.
{
struct bgp_nexthop_cache *bnc;
struct nexthop *nhop;
- uint8_t other_nh_count;
+ uint16_t other_nh_count;
bool nhop_ll_found = false;
bool nhop_found = false;
ifindex_t first_ifindex;
struct interface *ifp = NULL;
uint32_t hash_val = 0, mod_val = 0;
- uint8_t nh_iter = 0, found = 0;
+ uint16_t nh_iter = 0, found = 0;
uint32_t i, num_nbrs = 0;
struct pim_interface *pim_ifp;
struct interface *ifps[router->multipath], *ifp;
int first_ifindex;
int found = 0;
- uint8_t i = 0;
+ uint16_t i = 0;
uint32_t hash_val = 0, mod_val = 0;
uint32_t num_nbrs = 0;
struct pim_interface *pim_ifp;
uint32_t metric;
uint32_t distance;
/* Nexthop number and nexthop linked list. */
- uint8_t nexthop_num;
+ uint16_t nexthop_num;
struct nexthop *nexthop;
int64_t last_update;
uint16_t flags;
return nh;
}
-static uint8_t parse_multipath_nexthops_unicast(ns_id_t ns_id,
- struct nexthop_group *ng,
- struct rtmsg *rtm,
- struct rtnexthop *rtnh,
- struct rtattr **tb,
- void *prefsrc, vrf_id_t vrf_id)
+static uint16_t parse_multipath_nexthops_unicast(ns_id_t ns_id, struct nexthop_group *ng,
+ struct rtmsg *rtm, struct rtnexthop *rtnh,
+ struct rtattr **tb, void *prefsrc, vrf_id_t vrf_id)
{
void *gate = NULL;
struct interface *ifp = NULL;
rtnh = RTNH_NEXT(rtnh);
}
- uint8_t nhop_num = nexthop_group_nexthop_num(ng);
+ uint16_t nhop_num = nexthop_group_nexthop_num(ng);
return nhop_num;
}
(struct rtnexthop *)RTA_DATA(tb[RTA_MULTIPATH]);
if (!nhe_id) {
- uint8_t nhop_num;
+ uint16_t nhop_num;
/* Use temporary list of nexthops; parse
* message payload's nexthops.
/* Char length to debug ID with */
#define ID_LENGTH 10
-static bool _netlink_nexthop_build_group(struct nlmsghdr *n, size_t req_size,
- uint32_t id,
- const struct nh_grp *z_grp,
- const uint8_t count, bool resilient,
- const struct nhg_resilience *nhgr)
+static bool _netlink_nexthop_build_group(struct nlmsghdr *n, size_t req_size, uint32_t id,
+ const struct nh_grp *z_grp, const uint16_t count,
+ bool resilient, const struct nhg_resilience *nhgr)
{
struct nexthop_grp grp[count];
/* Need space for max group size, "/", and null term */
struct nh_grp *z_grp, int z_grp_size,
struct nhg_resilience *nhgr)
{
- uint8_t count = 0;
+ uint16_t count = 0;
/* linux/nexthop.h group struct */
struct nexthop_grp *n_grp = NULL;
struct nexthop nh = {.weight = 1};
struct nh_grp grp[MULTIPATH_NUM] = {};
/* Count of nexthops in group array */
- uint8_t grp_count = 0;
+ uint16_t grp_count = 0;
struct rtattr *tb[NHA_MAX + 1] = {};
frrtrace(3, frr_zebra, netlink_nexthop_change, h, ns_id, startup);
struct zapi_nexthop *api_nh;
struct nexthop *nexthop;
const struct prefix *p, *src_p;
- uint8_t count = 0;
+ uint16_t count = 0;
afi_t afi;
size_t stream_size =
MAX(ZEBRA_MAX_PACKET_SIZ, sizeof(struct zapi_route));
struct nexthop_group ng;
struct nh_grp nh_grp[MULTIPATH_NUM];
- uint8_t nh_grp_count;
+ uint16_t nh_grp_count;
};
/*
return ctx->u.rinfo.nhe.nh_grp;
}
-uint8_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx)
+uint16_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
return ctx->u.rinfo.nhe.nh_grp_count;
dplane_ctx_get_nhe_ng(const struct zebra_dplane_ctx *ctx);
const struct nh_grp *
dplane_ctx_get_nhe_nh_grp(const struct zebra_dplane_ctx *ctx);
-uint8_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx);
+uint16_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx);
/* Accessors for LSP information */
return nhe1->id == nhe2->id;
}
-static int zebra_nhg_process_grp(struct nexthop_group *nhg,
- struct nhg_connected_tree_head *depends,
- struct nh_grp *grp, uint8_t count,
+static int zebra_nhg_process_grp(struct nexthop_group *nhg, struct nhg_connected_tree_head *depends,
+ struct nh_grp *grp, uint16_t count,
struct nhg_resilience *resilience)
{
nhg_connected_tree_init(depends);
return &ctx->u.nh;
}
-static uint8_t nhg_ctx_get_count(const struct nhg_ctx *ctx)
+static uint16_t nhg_ctx_get_count(const struct nhg_ctx *ctx)
{
return ctx->count;
}
XFREE(MTYPE_NHG_CTX, *ctx);
}
-static struct nhg_ctx *nhg_ctx_init(uint32_t id, struct nexthop *nh,
- struct nh_grp *grp, vrf_id_t vrf_id,
- afi_t afi, int type, uint8_t count,
+static struct nhg_ctx *nhg_ctx_init(uint32_t id, struct nexthop *nh, struct nh_grp *grp,
+ vrf_id_t vrf_id, afi_t afi, int type, uint16_t count,
struct nhg_resilience *resilience)
{
struct nhg_ctx *ctx = NULL;
struct nhg_hash_entry *nhe = NULL;
uint32_t id = nhg_ctx_get_id(ctx);
- uint8_t count = nhg_ctx_get_count(ctx);
+ uint16_t count = nhg_ctx_get_count(ctx);
vrf_id_t vrf_id = nhg_ctx_get_vrf_id(ctx);
int type = nhg_ctx_get_type(ctx);
afi_t afi = nhg_ctx_get_afi(ctx);
}
/* Kernel-side, you either get a single new nexthop or a array of ID's */
-int zebra_nhg_kernel_find(uint32_t id, struct nexthop *nh, struct nh_grp *grp,
- uint8_t count, vrf_id_t vrf_id, afi_t afi, int type,
- int startup, struct nhg_resilience *nhgr)
+int zebra_nhg_kernel_find(uint32_t id, struct nexthop *nh, struct nh_grp *grp, uint16_t count,
+ vrf_id_t vrf_id, afi_t afi, int type, int startup,
+ struct nhg_resilience *nhgr)
{
struct nhg_ctx *ctx = NULL;
* I'm pretty sure we only allow ONE level of group within group currently.
* But making this recursive just in case that ever changes.
*/
-static uint8_t zebra_nhg_nhe2grp_internal(struct nh_grp *grp, uint8_t curr_index,
- struct nhg_hash_entry *nhe,
- struct nhg_hash_entry *original,
- int max_num)
+static uint16_t zebra_nhg_nhe2grp_internal(struct nh_grp *grp, uint16_t curr_index,
+ struct nhg_hash_entry *nhe,
+ struct nhg_hash_entry *original, int max_num)
{
struct nhg_connected *rb_node_dep = NULL;
struct nhg_hash_entry *depend = NULL;
struct nexthop *nexthop;
- uint8_t i = curr_index;
+ uint16_t i = curr_index;
frr_each(nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
bool duplicate = false;
}
/* Convert a nhe into a group array */
-uint8_t zebra_nhg_nhe2grp(struct nh_grp *grp, struct nhg_hash_entry *nhe,
- int max_num)
+uint16_t zebra_nhg_nhe2grp(struct nh_grp *grp, struct nhg_hash_entry *nhe, int max_num)
{
/* Call into the recursive function */
return zebra_nhg_nhe2grp_internal(grp, 0, nhe, nhe, max_num);
int type;
/* If its a group array, how many? */
- uint8_t count;
+ uint16_t count;
/* Its either a single nexthop or an array of ID's */
union {
void nhg_ctx_free(struct nhg_ctx **ctx);
/* Find via kernel nh creation */
-extern int zebra_nhg_kernel_find(uint32_t id, struct nexthop *nh,
- struct nh_grp *grp, uint8_t count,
- vrf_id_t vrf_id, afi_t afi, int type,
- int startup,
+extern int zebra_nhg_kernel_find(uint32_t id, struct nexthop *nh, struct nh_grp *grp,
+ uint16_t count, vrf_id_t vrf_id, afi_t afi, int type, int startup,
struct nhg_resilience *resilience);
/* Del via kernel */
extern int zebra_nhg_kernel_del(uint32_t id, vrf_id_t vrf_id);
extern void zebra_nhg_check_valid(struct nhg_hash_entry *nhe);
/* Convert nhe depends to a grp context that can be passed around safely */
-extern uint8_t zebra_nhg_nhe2grp(struct nh_grp *grp, struct nhg_hash_entry *nhe,
- int size);
+extern uint16_t zebra_nhg_nhe2grp(struct nh_grp *grp, struct nhg_hash_entry *nhe, int size);
/* Dataplane install/uninstall */
extern void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe, uint8_t type);