12cef6288SAlexander V. Chernikov /*- 22cef6288SAlexander V. Chernikov * SPDX-License-Identifier: BSD-2-Clause 32cef6288SAlexander V. Chernikov * 42cef6288SAlexander V. Chernikov * Copyright (c) 2023 Alexander V. Chernikov <melifaro@FreeBSD.org> 52cef6288SAlexander V. Chernikov * Copyright (c) 2023 Rubicon Communications, LLC (Netgate) 62cef6288SAlexander V. Chernikov * 72cef6288SAlexander V. Chernikov * Redistribution and use in source and binary forms, with or without 82cef6288SAlexander V. Chernikov * modification, are permitted provided that the following conditions 92cef6288SAlexander V. Chernikov * are met: 102cef6288SAlexander V. Chernikov * 1. Redistributions of source code must retain the above copyright 112cef6288SAlexander V. Chernikov * notice, this list of conditions and the following disclaimer. 122cef6288SAlexander V. Chernikov * 2. Redistributions in binary form must reproduce the above copyright 132cef6288SAlexander V. Chernikov * notice, this list of conditions and the following disclaimer in the 142cef6288SAlexander V. Chernikov * documentation and/or other materials provided with the distribution. 152cef6288SAlexander V. Chernikov * 162cef6288SAlexander V. Chernikov * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 172cef6288SAlexander V. Chernikov * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 182cef6288SAlexander V. Chernikov * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 192cef6288SAlexander V. Chernikov * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 202cef6288SAlexander V. Chernikov * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 212cef6288SAlexander V. Chernikov * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 222cef6288SAlexander V. Chernikov * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 232cef6288SAlexander V. Chernikov * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 242cef6288SAlexander V. Chernikov * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 252cef6288SAlexander V. Chernikov * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 262cef6288SAlexander V. Chernikov * SUCH DAMAGE. 272cef6288SAlexander V. Chernikov * 282cef6288SAlexander V. Chernikov */ 292cef6288SAlexander V. Chernikov 302cef6288SAlexander V. Chernikov #ifndef _NETPFIL_PF_PF_NL_H_ 312cef6288SAlexander V. Chernikov #define _NETPFIL_PF_PF_NL_H_ 322cef6288SAlexander V. Chernikov 332cef6288SAlexander V. Chernikov /* Genetlink family */ 342cef6288SAlexander V. Chernikov #define PFNL_FAMILY_NAME "pfctl" 352cef6288SAlexander V. Chernikov 362cef6288SAlexander V. Chernikov /* available commands */ 372cef6288SAlexander V. Chernikov enum { 382cef6288SAlexander V. Chernikov PFNL_CMD_UNSPEC = 0, 392cef6288SAlexander V. Chernikov PFNL_CMD_GETSTATES = 1, 40a7191e5dSKristof Provost PFNL_CMD_GETCREATORS = 2, 4181647eb6SKristof Provost PFNL_CMD_START = 3, 4281647eb6SKristof Provost PFNL_CMD_STOP = 4, 43ffbf2595SKristof Provost PFNL_CMD_ADDRULE = 5, 4444f323ecSKristof Provost PFNL_CMD_GETRULES = 6, 45777a4702SKristof Provost PFNL_CMD_GETRULE = 7, 46706d465dSKristof Provost PFNL_CMD_CLRSTATES = 8, 47706d465dSKristof Provost PFNL_CMD_KILLSTATES = 9, 48470a2b33SKristof Provost PFNL_CMD_SET_STATUSIF = 10, 495824df8dSKristof Provost PFNL_CMD_GET_STATUS = 11, 509dbbe68bSKristof Provost PFNL_CMD_CLEAR_STATUS = 12, 5171d3c704SKristof Provost PFNL_CMD_NATLOOK = 13, 52c36c90a2SKristof Provost PFNL_CMD_SET_DEBUG = 14, 5330bad751SKristof Provost PFNL_CMD_SET_TIMEOUT = 15, 5430bad751SKristof Provost PFNL_CMD_GET_TIMEOUT = 16, 55d9ab8999SKristof Provost PFNL_CMD_SET_LIMIT = 17, 56d9ab8999SKristof Provost PFNL_CMD_GET_LIMIT = 18, 57ba2a9207SKristof Provost PFNL_CMD_BEGIN_ADDRS = 19, 58d909f06bSKristof Provost PFNL_CMD_ADD_ADDR = 20, 59644b7b5aSKristof Provost PFNL_CMD_GET_ADDRS = 21, 609ae91f59SKristof Provost PFNL_CMD_GET_ADDR = 22, 6125e0f8f9SKristof Provost PFNL_CMD_GET_RULESETS = 23, 6248f5bf8bSKristof Provost PFNL_CMD_GET_RULESET = 24, 639c125336SKristof Provost PFNL_CMD_GET_SRCNODES = 25, 64441d4894SKristof Provost PFNL_CMD_CLEAR_TABLES = 26, 65*84a80eaeSKristof Provost PFNL_CMD_ADD_TABLE = 27, 662cef6288SAlexander V. Chernikov __PFNL_CMD_MAX, 672cef6288SAlexander V. Chernikov }; 682cef6288SAlexander V. Chernikov #define PFNL_CMD_MAX (__PFNL_CMD_MAX -1) 692cef6288SAlexander V. Chernikov 702cef6288SAlexander V. Chernikov enum pfstate_key_type_t { 712cef6288SAlexander V. Chernikov PF_STK_UNSPEC, 722cef6288SAlexander V. Chernikov PF_STK_ADDR0 = 1, /* ip */ 732cef6288SAlexander V. Chernikov PF_STK_ADDR1 = 2, /* ip */ 742cef6288SAlexander V. Chernikov PF_STK_PORT0 = 3, /* u16 */ 752cef6288SAlexander V. Chernikov PF_STK_PORT1 = 4, /* u16 */ 76ebe11b46SKristof Provost PF_STK_AF = 5, /* u8 */ 77ebe11b46SKristof Provost PF_STK_PROTO = 6, /* u16 */ 782cef6288SAlexander V. Chernikov }; 792cef6288SAlexander V. Chernikov 802cef6288SAlexander V. Chernikov enum pfstate_peer_type_t { 812cef6288SAlexander V. Chernikov PF_STP_UNSPEC, 822cef6288SAlexander V. Chernikov PF_STP_PFSS_FLAGS = 1, /* u16 */ 832cef6288SAlexander V. Chernikov PF_STP_PFSS_TTL = 2, /* u8 */ 842cef6288SAlexander V. Chernikov PF_STP_SCRUB_FLAG = 3, /* u8 */ 852cef6288SAlexander V. Chernikov PF_STP_PFSS_TS_MOD = 4, /* u32 */ 862cef6288SAlexander V. Chernikov PF_STP_SEQLO = 5, /* u32 */ 872cef6288SAlexander V. Chernikov PF_STP_SEQHI = 6, /* u32 */ 882cef6288SAlexander V. Chernikov PF_STP_SEQDIFF = 7, /* u32 */ 892cef6288SAlexander V. Chernikov PF_STP_MAX_WIN = 8, /* u16 */ 902cef6288SAlexander V. Chernikov PF_STP_MSS = 9, /* u16 */ 912cef6288SAlexander V. Chernikov PF_STP_STATE = 10, /* u8 */ 922cef6288SAlexander V. Chernikov PF_STP_WSCALE = 11, /* u8 */ 932cef6288SAlexander V. Chernikov }; 942cef6288SAlexander V. Chernikov 952cef6288SAlexander V. Chernikov enum pfstate_type_t { 962cef6288SAlexander V. Chernikov PF_ST_UNSPEC, 972cef6288SAlexander V. Chernikov PF_ST_ID = 1, /* u32, state id */ 982cef6288SAlexander V. Chernikov PF_ST_CREATORID = 2, /* u32, */ 992cef6288SAlexander V. Chernikov PF_ST_IFNAME = 3, /* string */ 1002cef6288SAlexander V. Chernikov PF_ST_ORIG_IFNAME = 4, /* string */ 1012cef6288SAlexander V. Chernikov PF_ST_KEY_WIRE = 5, /* nested, pfstate_key_type_t */ 1022cef6288SAlexander V. Chernikov PF_ST_KEY_STACK = 6, /* nested, pfstate_key_type_t */ 1032cef6288SAlexander V. Chernikov PF_ST_PEER_SRC = 7, /* nested, pfstate_peer_type_t*/ 1042cef6288SAlexander V. Chernikov PF_ST_PEER_DST = 8, /* nested, pfstate_peer_type_t */ 1052cef6288SAlexander V. Chernikov PF_ST_RT_ADDR = 9, /* ip */ 1062cef6288SAlexander V. Chernikov PF_ST_RULE = 10, /* u32 */ 1072cef6288SAlexander V. Chernikov PF_ST_ANCHOR = 11, /* u32 */ 1082cef6288SAlexander V. Chernikov PF_ST_NAT_RULE = 12, /* u32 */ 1092cef6288SAlexander V. Chernikov PF_ST_CREATION = 13, /* u32 */ 1102cef6288SAlexander V. Chernikov PF_ST_EXPIRE = 14, /* u32 */ 1112cef6288SAlexander V. Chernikov PF_ST_PACKETS0 = 15, /* u64 */ 1122cef6288SAlexander V. Chernikov PF_ST_PACKETS1 = 16, /* u64 */ 1132cef6288SAlexander V. Chernikov PF_ST_BYTES0 = 17, /* u64 */ 1142cef6288SAlexander V. Chernikov PF_ST_BYTES1 = 18, /* u64 */ 1152cef6288SAlexander V. Chernikov PF_ST_AF = 19, /* u8 */ 1162cef6288SAlexander V. Chernikov PF_ST_PROTO = 21, /* u8 */ 1172cef6288SAlexander V. Chernikov PF_ST_DIRECTION = 22, /* u8 */ 1182cef6288SAlexander V. Chernikov PF_ST_LOG = 23, /* u8 */ 1192cef6288SAlexander V. Chernikov PF_ST_TIMEOUT = 24, /* u8 */ 1202cef6288SAlexander V. Chernikov PF_ST_STATE_FLAGS = 25, /* u8 */ 1212cef6288SAlexander V. Chernikov PF_ST_SYNC_FLAGS = 26, /* u8 */ 1222cef6288SAlexander V. Chernikov PF_ST_UPDATES = 27, /* u8 */ 1232cef6288SAlexander V. Chernikov PF_ST_VERSION = 28, /* u64 */ 124044eef6aSKristof Provost PF_ST_FILTER_ADDR = 29, /* in6_addr */ 125044eef6aSKristof Provost PF_ST_FILTER_MASK = 30, /* in6_addr */ 126881bf881SKristof Provost PF_ST_RTABLEID = 31, /* i32 */ 127881bf881SKristof Provost PF_ST_MIN_TTL = 32, /* u8 */ 128881bf881SKristof Provost PF_ST_MAX_MSS = 33, /* u16 */ 129881bf881SKristof Provost PF_ST_DNPIPE = 34, /* u16 */ 130881bf881SKristof Provost PF_ST_DNRPIPE = 35, /* u16 */ 131881bf881SKristof Provost PF_ST_RT = 36, /* u8 */ 132881bf881SKristof Provost PF_ST_RT_IFNAME = 37, /* string */ 1332cef6288SAlexander V. Chernikov }; 1342cef6288SAlexander V. Chernikov 135ffbf2595SKristof Provost enum pf_addr_type_t { 136ffbf2595SKristof Provost PF_AT_UNSPEC, 137ffbf2595SKristof Provost PF_AT_ADDR = 1, /* in6_addr */ 138ffbf2595SKristof Provost PF_AT_MASK = 2, /* in6_addr */ 139ffbf2595SKristof Provost PF_AT_IFNAME = 3, /* string */ 140ffbf2595SKristof Provost PF_AT_TABLENAME = 4, /* string */ 141ffbf2595SKristof Provost PF_AT_TYPE = 5, /* u8 */ 142ffbf2595SKristof Provost PF_AT_IFLAGS = 6, /* u8 */ 143777a4702SKristof Provost PF_AT_TBLCNT = 7, /* u32 */ 144777a4702SKristof Provost PF_AT_DYNCNT = 8, /* u32 */ 145ffbf2595SKristof Provost }; 146ffbf2595SKristof Provost 147ffbf2595SKristof Provost enum pfrule_addr_type_t { 148ffbf2595SKristof Provost PF_RAT_UNSPEC, 149ffbf2595SKristof Provost PF_RAT_ADDR = 1, /* nested, pf_addr_type_t */ 150ffbf2595SKristof Provost PF_RAT_SRC_PORT = 2, /* u16 */ 151ffbf2595SKristof Provost PF_RAT_DST_PORT = 3, /* u16 */ 152ffbf2595SKristof Provost PF_RAT_NEG = 4, /* u8 */ 153ffbf2595SKristof Provost PF_RAT_OP = 5, /* u8 */ 154ffbf2595SKristof Provost }; 155ffbf2595SKristof Provost 156ffbf2595SKristof Provost enum pf_labels_type_t { 157ffbf2595SKristof Provost PF_LT_UNSPEC, 158ffbf2595SKristof Provost PF_LT_LABEL = 1, /* string */ 159ffbf2595SKristof Provost }; 160ffbf2595SKristof Provost 161ffbf2595SKristof Provost enum pf_mape_portset_type_t 162ffbf2595SKristof Provost { 163ffbf2595SKristof Provost PF_MET_UNSPEC, 164ffbf2595SKristof Provost PF_MET_OFFSET = 1, /* u8 */ 165ffbf2595SKristof Provost PF_MET_PSID_LEN = 2, /* u8 */ 166ffbf2595SKristof Provost PF_MET_PSID = 3, /* u16 */ 167ffbf2595SKristof Provost }; 168ffbf2595SKristof Provost 169ffbf2595SKristof Provost enum pf_rpool_type_t 170ffbf2595SKristof Provost { 171ffbf2595SKristof Provost PF_PT_UNSPEC, 172ffbf2595SKristof Provost PF_PT_KEY = 1, /* bytes, sizeof(struct pf_poolhashkey) */ 173ffbf2595SKristof Provost PF_PT_COUNTER = 2, /* in6_addr */ 174ffbf2595SKristof Provost PF_PT_TBLIDX = 3, /* u32 */ 175ffbf2595SKristof Provost PF_PT_PROXY_SRC_PORT = 4, /* u16 */ 176ffbf2595SKristof Provost PF_PT_PROXY_DST_PORT = 5, /* u16 */ 177ffbf2595SKristof Provost PF_PT_OPTS = 6, /* u8 */ 178ffbf2595SKristof Provost PF_PT_MAPE = 7, /* nested, pf_mape_portset_type_t */ 179ffbf2595SKristof Provost }; 180ffbf2595SKristof Provost 181ffbf2595SKristof Provost enum pf_timeout_type_t { 182ffbf2595SKristof Provost PF_TT_UNSPEC, 183ffbf2595SKristof Provost PF_TT_TIMEOUT = 1, /* u32 */ 184ffbf2595SKristof Provost }; 185ffbf2595SKristof Provost 186ffbf2595SKristof Provost enum pf_rule_uid_type_t { 187ffbf2595SKristof Provost PF_RUT_UNSPEC, 188ffbf2595SKristof Provost PF_RUT_UID_LOW = 1, /* u32 */ 189ffbf2595SKristof Provost PF_RUT_UID_HIGH = 2, /* u32 */ 190ffbf2595SKristof Provost PF_RUT_OP = 3, /* u8 */ 191ffbf2595SKristof Provost }; 192ffbf2595SKristof Provost 193ffbf2595SKristof Provost enum pf_rule_type_t { 194ffbf2595SKristof Provost PF_RT_UNSPEC, 195ffbf2595SKristof Provost PF_RT_SRC = 1, /* nested, pf_rule_addr_type_t */ 196ffbf2595SKristof Provost PF_RT_DST = 2, /* nested, pf_rule_addr_type_t */ 197ffbf2595SKristof Provost PF_RT_RIDENTIFIER = 3, /* u32 */ 198ffbf2595SKristof Provost PF_RT_LABELS = 4, /* nested, pf_labels_type_t */ 199ffbf2595SKristof Provost PF_RT_IFNAME = 5, /* string */ 200ffbf2595SKristof Provost PF_RT_QNAME = 6, /* string */ 201ffbf2595SKristof Provost PF_RT_PQNAME = 7, /* string */ 202ffbf2595SKristof Provost PF_RT_TAGNAME = 8, /* string */ 203ffbf2595SKristof Provost PF_RT_MATCH_TAGNAME = 9, /* string */ 204ffbf2595SKristof Provost PF_RT_OVERLOAD_TBLNAME = 10, /* string */ 205e11dacbfSKristof Provost PF_RT_RPOOL_RDR = 11, /* nested, pf_rpool_type_t */ 206ffbf2595SKristof Provost PF_RT_OS_FINGERPRINT = 12, /* u32 */ 207ffbf2595SKristof Provost PF_RT_RTABLEID = 13, /* u32 */ 208ffbf2595SKristof Provost PF_RT_TIMEOUT = 14, /* nested, pf_timeout_type_t */ 209ffbf2595SKristof Provost PF_RT_MAX_STATES = 15, /* u32 */ 210ffbf2595SKristof Provost PF_RT_MAX_SRC_NODES = 16, /* u32 */ 211ffbf2595SKristof Provost PF_RT_MAX_SRC_STATES = 17, /* u32 */ 212ffbf2595SKristof Provost PF_RT_MAX_SRC_CONN_RATE_LIMIT = 18, /* u32 */ 213ffbf2595SKristof Provost PF_RT_MAX_SRC_CONN_RATE_SECS = 19, /* u32 */ 214ffbf2595SKristof Provost PF_RT_DNPIPE = 20, /* u16 */ 215ffbf2595SKristof Provost PF_RT_DNRPIPE = 21, /* u16 */ 216ffbf2595SKristof Provost PF_RT_DNFLAGS = 22, /* u32 */ 217ffbf2595SKristof Provost PF_RT_NR = 23, /* u32 */ 218ffbf2595SKristof Provost PF_RT_PROB = 24, /* u32 */ 219ffbf2595SKristof Provost PF_RT_CUID = 25, /* u32 */ 220ffbf2595SKristof Provost PF_RT_CPID = 26, /* u32 */ 221ffbf2595SKristof Provost PF_RT_RETURN_ICMP = 27, /* u16 */ 222ffbf2595SKristof Provost PF_RT_RETURN_ICMP6 = 28, /* u16 */ 223ffbf2595SKristof Provost PF_RT_MAX_MSS = 29, /* u16 */ 224ffbf2595SKristof Provost PF_RT_SCRUB_FLAGS = 30, /* u16 */ 225ffbf2595SKristof Provost PF_RT_UID = 31, /* nested, pf_rule_uid_type_t */ 226ffbf2595SKristof Provost PF_RT_GID = 32, /* nested, pf_rule_uid_type_t */ 227ffbf2595SKristof Provost PF_RT_RULE_FLAG = 33, /* u32 */ 228ffbf2595SKristof Provost PF_RT_ACTION = 34, /* u8 */ 229ffbf2595SKristof Provost PF_RT_DIRECTION = 35, /* u8 */ 230ffbf2595SKristof Provost PF_RT_LOG = 36, /* u8 */ 231ffbf2595SKristof Provost PF_RT_LOGIF = 37, /* u8 */ 232ffbf2595SKristof Provost PF_RT_QUICK = 38, /* u8 */ 233ffbf2595SKristof Provost PF_RT_IF_NOT = 39, /* u8 */ 234ffbf2595SKristof Provost PF_RT_MATCH_TAG_NOT = 40, /* u8 */ 235ffbf2595SKristof Provost PF_RT_NATPASS = 41, /* u8 */ 236ffbf2595SKristof Provost PF_RT_KEEP_STATE = 42, /* u8 */ 237ffbf2595SKristof Provost PF_RT_AF = 43, /* u8 */ 238ffbf2595SKristof Provost PF_RT_PROTO = 44, /* u8 */ 239ffbf2595SKristof Provost PF_RT_TYPE = 45, /* u8 */ 240ffbf2595SKristof Provost PF_RT_CODE = 46, /* u8 */ 241ffbf2595SKristof Provost PF_RT_FLAGS = 47, /* u8 */ 242ffbf2595SKristof Provost PF_RT_FLAGSET = 48, /* u8 */ 243ffbf2595SKristof Provost PF_RT_MIN_TTL = 49, /* u8 */ 244ffbf2595SKristof Provost PF_RT_ALLOW_OPTS = 50, /* u8 */ 245ffbf2595SKristof Provost PF_RT_RT = 51, /* u8 */ 246ffbf2595SKristof Provost PF_RT_RETURN_TTL = 52, /* u8 */ 247ffbf2595SKristof Provost PF_RT_TOS = 53, /* u8 */ 248ffbf2595SKristof Provost PF_RT_SET_TOS = 54, /* u8 */ 249ffbf2595SKristof Provost PF_RT_ANCHOR_RELATIVE = 55, /* u8 */ 250ffbf2595SKristof Provost PF_RT_ANCHOR_WILDCARD = 56, /* u8 */ 251ffbf2595SKristof Provost PF_RT_FLUSH = 57, /* u8 */ 252ffbf2595SKristof Provost PF_RT_PRIO = 58, /* u8 */ 253ffbf2595SKristof Provost PF_RT_SET_PRIO = 59, /* u8 */ 254ffbf2595SKristof Provost PF_RT_SET_PRIO_REPLY = 60, /* u8 */ 255ffbf2595SKristof Provost PF_RT_DIVERT_ADDRESS = 61, /* in6_addr */ 256ffbf2595SKristof Provost PF_RT_DIVERT_PORT = 62, /* u16 */ 257777a4702SKristof Provost PF_RT_PACKETS_IN = 63, /* u64 */ 258777a4702SKristof Provost PF_RT_PACKETS_OUT = 64, /* u64 */ 259777a4702SKristof Provost PF_RT_BYTES_IN = 65, /* u64 */ 260777a4702SKristof Provost PF_RT_BYTES_OUT = 66, /* u64 */ 261777a4702SKristof Provost PF_RT_EVALUATIONS = 67, /* u64 */ 262777a4702SKristof Provost PF_RT_TIMESTAMP = 68, /* u64 */ 263777a4702SKristof Provost PF_RT_STATES_CUR = 69, /* u64 */ 264777a4702SKristof Provost PF_RT_STATES_TOTAL = 70, /* u64 */ 265777a4702SKristof Provost PF_RT_SRC_NODES = 71, /* u64 */ 266777a4702SKristof Provost PF_RT_ANCHOR_CALL = 72, /* string */ 2672339ead6SKristof Provost PF_RT_RCV_IFNAME = 73, /* string */ 2687fe42038SKajetan Staszkiewicz PF_RT_MAX_SRC_CONN = 74, /* u32 */ 269e11dacbfSKristof Provost PF_RT_RPOOL_NAT = 75, /* nested, pf_rpool_type_t */ 270fcdb520cSKristof Provost PF_RT_NAF = 76, /* u8 */ 2710972294eSKristof Provost PF_RT_RPOOL_RT = 77, /* nested, pf_rpool_type_t */ 272ffbf2595SKristof Provost }; 273ffbf2595SKristof Provost 274ffbf2595SKristof Provost enum pf_addrule_type_t { 275ffbf2595SKristof Provost PF_ART_UNSPEC, 276ffbf2595SKristof Provost PF_ART_TICKET = 1, /* u32 */ 277ffbf2595SKristof Provost PF_ART_POOL_TICKET = 2, /* u32 */ 278ffbf2595SKristof Provost PF_ART_ANCHOR = 3, /* string */ 279ffbf2595SKristof Provost PF_ART_ANCHOR_CALL = 4, /* string */ 280ffbf2595SKristof Provost PF_ART_RULE = 5, /* nested, pfrule_type_t */ 281ffbf2595SKristof Provost }; 282ffbf2595SKristof Provost 28344f323ecSKristof Provost enum pf_getrules_type_t { 28444f323ecSKristof Provost PF_GR_UNSPEC, 28544f323ecSKristof Provost PF_GR_ANCHOR = 1, /* string */ 28644f323ecSKristof Provost PF_GR_ACTION = 2, /* u8 */ 28744f323ecSKristof Provost PF_GR_NR = 3, /* u32 */ 28844f323ecSKristof Provost PF_GR_TICKET = 4, /* u32 */ 289777a4702SKristof Provost PF_GR_CLEAR = 5, /* u8 */ 29044f323ecSKristof Provost }; 29144f323ecSKristof Provost 292706d465dSKristof Provost enum pf_clear_states_type_t { 293706d465dSKristof Provost PF_CS_UNSPEC, 294706d465dSKristof Provost PF_CS_CMP_ID = 1, /* u64 */ 295706d465dSKristof Provost PF_CS_CMP_CREATORID = 2, /* u32 */ 296706d465dSKristof Provost PF_CS_CMP_DIR = 3, /* u8 */ 297706d465dSKristof Provost PF_CS_AF = 4, /* u8 */ 298706d465dSKristof Provost PF_CS_PROTO = 5, /* u8 */ 299706d465dSKristof Provost PF_CS_SRC = 6, /* nested, pf_addr_wrap */ 300706d465dSKristof Provost PF_CS_DST = 7, /* nested, pf_addr_wrap */ 301706d465dSKristof Provost PF_CS_RT_ADDR = 8, /* nested, pf_addr_wrap */ 302706d465dSKristof Provost PF_CS_IFNAME = 9, /* string */ 303706d465dSKristof Provost PF_CS_LABEL = 10, /* string */ 304706d465dSKristof Provost PF_CS_KILL_MATCH = 11, /* bool */ 305706d465dSKristof Provost PF_CS_NAT = 12, /* bool */ 306706d465dSKristof Provost PF_CS_KILLED = 13, /* u32 */ 307706d465dSKristof Provost }; 308706d465dSKristof Provost 309470a2b33SKristof Provost enum pf_set_statusif_types_t { 310470a2b33SKristof Provost PF_SS_UNSPEC, 311470a2b33SKristof Provost PF_SS_IFNAME = 1, /* string */ 312470a2b33SKristof Provost }; 3135824df8dSKristof Provost 3145824df8dSKristof Provost enum pf_counter_types_t { 3155824df8dSKristof Provost PF_C_UNSPEC, 3165824df8dSKristof Provost PF_C_COUNTER = 1, /* u64 */ 3175824df8dSKristof Provost PF_C_NAME = 2, /* string */ 3185824df8dSKristof Provost PF_C_ID = 3, /* u32 */ 3195824df8dSKristof Provost }; 3205824df8dSKristof Provost 3215824df8dSKristof Provost enum pf_get_status_types_t { 3225824df8dSKristof Provost PF_GS_UNSPEC, 3235824df8dSKristof Provost PF_GS_IFNAME = 1, /* string */ 3245824df8dSKristof Provost PF_GS_RUNNING = 2, /* bool */ 3255824df8dSKristof Provost PF_GS_SINCE = 3, /* u32 */ 3265824df8dSKristof Provost PF_GS_DEBUG = 4, /* u32 */ 3275824df8dSKristof Provost PF_GS_HOSTID = 5, /* u32 */ 3285824df8dSKristof Provost PF_GS_STATES = 6, /* u32 */ 3295824df8dSKristof Provost PF_GS_SRC_NODES = 7, /* u32 */ 3305824df8dSKristof Provost PF_GS_REASSEMBLE = 8, /* u32 */ 3315824df8dSKristof Provost PF_GS_SYNCOOKIES_ACTIVE = 9, /* bool */ 3325824df8dSKristof Provost PF_GS_COUNTERS = 10, /* nested, */ 3335824df8dSKristof Provost PF_GS_LCOUNTERS = 11, /* nested, */ 3345824df8dSKristof Provost PF_GS_FCOUNTERS = 12, /* nested, */ 3355824df8dSKristof Provost PF_GS_SCOUNTERS = 13, /* nested, */ 3365824df8dSKristof Provost PF_GS_CHKSUM = 14, /* byte array */ 3375824df8dSKristof Provost PF_GS_PCOUNTERS = 15, /* u64 array */ 3385824df8dSKristof Provost PF_GS_BCOUNTERS = 16, /* u64 array */ 3395824df8dSKristof Provost }; 3405824df8dSKristof Provost 34171d3c704SKristof Provost enum pf_natlook_types_t { 34271d3c704SKristof Provost PF_NL_UNSPEC, 34371d3c704SKristof Provost PF_NL_AF = 1, /* u8 */ 34471d3c704SKristof Provost PF_NL_DIRECTION = 2, /* u8 */ 34571d3c704SKristof Provost PF_NL_PROTO = 3, /* u8 */ 34671d3c704SKristof Provost PF_NL_SRC_ADDR = 4, /* in6_addr */ 34771d3c704SKristof Provost PF_NL_DST_ADDR = 5, /* in6_addr */ 34871d3c704SKristof Provost PF_NL_SRC_PORT = 6, /* u16 */ 34971d3c704SKristof Provost PF_NL_DST_PORT = 7, /* u16 */ 35071d3c704SKristof Provost }; 35171d3c704SKristof Provost 352c36c90a2SKristof Provost enum pf_set_debug_types_t { 353c36c90a2SKristof Provost PF_SD_UNSPEC, 354c36c90a2SKristof Provost PF_SD_LEVEL = 1, /* u32 */ 355c36c90a2SKristof Provost }; 356c36c90a2SKristof Provost 35730bad751SKristof Provost enum pf_timeout_types_t { 35830bad751SKristof Provost PF_TO_UNSPEC, 35930bad751SKristof Provost PF_TO_TIMEOUT = 1, /* u32 */ 36030bad751SKristof Provost PF_TO_SECONDS = 2, /* u32 */ 36130bad751SKristof Provost }; 36230bad751SKristof Provost 363d9ab8999SKristof Provost enum pf_limit_types_t { 364d9ab8999SKristof Provost PF_LI_UNSPEC, 365d9ab8999SKristof Provost PF_LI_INDEX = 1, /* u32 */ 366d9ab8999SKristof Provost PF_LI_LIMIT = 2, /* u32 */ 367d9ab8999SKristof Provost }; 368d9ab8999SKristof Provost 369ba2a9207SKristof Provost enum pf_begin_addrs_types_t { 370ba2a9207SKristof Provost PF_BA_UNSPEC, 371ba2a9207SKristof Provost PF_BA_TICKET = 1, /* u32 */ 372ba2a9207SKristof Provost }; 373ba2a9207SKristof Provost 374d909f06bSKristof Provost enum pf_pool_addr_types_t { 375d909f06bSKristof Provost PF_PA_UNSPEC, 376d909f06bSKristof Provost PF_PA_ADDR = 1, /* nested, pf_addr_wrap */ 377d909f06bSKristof Provost PF_PA_IFNAME = 2, /* string */ 378d909f06bSKristof Provost }; 379d909f06bSKristof Provost 380d909f06bSKristof Provost enum pf_add_addr_types_t { 381d909f06bSKristof Provost PF_AA_UNSPEC, 382d909f06bSKristof Provost PF_AA_ACTION = 1, /* u32 */ 383d909f06bSKristof Provost PF_AA_TICKET = 2, /* u32 */ 384d909f06bSKristof Provost PF_AA_NR = 3, /* u32 */ 385d909f06bSKristof Provost PF_AA_R_NUM = 4, /* u32 */ 386d909f06bSKristof Provost PF_AA_R_ACTION = 5, /* u8 */ 387d909f06bSKristof Provost PF_AA_R_LAST = 6, /* u8 */ 388d909f06bSKristof Provost PF_AA_AF = 7, /* u8 */ 389d909f06bSKristof Provost PF_AA_ANCHOR = 8, /* string */ 390d909f06bSKristof Provost PF_AA_ADDR = 9, /* nested, pf_pooladdr */ 391e11dacbfSKristof Provost PF_AA_WHICH = 10, /* u32 */ 392d909f06bSKristof Provost }; 393d909f06bSKristof Provost 39425e0f8f9SKristof Provost enum pf_get_rulesets_types_t { 39525e0f8f9SKristof Provost PF_RS_UNSPEC, 39625e0f8f9SKristof Provost PF_RS_PATH = 1, /* string */ 39725e0f8f9SKristof Provost PF_RS_NR = 2, /* u32 */ 39848f5bf8bSKristof Provost PF_RS_NAME = 3, /* string */ 39925e0f8f9SKristof Provost }; 40025e0f8f9SKristof Provost 4019c125336SKristof Provost enum pf_threshold_types_t { 4029c125336SKristof Provost PF_TH_UNSPEC, 4039c125336SKristof Provost PF_TH_LIMIT = 1, /* u32 */ 4049c125336SKristof Provost PF_TH_SECONDS = 2, /* u32 */ 4059c125336SKristof Provost PF_TH_COUNT = 3, /* u32 */ 4069c125336SKristof Provost PF_TH_LAST = 4, /* u32 */ 4079c125336SKristof Provost }; 4089c125336SKristof Provost 4099c125336SKristof Provost enum pf_srcnodes_types_t { 4109c125336SKristof Provost PF_SN_UNSPEC, 4119c125336SKristof Provost PF_SN_ADDR = 1, /* nested, pf_addr */ 4129c125336SKristof Provost PF_SN_RADDR = 2, /* nested, pf_addr */ 4139c125336SKristof Provost PF_SN_RULE_NR = 3, /* u32 */ 4149c125336SKristof Provost PF_SN_BYTES_IN = 4, /* u64 */ 4159c125336SKristof Provost PF_SN_BYTES_OUT = 5, /* u64 */ 4169c125336SKristof Provost PF_SN_PACKETS_IN = 6, /* u64 */ 4179c125336SKristof Provost PF_SN_PACKETS_OUT = 7, /* u64 */ 4189c125336SKristof Provost PF_SN_STATES = 8, /* u32 */ 4199c125336SKristof Provost PF_SN_CONNECTIONS = 9, /* u32 */ 4209c125336SKristof Provost PF_SN_AF = 10, /* u8 */ 4219c125336SKristof Provost PF_SN_RULE_TYPE = 11, /* u8 */ 4229c125336SKristof Provost PF_SN_CREATION = 12, /* u64 */ 4239c125336SKristof Provost PF_SN_EXPIRE = 13, /* u64 */ 4249c125336SKristof Provost PF_SN_CONNECTION_RATE = 14, /* nested, pf_threshold */ 425aa69fdf1SKristof Provost PF_SN_NAF = 15, /* u8 */ 4269c125336SKristof Provost }; 4279c125336SKristof Provost 428441d4894SKristof Provost enum pf_tables_t { 429441d4894SKristof Provost PF_T_UNSPEC, 430441d4894SKristof Provost PF_T_ANCHOR = 1, /* string */ 431441d4894SKristof Provost PF_T_NAME = 2, /* string */ 432441d4894SKristof Provost PF_T_TABLE_FLAGS = 3, /* u32 */ 433441d4894SKristof Provost PF_T_FLAGS = 4, /* u32 */ 434441d4894SKristof Provost PF_T_NBR_DELETED = 5, /* u32 */ 435*84a80eaeSKristof Provost PF_T_NBR_ADDED = 6, /* u32 */ 436441d4894SKristof Provost }; 437441d4894SKristof Provost 4382cef6288SAlexander V. Chernikov #ifdef _KERNEL 4392cef6288SAlexander V. Chernikov 4402cef6288SAlexander V. Chernikov void pf_nl_register(void); 4412cef6288SAlexander V. Chernikov void pf_nl_unregister(void); 4422cef6288SAlexander V. Chernikov 4432cef6288SAlexander V. Chernikov #endif 4442cef6288SAlexander V. Chernikov 4452cef6288SAlexander V. Chernikov #endif 446