From: Philippe Guibert Date: Fri, 30 Mar 2018 11:01:39 +0000 (+0200) Subject: bgpd: add 3 fields to ipset_entry : src,dst port, and proto X-Git-Tag: frr-5.0~3^2~17 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=38c52e4fd5a05291f0dbd361b1de46616d8e7e20;p=mirror%2Ffrr.git bgpd: add 3 fields to ipset_entry : src,dst port, and proto Those 3 fields are read and written between zebra and bgpd. This permits extending the ipset_entry structure. Combinatories will be possible: - filtering with one of the src/dst port. - filtering with one of the range src/ range dst port usage of src or dst is exclusive in a FS entry. - filtering a port or a port range based on either src or dst port. Signed-off-by: Philippe Guibert --- diff --git a/bgpd/bgp_pbr.h b/bgpd/bgp_pbr.h index 5129ada37b..fd47ad6fbb 100644 --- a/bgpd/bgp_pbr.h +++ b/bgpd/bgp_pbr.h @@ -189,6 +189,12 @@ struct bgp_pbr_match_entry { struct prefix src; struct prefix dst; + uint16_t src_port_min; + uint16_t src_port_max; + uint16_t dst_port_min; + uint16_t dst_port_max; + uint8_t proto; + bool installed; bool install_in_progress; }; diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index bc3f2a0756..0e1ff33033 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2181,6 +2181,12 @@ static void bgp_encode_pbr_ipset_entry_match(struct stream *s, stream_putc(s, pbime->dst.family); stream_putc(s, pbime->dst.prefixlen); stream_put(s, &pbime->dst.u.prefix, prefix_blen(&pbime->dst)); + + stream_putw(s, pbime->src_port_min); + stream_putw(s, pbime->src_port_max); + stream_putw(s, pbime->dst_port_min); + stream_putw(s, pbime->dst_port_max); + stream_putc(s, pbime->proto); } static void bgp_encode_pbr_iptable_match(struct stream *s,