From 41023042d984b9c2d69cd23daf7af8ca12a30f3c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 17 Dec 2019 18:16:53 +0100 Subject: exthdr: add exthdr_desc_id enum and use it This allows to identify the exthdr protocol from the userdata area. Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal --- include/exthdr.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/exthdr.h b/include/exthdr.h index 3959a65c..c9a3c211 100644 --- a/include/exthdr.h +++ b/include/exthdr.h @@ -5,6 +5,20 @@ #include #include +enum exthdr_desc_id { + EXTHDR_DESC_UNKNOWN = 0, + EXTHDR_DESC_HBH, + EXTHDR_DESC_RT, + EXTHDR_DESC_RT0, + EXTHDR_DESC_RT2, + EXTHDR_DESC_SRH, + EXTHDR_DESC_FRAG, + EXTHDR_DESC_DST, + EXTHDR_DESC_MH, + __EXTHDR_DESC_MAX +}; +#define EXTHDR_DESC_MAX (__EXTHDR_DESC_MAX - 1) + /** * struct exthdr_desc - extension header description * @@ -14,6 +28,7 @@ */ struct exthdr_desc { const char *name; + enum exthdr_desc_id id; uint8_t type; int proto_key; struct proto_hdr_template templates[10]; -- cgit v1.2.3