X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=bgpd%2Fbgp_advertise.h;h=9aa5a0eaff518c159dde3a2c03d1a4dd600ee543;hb=91d227b7e3cb53ad8fdbcd9d4cff7f0a666918e3;hp=3fdc6d8d235529c93fa2038daf9ed36fc194204b;hpb=211ee93ffb02c5b404a7206e4f46bd23d02d2d26;p=mirror_frr.git diff --git a/bgpd/bgp_advertise.h b/bgpd/bgp_advertise.h index 3fdc6d8d2..9aa5a0eaf 100644 --- a/bgpd/bgp_advertise.h +++ b/bgpd/bgp_advertise.h @@ -29,7 +29,7 @@ struct update_subgroup; struct bgp_advertise_fifo { struct bgp_advertise *next; struct bgp_advertise *prev; - u_int32_t count; + uint32_t count; }; /* BGP advertise attribute. */ @@ -62,14 +62,13 @@ struct bgp_advertise { struct bgp_advertise_attr *baa; /* BGP info. */ - struct bgp_info *binfo; + struct bgp_path_info *pathi; }; /* BGP adjacency out. */ struct bgp_adj_out { - /* Lined list pointer. */ - struct bgp_adj_out *next; - struct bgp_adj_out *prev; + /* RB Tree of adjacency entries */ + RB_ENTRY(bgp_adj_out) adj_entry; /* Advertised subgroup. */ struct update_subgroup *subgroup; @@ -80,7 +79,7 @@ struct bgp_adj_out { /* Prefix information. */ struct bgp_node *rn; - u_int32_t addpath_tx_id; + uint32_t addpath_tx_id; /* Advertised attribute. */ struct attr *attr; @@ -89,6 +88,10 @@ struct bgp_adj_out { struct bgp_advertise *adv; }; +RB_HEAD(bgp_adj_out_rb, bgp_adj_out); +RB_PROTOTYPE(bgp_adj_out_rb, bgp_adj_out, adj_entry, + bgp_adj_out_compare); + /* BGP adjacency in. */ struct bgp_adj_in { /* Linked list pointer. */ @@ -102,7 +105,7 @@ struct bgp_adj_in { struct attr *attr; /* Addpath identifier */ - u_int32_t addpath_rx_id; + uint32_t addpath_rx_id; }; /* BGP advertisement list. */ @@ -113,7 +116,7 @@ struct bgp_synchronize { }; /* BGP adjacency linked list. */ -#define BGP_INFO_ADD(N, A, TYPE) \ +#define BGP_PATH_INFO_ADD(N, A, TYPE) \ do { \ (A)->prev = NULL; \ (A)->next = (N)->TYPE; \ @@ -122,7 +125,7 @@ struct bgp_synchronize { (N)->TYPE = (A); \ } while (0) -#define BGP_INFO_DEL(N, A, TYPE) \ +#define BGP_PATH_INFO_DEL(N, A, TYPE) \ do { \ if ((A)->next) \ (A)->next->prev = (A)->prev; \ @@ -132,10 +135,8 @@ struct bgp_synchronize { (N)->TYPE = (A)->next; \ } while (0) -#define BGP_ADJ_IN_ADD(N,A) BGP_INFO_ADD(N,A,adj_in) -#define BGP_ADJ_IN_DEL(N,A) BGP_INFO_DEL(N,A,adj_in) -#define BGP_ADJ_OUT_ADD(N,A) BGP_INFO_ADD(N,A,adj_out) -#define BGP_ADJ_OUT_DEL(N,A) BGP_INFO_DEL(N,A,adj_out) +#define BGP_ADJ_IN_ADD(N, A) BGP_PATH_INFO_ADD(N, A, adj_in) +#define BGP_ADJ_IN_DEL(N, A) BGP_PATH_INFO_DEL(N, A, adj_in) #define BGP_ADV_FIFO_ADD(F, N) \ do { \ @@ -168,16 +169,16 @@ struct bgp_synchronize { : (F)->next) /* Prototypes. */ -extern int bgp_adj_out_lookup(struct peer *, struct bgp_node *, u_int32_t); +extern int bgp_adj_out_lookup(struct peer *, struct bgp_node *, uint32_t); extern void bgp_adj_in_set(struct bgp_node *, struct peer *, struct attr *, - u_int32_t); -extern int bgp_adj_in_unset(struct bgp_node *, struct peer *, u_int32_t); + uint32_t); +extern int bgp_adj_in_unset(struct bgp_node *, struct peer *, uint32_t); extern void bgp_adj_in_remove(struct bgp_node *, struct bgp_adj_in *); extern void bgp_sync_init(struct peer *); extern void bgp_sync_delete(struct peer *); extern unsigned int baa_hash_key(void *p); -extern int baa_hash_cmp(const void *p1, const void *p2); +extern bool baa_hash_cmp(const void *p1, const void *p2); extern void bgp_advertise_add(struct bgp_advertise_attr *baa, struct bgp_advertise *adv); extern struct bgp_advertise *bgp_advertise_new(void);