| 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */cxx . . $ `<file>/src/expr/exthdr.c`/ |
| 2 | /* |
| 3 | * (C) 2012-2013 by Pablo Neira Ayuso <[email protected]> |
| 4 | * |
| 5 | * This code has been sponsored by Sophos Astaro <http://www.sophos.com> |
| 6 | */ |
| 7 | |
| 8 | #include "internal.h"cxx . . $ `<file>/include/internal.h`/ |
| 9 | |
| 10 | #include <stdio.h> |
| 11 | #include <string.h> |
| 12 | #include <stdint.h> |
| 13 | #include <limits.h> |
| 14 | #include <arpa/inet.h> |
| 15 | #include <errno.h> |
| 16 | #include <libmnl/libmnl.h> |
| 17 | |
| 18 | #include <linux/netfilter/nf_tables.h>cxx . . $ `<file>/include/linux/netfilter/nf_tables.h`/ |
| 19 | |
| 20 | #include <libnftnl/expr.h>cxx . . $ `<file>/include/libnftnl/expr.h`/ |
| 21 | #include <libnftnl/rule.h>cxx . . $ `<file>/include/libnftnl/rule.h`/ |
| 22 | |
| 23 | #ifndef IPPROTO_MHcxx . . $ `<external>/9581057695539925927/in.h:122:9`! |
| 24 | #define IPPROTO_MH 135 |
| 25 | #endif |
| 26 | |
| 27 | struct nftnl_expr_exthdrcxx . . $ nftnl_expr_exthdr# { |
| 28 | enum nft_registerscxx . . $ nft_registers# dregcxx . . $ nftnl_expr_exthdr#dreg.; |
| 29 | enum nft_registerscxx . . $ nft_registers# sregcxx . . $ nftnl_expr_exthdr#sreg.; |
| 30 | uint32_tcxx . . $ uint32_t# offsetcxx . . $ nftnl_expr_exthdr#offset.; |
| 31 | uint32_tcxx . . $ uint32_t# lencxx . . $ nftnl_expr_exthdr#len.; |
| 32 | uint8_tcxx . . $ uint8_t# typecxx . . $ nftnl_expr_exthdr#type.; |
| 33 | uint32_tcxx . . $ uint32_t# opcxx . . $ nftnl_expr_exthdr#op.; |
| 34 | uint32_tcxx . . $ uint32_t# flagscxx . . $ nftnl_expr_exthdr#flags.; |
| 35 | }; |
| 36 | |
| 37 | static int |
| 38 | nftnl_expr_exthdr_setcxx . . $ nftnl_expr_exthdr_set(211371a3e3842127).(struct nftnl_exprcxx . . $ nftnl_expr# *e, uint16_tcxx . . $ uint16_t# type, |
| 39 | const void *data, uint32_tcxx . . $ uint32_t# data_len, uint32_tcxx . . $ uint32_t# byteorder) |
| 40 | { |
| 41 | struct nftnl_expr_exthdrcxx . . $ nftnl_expr_exthdr# *exthdr = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e); |
| 42 | |
| 43 | switch(type) { |
| 44 | case NFTNL_EXPR_EXTHDR_DREGcxx . . $ NFTNL_EXPR_EXTHDR_DREG.: |
| 45 | memcpycxx . . $ memcpy(cc817cb175f282d).(&exthdr->dregcxx . . $ nftnl_expr_exthdr#dreg., data, data_len); |
| 46 | break; |
| 47 | case NFTNL_EXPR_EXTHDR_TYPEcxx . . $ NFTNL_EXPR_EXTHDR_TYPE.: |
| 48 | memcpycxx . . $ memcpy(cc817cb175f282d).(&exthdr->typecxx . . $ nftnl_expr_exthdr#type., data, data_len); |
| 49 | break; |
| 50 | case NFTNL_EXPR_EXTHDR_OFFSETcxx . . $ NFTNL_EXPR_EXTHDR_OFFSET.: |
| 51 | memcpycxx . . $ memcpy(cc817cb175f282d).(&exthdr->offsetcxx . . $ nftnl_expr_exthdr#offset., data, data_len); |
| 52 | break; |
| 53 | case NFTNL_EXPR_EXTHDR_LENcxx . . $ NFTNL_EXPR_EXTHDR_LEN.: |
| 54 | memcpycxx . . $ memcpy(cc817cb175f282d).(&exthdr->lencxx . . $ nftnl_expr_exthdr#len., data, data_len); |
| 55 | break; |
| 56 | case NFTNL_EXPR_EXTHDR_OPcxx . . $ NFTNL_EXPR_EXTHDR_OP.: |
| 57 | memcpycxx . . $ memcpy(cc817cb175f282d).(&exthdr->opcxx . . $ nftnl_expr_exthdr#op., data, data_len); |
| 58 | break; |
| 59 | case NFTNL_EXPR_EXTHDR_FLAGScxx . . $ NFTNL_EXPR_EXTHDR_FLAGS.: |
| 60 | memcpycxx . . $ memcpy(cc817cb175f282d).(&exthdr->flagscxx . . $ nftnl_expr_exthdr#flags., data, data_len); |
| 61 | break; |
| 62 | case NFTNL_EXPR_EXTHDR_SREGcxx . . $ NFTNL_EXPR_EXTHDR_SREG.: |
| 63 | memcpycxx . . $ memcpy(cc817cb175f282d).(&exthdr->sregcxx . . $ nftnl_expr_exthdr#sreg., data, data_len); |
| 64 | break; |
| 65 | } |
| 66 | return 0; |
| 67 | } |
| 68 | |
| 69 | static const void * |
| 70 | nftnl_expr_exthdr_getcxx . . $ nftnl_expr_exthdr_get(9de263c4f9e71c4b).(const struct nftnl_exprcxx . . $ nftnl_expr# *e, uint16_tcxx . . $ uint16_t# type, |
| 71 | uint32_tcxx . . $ uint32_t# *data_len) |
| 72 | { |
| 73 | struct nftnl_expr_exthdrcxx . . $ nftnl_expr_exthdr# *exthdr = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e); |
| 74 | |
| 75 | switch(type) { |
| 76 | case NFTNL_EXPR_EXTHDR_DREGcxx . . $ NFTNL_EXPR_EXTHDR_DREG.: |
| 77 | *data_len = sizeof(exthdr->dregcxx . . $ nftnl_expr_exthdr#dreg.); |
| 78 | return &exthdr->dregcxx . . $ nftnl_expr_exthdr#dreg.; |
| 79 | case NFTNL_EXPR_EXTHDR_TYPEcxx . . $ NFTNL_EXPR_EXTHDR_TYPE.: |
| 80 | *data_len = sizeof(exthdr->typecxx . . $ nftnl_expr_exthdr#type.); |
| 81 | return &exthdr->typecxx . . $ nftnl_expr_exthdr#type.; |
| 82 | case NFTNL_EXPR_EXTHDR_OFFSETcxx . . $ NFTNL_EXPR_EXTHDR_OFFSET.: |
| 83 | *data_len = sizeof(exthdr->offsetcxx . . $ nftnl_expr_exthdr#offset.); |
| 84 | return &exthdr->offsetcxx . . $ nftnl_expr_exthdr#offset.; |
| 85 | case NFTNL_EXPR_EXTHDR_LENcxx . . $ NFTNL_EXPR_EXTHDR_LEN.: |
| 86 | *data_len = sizeof(exthdr->lencxx . . $ nftnl_expr_exthdr#len.); |
| 87 | return &exthdr->lencxx . . $ nftnl_expr_exthdr#len.; |
| 88 | case NFTNL_EXPR_EXTHDR_OPcxx . . $ NFTNL_EXPR_EXTHDR_OP.: |
| 89 | *data_len = sizeof(exthdr->opcxx . . $ nftnl_expr_exthdr#op.); |
| 90 | return &exthdr->opcxx . . $ nftnl_expr_exthdr#op.; |
| 91 | case NFTNL_EXPR_EXTHDR_FLAGScxx . . $ NFTNL_EXPR_EXTHDR_FLAGS.: |
| 92 | *data_len = sizeof(exthdr->flagscxx . . $ nftnl_expr_exthdr#flags.); |
| 93 | return &exthdr->flagscxx . . $ nftnl_expr_exthdr#flags.; |
| 94 | case NFTNL_EXPR_EXTHDR_SREGcxx . . $ NFTNL_EXPR_EXTHDR_SREG.: |
| 95 | *data_len = sizeof(exthdr->sregcxx . . $ nftnl_expr_exthdr#sreg.); |
| 96 | return &exthdr->sregcxx . . $ nftnl_expr_exthdr#sreg.; |
| 97 | } |
| 98 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 99 | } |
| 100 | |
| 101 | static int nftnl_expr_exthdr_cbcxx . . $ nftnl_expr_exthdr_cb(de2ef18c48fd675c).(const struct nlattrcxx . . $ nlattr# *attr, void *data) |
| 102 | { |
| 103 | const struct nlattrcxx . . $ nlattr# **tb = data; |
| 104 | int type = mnl_attr_get_typecxx . . $ mnl_attr_get_type(1da47bcc4c4b975).(attr); |
| 105 | |
| 106 | if (mnl_attr_type_validcxx . . $ mnl_attr_type_valid(47df1cce1c7be855).(attr, NFTA_EXTHDR_MAXcxx . . $ `include/linux/netfilter/nf_tables.h:921:9`!) < 0) |
| 107 | return MNL_CB_OKcxx . . $ `<external>/12386019527593959648/libmnl.h:174:9`!; |
| 108 | |
| 109 | switch(type) { |
| 110 | case NFTA_EXTHDR_TYPEcxx . . $ NFTA_EXTHDR_TYPE.: |
| 111 | if (mnl_attr_validatecxx . . $ mnl_attr_validate(e419697a5e1ae2b1).(attr, MNL_TYPE_U8cxx . . $ MNL_TYPE_U8.) < 0) |
| 112 | abi_breakagecxx . . $ `include/utils.h:28:9`!(); |
| 113 | break; |
| 114 | case NFTA_EXTHDR_DREGcxx . . $ NFTA_EXTHDR_DREG.: |
| 115 | case NFTA_EXTHDR_SREGcxx . . $ NFTA_EXTHDR_SREG.: |
| 116 | case NFTA_EXTHDR_OFFSETcxx . . $ NFTA_EXTHDR_OFFSET.: |
| 117 | case NFTA_EXTHDR_LENcxx . . $ NFTA_EXTHDR_LEN.: |
| 118 | case NFTA_EXTHDR_OPcxx . . $ NFTA_EXTHDR_OP.: |
| 119 | case NFTA_EXTHDR_FLAGScxx . . $ NFTA_EXTHDR_FLAGS.: |
| 120 | if (mnl_attr_validatecxx . . $ mnl_attr_validate(e419697a5e1ae2b1).(attr, MNL_TYPE_U32cxx . . $ MNL_TYPE_U32.) < 0) |
| 121 | abi_breakagecxx . . $ `include/utils.h:28:9`!(); |
| 122 | break; |
| 123 | } |
| 124 | |
| 125 | tb[type] = attr; |
| 126 | return MNL_CB_OKcxx . . $ `<external>/12386019527593959648/libmnl.h:174:9`!; |
| 127 | } |
| 128 | |
| 129 | static void |
| 130 | nftnl_expr_exthdr_buildcxx . . $ nftnl_expr_exthdr_build(93c7528a9cf90b41).(struct nlmsghdrcxx . . $ nlmsghdr# *nlh, const struct nftnl_exprcxx . . $ nftnl_expr# *e) |
| 131 | { |
| 132 | struct nftnl_expr_exthdrcxx . . $ nftnl_expr_exthdr# *exthdr = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e); |
| 133 | |
| 134 | if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_EXTHDR_DREGcxx . . $ NFTNL_EXPR_EXTHDR_DREG.)) |
| 135 | mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_EXTHDR_DREGcxx . . $ NFTA_EXTHDR_DREG., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(exthdr->dreg)); |
| 136 | if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_EXTHDR_SREGcxx . . $ NFTNL_EXPR_EXTHDR_SREG.)) |
| 137 | mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_EXTHDR_SREGcxx . . $ NFTA_EXTHDR_SREG., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(exthdr->sreg)); |
| 138 | if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_EXTHDR_TYPEcxx . . $ NFTNL_EXPR_EXTHDR_TYPE.)) |
| 139 | mnl_attr_put_u8cxx . . $ mnl_attr_put_u8(897b09f57801d77).(nlh, NFTA_EXTHDR_TYPEcxx . . $ NFTA_EXTHDR_TYPE., exthdr->typecxx . . $ nftnl_expr_exthdr#type.); |
| 140 | if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_EXTHDR_OFFSETcxx . . $ NFTNL_EXPR_EXTHDR_OFFSET.)) |
| 141 | mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_EXTHDR_OFFSETcxx . . $ NFTA_EXTHDR_OFFSET., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(exthdr->offset)); |
| 142 | if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_EXTHDR_LENcxx . . $ NFTNL_EXPR_EXTHDR_LEN.)) |
| 143 | mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_EXTHDR_LENcxx . . $ NFTA_EXTHDR_LEN., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(exthdr->len)); |
| 144 | if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_EXTHDR_OPcxx . . $ NFTNL_EXPR_EXTHDR_OP.)) |
| 145 | mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_EXTHDR_OPcxx . . $ NFTA_EXTHDR_OP., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(exthdr->op)); |
| 146 | if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_EXTHDR_FLAGScxx . . $ NFTNL_EXPR_EXTHDR_FLAGS.)) |
| 147 | mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_EXTHDR_FLAGScxx . . $ NFTA_EXTHDR_FLAGS., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(exthdr->flags)); |
| 148 | } |
| 149 | |
| 150 | static int |
| 151 | nftnl_expr_exthdr_parsecxx . . $ nftnl_expr_exthdr_parse(ed61207049d8af9a).(struct nftnl_exprcxx . . $ nftnl_expr# *e, struct nlattrcxx . . $ nlattr# *attr) |
| 152 | { |
| 153 | struct nftnl_expr_exthdrcxx . . $ nftnl_expr_exthdr# *exthdr = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e); |
| 154 | struct nlattrcxx . . $ nlattr# *tb[NFTA_EXTHDR_MAXcxx . . $ `include/linux/netfilter/nf_tables.h:921:9`!+1] = {}; |
| 155 | |
| 156 | if (mnl_attr_parse_nestedcxx . . $ mnl_attr_parse_nested(f99c0e9fa94f99d9).(attr, nftnl_expr_exthdr_cbcxx . . $ nftnl_expr_exthdr_cb(de2ef18c48fd675c)., tb) < 0) |
| 157 | return -1; |
| 158 | |
| 159 | if (tb[NFTA_EXTHDR_DREGcxx . . $ NFTA_EXTHDR_DREG.]) { |
| 160 | exthdr->dregcxx . . $ nftnl_expr_exthdr#dreg. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_EXTHDR_DREG])); |
| 161 | e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_EXTHDR_DREGcxx . . $ NFTNL_EXPR_EXTHDR_DREG.); |
| 162 | } |
| 163 | if (tb[NFTA_EXTHDR_SREGcxx . . $ NFTA_EXTHDR_SREG.]) { |
| 164 | exthdr->sregcxx . . $ nftnl_expr_exthdr#sreg. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_EXTHDR_SREG])); |
| 165 | e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_EXTHDR_SREGcxx . . $ NFTNL_EXPR_EXTHDR_SREG.); |
| 166 | } |
| 167 | if (tb[NFTA_EXTHDR_TYPEcxx . . $ NFTA_EXTHDR_TYPE.]) { |
| 168 | exthdr->typecxx . . $ nftnl_expr_exthdr#type. = mnl_attr_get_u8cxx . . $ mnl_attr_get_u8(68d72702597f1127).(tb[NFTA_EXTHDR_TYPEcxx . . $ NFTA_EXTHDR_TYPE.]); |
| 169 | e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_EXTHDR_TYPEcxx . . $ NFTNL_EXPR_EXTHDR_TYPE.); |
| 170 | } |
| 171 | if (tb[NFTA_EXTHDR_OFFSETcxx . . $ NFTA_EXTHDR_OFFSET.]) { |
| 172 | exthdr->offsetcxx . . $ nftnl_expr_exthdr#offset. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_EXTHDR_OFFSET])); |
| 173 | e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_EXTHDR_OFFSETcxx . . $ NFTNL_EXPR_EXTHDR_OFFSET.); |
| 174 | } |
| 175 | if (tb[NFTA_EXTHDR_LENcxx . . $ NFTA_EXTHDR_LEN.]) { |
| 176 | exthdr->lencxx . . $ nftnl_expr_exthdr#len. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_EXTHDR_LEN])); |
| 177 | e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_EXTHDR_LENcxx . . $ NFTNL_EXPR_EXTHDR_LEN.); |
| 178 | } |
| 179 | if (tb[NFTA_EXTHDR_OPcxx . . $ NFTA_EXTHDR_OP.]) { |
| 180 | exthdr->opcxx . . $ nftnl_expr_exthdr#op. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_EXTHDR_OP])); |
| 181 | e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_EXTHDR_OPcxx . . $ NFTNL_EXPR_EXTHDR_OP.); |
| 182 | } |
| 183 | if (tb[NFTA_EXTHDR_FLAGScxx . . $ NFTA_EXTHDR_FLAGS.]) { |
| 184 | exthdr->flagscxx . . $ nftnl_expr_exthdr#flags. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_EXTHDR_FLAGS])); |
| 185 | e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_EXTHDR_FLAGScxx . . $ NFTNL_EXPR_EXTHDR_FLAGS.); |
| 186 | } |
| 187 | |
| 188 | return 0; |
| 189 | } |
| 190 | |
| 191 | static const char *op2strcxx . . $ op2str(42624c5f3be67010).(uint8_tcxx . . $ uint8_t# op) |
| 192 | { |
| 193 | switch (op) { |
| 194 | case NFT_EXTHDR_OP_TCPOPTcxx . . $ NFT_EXTHDR_OP_TCPOPT.: |
| 195 | return " tcpopt"; |
| 196 | case NFT_EXTHDR_OP_IPV6cxx . . $ NFT_EXTHDR_OP_IPV6.: |
| 197 | return " ipv6"; |
| 198 | case NFT_EXTHDR_OP_IPV4cxx . . $ NFT_EXTHDR_OP_IPV4.: |
| 199 | return " ipv4"; |
| 200 | default: |
| 201 | return ""; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | static int |
| 206 | nftnl_expr_exthdr_snprintfcxx . . $ nftnl_expr_exthdr_snprintf(2b4af69501aef780).(char *buf, size_t len, |
| 207 | uint32_tcxx . . $ uint32_t# flags, const struct nftnl_exprcxx . . $ nftnl_expr# *e) |
| 208 | { |
| 209 | struct nftnl_expr_exthdrcxx . . $ nftnl_expr_exthdr# *exthdr = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e); |
| 210 | |
| 211 | if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_EXTHDR_DREGcxx . . $ NFTNL_EXPR_EXTHDR_DREG.)) |
| 212 | return snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, len, "load%s %ub @ %u + %u%s => reg %u ", |
| 213 | op2strcxx . . $ op2str(42624c5f3be67010).(exthdr->opcxx . . $ nftnl_expr_exthdr#op.), exthdr->lencxx . . $ nftnl_expr_exthdr#len., exthdr->typecxx . . $ nftnl_expr_exthdr#type., |
| 214 | exthdr->offsetcxx . . $ nftnl_expr_exthdr#offset., |
| 215 | exthdr->flagscxx . . $ nftnl_expr_exthdr#flags. & NFT_EXTHDR_F_PRESENTcxx . . $ NFT_EXTHDR_F_PRESENT. ? " present" : "", |
| 216 | exthdr->dregcxx . . $ nftnl_expr_exthdr#dreg.); |
| 217 | else if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_EXTHDR_SREGcxx . . $ NFTNL_EXPR_EXTHDR_SREG.)) |
| 218 | return snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, len, "write%s reg %u => %ub @ %u + %u ", |
| 219 | op2strcxx . . $ op2str(42624c5f3be67010).(exthdr->opcxx . . $ nftnl_expr_exthdr#op.), exthdr->sregcxx . . $ nftnl_expr_exthdr#sreg., exthdr->lencxx . . $ nftnl_expr_exthdr#len., exthdr->typecxx . . $ nftnl_expr_exthdr#type., |
| 220 | exthdr->offsetcxx . . $ nftnl_expr_exthdr#offset.); |
| 221 | else if (exthdr->opcxx . . $ nftnl_expr_exthdr#op. == NFT_EXTHDR_OP_TCPOPTcxx . . $ NFT_EXTHDR_OP_TCPOPT. && exthdr->lencxx . . $ nftnl_expr_exthdr#len. == 0) |
| 222 | return snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, len, "reset tcpopt %u ", exthdr->typecxx . . $ nftnl_expr_exthdr#type.); |
| 223 | else |
| 224 | return snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, len, "op %u len %u type %u offset %u ", |
| 225 | exthdr->opcxx . . $ nftnl_expr_exthdr#op., exthdr->lencxx . . $ nftnl_expr_exthdr#len., exthdr->typecxx . . $ nftnl_expr_exthdr#type., exthdr->offsetcxx . . $ nftnl_expr_exthdr#offset.); |
| 226 | |
| 227 | } |
| 228 | |
| 229 | static struct attr_policycxx . . $ attr_policy# exthdr_attr_policycxx . . $ exthdr_attr_policy.[__NFTNL_EXPR_EXTHDR_MAXcxx . . $ __NFTNL_EXPR_EXTHDR_MAX.] = { |
| 230 | [NFTNL_EXPR_EXTHDR_DREGcxx . . $ NFTNL_EXPR_EXTHDR_DREG.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) }, |
| 231 | [NFTNL_EXPR_EXTHDR_TYPEcxx . . $ NFTNL_EXPR_EXTHDR_TYPE.] = { .maxlen = sizeof(uint8_tcxx . . $ uint8_t#) }, |
| 232 | [NFTNL_EXPR_EXTHDR_OFFSETcxx . . $ NFTNL_EXPR_EXTHDR_OFFSET.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) }, |
| 233 | [NFTNL_EXPR_EXTHDR_LENcxx . . $ NFTNL_EXPR_EXTHDR_LEN.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) }, |
| 234 | [NFTNL_EXPR_EXTHDR_FLAGScxx . . $ NFTNL_EXPR_EXTHDR_FLAGS.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) }, |
| 235 | [NFTNL_EXPR_EXTHDR_OPcxx . . $ NFTNL_EXPR_EXTHDR_OP.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) }, |
| 236 | [NFTNL_EXPR_EXTHDR_SREGcxx . . $ NFTNL_EXPR_EXTHDR_SREG.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) }, |
| 237 | }; |
| 238 | |
| 239 | struct expr_opscxx . . $ expr_ops# expr_ops_exthdrcxx . . $ expr_ops_exthdr. = { |
| 240 | .name = "exthdr", |
| 241 | .alloc_len = sizeof(struct nftnl_expr_exthdrcxx . . $ nftnl_expr_exthdr#), |
| 242 | .nftnl_max_attr = __NFTNL_EXPR_EXTHDR_MAXcxx . . $ __NFTNL_EXPR_EXTHDR_MAX. - 1, |
| 243 | .attr_policy = exthdr_attr_policycxx . . $ exthdr_attr_policy., |
| 244 | .set = nftnl_expr_exthdr_setcxx . . $ nftnl_expr_exthdr_set(211371a3e3842127)., |
| 245 | .get = nftnl_expr_exthdr_getcxx . . $ nftnl_expr_exthdr_get(9de263c4f9e71c4b)., |
| 246 | .parse = nftnl_expr_exthdr_parsecxx . . $ nftnl_expr_exthdr_parse(ed61207049d8af9a)., |
| 247 | .build = nftnl_expr_exthdr_buildcxx . . $ nftnl_expr_exthdr_build(93c7528a9cf90b41)., |
| 248 | .output = nftnl_expr_exthdr_snprintfcxx . . $ nftnl_expr_exthdr_snprintf(2b4af69501aef780)., |
| 249 | }; |