]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_pbr.h
Merge pull request #12187 from mjstapp/mjs_fix_bgp_allowas
[mirror_frr.git] / bgpd / bgp_pbr.h
index b368d8892def96e76559095a0dc53e71b28016d8..379ac40672fc0116dfc6cedfd5463da4c31ea9b0 100644 (file)
@@ -79,6 +79,7 @@ struct bgp_pbr_entry_action {
                vrf_id_t redirect_vrf;
                struct _pbr_redirect_ip {
                        struct in_addr redirect_ip_v4;
+                       struct in6_addr redirect_ip_v6;
                        uint8_t duplicate;
                } zr;
                uint8_t marking_dscp;
@@ -114,13 +115,17 @@ struct bgp_pbr_entry_main {
        uint8_t match_dscp_num;
        uint8_t match_tcpflags_num;
        uint8_t match_fragment_num;
+       uint8_t match_flowlabel_num;
 
        struct prefix src_prefix;
        struct prefix dst_prefix;
+       uint8_t src_prefix_offset;
+       uint8_t dst_prefix_offset;
 
 #define PROTOCOL_UDP 17
 #define PROTOCOL_TCP 6
 #define PROTOCOL_ICMP 1
+#define PROTOCOL_ICMPV6 58
        struct bgp_pbr_match_val protocol[BGP_PBR_MATCH_VAL_MAX];
        struct bgp_pbr_match_val src_port[BGP_PBR_MATCH_VAL_MAX];
        struct bgp_pbr_match_val dst_port[BGP_PBR_MATCH_VAL_MAX];
@@ -129,6 +134,7 @@ struct bgp_pbr_entry_main {
        struct bgp_pbr_match_val icmp_code[BGP_PBR_MATCH_VAL_MAX];
        struct bgp_pbr_match_val packet_length[BGP_PBR_MATCH_VAL_MAX];
        struct bgp_pbr_match_val dscp[BGP_PBR_MATCH_VAL_MAX];
+       struct bgp_pbr_match_val flow_label[BGP_PBR_MATCH_VAL_MAX];
 
        struct bgp_pbr_match_val tcpflags[BGP_PBR_MATCH_VAL_MAX];
        struct bgp_pbr_match_val fragment[BGP_PBR_MATCH_VAL_MAX];
@@ -154,6 +160,8 @@ extern int bgp_pbr_interface_compare(const struct bgp_pbr_interface *a,
 struct bgp_pbr_config {
        struct bgp_pbr_interface_head ifaces_by_name_ipv4;
        bool pbr_interface_any_ipv4;
+       struct bgp_pbr_interface_head ifaces_by_name_ipv6;
+       bool pbr_interface_any_ipv6;
 };
 
 extern struct bgp_pbr_config *bgp_pbr_cfg;
@@ -179,6 +187,7 @@ struct bgp_pbr_match {
        uint32_t type;
 
        uint32_t flags;
+       uint8_t family;
 
        uint16_t pkt_len_min;
        uint16_t pkt_len_max;
@@ -186,6 +195,8 @@ struct bgp_pbr_match {
        uint16_t tcp_mask_flags;
        uint8_t dscp_value;
        uint8_t fragment;
+       uint8_t protocol;
+       uint16_t flow_label;
 
        vrf_id_t vrf_id;
 
@@ -253,6 +264,7 @@ struct bgp_pbr_action {
        bool install_in_progress;
        uint32_t refcnt;
        struct bgp *bgp;
+       afi_t afi;
 };
 
 extern struct bgp_pbr_rule *bgp_pbr_rule_lookup(vrf_id_t vrf_id,
@@ -288,9 +300,8 @@ extern bool bgp_pbr_match_hash_equal(const void *arg1,
 
 void bgp_pbr_print_policy_route(struct bgp_pbr_entry_main *api);
 
-struct bgp_node;
 struct bgp_path_info;
-extern void bgp_pbr_update_entry(struct bgp *bgp, struct prefix *p,
+extern void bgp_pbr_update_entry(struct bgp *bgp, const struct prefix *p,
                                 struct bgp_path_info *new_select, afi_t afi,
                                 safi_t safi, bool nlri_update);
 
@@ -300,7 +311,7 @@ extern void bgp_pbr_reset(struct bgp *bgp, afi_t afi);
 extern struct bgp_pbr_interface *bgp_pbr_interface_lookup(const char *name,
                                   struct bgp_pbr_interface_head *head);
 
-extern int bgp_pbr_build_and_validate_entry(struct prefix *p,
+extern int bgp_pbr_build_and_validate_entry(const struct prefix *p,
                                            struct bgp_path_info *path,
                                            struct bgp_pbr_entry_main *api);
 #endif /* __BGP_PBR_H__ */