]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: add 3 fields to ipset_entry : src,dst port, and proto
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 30 Mar 2018 11:01:39 +0000 (13:01 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 25 May 2018 13:49:38 +0000 (15:49 +0200)
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 <philippe.guibert@6wind.com>
bgpd/bgp_pbr.h
bgpd/bgp_zebra.c

index 5129ada37b57d8a6b4ae4dfa3b55146efb6e355a..fd47ad6fbb34bb9df7645e6c827968a48f6879f0 100644 (file)
@@ -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;
 };
index 360a496e4919168598d53b1dd33901180b70bf76..ecc6d1ee3433730a0512a012e092fa4983cf5ec4 100644 (file)
@@ -2167,6 +2167,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,