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_MAX 59 }; 60 #define CTA_MAX (__CTA_MAX - 1) 61 62 enum ctattr_tuple { 63 CTA_TUPLE_UNSPEC, 64 CTA_TUPLE_IP, 65 CTA_TUPLE_PROTO, 66 CTA_TUPLE_ZONE, 67 __CTA_TUPLE_MAX 68 }; 69 #define CTA_TUPLE_MAX (__CTA_TUPLE_MAX - 1) 70 71 enum ctattr_ip { 72 CTA_IP_UNSPEC, 73 CTA_IP_V4_SRC, 74 CTA_IP_V4_DST, 75 CTA_IP_V6_SRC, 76 CTA_IP_V6_DST, 77 __CTA_IP_MAX 78 }; 79 #define CTA_IP_MAX (__CTA_IP_MAX - 1) 80 81 enum ctattr_l4proto { 82 CTA_PROTO_UNSPEC, 83 CTA_PROTO_NUM, 84 CTA_PROTO_SRC_PORT, 85 CTA_PROTO_DST_PORT, 86 CTA_PROTO_ICMP_ID, 87 CTA_PROTO_ICMP_TYPE, 88 CTA_PROTO_ICMP_CODE, 89 CTA_PROTO_ICMPV6_ID, 90 CTA_PROTO_ICMPV6_TYPE, 91 CTA_PROTO_ICMPV6_CODE, 92 __CTA_PROTO_MAX 93 }; 94 #define CTA_PROTO_MAX (__CTA_PROTO_MAX - 1) 95 96 enum ctattr_protoinfo { 97 CTA_PROTOINFO_UNSPEC, 98 CTA_PROTOINFO_TCP, 99 CTA_PROTOINFO_DCCP, 100 CTA_PROTOINFO_SCTP, 101 __CTA_PROTOINFO_MAX 102 }; 103 #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) 104 105 enum ctattr_protoinfo_tcp { 106 CTA_PROTOINFO_TCP_UNSPEC, 107 CTA_PROTOINFO_TCP_STATE, 108 CTA_PROTOINFO_TCP_WSCALE_ORIGINAL, 109 CTA_PROTOINFO_TCP_WSCALE_REPLY, 110 CTA_PROTOINFO_TCP_FLAGS_ORIGINAL, 111 CTA_PROTOINFO_TCP_FLAGS_REPLY, 112 __CTA_PROTOINFO_TCP_MAX 113 }; 114 #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) 115 116 enum ctattr_protoinfo_dccp { 117 CTA_PROTOINFO_DCCP_UNSPEC, 118 CTA_PROTOINFO_DCCP_STATE, 119 CTA_PROTOINFO_DCCP_ROLE, 120 CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ, 121 CTA_PROTOINFO_DCCP_PAD, 122 __CTA_PROTOINFO_DCCP_MAX, 123 }; 124 #define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) 125 126 enum ctattr_protoinfo_sctp { 127 CTA_PROTOINFO_SCTP_UNSPEC, 128 CTA_PROTOINFO_SCTP_STATE, 129 CTA_PROTOINFO_SCTP_VTAG_ORIGINAL, 130 CTA_PROTOINFO_SCTP_VTAG_REPLY, 131 __CTA_PROTOINFO_SCTP_MAX 132 }; 133 #define CTA_PROTOINFO_SCTP_MAX (__CTA_PROTOINFO_SCTP_MAX - 1) 134 135 enum ctattr_counters { 136 CTA_COUNTERS_UNSPEC, 137 CTA_COUNTERS_PACKETS, /* 64bit counters */ 138 CTA_COUNTERS_BYTES, /* 64bit counters */ 139 CTA_COUNTERS32_PACKETS, /* old 32bit counters, unused */ 140 CTA_COUNTERS32_BYTES, /* old 32bit counters, unused */ 141 CTA_COUNTERS_PAD, 142 __CTA_COUNTERS_MAX 143 }; 144 #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) 145 146 enum ctattr_tstamp { 147 CTA_TIMESTAMP_UNSPEC, 148 CTA_TIMESTAMP_START, 149 CTA_TIMESTAMP_STOP, 150 CTA_TIMESTAMP_PAD, 151 __CTA_TIMESTAMP_MAX 152 }; 153 #define CTA_TIMESTAMP_MAX (__CTA_TIMESTAMP_MAX - 1) 154 155 enum ctattr_nat { 156 CTA_NAT_UNSPEC, 157 CTA_NAT_V4_MINIP, 158 #define CTA_NAT_MINIP CTA_NAT_V4_MINIP 159 CTA_NAT_V4_MAXIP, 160 #define CTA_NAT_MAXIP CTA_NAT_V4_MAXIP 161 CTA_NAT_PROTO, 162 CTA_NAT_V6_MINIP, 163 CTA_NAT_V6_MAXIP, 164 __CTA_NAT_MAX 165 }; 166 #define CTA_NAT_MAX (__CTA_NAT_MAX - 1) 167 168 enum ctattr_protonat { 169 CTA_PROTONAT_UNSPEC, 170 CTA_PROTONAT_PORT_MIN, 171 CTA_PROTONAT_PORT_MAX, 172 __CTA_PROTONAT_MAX 173 }; 174 #define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1) 175 176 enum ctattr_seqadj { 177 CTA_SEQADJ_UNSPEC, 178 CTA_SEQADJ_CORRECTION_POS, 179 CTA_SEQADJ_OFFSET_BEFORE, 180 CTA_SEQADJ_OFFSET_AFTER, 181 __CTA_SEQADJ_MAX 182 }; 183 #define CTA_SEQADJ_MAX (__CTA_SEQADJ_MAX - 1) 184 185 enum ctattr_natseq { 186 CTA_NAT_SEQ_UNSPEC, 187 CTA_NAT_SEQ_CORRECTION_POS, 188 CTA_NAT_SEQ_OFFSET_BEFORE, 189 CTA_NAT_SEQ_OFFSET_AFTER, 190 __CTA_NAT_SEQ_MAX 191 }; 192 #define CTA_NAT_SEQ_MAX (__CTA_NAT_SEQ_MAX - 1) 193 194 enum ctattr_synproxy { 195 CTA_SYNPROXY_UNSPEC, 196 CTA_SYNPROXY_ISN, 197 CTA_SYNPROXY_ITS, 198 CTA_SYNPROXY_TSOFF, 199 __CTA_SYNPROXY_MAX, 200 }; 201 #define CTA_SYNPROXY_MAX (__CTA_SYNPROXY_MAX - 1) 202 203 enum ctattr_expect { 204 CTA_EXPECT_UNSPEC, 205 CTA_EXPECT_MASTER, 206 CTA_EXPECT_TUPLE, 207 CTA_EXPECT_MASK, 208 CTA_EXPECT_TIMEOUT, 209 CTA_EXPECT_ID, 210 CTA_EXPECT_HELP_NAME, 211 CTA_EXPECT_ZONE, 212 CTA_EXPECT_FLAGS, 213 CTA_EXPECT_CLASS, 214 CTA_EXPECT_NAT, 215 CTA_EXPECT_FN, 216 __CTA_EXPECT_MAX 217 }; 218 #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) 219 220 enum ctattr_expect_nat { 221 CTA_EXPECT_NAT_UNSPEC, 222 CTA_EXPECT_NAT_DIR, 223 CTA_EXPECT_NAT_TUPLE, 224 __CTA_EXPECT_NAT_MAX 225 }; 226 #define CTA_EXPECT_NAT_MAX (__CTA_EXPECT_NAT_MAX - 1) 227 228 enum ctattr_help { 229 CTA_HELP_UNSPEC, 230 CTA_HELP_NAME, 231 CTA_HELP_INFO, 232 __CTA_HELP_MAX 233 }; 234 #define CTA_HELP_MAX (__CTA_HELP_MAX - 1) 235 236 enum ctattr_secctx { 237 CTA_SECCTX_UNSPEC, 238 CTA_SECCTX_NAME, 239 __CTA_SECCTX_MAX 240 }; 241 #define CTA_SECCTX_MAX (__CTA_SECCTX_MAX - 1) 242 243 enum ctattr_stats_cpu { 244 CTA_STATS_UNSPEC, 245 CTA_STATS_SEARCHED, /* no longer used */ 246 CTA_STATS_FOUND, 247 CTA_STATS_NEW, /* no longer used */ 248 CTA_STATS_INVALID, 249 CTA_STATS_IGNORE, 250 CTA_STATS_DELETE, /* no longer used */ 251 CTA_STATS_DELETE_LIST, /* no longer used */ 252 CTA_STATS_INSERT, 253 CTA_STATS_INSERT_FAILED, 254 CTA_STATS_DROP, 255 CTA_STATS_EARLY_DROP, 256 CTA_STATS_ERROR, 257 CTA_STATS_SEARCH_RESTART, 258 __CTA_STATS_MAX, 259 }; 260 #define CTA_STATS_MAX (__CTA_STATS_MAX - 1) 261 262 enum ctattr_stats_global { 263 CTA_STATS_GLOBAL_UNSPEC, 264 CTA_STATS_GLOBAL_ENTRIES, 265 CTA_STATS_GLOBAL_MAX_ENTRIES, 266 __CTA_STATS_GLOBAL_MAX, 267 }; 268 #define CTA_STATS_GLOBAL_MAX (__CTA_STATS_GLOBAL_MAX - 1) 269 270 enum ctattr_expect_stats { 271 CTA_STATS_EXP_UNSPEC, 272 CTA_STATS_EXP_NEW, 273 CTA_STATS_EXP_CREATE, 274 CTA_STATS_EXP_DELETE, 275 __CTA_STATS_EXP_MAX, 276 }; 277 #define CTA_STATS_EXP_MAX (__CTA_STATS_EXP_MAX - 1) 278 279 #endif /* _IPCONNTRACK_NETLINK_H */ 280