diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-08 17:23:02 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-30 11:56:23 +0200 |
| commit | f3d32faaede795fbc5bef395290634fe5448f8d5 (patch) | |
| tree | 4532445c9cda35cd5f39d1372573afa818478e78 /bgpd/bgp_pbr.h | |
| parent | 30d50e6dd519418bbb5ad8e1b4d031cafffd923c (diff) | |
bgpd: initialise hash lists for pbr
bgp structure is being extended with hash sets that will be used by
flowspec to give policy routing facilities.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_pbr.h')
| -rw-r--r-- | bgpd/bgp_pbr.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/bgpd/bgp_pbr.h b/bgpd/bgp_pbr.h index b896c7db75..62fe7aa4fb 100644 --- a/bgpd/bgp_pbr.h +++ b/bgpd/bgp_pbr.h @@ -29,10 +29,30 @@ struct bgp_pbr_match { */ uint32_t type; +#define MATCH_IP_SRC_SET 1 << 0 +#define MATCH_IP_DST_SET 1 << 1 + uint32_t flags; + + vrf_id_t vrf_id; + + /* unique identifier for ipset create transaction + */ uint32_t unique; + /* unique identifier for iptable add transaction + */ + uint32_t unique2; + bool installed; bool install_in_progress; + + bool installed_in_iptable; + bool install_iptable_in_progress; + + struct hash *entry_hash; + + struct bgp_pbr_action *action; + }; struct bgp_pbr_match_entry { @@ -58,6 +78,8 @@ struct bgp_pbr_action { uint32_t table_id; + float rate; + /* * nexthop information, or drop information * contains src vrf_id and nh contains dest vrf_id @@ -68,7 +90,6 @@ struct bgp_pbr_action { bool installed; bool install_in_progress; - struct bgp_pbr_match *match; }; extern struct bgp_pbr_action *bgp_pbr_action_rule_lookup(uint32_t unique); @@ -79,4 +100,17 @@ extern struct bgp_pbr_match *bgp_pbr_match_ipset_lookup(vrf_id_t vrf_id, extern struct bgp_pbr_match_entry *bgp_pbr_match_ipset_entry_lookup( vrf_id_t vrf_id, char *name, uint32_t unique); + +extern void bgp_pbr_init(struct bgp *bgp); + +extern uint32_t bgp_pbr_action_hash_key(void *arg); +extern int bgp_pbr_action_hash_equal(const void *arg1, + const void *arg2); +extern uint32_t bgp_pbr_match_entry_hash_key(void *arg); +extern int bgp_pbr_match_entry_hash_equal(const void *arg1, + const void *arg2); +extern uint32_t bgp_pbr_match_hash_key(void *arg); +extern int bgp_pbr_match_hash_equal(const void *arg1, + const void *arg2); + #endif /* __BGP_PBR_H__ */ |
