summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2018-06-29 19:45:44 +0200
committerGitHub <noreply@github.com>2018-06-29 19:45:44 +0200
commit1ad26882cb8ebdd4b5e47acd99ea302f29489718 (patch)
treeebfaa911dc27fd20d545ecb5f3f52c8de25ceec0 /lib
parentMerge pull request #2532 from donaldsharp/various_stuff (diff)
parentbgpd: rework enumerate function, handle not values (diff)
downloadfrr-1ad26882cb8ebdd4b5e47acd99ea302f29489718.tar.xz
frr-1ad26882cb8ebdd4b5e47acd99ea302f29489718.zip
Merge pull request #2517 from pguibert6WIND/flowspec_other_options
Flowspec support other options
Diffstat (limited to 'lib')
-rw-r--r--lib/pbr.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/pbr.h b/lib/pbr.h
index 1704d8d37..90997348c 100644
--- a/lib/pbr.h
+++ b/lib/pbr.h
@@ -89,6 +89,35 @@ struct pbr_rule {
uint32_t ifindex;
};
+/* TCP flags value shared
+ * those are values of byte 13 of TCP header
+ * as mentioned in rfc793
+ */
+#define TCP_HEADER_FIN (0x01)
+#define TCP_HEADER_SYN (0x02)
+#define TCP_HEADER_RST (0x04)
+#define TCP_HEADER_PSH (0x08)
+#define TCP_HEADER_ACK (0x10)
+#define TCP_HEADER_URG (0x20)
+#define TCP_HEADER_ALL_FLAGS (TCP_HEADER_FIN | TCP_HEADER_SYN \
+ | 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)
+#define MATCH_DSCP_SET (1 << 6)
+#define MATCH_DSCP_INVERSE_SET (1 << 7)
+#define MATCH_PKT_LEN_INVERSE_SET (1 << 8)
+#define MATCH_FRAGMENT_INVERSE_SET (1 << 9)
+#define MATCH_ICMP_SET (1 << 10)
+
extern int zapi_pbr_rule_encode(uint8_t cmd, struct stream *s,
struct pbr_rule *zrule);