1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 #ifndef _IPCONNTRACK_NETLINK_H 3 #define _IPCONNTRACK_NETLINK_H 4 #include <linux/netfilter/nfnetlink.h> 5 6 enum cntl_msg_types { 7 IPCTNL_MSG_CT_NEW, 8 IPCTNL_MSG_CT_GET, 9 IPCTNL_MSG_CT_DELETE, 10 IPCTNL_MSG_CT_GET_CTRZERO, 11 IPCTNL_MSG_CT_GET_STATS_CPU, 12 IPCTNL_MSG_CT_GET_STATS, 13 IPCTNL_MSG_CT_GET_DYING, 14 IPCTNL_MSG_CT_GET_UNCONFIRMED, 15 16 IPCTNL_MSG_MAX 17 }; 18 19 enum ctnl_exp_msg_types { 20 IPCTNL_MSG_EXP_NEW, 21 IPCTNL_MSG_EXP_GET, 22 IPCTNL_MSG_EXP_DELETE, 23 IPCTNL_MSG_EXP_GET_STATS_CPU, 24 25 IPCTNL_MSG_EXP_MAX 26 }; 27 28 29 enum ctattr_type { 30 CTA_UNSPEC, 31 CTA_TUPLE_ORIG, 32 CTA_TUPLE_REPLY, 33 CTA_STATUS, 34 CTA_PROTOINFO, 35 CTA_HELP, 36 CTA_NAT_SRC, 37 #define CTA_NAT CTA_NAT_SRC /* backwards compatibility */ 38 CTA_TIMEOUT, 39 CTA_MARK, 40 CTA_COUNTERS_ORIG, 41 CTA_COUNTERS_REPLY, 42 CTA_USE, 43 CTA_ID, 44 CTA_NAT_DST, 45 CTA_TUPLE_MASTER, 46 CTA_SEQ_ADJ_ORIG, 47 CTA_NAT_SEQ_ADJ_ORIG = CTA_SEQ_ADJ_ORIG, 48 CTA_SEQ_ADJ_REPLY, 49 CTA_NAT_SEQ_ADJ_REPLY = CTA_SEQ_ADJ_REPLY, 50 CTA_SECMARK, /* obsolete */ 51 CTA_ZONE, 52 CTA_SECCTX, 53 CTA_TIMESTAMP, 54 CTA_MARK_MASK, 55 CTA_LABELS, 56 CTA_LABELS_MASK, 57 CTA_SYNPROXY, 58 CTA_FILTER, 59 CTA_STATUS_MASK, 60 __CTA_MAX 61 }; 62 #define CTA_MAX (__CTA_MAX - 1) 63 64 enum ctattr_tuple { 65 CTA_TUPLE_UNSPEC, 66 CTA_TUPLE_IP, 67 CTA_TUPLE_PROTO, 68 CTA_TUPLE_ZONE, 69 __CTA_TUPLE_MAX 70 }; 71 #define CTA_TUPLE_MAX (__CTA_TUPLE_MAX - 1) 72 73 enum ctattr_ip { 74 CTA_IP_UNSPEC, 75 CTA_IP_V4_SRC, 76 CTA_IP_V4_DST, 77 CTA_IP_V6_SRC, 78 CTA_IP_V6_DST, 79 __CTA_IP_MAX 80 }; 81 #define CTA_IP_MAX (__CTA_IP_MAX - 1) 82 83 enum ctattr_l4proto { 84 CTA_PROTO_UNSPEC, 85 CTA_PROTO_NUM, 86 CTA_PROTO_SRC_PORT, 87 CTA_PROTO_DST_PORT, 88 CTA_PROTO_ICMP_ID, 89 CTA_PROTO_ICMP_TYPE, 90 CTA_PROTO_ICMP_CODE, 91 CTA_PROTO_ICMPV6_ID, 92 CTA_PROTO_ICMPV6_TYPE, 93 CTA_PROTO_ICMPV6_CODE, 94 __CTA_PROTO_MAX 95 }; 96 #define CTA_PROTO_MAX (__CTA_PROTO_MAX - 1) 97 98 enum ctattr_protoinfo { 99 CTA_PROTOINFO_UNSPEC, 100 CTA_PROTOINFO_TCP, 101 CTA_PROTOINFO_DCCP, 102 CTA_PROTOINFO_SCTP, 103 __CTA_PROTOINFO_MAX 104 }; 105 #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) 106 107 enum ctattr_protoinfo_tcp { 108 CTA_PROTOINFO_TCP_UNSPEC, 109 CTA_PROTOINFO_TCP_STATE, 110 CTA_PROTOINFO_TCP_WSCALE_ORIGINAL, 111 CTA_PROTOINFO_TCP_WSCALE_REPLY, 112 CTA_PROTOINFO_TCP_FLAGS_ORIGINAL, 113 CTA_PROTOINFO_TCP_FLAGS_REPLY, 114 __CTA_PROTOINFO_TCP_MAX 115 }; 116 #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) 117 118 enum ctattr_protoinfo_dccp { 119 CTA_PROTOINFO_DCCP_UNSPEC, 120 CTA_PROTOINFO_DCCP_STATE, 121 CTA_PROTOINFO_DCCP_ROLE, 122 CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ, 123 CTA_PROTOINFO_DCCP_PAD, 124 __CTA_PROTOINFO_DCCP_MAX, 125 }; 126 #define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) 127 128 enum ctattr_protoinfo_sctp { 129 CTA_PROTOINFO_SCTP_UNSPEC, 130 CTA_PROTOINFO_SCTP_STATE, 131 CTA_PROTOINFO_SCTP_VTAG_ORIGINAL, 132 CTA_PROTOINFO_SCTP_VTAG_REPLY, 133 __CTA_PROTOINFO_SCTP_MAX 134 }; 135 #define CTA_PROTOINFO_SCTP_MAX (__CTA_PROTOINFO_SCTP_MAX - 1) 136 137 enum ctattr_counters { 138 CTA_COUNTERS_UNSPEC, 139 CTA_COUNTERS_PACKETS, /* 64bit counters */ 140 CTA_COUNTERS_BYTES, /* 64bit counters */ 141 CTA_COUNTERS32_PACKETS, /* old 32bit counters, unused */ 142 CTA_COUNTERS32_BYTES, /* old 32bit counters, unused */ 143 CTA_COUNTERS_PAD, 144 __CTA_COUNTERS_MAX 145 }; 146 #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) 147 148 enum ctattr_tstamp { 149 CTA_TIMESTAMP_UNSPEC, 150 CTA_TIMESTAMP_START, 151 CTA_TIMESTAMP_STOP, 152 CTA_TIMESTAMP_PAD, 153 __CTA_TIMESTAMP_MAX 154 }; 155 #define CTA_TIMESTAMP_MAX (__CTA_TIMESTAMP_MAX - 1) 156 157 enum ctattr_nat { 158 CTA_NAT_UNSPEC, 159 CTA_NAT_V4_MINIP, 160 #define CTA_NAT_MINIP CTA_NAT_V4_MINIP 161 CTA_NAT_V4_MAXIP, 162 #define CTA_NAT_MAXIP CTA_NAT_V4_MAXIP 163 CTA_NAT_PROTO, 164 CTA_NAT_V6_MINIP, 165 CTA_NAT_V6_MAXIP, 166 __CTA_NAT_MAX 167 }; 168 #define CTA_NAT_MAX (__CTA_NAT_MAX - 1) 169 170 enum ctattr_protonat { 171 CTA_PROTONAT_UNSPEC, 172 CTA_PROTONAT_PORT_MIN, 173 CTA_PROTONAT_PORT_MAX, 174 __CTA_PROTONAT_MAX 175 }; 176 #define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1) 177 178 enum ctattr_seqadj { 179 CTA_SEQADJ_UNSPEC, 180 CTA_SEQADJ_CORRECTION_POS, 181 CTA_SEQADJ_OFFSET_BEFORE, 182 CTA_SEQADJ_OFFSET_AFTER, 183 __CTA_SEQADJ_MAX 184 }; 185 #define CTA_SEQADJ_MAX (__CTA_SEQADJ_MAX - 1) 186 187 enum ctattr_natseq { 188 CTA_NAT_SEQ_UNSPEC, 189 CTA_NAT_SEQ_CORRECTION_POS, 190 CTA_NAT_SEQ_OFFSET_BEFORE, 191 CTA_NAT_SEQ_OFFSET_AFTER, 192 __CTA_NAT_SEQ_MAX 193 }; 194 #define CTA_NAT_SEQ_MAX (__CTA_NAT_SEQ_MAX - 1) 195 196 enum ctattr_synproxy { 197 CTA_SYNPROXY_UNSPEC, 198 CTA_SYNPROXY_ISN, 199 CTA_SYNPROXY_ITS, 200 CTA_SYNPROXY_TSOFF, 201 __CTA_SYNPROXY_MAX, 202 }; 203 #define CTA_SYNPROXY_MAX (__CTA_SYNPROXY_MAX - 1) 204 205 enum ctattr_expect { 206 CTA_EXPECT_UNSPEC, 207 CTA_EXPECT_MASTER, 208 CTA_EXPECT_TUPLE, 209 CTA_EXPECT_MASK, 210 CTA_EXPECT_TIMEOUT, 211 CTA_EXPECT_ID, 212 CTA_EXPECT_HELP_NAME, 213 CTA_EXPECT_ZONE, 214 CTA_EXPECT_FLAGS, 215 CTA_EXPECT_CLASS, 216 CTA_EXPECT_NAT, 217 CTA_EXPECT_FN, 218 __CTA_EXPECT_MAX 219 }; 220 #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) 221 222 enum ctattr_expect_nat { 223 CTA_EXPECT_NAT_UNSPEC, 224 CTA_EXPECT_NAT_DIR, 225 CTA_EXPECT_NAT_TUPLE, 226 __CTA_EXPECT_NAT_MAX 227 }; 228 #define CTA_EXPECT_NAT_MAX (__CTA_EXPECT_NAT_MAX - 1) 229 230 enum ctattr_help { 231 CTA_HELP_UNSPEC, 232 CTA_HELP_NAME, 233 CTA_HELP_INFO, 234 __CTA_HELP_MAX 235 }; 236 #define CTA_HELP_MAX (__CTA_HELP_MAX - 1) 237 238 enum ctattr_secctx { 239 CTA_SECCTX_UNSPEC, 240 CTA_SECCTX_NAME, 241 __CTA_SECCTX_MAX 242 }; 243 #define CTA_SECCTX_MAX (__CTA_SECCTX_MAX - 1) 244 245 enum ctattr_stats_cpu { 246 CTA_STATS_UNSPEC, 247 CTA_STATS_SEARCHED, /* no longer used */ 248 CTA_STATS_FOUND, 249 CTA_STATS_NEW, /* no longer used */ 250 CTA_STATS_INVALID, 251 CTA_STATS_IGNORE, /* no longer used */ 252 CTA_STATS_DELETE, /* no longer used */ 253 CTA_STATS_DELETE_LIST, /* no longer used */ 254 CTA_STATS_INSERT, 255 CTA_STATS_INSERT_FAILED, 256 CTA_STATS_DROP, 257 CTA_STATS_EARLY_DROP, 258 CTA_STATS_ERROR, 259 CTA_STATS_SEARCH_RESTART, 260 CTA_STATS_CLASH_RESOLVE, 261 CTA_STATS_CHAIN_TOOLONG, 262 __CTA_STATS_MAX, 263 }; 264 #define CTA_STATS_MAX (__CTA_STATS_MAX - 1) 265 266 enum ctattr_stats_global { 267 CTA_STATS_GLOBAL_UNSPEC, 268 CTA_STATS_GLOBAL_ENTRIES, 269 CTA_STATS_GLOBAL_MAX_ENTRIES, 270 __CTA_STATS_GLOBAL_MAX, 271 }; 272 #define CTA_STATS_GLOBAL_MAX (__CTA_STATS_GLOBAL_MAX - 1) 273 274 enum ctattr_expect_stats { 275 CTA_STATS_EXP_UNSPEC, 276 CTA_STATS_EXP_NEW, 277 CTA_STATS_EXP_CREATE, 278 CTA_STATS_EXP_DELETE, 279 __CTA_STATS_EXP_MAX, 280 }; 281 #define CTA_STATS_EXP_MAX (__CTA_STATS_EXP_MAX - 1) 282 283 enum ctattr_filter { 284 CTA_FILTER_UNSPEC, 285 CTA_FILTER_ORIG_FLAGS, 286 CTA_FILTER_REPLY_FLAGS, 287 __CTA_FILTER_MAX 288 }; 289 #define CTA_FILTER_MAX (__CTA_FILTER_MAX - 1) 290 291 #endif /* _IPCONNTRACK_NETLINK_H */ 292