diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-12-07 18:28:07 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-12-07 18:29:34 +0100 |
commit | ac3ad139f648184d44707ab145fde3a03ef5cb6e (patch) | |
tree | 789f16b88e0be380306f86ed1fdc4cc3cb4ae59c /lib | |
parent | b7605d5c953902b461e5c9e87aa3dfa60ddce5bc (diff) |
BGP: Add support for flowspec (RFC 5575)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/flowspec.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/flowspec.h b/lib/flowspec.h index 57809bec..aa9735f4 100644 --- a/lib/flowspec.h +++ b/lib/flowspec.h @@ -42,6 +42,9 @@ const char *flow_type_str(enum flow_type type, int ipv6); uint flow_write_length(byte *data, u16 len); +static inline u16 flow_hdr_length(const byte *data) +{ return ((*data & 0xf0) == 0xf0) ? 2 : 1; } + static inline u16 flow_read_length(const byte *data) { return ((*data & 0xf0) == 0xf0) ? get_u16(data) & 0x0fff : *data; } |