]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd, lib: share flags values for iptable configuration
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 13 Jun 2018 09:12:08 +0000 (11:12 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 2 Jul 2018 07:20:39 +0000 (09:20 +0200)
Those flags can be shared between BGP and Zebra. That is why
those flags are moved to common pbr.h header file.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_pbr.c
bgpd/bgp_pbr.h
lib/pbr.h

index a55486064799e9dad50315d581a23b7ecbf0dea0..bf09a999d477748d7f86e094220765e191c29f5c 100644 (file)
@@ -21,6 +21,7 @@
 #include "prefix.h"
 #include "zclient.h"
 #include "jhash.h"
+#include "pbr.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_pbr.h"
index a39fba82c17512de567fe4b8f28e62ddba859165..6a06ba3893ed312f7eb1427e6e1d94409f07309c 100644 (file)
@@ -178,12 +178,6 @@ struct bgp_pbr_match {
         */
        uint32_t type;
 
-#define MATCH_IP_SRC_SET               (1 << 0)
-#define MATCH_IP_DST_SET               (1 << 1)
-#define MATCH_PORT_SRC_SET             (1 << 2)
-#define MATCH_PORT_DST_SET             (1 << 3)
-#define MATCH_PORT_SRC_RANGE_SET       (1 << 4)
-#define MATCH_PORT_DST_RANGE_SET       (1 << 5)
        uint32_t flags;
 
        uint16_t pkt_len_min;
index 832788d78434fb9cf9e2ce92b0ca52d686a88b7a..72a870f1f3b2211f535dc6262679bcead072af7d 100644 (file)
--- a/lib/pbr.h
+++ b/lib/pbr.h
@@ -97,6 +97,16 @@ struct pbr_rule {
                              | TCP_HEADER_RST | TCP_HEADER_PSH \
                              | TCP_HEADER_ACK | TCP_HEADER_URG)
 
+/* Pbr IPTable defines
+ * those are common flags shared between BGP and Zebra
+ */
+#define MATCH_IP_SRC_SET               (1 << 0)
+#define MATCH_IP_DST_SET               (1 << 1)
+#define MATCH_PORT_SRC_SET             (1 << 2)
+#define MATCH_PORT_DST_SET             (1 << 3)
+#define MATCH_PORT_SRC_RANGE_SET       (1 << 4)
+#define MATCH_PORT_DST_RANGE_SET       (1 << 5)
+
 extern int zapi_pbr_rule_encode(uint8_t cmd, struct stream *s,
                                struct pbr_rule *zrule);