summaryrefslogtreecommitdiffstats
path: root/src/socket.c
diff options
context:
space:
mode:
authorMáté Eckl <ecklm94@gmail.com>2018-08-01 20:09:22 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-08-03 12:25:59 +0200
commit9ea0401e385e1dd3f1579a4e772aa876a5e21288 (patch)
tree44c88a4960fda27226bdd11b938d1a3871af1588 /src/socket.c
parent029d9b3c16ae2354b6397c325a8dc389c67d970b (diff)
src: Expose socket mark via socket expression
This can be used like ct mark or meta mark except it cannot be set. doc and tests are included. Signed-off-by: Máté Eckl <ecklm94@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/socket.c b/src/socket.c
index 7cfe5a9d..d90b0416 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -14,11 +14,18 @@
#include <json.h>
const struct socket_template socket_templates[] = {
- [NFT_SOCKET_TRANSPARENT] = {.token = "transparent",
- .dtype = &integer_type,
- .len = BITS_PER_BYTE,
- .byteorder = BYTEORDER_HOST_ENDIAN,
- }
+ [NFT_SOCKET_TRANSPARENT] = {
+ .token = "transparent",
+ .dtype = &integer_type,
+ .len = BITS_PER_BYTE,
+ .byteorder = BYTEORDER_HOST_ENDIAN,
+ },
+ [NFT_SOCKET_MARK] = {
+ .token = "mark",
+ .dtype = &mark_type,
+ .len = 4 * BITS_PER_BYTE,
+ .byteorder = BYTEORDER_HOST_ENDIAN,
+ },
};
static void socket_expr_print(const struct expr *expr, struct output_ctx *octx)