Commit Graph

111 Commits

Author SHA1 Message Date
Philippe Guibert
31c28cd708 bgpd: get table identifier from table manager
A table chunk of 100000 is allocated from zebra, and when needed in
flowspec, the table identifier is extracted from that chunk.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00
Philippe Guibert
f7df19076a bgpd: handle FS redirect IP rule in PBR
If a new rule is identified, a new table identifier is created.
In that table, add a default route when possible. If redirect IP rule is
identified, then add a default route to that IP address.
If redirect VRF is identified, nothing is done for now

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00
Philippe Guibert
529efa2346 bgpd: allow flowspec entries to be announced to zebra
Flowspec entries are allowed to be announced.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00
Philippe Guibert
70eabd1286 bgpd: hash lookup for iprule entries
once an iprule has been created, a notification is sent back, and the
context of bgp_action is searched.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00
Philippe Guibert
c5d429e160 bgpd: hash lookup for ipset and ipset entries
relevant structures, after being written to zebra, are lookup up with
their identifiers.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00
Philippe Guibert
1815c6fc9d bgpd: hash_lookup for iptables
This commit is reading the installed2 value from bgp_pbr_match hash set.
Once value matches with the one received, the walk stops and the last
bgp_pbr_match structure is stored in a static entry, so that the entry
is obtained.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00
Philippe Guibert
d114b0d739 bgpd: inject policy route entry from bgp into zebra pbr entries.
Once the bgp flowspec entry is validated, then that means that zebra is
able to handle the entries.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00
Philippe Guibert
45918cfb97 bgpd: add function handling flowspec entries to pass to zebra
Add a policy-route API to handle flowspec entry.
The entry is analysed, converted, and
selected if it is possible to inject the flowspec entry in local policy
routing entries.
redirect IP and redirect VRF actions are handled. The former extracts
the IPv4 address to redirect traffic to. The latter calculates the
matching VRF to redirect traffic to.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00
Philippe Guibert
b46b6f1a55 bgpd: add bgp_pbr_route structure
This structure is the model exchange between some bgp services like
flowspec and the policy routing service. This structure reflects what
the nlri entry means. To handle that structure, a dump routine is made
available. Also, a validation function is here to cancel a policy route
installation, whenever it is not possible to install the requested
policy routing.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00
Philippe Guibert
f3d32faaed 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>
2018-04-30 11:56:23 +02:00
Philippe Guibert
bbe6ffd61f bgpd: support for policy-routing context used with flowspec
BGP flowspec will be able to inject or remove policy-routing contexts,
thanks to some protocols like flowspec. This commit adds some the APIS
necessary to create/delete policy routing contexts that will be injected
then into zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30 11:56:23 +02:00