From bc1cb4b1140327dc69246907518c95da2d3f580d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Wed, 24 Jun 2020 15:30:03 +0200 Subject: conntrack: Move icmp request>reply type mapping to common file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the invmap_icmp* arrays are duplicated in setter.c and grp_setter.c. This moves them to a new module 'proto'. Instead of having the code access the arrays directly we provide new wrapper functions __icmp{,v6}_reply_type. Signed-off-by: Daniel Gröber Signed-off-by: Pablo Neira Ayuso --- include/internal/internal.h | 1 + include/internal/proto.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 include/internal/proto.h (limited to 'include/internal') diff --git a/include/internal/internal.h b/include/internal/internal.h index 0f59f1a..2ef8a90 100644 --- a/include/internal/internal.h +++ b/include/internal/internal.h @@ -27,6 +27,7 @@ #include "internal/types.h" #include "internal/extern.h" #include "internal/bitops.h" +#include "internal/proto.h" #ifndef IPPROTO_SCTP #define IPPROTO_SCTP 132 diff --git a/include/internal/proto.h b/include/internal/proto.h new file mode 100644 index 0000000..40e7bfe --- /dev/null +++ b/include/internal/proto.h @@ -0,0 +1,19 @@ +#ifndef _NFCT_PROTO_H_ +#define _NFCT_PROTO_H_ + +#include +#include +#include + +#ifndef ICMPV6_NI_QUERY +#define ICMPV6_NI_QUERY 139 +#endif + +#ifndef ICMPV6_NI_REPLY +#define ICMPV6_NI_REPLY 140 +#endif + +uint8_t __icmp_reply_type(uint8_t type); +uint8_t __icmpv6_reply_type(uint8_t type); + +#endif -- cgit v1.2.3