| 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */cxx . . $ `<file>/src/object.c`/ |
| 2 | /* |
| 3 | * (C) 2012-2016 by Pablo Neira Ayuso <[email protected]> |
| 4 | */ |
| 5 | #include "internal.h"cxx . . $ `<file>/include/internal.h`/ |
| 6 | |
| 7 | #include <time.h> |
| 8 | #include <endian.h> |
| 9 | #include <stdint.h> |
| 10 | #include <limits.h> |
| 11 | #include <stdlib.h> |
| 12 | #include <string.h> |
| 13 | #include <netinet/in.h> |
| 14 | #include <errno.h> |
| 15 | |
| 16 | #include <libmnl/libmnl.h> |
| 17 | #include <linux/netfilter/nfnetlink.h>cxx . . $ `<file>/include/linux/netfilter/nfnetlink.h`/ |
| 18 | #include <linux/netfilter/nf_tables.h>cxx . . $ `<file>/include/linux/netfilter/nf_tables.h`/ |
| 19 | |
| 20 | #include <libnftnl/object.h>cxx . . $ `<file>/include/libnftnl/object.h`/ |
| 21 | #include "obj.h"cxx . . $ `<file>/include/obj.h`/ |
| 22 | |
| 23 | static struct obj_opscxx . . $ obj_ops# *obj_opscxx . . $ obj_ops.[__NFT_OBJECT_MAXcxx . . $ `include/linux/netfilter/nf_tables.h:1669:9`!] = { |
| 24 | [NFT_OBJECT_COUNTERcxx . . $ `include/linux/netfilter/nf_tables.h:1659:9`!] = &obj_ops_countercxx . . $ obj_ops_counter., |
| 25 | [NFT_OBJECT_QUOTAcxx . . $ `include/linux/netfilter/nf_tables.h:1660:9`!] = &obj_ops_quotacxx . . $ obj_ops_quota., |
| 26 | [NFT_OBJECT_CT_HELPERcxx . . $ `include/linux/netfilter/nf_tables.h:1661:9`!] = &obj_ops_ct_helpercxx . . $ obj_ops_ct_helper., |
| 27 | [NFT_OBJECT_LIMITcxx . . $ `include/linux/netfilter/nf_tables.h:1662:9`!] = &obj_ops_limitcxx . . $ obj_ops_limit., |
| 28 | [NFT_OBJECT_TUNNELcxx . . $ `include/linux/netfilter/nf_tables.h:1664:9`!] = &obj_ops_tunnelcxx . . $ obj_ops_tunnel., |
| 29 | [NFT_OBJECT_CT_TIMEOUTcxx . . $ `include/linux/netfilter/nf_tables.h:1665:9`!] = &obj_ops_ct_timeoutcxx . . $ obj_ops_ct_timeout., |
| 30 | [NFT_OBJECT_SECMARKcxx . . $ `include/linux/netfilter/nf_tables.h:1666:9`!] = &obj_ops_secmarkcxx . . $ obj_ops_secmark., |
| 31 | [NFT_OBJECT_CT_EXPECTcxx . . $ `include/linux/netfilter/nf_tables.h:1667:9`!] = &obj_ops_ct_expectcxx . . $ obj_ops_ct_expect., |
| 32 | [NFT_OBJECT_SYNPROXYcxx . . $ `include/linux/netfilter/nf_tables.h:1668:9`!] = &obj_ops_synproxycxx . . $ obj_ops_synproxy., |
| 33 | [NFT_OBJECT_CONNLIMITcxx . . $ `include/linux/netfilter/nf_tables.h:1663:9`!] = &obj_ops_connlimitcxx . . $ obj_ops_connlimit., |
| 34 | }; |
| 35 | |
| 36 | static struct obj_opscxx . . $ obj_ops# *nftnl_obj_ops_lookupcxx . . $ nftnl_obj_ops_lookup(2d1120a9637eed2e).(uint32_tcxx . . $ uint32_t# type) |
| 37 | { |
| 38 | if (type > NFT_OBJECT_MAXcxx . . $ `include/linux/netfilter/nf_tables.h:1670:9`!) |
| 39 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 40 | |
| 41 | return obj_opscxx . . $ obj_ops.[type]; |
| 42 | } |
| 43 | |
| 44 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_alloc); |
| 45 | struct nftnl_objcxx . . $ nftnl_obj# *nftnl_obj_alloccxx . . $ nftnl_obj_alloc(833e9eae2eb02c7c).(void) |
| 46 | { |
| 47 | return calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct nftnl_objcxx . . $ nftnl_obj#)); |
| 48 | } |
| 49 | |
| 50 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_free); |
| 51 | void nftnl_obj_freecxx . . $ nftnl_obj_free(43c97f053fbb99c6).(const struct nftnl_objcxx . . $ nftnl_obj# *obj) |
| 52 | { |
| 53 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_TABLEcxx . . $ NFTNL_OBJ_TABLE.)) |
| 54 | xfreecxx . . $ `include/utils.h:22:9`!(obj->table); |
| 55 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_NAMEcxx . . $ NFTNL_OBJ_NAME.)) |
| 56 | xfreecxx . . $ `include/utils.h:22:9`!(obj->name); |
| 57 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_USERDATAcxx . . $ NFTNL_OBJ_USERDATA.)) |
| 58 | xfreecxx . . $ `include/utils.h:22:9`!(obj->user.data); |
| 59 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_TUNNEL_OPTScxx . . $ NFTNL_OBJ_TUNNEL_OPTS.)) { |
| 60 | nftnl_tunnel_opts_freecxx . . $ nftnl_tunnel_opts_free(b478d88dbab346e7).(obj->datacxx . . $ nftnl_obj#data..tunnelcxx . . $ nftnl_obj#$anonymous_type_1#tunnel..tun_optscxx . . $ nftnl_obj_tunnel#tun_opts.); |
| 61 | xfreecxx . . $ `include/utils.h:22:9`!(obj->data.tunnel.tun_opts); |
| 62 | } |
| 63 | |
| 64 | xfreecxx . . $ `include/utils.h:22:9`!(obj); |
| 65 | } |
| 66 | |
| 67 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_is_set); |
| 68 | boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! nftnl_obj_is_setcxx . . $ nftnl_obj_is_set(e4fcc7d6865fb2ff).(const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr) |
| 69 | { |
| 70 | return obj->flagscxx . . $ nftnl_obj#flags. & (1 << attr); |
| 71 | } |
| 72 | |
| 73 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_unset); |
| 74 | void nftnl_obj_unsetcxx . . $ nftnl_obj_unset(41706c55267ec724).(struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr) |
| 75 | { |
| 76 | if (!(obj->flagscxx . . $ nftnl_obj#flags. & (1 << attr))) |
| 77 | return; |
| 78 | |
| 79 | switch (attr) { |
| 80 | case NFTNL_OBJ_TABLEcxx . . $ NFTNL_OBJ_TABLE.: |
| 81 | xfreecxx . . $ `include/utils.h:22:9`!(obj->table); |
| 82 | break; |
| 83 | case NFTNL_OBJ_NAMEcxx . . $ NFTNL_OBJ_NAME.: |
| 84 | xfreecxx . . $ `include/utils.h:22:9`!(obj->name); |
| 85 | break; |
| 86 | case NFTNL_OBJ_USERDATAcxx . . $ NFTNL_OBJ_USERDATA.: |
| 87 | xfreecxx . . $ `include/utils.h:22:9`!(obj->user.data); |
| 88 | break; |
| 89 | case NFTNL_OBJ_TYPEcxx . . $ NFTNL_OBJ_TYPE.: |
| 90 | case NFTNL_OBJ_FAMILYcxx . . $ NFTNL_OBJ_FAMILY.: |
| 91 | case NFTNL_OBJ_USEcxx . . $ NFTNL_OBJ_USE.: |
| 92 | case NFTNL_OBJ_HANDLEcxx . . $ NFTNL_OBJ_HANDLE.: |
| 93 | break; |
| 94 | default: |
| 95 | break; |
| 96 | } |
| 97 | |
| 98 | obj->flagscxx . . $ nftnl_obj#flags. &= ~(1 << attr); |
| 99 | } |
| 100 | |
| 101 | static uint32_tcxx . . $ uint32_t# nftnl_obj_validatecxx . . $ nftnl_obj_validate.[NFTNL_OBJ_MAXcxx . . $ `include/libnftnl/object.h:26:9`! + 1] = { |
| 102 | [NFTNL_OBJ_TYPEcxx . . $ NFTNL_OBJ_TYPE.] = sizeof(uint32_tcxx . . $ uint32_t#), |
| 103 | [NFTNL_OBJ_FAMILYcxx . . $ NFTNL_OBJ_FAMILY.] = sizeof(uint32_tcxx . . $ uint32_t#), |
| 104 | [NFTNL_OBJ_USEcxx . . $ NFTNL_OBJ_USE.] = sizeof(uint32_tcxx . . $ uint32_t#), |
| 105 | [NFTNL_OBJ_HANDLEcxx . . $ NFTNL_OBJ_HANDLE.] = sizeof(uint64_tcxx . . $ uint64_t#), |
| 106 | }; |
| 107 | |
| 108 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_set_data); |
| 109 | int nftnl_obj_set_datacxx . . $ nftnl_obj_set_data(96c901c785434bf1).(struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr, |
| 110 | const void *data, uint32_tcxx . . $ uint32_t# data_len) |
| 111 | { |
| 112 | if (attr < NFTNL_OBJ_MAXcxx . . $ `include/libnftnl/object.h:26:9`!) |
| 113 | nftnl_assert_validatecxx . . $ `include/utils.h:38:9`!(data, nftnl_obj_validate, attr, data_len); |
| 114 | |
| 115 | switch (attr) { |
| 116 | case NFTNL_OBJ_TABLEcxx . . $ NFTNL_OBJ_TABLE.: |
| 117 | return nftnl_set_str_attrcxx . . $ nftnl_set_str_attr(fd565288bd370d98).(&obj->tablecxx . . $ nftnl_obj#table., &obj->flagscxx . . $ nftnl_obj#flags., |
| 118 | attr, data, data_len); |
| 119 | break; |
| 120 | case NFTNL_OBJ_NAMEcxx . . $ NFTNL_OBJ_NAME.: |
| 121 | return nftnl_set_str_attrcxx . . $ nftnl_set_str_attr(fd565288bd370d98).(&obj->namecxx . . $ nftnl_obj#name., &obj->flagscxx . . $ nftnl_obj#flags., |
| 122 | attr, data, data_len); |
| 123 | case NFTNL_OBJ_TYPEcxx . . $ NFTNL_OBJ_TYPE.: |
| 124 | obj->opscxx . . $ nftnl_obj#ops. = nftnl_obj_ops_lookupcxx . . $ nftnl_obj_ops_lookup(2d1120a9637eed2e).(*((uint32_tcxx . . $ uint32_t# *)data)); |
| 125 | if (!obj->opscxx . . $ nftnl_obj#ops.) |
| 126 | return -1; |
| 127 | break; |
| 128 | case NFTNL_OBJ_FAMILYcxx . . $ NFTNL_OBJ_FAMILY.: |
| 129 | memcpycxx . . $ memcpy(cc817cb175f282d).(&obj->familycxx . . $ nftnl_obj#family., data, sizeof(obj->familycxx . . $ nftnl_obj#family.)); |
| 130 | break; |
| 131 | case NFTNL_OBJ_USEcxx . . $ NFTNL_OBJ_USE.: |
| 132 | memcpycxx . . $ memcpy(cc817cb175f282d).(&obj->usecxx . . $ nftnl_obj#use., data, sizeof(obj->usecxx . . $ nftnl_obj#use.)); |
| 133 | break; |
| 134 | case NFTNL_OBJ_HANDLEcxx . . $ NFTNL_OBJ_HANDLE.: |
| 135 | memcpycxx . . $ memcpy(cc817cb175f282d).(&obj->handlecxx . . $ nftnl_obj#handle., data, sizeof(obj->handlecxx . . $ nftnl_obj#handle.)); |
| 136 | break; |
| 137 | case NFTNL_OBJ_USERDATAcxx . . $ NFTNL_OBJ_USERDATA.: |
| 138 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_USERDATAcxx . . $ NFTNL_OBJ_USERDATA.)) |
| 139 | xfreecxx . . $ `include/utils.h:22:9`!(obj->user.data); |
| 140 | |
| 141 | obj->usercxx . . $ nftnl_obj#user..datacxx . . $ nftnl_obj#$anonymous_type_0#data. = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(data_len); |
| 142 | if (!obj->usercxx . . $ nftnl_obj#user..datacxx . . $ nftnl_obj#$anonymous_type_0#data.) |
| 143 | return -1; |
| 144 | memcpycxx . . $ memcpy(cc817cb175f282d).(obj->usercxx . . $ nftnl_obj#user..datacxx . . $ nftnl_obj#$anonymous_type_0#data., data, data_len); |
| 145 | obj->usercxx . . $ nftnl_obj#user..lencxx . . $ nftnl_obj#$anonymous_type_0#len. = data_len; |
| 146 | break; |
| 147 | default: |
| 148 | if (!obj->opscxx . . $ nftnl_obj#ops. || |
| 149 | attr < NFTNL_OBJ_BASEcxx . . $ NFTNL_OBJ_BASE. || |
| 150 | attr > obj->opscxx . . $ nftnl_obj#ops.->nftnl_max_attrcxx . . $ obj_ops#nftnl_max_attr. || |
| 151 | !obj->opscxx . . $ nftnl_obj#ops.->attr_policycxx . . $ obj_ops#attr_policy.) |
| 152 | return -1; |
| 153 | |
| 154 | if (obj->opscxx . . $ nftnl_obj#ops.->attr_policycxx . . $ obj_ops#attr_policy.[attr].maxlencxx . . $ attr_policy#maxlen. && |
| 155 | obj->opscxx . . $ nftnl_obj#ops.->attr_policycxx . . $ obj_ops#attr_policy.[attr].maxlencxx . . $ attr_policy#maxlen. < data_len) |
| 156 | return -1; |
| 157 | |
| 158 | if (obj->opscxx . . $ nftnl_obj#ops.->setcxx . . $ obj_ops#set.(obj, attr, data, data_len) < 0) |
| 159 | return -1; |
| 160 | } |
| 161 | obj->flagscxx . . $ nftnl_obj#flags. |= (1 << attr); |
| 162 | return 0; |
| 163 | } |
| 164 | |
| 165 | void nftnl_obj_setcxx . . $ nftnl_obj_set(dc419a005e113f05).(struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr, const void *data) __visiblecxx . . $ `include/utils.h:13:10`!; |
| 166 | void nftnl_obj_setcxx . . $ nftnl_obj_set(dc419a005e113f05).(struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr, const void *data) |
| 167 | { |
| 168 | nftnl_obj_set_datacxx . . $ nftnl_obj_set_data(96c901c785434bf1).(obj, attr, data, nftnl_obj_validatecxx . . $ nftnl_obj_validate.[attr]); |
| 169 | } |
| 170 | |
| 171 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_set_u8); |
| 172 | int nftnl_obj_set_u8cxx . . $ nftnl_obj_set_u8(f82a9d944c874116).(struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr, uint8_tcxx . . $ uint8_t# val) |
| 173 | { |
| 174 | return nftnl_obj_set_datacxx . . $ nftnl_obj_set_data(96c901c785434bf1).(obj, attr, &val, sizeof(uint8_tcxx . . $ uint8_t#)); |
| 175 | } |
| 176 | |
| 177 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_set_u16); |
| 178 | int nftnl_obj_set_u16cxx . . $ nftnl_obj_set_u16(849c4a3643d383e4).(struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr, uint16_tcxx . . $ uint16_t# val) |
| 179 | { |
| 180 | return nftnl_obj_set_datacxx . . $ nftnl_obj_set_data(96c901c785434bf1).(obj, attr, &val, sizeof(uint16_tcxx . . $ uint16_t#)); |
| 181 | } |
| 182 | |
| 183 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_set_u32); |
| 184 | int nftnl_obj_set_u32cxx . . $ nftnl_obj_set_u32(782bcbb8cc9433d5).(struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr, uint32_tcxx . . $ uint32_t# val) |
| 185 | { |
| 186 | return nftnl_obj_set_datacxx . . $ nftnl_obj_set_data(96c901c785434bf1).(obj, attr, &val, sizeof(uint32_tcxx . . $ uint32_t#)); |
| 187 | } |
| 188 | |
| 189 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_set_u64); |
| 190 | int nftnl_obj_set_u64cxx . . $ nftnl_obj_set_u64(66a4cee76fc09319).(struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr, uint64_tcxx . . $ uint64_t# val) |
| 191 | { |
| 192 | return nftnl_obj_set_datacxx . . $ nftnl_obj_set_data(96c901c785434bf1).(obj, attr, &val, sizeof(uint64_tcxx . . $ uint64_t#)); |
| 193 | } |
| 194 | |
| 195 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_set_str); |
| 196 | int nftnl_obj_set_strcxx . . $ nftnl_obj_set_str(54249b1a412eb67e).(struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr, const char *str) |
| 197 | { |
| 198 | return nftnl_obj_set_datacxx . . $ nftnl_obj_set_data(96c901c785434bf1).(obj, attr, str, strlencxx . . $ strlen(751346f8406fd082).(str) + 1); |
| 199 | } |
| 200 | |
| 201 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_get_data); |
| 202 | const void *nftnl_obj_get_datacxx . . $ nftnl_obj_get_data(d22e54b888e7c4b).(const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr, |
| 203 | uint32_tcxx . . $ uint32_t# *data_len) |
| 204 | { |
| 205 | if (!(obj->flagscxx . . $ nftnl_obj#flags. & (1 << attr))) |
| 206 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 207 | |
| 208 | switch(attr) { |
| 209 | case NFTNL_OBJ_TABLEcxx . . $ NFTNL_OBJ_TABLE.: |
| 210 | return obj->tablecxx . . $ nftnl_obj#table.; |
| 211 | case NFTNL_OBJ_NAMEcxx . . $ NFTNL_OBJ_NAME.: |
| 212 | return obj->namecxx . . $ nftnl_obj#name.; |
| 213 | case NFTNL_OBJ_TYPEcxx . . $ NFTNL_OBJ_TYPE.: |
| 214 | if (!obj->opscxx . . $ nftnl_obj#ops.) |
| 215 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 216 | |
| 217 | *data_len = sizeof(uint32_tcxx . . $ uint32_t#); |
| 218 | return &obj->opscxx . . $ nftnl_obj#ops.->typecxx . . $ obj_ops#type.; |
| 219 | case NFTNL_OBJ_FAMILYcxx . . $ NFTNL_OBJ_FAMILY.: |
| 220 | *data_len = sizeof(uint32_tcxx . . $ uint32_t#); |
| 221 | return &obj->familycxx . . $ nftnl_obj#family.; |
| 222 | case NFTNL_OBJ_USEcxx . . $ NFTNL_OBJ_USE.: |
| 223 | *data_len = sizeof(uint32_tcxx . . $ uint32_t#); |
| 224 | return &obj->usecxx . . $ nftnl_obj#use.; |
| 225 | case NFTNL_OBJ_HANDLEcxx . . $ NFTNL_OBJ_HANDLE.: |
| 226 | *data_len = sizeof(uint64_tcxx . . $ uint64_t#); |
| 227 | return &obj->handlecxx . . $ nftnl_obj#handle.; |
| 228 | case NFTNL_OBJ_USERDATAcxx . . $ NFTNL_OBJ_USERDATA.: |
| 229 | *data_len = obj->usercxx . . $ nftnl_obj#user..lencxx . . $ nftnl_obj#$anonymous_type_0#len.; |
| 230 | return obj->usercxx . . $ nftnl_obj#user..datacxx . . $ nftnl_obj#$anonymous_type_0#data.; |
| 231 | default: |
| 232 | if (obj->opscxx . . $ nftnl_obj#ops.) |
| 233 | return obj->opscxx . . $ nftnl_obj#ops.->getcxx . . $ obj_ops#get.(obj, attr, data_len); |
| 234 | break; |
| 235 | } |
| 236 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 237 | } |
| 238 | |
| 239 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_get); |
| 240 | const void *nftnl_obj_getcxx . . $ nftnl_obj_get(8b57169fcf0de42b).(const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr) |
| 241 | { |
| 242 | uint32_tcxx . . $ uint32_t# data_len; |
| 243 | return nftnl_obj_get_datacxx . . $ nftnl_obj_get_data(d22e54b888e7c4b).(obj, attr, &data_len); |
| 244 | } |
| 245 | |
| 246 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_get_u8); |
| 247 | uint8_tcxx . . $ uint8_t# nftnl_obj_get_u8cxx . . $ nftnl_obj_get_u8(d2a3126eee124178).(const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr) |
| 248 | { |
| 249 | const void *ret = nftnl_obj_getcxx . . $ nftnl_obj_get(8b57169fcf0de42b).(obj, attr); |
| 250 | return ret == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! ? 0 : *((uint8_tcxx . . $ uint8_t# *)ret); |
| 251 | } |
| 252 | |
| 253 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_get_u16); |
| 254 | uint16_tcxx . . $ uint16_t# nftnl_obj_get_u16cxx . . $ nftnl_obj_get_u16(1df02b57bca4082d).(const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr) |
| 255 | { |
| 256 | const void *ret = nftnl_obj_getcxx . . $ nftnl_obj_get(8b57169fcf0de42b).(obj, attr); |
| 257 | return ret == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! ? 0 : *((uint16_tcxx . . $ uint16_t# *)ret); |
| 258 | } |
| 259 | |
| 260 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_get_u32); |
| 261 | uint32_tcxx . . $ uint32_t# nftnl_obj_get_u32cxx . . $ nftnl_obj_get_u32(1fa04fdb908cd337).(const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr) |
| 262 | { |
| 263 | const void *ret = nftnl_obj_getcxx . . $ nftnl_obj_get(8b57169fcf0de42b).(obj, attr); |
| 264 | return ret == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! ? 0 : *((uint32_tcxx . . $ uint32_t# *)ret); |
| 265 | } |
| 266 | |
| 267 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_get_u64); |
| 268 | uint64_tcxx . . $ uint64_t# nftnl_obj_get_u64cxx . . $ nftnl_obj_get_u64(472fbe1ad2268e69).(const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr) |
| 269 | { |
| 270 | const void *ret = nftnl_obj_getcxx . . $ nftnl_obj_get(8b57169fcf0de42b).(obj, attr); |
| 271 | return ret == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! ? 0 : *((uint64_tcxx . . $ uint64_t# *)ret); |
| 272 | } |
| 273 | |
| 274 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_get_str); |
| 275 | const char *nftnl_obj_get_strcxx . . $ nftnl_obj_get_str(8a30698af24426b).(const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint16_tcxx . . $ uint16_t# attr) |
| 276 | { |
| 277 | return nftnl_obj_getcxx . . $ nftnl_obj_get(8b57169fcf0de42b).(obj, attr); |
| 278 | } |
| 279 | |
| 280 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_nlmsg_build_payload); |
| 281 | void nftnl_obj_nlmsg_build_payloadcxx . . $ nftnl_obj_nlmsg_build_payload(3650aba98805b449).(struct nlmsghdrcxx . . $ nlmsghdr# *nlh, |
| 282 | const struct nftnl_objcxx . . $ nftnl_obj# *obj) |
| 283 | { |
| 284 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_TABLEcxx . . $ NFTNL_OBJ_TABLE.)) |
| 285 | mnl_attr_put_strzcxx . . $ mnl_attr_put_strz(eb76286d4bfc1a8d).(nlh, NFTA_OBJ_TABLEcxx . . $ NFTA_OBJ_TABLE., obj->tablecxx . . $ nftnl_obj#table.); |
| 286 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_NAMEcxx . . $ NFTNL_OBJ_NAME.)) |
| 287 | mnl_attr_put_strzcxx . . $ mnl_attr_put_strz(eb76286d4bfc1a8d).(nlh, NFTA_OBJ_NAMEcxx . . $ NFTA_OBJ_NAME., obj->namecxx . . $ nftnl_obj#name.); |
| 288 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_TYPEcxx . . $ NFTNL_OBJ_TYPE.)) |
| 289 | mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_OBJ_TYPEcxx . . $ NFTA_OBJ_TYPE., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(obj->ops->type)); |
| 290 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_HANDLEcxx . . $ NFTNL_OBJ_HANDLE.)) |
| 291 | mnl_attr_put_u64cxx . . $ mnl_attr_put_u64(6d753f4d486e3a2f).(nlh, NFTA_OBJ_HANDLEcxx . . $ NFTA_OBJ_HANDLE., htobe64cxx . . $ `<external>/15855202785537844739/endian.h:49:11`!(obj->handle)); |
| 292 | if (obj->flagscxx . . $ nftnl_obj#flags. & (1 << NFTNL_OBJ_USERDATAcxx . . $ NFTNL_OBJ_USERDATA.)) |
| 293 | mnl_attr_putcxx . . $ mnl_attr_put(612d908c39ff741d).(nlh, NFTA_OBJ_USERDATAcxx . . $ NFTA_OBJ_USERDATA., obj->usercxx . . $ nftnl_obj#user..lencxx . . $ nftnl_obj#$anonymous_type_0#len., obj->usercxx . . $ nftnl_obj#user..datacxx . . $ nftnl_obj#$anonymous_type_0#data.); |
| 294 | if (obj->opscxx . . $ nftnl_obj#ops.) { |
| 295 | struct nlattrcxx . . $ nlattr# *nest = mnl_attr_nest_startcxx . . $ mnl_attr_nest_start(c8ed348a075426e7).(nlh, NFTA_OBJ_DATAcxx . . $ NFTA_OBJ_DATA.); |
| 296 | |
| 297 | obj->opscxx . . $ nftnl_obj#ops.->buildcxx . . $ obj_ops#build.(nlh, obj); |
| 298 | mnl_attr_nest_endcxx . . $ mnl_attr_nest_end(564f73625c62ba58).(nlh, nest); |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | static int nftnl_obj_parse_attr_cbcxx . . $ nftnl_obj_parse_attr_cb(de2ef18c48fd675c).(const struct nlattrcxx . . $ nlattr# *attr, void *data) |
| 303 | { |
| 304 | const struct nlattrcxx . . $ nlattr# **tb = data; |
| 305 | int type = mnl_attr_get_typecxx . . $ mnl_attr_get_type(1da47bcc4c4b975).(attr); |
| 306 | |
| 307 | if (mnl_attr_type_validcxx . . $ mnl_attr_type_valid(47df1cce1c7be855).(attr, NFTA_OBJ_MAXcxx . . $ `include/linux/netfilter/nf_tables.h:1695:9`!) < 0) |
| 308 | return MNL_CB_OKcxx . . $ `<external>/12386019527593959648/libmnl.h:174:9`!; |
| 309 | |
| 310 | switch(type) { |
| 311 | case NFTA_OBJ_TABLEcxx . . $ NFTA_OBJ_TABLE.: |
| 312 | case NFTA_OBJ_NAMEcxx . . $ NFTA_OBJ_NAME.: |
| 313 | if (mnl_attr_validatecxx . . $ mnl_attr_validate(e419697a5e1ae2b1).(attr, MNL_TYPE_STRINGcxx . . $ MNL_TYPE_STRING.) < 0) |
| 314 | abi_breakagecxx . . $ `include/utils.h:28:9`!(); |
| 315 | break; |
| 316 | case NFTA_OBJ_HANDLEcxx . . $ NFTA_OBJ_HANDLE.: |
| 317 | if (mnl_attr_validatecxx . . $ mnl_attr_validate(e419697a5e1ae2b1).(attr, MNL_TYPE_U64cxx . . $ MNL_TYPE_U64.) < 0) |
| 318 | abi_breakagecxx . . $ `include/utils.h:28:9`!(); |
| 319 | break; |
| 320 | case NFTA_OBJ_DATAcxx . . $ NFTA_OBJ_DATA.: |
| 321 | if (mnl_attr_validatecxx . . $ mnl_attr_validate(e419697a5e1ae2b1).(attr, MNL_TYPE_NESTEDcxx . . $ MNL_TYPE_NESTED.) < 0) |
| 322 | abi_breakagecxx . . $ `include/utils.h:28:9`!(); |
| 323 | break; |
| 324 | case NFTA_OBJ_USEcxx . . $ NFTA_OBJ_USE.: |
| 325 | if (mnl_attr_validatecxx . . $ mnl_attr_validate(e419697a5e1ae2b1).(attr, MNL_TYPE_U32cxx . . $ MNL_TYPE_U32.) < 0) |
| 326 | abi_breakagecxx . . $ `include/utils.h:28:9`!(); |
| 327 | break; |
| 328 | case NFTA_OBJ_USERDATAcxx . . $ NFTA_OBJ_USERDATA.: |
| 329 | if (mnl_attr_validatecxx . . $ mnl_attr_validate(e419697a5e1ae2b1).(attr, MNL_TYPE_BINARYcxx . . $ MNL_TYPE_BINARY.) < 0) |
| 330 | abi_breakagecxx . . $ `include/utils.h:28:9`!(); |
| 331 | break; |
| 332 | } |
| 333 | |
| 334 | tb[type] = attr; |
| 335 | return MNL_CB_OKcxx . . $ `<external>/12386019527593959648/libmnl.h:174:9`!; |
| 336 | } |
| 337 | |
| 338 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_nlmsg_parse); |
| 339 | int nftnl_obj_nlmsg_parsecxx . . $ nftnl_obj_nlmsg_parse(333bfc4cbaf93a88).(const struct nlmsghdrcxx . . $ nlmsghdr# *nlh, struct nftnl_objcxx . . $ nftnl_obj# *obj) |
| 340 | { |
| 341 | struct nfgenmsgcxx . . $ nfgenmsg# *nfg = mnl_nlmsg_get_payloadcxx . . $ mnl_nlmsg_get_payload(33f780b45aa89a18).(nlh); |
| 342 | struct nlattrcxx . . $ nlattr# *tb[NFTA_OBJ_MAXcxx . . $ `include/linux/netfilter/nf_tables.h:1695:9`! + 1] = {}; |
| 343 | int err; |
| 344 | |
| 345 | if (mnl_attr_parsecxx . . $ mnl_attr_parse(8b80a5a12c5e6592).(nlh, sizeof(*nfg), nftnl_obj_parse_attr_cbcxx . . $ nftnl_obj_parse_attr_cb(de2ef18c48fd675c)., tb) < 0) |
| 346 | return -1; |
| 347 | |
| 348 | if (nftnl_parse_str_attrcxx . . $ nftnl_parse_str_attr(2002c8408bf98f7f).(tb[NFTA_OBJ_TABLEcxx . . $ NFTA_OBJ_TABLE.], NFTNL_OBJ_TABLEcxx . . $ NFTNL_OBJ_TABLE., |
| 349 | &obj->tablecxx . . $ nftnl_obj#table., &obj->flagscxx . . $ nftnl_obj#flags.) < 0) |
| 350 | return -1; |
| 351 | if (nftnl_parse_str_attrcxx . . $ nftnl_parse_str_attr(2002c8408bf98f7f).(tb[NFTA_OBJ_NAMEcxx . . $ NFTA_OBJ_NAME.], NFTNL_OBJ_NAMEcxx . . $ NFTNL_OBJ_NAME., |
| 352 | &obj->namecxx . . $ nftnl_obj#name., &obj->flagscxx . . $ nftnl_obj#flags.) < 0) |
| 353 | return -1; |
| 354 | if (tb[NFTA_OBJ_TYPEcxx . . $ NFTA_OBJ_TYPE.]) { |
| 355 | uint32_tcxx . . $ uint32_t# type = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_OBJ_TYPE])); |
| 356 | |
| 357 | obj->opscxx . . $ nftnl_obj#ops. = nftnl_obj_ops_lookupcxx . . $ nftnl_obj_ops_lookup(2d1120a9637eed2e).(type); |
| 358 | if (obj->opscxx . . $ nftnl_obj#ops.) |
| 359 | obj->flagscxx . . $ nftnl_obj#flags. |= (1 << NFTNL_OBJ_TYPEcxx . . $ NFTNL_OBJ_TYPE.); |
| 360 | } |
| 361 | if (tb[NFTA_OBJ_DATAcxx . . $ NFTA_OBJ_DATA.]) { |
| 362 | if (obj->opscxx . . $ nftnl_obj#ops.) { |
| 363 | err = obj->opscxx . . $ nftnl_obj#ops.->parsecxx . . $ obj_ops#parse.(obj, tb[NFTA_OBJ_DATAcxx . . $ NFTA_OBJ_DATA.]); |
| 364 | if (err < 0) |
| 365 | return err; |
| 366 | } |
| 367 | } |
| 368 | if (tb[NFTA_OBJ_USEcxx . . $ NFTA_OBJ_USE.]) { |
| 369 | obj->usecxx . . $ nftnl_obj#use. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_OBJ_USE])); |
| 370 | obj->flagscxx . . $ nftnl_obj#flags. |= (1 << NFTNL_OBJ_USEcxx . . $ NFTNL_OBJ_USE.); |
| 371 | } |
| 372 | if (tb[NFTA_OBJ_HANDLEcxx . . $ NFTA_OBJ_HANDLE.]) { |
| 373 | obj->handlecxx . . $ nftnl_obj#handle. = be64tohcxx . . $ `<external>/15855202785537844739/endian.h:51:11`!(mnl_attr_get_u64(tb[NFTA_OBJ_HANDLE])); |
| 374 | obj->flagscxx . . $ nftnl_obj#flags. |= (1 << NFTNL_OBJ_HANDLEcxx . . $ NFTNL_OBJ_HANDLE.); |
| 375 | } |
| 376 | if (tb[NFTA_OBJ_USERDATAcxx . . $ NFTA_OBJ_USERDATA.]) { |
| 377 | nftnl_obj_set_datacxx . . $ nftnl_obj_set_data(96c901c785434bf1).(obj, NFTNL_OBJ_USERDATAcxx . . $ NFTNL_OBJ_USERDATA., |
| 378 | mnl_attr_get_payloadcxx . . $ mnl_attr_get_payload(cbbcdcb61d3bc7e8).(tb[NFTA_OBJ_USERDATAcxx . . $ NFTA_OBJ_USERDATA.]), |
| 379 | mnl_attr_get_payload_lencxx . . $ mnl_attr_get_payload_len(1da47bcc4c4b975).(tb[NFTA_OBJ_USERDATAcxx . . $ NFTA_OBJ_USERDATA.])); |
| 380 | } |
| 381 | |
| 382 | obj->familycxx . . $ nftnl_obj#family. = nfg->nfgen_familycxx . . $ nfgenmsg#nfgen_family.; |
| 383 | obj->flagscxx . . $ nftnl_obj#flags. |= (1 << NFTNL_OBJ_FAMILYcxx . . $ NFTNL_OBJ_FAMILY.); |
| 384 | |
| 385 | return 0; |
| 386 | } |
| 387 | |
| 388 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_parse); |
| 389 | int nftnl_obj_parsecxx . . $ nftnl_obj_parse(a3bbb3fae6666957).(struct nftnl_objcxx . . $ nftnl_obj# *obj, enum nftnl_parse_typecxx . . $ nftnl_parse_type# type, |
| 390 | const char *data, struct nftnl_parse_errcxx . . $ nftnl_parse_err# *err) |
| 391 | { |
| 392 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = EOPNOTSUPPcxx . . $ `<external>/17922322188510340118/errno.h:79:9`!; |
| 393 | |
| 394 | return -1; |
| 395 | } |
| 396 | |
| 397 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_parse_file); |
| 398 | int nftnl_obj_parse_filecxx . . $ nftnl_obj_parse_file(4dded418e831f721).(struct nftnl_objcxx . . $ nftnl_obj# *obj, enum nftnl_parse_typecxx . . $ nftnl_parse_type# type, |
| 399 | FILEcxx . . $ FILE# *fp, struct nftnl_parse_errcxx . . $ nftnl_parse_err# *err) |
| 400 | { |
| 401 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = EOPNOTSUPPcxx . . $ `<external>/17922322188510340118/errno.h:79:9`!; |
| 402 | |
| 403 | return -1; |
| 404 | } |
| 405 | |
| 406 | static int nftnl_obj_snprintf_dfltcxx . . $ nftnl_obj_snprintf_dflt(bdeae6f7167eb1fc).(char *buf, size_t remain, |
| 407 | const struct nftnl_objcxx . . $ nftnl_obj# *obj, |
| 408 | uint32_tcxx . . $ uint32_t# type, uint32_tcxx . . $ uint32_t# flags) |
| 409 | { |
| 410 | const char *name = obj->opscxx . . $ nftnl_obj#ops. ? obj->opscxx . . $ nftnl_obj#ops.->namecxx . . $ obj_ops#name. : "(unknown)"; |
| 411 | int ret, offset = 0; |
| 412 | |
| 413 | ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, remain, "table %s name %s use %u [ %s ", |
| 414 | obj->tablecxx . . $ nftnl_obj#table., obj->namecxx . . $ nftnl_obj#name., obj->usecxx . . $ nftnl_obj#use., name); |
| 415 | SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset); |
| 416 | |
| 417 | if (obj->opscxx . . $ nftnl_obj#ops.) { |
| 418 | ret = obj->opscxx . . $ nftnl_obj#ops.->outputcxx . . $ obj_ops#output.(buf + offset, remain, flags, obj); |
| 419 | SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset); |
| 420 | } |
| 421 | ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf + offset, remain, "]"); |
| 422 | SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset); |
| 423 | |
| 424 | return offset; |
| 425 | } |
| 426 | |
| 427 | static int nftnl_obj_cmd_snprintfcxx . . $ nftnl_obj_cmd_snprintf(4386f91df9b90094).(char *buf, size_t remain, |
| 428 | const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint32_tcxx . . $ uint32_t# cmd, |
| 429 | uint32_tcxx . . $ uint32_t# type, uint32_tcxx . . $ uint32_t# flags) |
| 430 | { |
| 431 | int ret, offset = 0; |
| 432 | |
| 433 | if (type != NFTNL_OUTPUT_DEFAULTcxx . . $ NFTNL_OUTPUT_DEFAULT.) |
| 434 | return -1; |
| 435 | |
| 436 | ret = nftnl_obj_snprintf_dfltcxx . . $ nftnl_obj_snprintf_dflt(bdeae6f7167eb1fc).(buf + offset, remain, obj, type, flags); |
| 437 | SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset); |
| 438 | return offset; |
| 439 | } |
| 440 | |
| 441 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_snprintf); |
| 442 | int nftnl_obj_snprintfcxx . . $ nftnl_obj_snprintf(bdeae6f7167eb1fc).(char *buf, size_t size, const struct nftnl_objcxx . . $ nftnl_obj# *obj, |
| 443 | uint32_tcxx . . $ uint32_t# type, uint32_tcxx . . $ uint32_t# flags) |
| 444 | { |
| 445 | if (size) |
| 446 | buf[0] = '\0'; |
| 447 | |
| 448 | return nftnl_obj_cmd_snprintfcxx . . $ nftnl_obj_cmd_snprintf(4386f91df9b90094).(buf, size, obj, nftnl_flag2cmdcxx . . $ nftnl_flag2cmd(73b61a9477c235b4).(flags), |
| 449 | type, flags); |
| 450 | } |
| 451 | |
| 452 | static int nftnl_obj_do_snprintfcxx . . $ nftnl_obj_do_snprintf(809f16203406eb30).(char *buf, size_t size, const void *obj, |
| 453 | uint32_tcxx . . $ uint32_t# cmd, uint32_tcxx . . $ uint32_t# type, uint32_tcxx . . $ uint32_t# flags) |
| 454 | { |
| 455 | return nftnl_obj_snprintfcxx . . $ nftnl_obj_snprintf(bdeae6f7167eb1fc).(buf, size, obj, type, flags); |
| 456 | } |
| 457 | |
| 458 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_fprintf); |
| 459 | int nftnl_obj_fprintfcxx . . $ nftnl_obj_fprintf(81bc1368f839ea7b).(FILEcxx . . $ FILE# *fp, const struct nftnl_objcxx . . $ nftnl_obj# *obj, uint32_tcxx . . $ uint32_t# type, |
| 460 | uint32_tcxx . . $ uint32_t# flags) |
| 461 | { |
| 462 | return nftnl_fprintfcxx . . $ nftnl_fprintf(959aea809fde9589).(fp, obj, NFTNL_CMD_UNSPECcxx . . $ NFTNL_CMD_UNSPEC., type, flags, |
| 463 | nftnl_obj_do_snprintfcxx . . $ nftnl_obj_do_snprintf(809f16203406eb30).); |
| 464 | } |
| 465 | |
| 466 | struct nftnl_obj_listcxx . . $ nftnl_obj_list# { |
| 467 | struct list_headcxx . . $ list_head# listcxx . . $ nftnl_obj_list#list.; |
| 468 | }; |
| 469 | |
| 470 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_alloc); |
| 471 | struct nftnl_obj_listcxx . . $ nftnl_obj_list# *nftnl_obj_list_alloccxx . . $ nftnl_obj_list_alloc(6ba9c81cdf4e9655).(void) |
| 472 | { |
| 473 | struct nftnl_obj_listcxx . . $ nftnl_obj_list# *list; |
| 474 | |
| 475 | list = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct nftnl_obj_listcxx . . $ nftnl_obj_list#)); |
| 476 | if (list == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) |
| 477 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 478 | |
| 479 | INIT_LIST_HEADcxx . . $ `include/linux_list.h:66:9`!(&list->list); |
| 480 | |
| 481 | return list; |
| 482 | } |
| 483 | |
| 484 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_free); |
| 485 | void nftnl_obj_list_freecxx . . $ nftnl_obj_list_free(3dffb4ac123c91c7).(struct nftnl_obj_listcxx . . $ nftnl_obj_list# *list) |
| 486 | { |
| 487 | struct nftnl_objcxx . . $ nftnl_obj# *r, *tmp; |
| 488 | |
| 489 | list_for_each_entry_safecxx . . $ `include/linux_list.h:435:9`!(r, tmp, &list->list, head) { |
| 490 | list_delcxx . . $ list_del(35ab6d74de6aba0a).(&r->headcxx . . $ nftnl_obj#head.); |
| 491 | nftnl_obj_freecxx . . $ nftnl_obj_free(43c97f053fbb99c6).(r); |
| 492 | } |
| 493 | xfreecxx . . $ `include/utils.h:22:9`!(list); |
| 494 | } |
| 495 | |
| 496 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_is_empty); |
| 497 | int nftnl_obj_list_is_emptycxx . . $ nftnl_obj_list_is_empty(10bd663a429d0a16).(struct nftnl_obj_listcxx . . $ nftnl_obj_list# *list) |
| 498 | { |
| 499 | return list_emptycxx . . $ list_empty(df525b6afabf24a2).(&list->listcxx . . $ nftnl_obj_list#list.); |
| 500 | } |
| 501 | |
| 502 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_add); |
| 503 | void nftnl_obj_list_addcxx . . $ nftnl_obj_list_add(f61d255567f86180).(struct nftnl_objcxx . . $ nftnl_obj# *r, struct nftnl_obj_listcxx . . $ nftnl_obj_list# *list) |
| 504 | { |
| 505 | list_addcxx . . $ list_add(6c3f7387ec573de3).(&r->headcxx . . $ nftnl_obj#head., &list->listcxx . . $ nftnl_obj_list#list.); |
| 506 | } |
| 507 | |
| 508 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_add_tail); |
| 509 | void nftnl_obj_list_add_tailcxx . . $ nftnl_obj_list_add_tail(f61d255567f86180).(struct nftnl_objcxx . . $ nftnl_obj# *r, |
| 510 | struct nftnl_obj_listcxx . . $ nftnl_obj_list# *list) |
| 511 | { |
| 512 | list_add_tailcxx . . $ list_add_tail(6c3f7387ec573de3).(&r->headcxx . . $ nftnl_obj#head., &list->listcxx . . $ nftnl_obj_list#list.); |
| 513 | } |
| 514 | |
| 515 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_del); |
| 516 | void nftnl_obj_list_delcxx . . $ nftnl_obj_list_del(ca7d0c7c65055b31).(struct nftnl_objcxx . . $ nftnl_obj# *t) |
| 517 | { |
| 518 | list_delcxx . . $ list_del(35ab6d74de6aba0a).(&t->headcxx . . $ nftnl_obj#head.); |
| 519 | } |
| 520 | |
| 521 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_foreach); |
| 522 | int nftnl_obj_list_foreachcxx . . $ nftnl_obj_list_foreach(fb345cf25a3bb07c).(struct nftnl_obj_listcxx . . $ nftnl_obj_list# *table_list, |
| 523 | int (*cb)(struct nftnl_objcxx . . $ nftnl_obj# *t, void *data), |
| 524 | void *data) |
| 525 | { |
| 526 | struct nftnl_objcxx . . $ nftnl_obj# *cur, *tmp; |
| 527 | int ret; |
| 528 | |
| 529 | list_for_each_entry_safecxx . . $ `include/linux_list.h:435:9`!(cur, tmp, &table_list->list, head) { |
| 530 | ret = cb(cur, data); |
| 531 | if (ret < 0) |
| 532 | return ret; |
| 533 | } |
| 534 | return 0; |
| 535 | } |
| 536 | |
| 537 | struct nftnl_obj_list_itercxx . . $ nftnl_obj_list_iter# { |
| 538 | struct nftnl_obj_listcxx . . $ nftnl_obj_list# *listcxx . . $ nftnl_obj_list_iter#list.; |
| 539 | struct nftnl_objcxx . . $ nftnl_obj# *curcxx . . $ nftnl_obj_list_iter#cur.; |
| 540 | }; |
| 541 | |
| 542 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_iter_create); |
| 543 | struct nftnl_obj_list_itercxx . . $ nftnl_obj_list_iter# * |
| 544 | nftnl_obj_list_iter_createcxx . . $ nftnl_obj_list_iter_create(228f1758a5369dd6).(struct nftnl_obj_listcxx . . $ nftnl_obj_list# *l) |
| 545 | { |
| 546 | struct nftnl_obj_list_itercxx . . $ nftnl_obj_list_iter# *iter; |
| 547 | |
| 548 | iter = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(struct nftnl_obj_list_itercxx . . $ nftnl_obj_list_iter#)); |
| 549 | if (iter == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) |
| 550 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 551 | |
| 552 | iter->listcxx . . $ nftnl_obj_list_iter#list. = l; |
| 553 | if (nftnl_obj_list_is_emptycxx . . $ nftnl_obj_list_is_empty(10bd663a429d0a16).(l)) |
| 554 | iter->curcxx . . $ nftnl_obj_list_iter#cur. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 555 | else |
| 556 | iter->curcxx . . $ nftnl_obj_list_iter#cur. = list_entrycxx . . $ `include/linux_list.h:334:9`!(l->list.next, struct nftnl_obj, head); |
| 557 | |
| 558 | return iter; |
| 559 | } |
| 560 | |
| 561 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_iter_next); |
| 562 | struct nftnl_objcxx . . $ nftnl_obj# *nftnl_obj_list_iter_nextcxx . . $ nftnl_obj_list_iter_next(401e26e9018051dd).(struct nftnl_obj_list_itercxx . . $ nftnl_obj_list_iter# *iter) |
| 563 | { |
| 564 | struct nftnl_objcxx . . $ nftnl_obj# *r = iter->curcxx . . $ nftnl_obj_list_iter#cur.; |
| 565 | |
| 566 | if (r == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) |
| 567 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 568 | |
| 569 | /* get next table, if any */ |
| 570 | iter->curcxx . . $ nftnl_obj_list_iter#cur. = list_entrycxx . . $ `include/linux_list.h:334:9`!(iter->cur->head.next, struct nftnl_obj, head); |
| 571 | if (&iter->curcxx . . $ nftnl_obj_list_iter#cur.->headcxx . . $ nftnl_obj#head. == iter->listcxx . . $ nftnl_obj_list_iter#list.->listcxx . . $ nftnl_obj_list#list..nextcxx . . $ list_head#next.) |
| 572 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 573 | |
| 574 | return r; |
| 575 | } |
| 576 | |
| 577 | EXPORT_SYMBOLcxx . . $ `include/utils.h:14:10`!(nftnl_obj_list_iter_destroy); |
| 578 | void nftnl_obj_list_iter_destroycxx . . $ nftnl_obj_list_iter_destroy(9b5aeb1178d7c00d).(struct nftnl_obj_list_itercxx . . $ nftnl_obj_list_iter# *iter) |
| 579 | { |
| 580 | xfreecxx . . $ `include/utils.h:22:9`!(iter); |
| 581 | } |