#include <stdint.h>
#include <sys/types.h>
|
enum | nethdr_type {
NET_T_STATE_CT_NEW = 0,
NET_T_STATE_CT_UPD,
NET_T_STATE_CT_DEL,
NET_T_STATE_EXP_NEW = 3,
NET_T_STATE_EXP_UPD,
NET_T_STATE_EXP_DEL,
NET_T_STATE_MAX = NET_T_STATE_EXP_DEL,
NET_T_CTL = 10
} |
|
enum | {
NET_F_UNUSED = (1 << 0),
NET_F_RESYNC = (1 << 1),
NET_F_NACK = (1 << 2),
NET_F_ACK = (1 << 3),
NET_F_ALIVE = (1 << 4),
NET_F_HELLO = (1 << 5),
NET_F_HELLO_BACK = (1 << 6)
} |
|
enum | {
MSG_DATA,
MSG_CTL,
MSG_DROP,
MSG_BAD
} |
|
enum | {
SEQ_UNKNOWN,
SEQ_UNSET,
SEQ_IN_SYNC,
SEQ_AFTER,
SEQ_BEFORE
} |
|
enum | nta_attr {
NTA_IPV4 = 0,
NTA_IPV6,
NTA_L4PROTO,
NTA_PORT,
NTA_TCP_STATE = 4,
NTA_STATUS,
NTA_TIMEOUT,
NTA_MARK,
NTA_MASTER_IPV4 = 8,
NTA_MASTER_IPV6,
NTA_MASTER_L4PROTO,
NTA_MASTER_PORT,
NTA_SNAT_IPV4 = 12,
NTA_DNAT_IPV4,
NTA_SPAT_PORT,
NTA_DPAT_PORT,
NTA_NAT_SEQ_ADJ = 16,
NTA_SCTP_STATE,
NTA_SCTP_VTAG_ORIG,
NTA_SCTP_VTAG_REPL,
NTA_DCCP_STATE = 20,
NTA_DCCP_ROLE,
NTA_ICMP_TYPE,
NTA_ICMP_CODE,
NTA_ICMP_ID,
NTA_TCP_WSCALE_ORIG,
NTA_TCP_WSCALE_REPL,
NTA_HELPER_NAME,
NTA_LABELS,
NTA_MAX
} |
|
enum | nta_exp_attr {
NTA_EXP_MASTER_IPV4 = 0,
NTA_EXP_MASTER_IPV6,
NTA_EXP_MASTER_L4PROTO,
NTA_EXP_MASTER_PORT,
NTA_EXP_EXPECT_IPV4 = 4,
NTA_EXP_EXPECT_IPV6,
NTA_EXP_EXPECT_L4PROTO,
NTA_EXP_EXPECT_PORT,
NTA_EXP_MASK_IPV4 = 8,
NTA_EXP_MASK_IPV6,
NTA_EXP_MASK_L4PROTO,
NTA_EXP_MASK_PORT,
NTA_EXP_TIMEOUT,
NTA_EXP_FLAGS,
NTA_EXP_CLASS,
NTA_EXP_NAT_IPV4,
NTA_EXP_NAT_PORT,
NTA_EXP_NAT_L4PROTO,
NTA_EXP_NAT_DIR,
NTA_EXP_HELPER_NAME,
NTA_EXP_FN,
NTA_EXP_MAX
} |
|
#define after |
( |
|
seq2, |
|
|
|
seq1 |
|
) |
| before(seq1, seq2) |
#define ATTR_NETWORK2HOST |
( |
|
x | ) |
|
Value:({ \
x->nta_len = ntohs(x->nta_len); \
x->nta_attr = ntohs(x->nta_attr); \
})
Referenced by msg2ct(), and msg2exp().
#define BUILD_NETMSG_FROM_CT |
( |
|
ct, |
|
|
|
query |
|
) |
| |
Value:({ \
static
char __net[4096];
\
__hdr; \
})
void ct2msg(const struct nf_conntrack *ct, struct nethdr *n)
Definition: build.c:216
#define NETHDR_SIZ
Definition: network.h:26
#define HDR_HOST2NETWORK(x)
Definition: network.h:146
struct nf_conntrack * ct
Definition: conntrack.c:72
void nethdr_set(struct nethdr *net, int type)
Definition: network.c:53
struct nlmsghdr struct nlmsghdr int struct
Definition: libnfnetlink.h:96
#define BUILD_NETMSG_FROM_EXP |
( |
|
exp, |
|
|
|
query |
|
) |
| |
Value:({ \
static
char __net[4096];
\
__hdr; \
})
#define NETHDR_SIZ
Definition: network.h:26
#define HDR_HOST2NETWORK(x)
Definition: network.h:146
void nethdr_set(struct nethdr *net, int type)
Definition: network.c:53
void exp2msg(const struct nf_expect *exp, struct nethdr *n)
Definition: build.c:333
struct nf_expect * exp
Definition: conntrack.c:73
struct nlmsghdr struct nlmsghdr int struct
Definition: libnfnetlink.h:96
#define CONNTRACKD_PROTOCOL_VERSION 1 |
#define HDR_HOST2NETWORK |
( |
|
x | ) |
|
Value:({ \
__ack->
from = htonl(__ack->from); \
__ack->to = htonl(__ack->to); \
} \
x->len = htons(x->len); \
x->seq = htonl(x->seq); \
})
#define IS_RESYNC(x)
Definition: network.h:130
#define IS_NACK(x)
Definition: network.h:129
#define IS_ACK(x)
Definition: network.h:128
uint32_t from
Definition: network.h:66
struct nlmsghdr struct nlmsghdr int struct
Definition: libnfnetlink.h:96
#define HDR_NETWORK2HOST |
( |
|
x | ) |
|
Value:({ \
x->len = ntohs(x->len); \
x->seq = ntohl(x->seq); \
__ack->
from = ntohl(__ack->from); \
__ack->to = ntohl(__ack->to); \
} \
})
#define IS_RESYNC(x)
Definition: network.h:130
#define IS_NACK(x)
Definition: network.h:129
#define IS_ACK(x)
Definition: network.h:128
uint32_t from
Definition: network.h:66
struct nlmsghdr struct nlmsghdr int struct
Definition: libnfnetlink.h:96
#define NTA_LABELS_MAX_SIZE (4096/sizeof(uint32_t)) |
#define NTA_NEXT |
( |
|
x, |
|
|
|
len |
|
) |
| |
Value:
)
Definition: network.h:176
#define NTA_ALIGN(len)
Definition: network.h:199
int len
Definition: utils.c:56
Referenced by msg2ct(), and msg2exp().
Enumerator |
---|
NET_F_UNUSED |
|
NET_F_RESYNC |
|
NET_F_NACK |
|
NET_F_ACK |
|
NET_F_ALIVE |
|
NET_F_HELLO |
|
NET_F_HELLO_BACK |
|
Enumerator |
---|
MSG_DATA |
|
MSG_CTL |
|
MSG_DROP |
|
MSG_BAD |
|
Enumerator |
---|
SEQ_UNKNOWN |
|
SEQ_UNSET |
|
SEQ_IN_SYNC |
|
SEQ_AFTER |
|
SEQ_BEFORE |
|
Enumerator |
---|
NET_T_STATE_CT_NEW |
|
NET_T_STATE_CT_UPD |
|
NET_T_STATE_CT_DEL |
|
NET_T_STATE_EXP_NEW |
|
NET_T_STATE_EXP_UPD |
|
NET_T_STATE_EXP_DEL |
|
NET_T_STATE_MAX |
|
NET_T_CTL |
|
Enumerator |
---|
NTA_IPV4 |
|
NTA_IPV6 |
|
NTA_L4PROTO |
|
NTA_PORT |
|
NTA_TCP_STATE |
|
NTA_STATUS |
|
NTA_TIMEOUT |
|
NTA_MARK |
|
NTA_MASTER_IPV4 |
|
NTA_MASTER_IPV6 |
|
NTA_MASTER_L4PROTO |
|
NTA_MASTER_PORT |
|
NTA_SNAT_IPV4 |
|
NTA_DNAT_IPV4 |
|
NTA_SPAT_PORT |
|
NTA_DPAT_PORT |
|
NTA_NAT_SEQ_ADJ |
|
NTA_SCTP_STATE |
|
NTA_SCTP_VTAG_ORIG |
|
NTA_SCTP_VTAG_REPL |
|
NTA_DCCP_STATE |
|
NTA_DCCP_ROLE |
|
NTA_ICMP_TYPE |
|
NTA_ICMP_CODE |
|
NTA_ICMP_ID |
|
NTA_TCP_WSCALE_ORIG |
|
NTA_TCP_WSCALE_REPL |
|
NTA_HELPER_NAME |
|
NTA_LABELS |
|
NTA_MAX |
|
Enumerator |
---|
NTA_EXP_MASTER_IPV4 |
|
NTA_EXP_MASTER_IPV6 |
|
NTA_EXP_MASTER_L4PROTO |
|
NTA_EXP_MASTER_PORT |
|
NTA_EXP_EXPECT_IPV4 |
|
NTA_EXP_EXPECT_IPV6 |
|
NTA_EXP_EXPECT_L4PROTO |
|
NTA_EXP_EXPECT_PORT |
|
NTA_EXP_MASK_IPV4 |
|
NTA_EXP_MASK_IPV6 |
|
NTA_EXP_MASK_L4PROTO |
|
NTA_EXP_MASK_PORT |
|
NTA_EXP_TIMEOUT |
|
NTA_EXP_FLAGS |
|
NTA_EXP_CLASS |
|
NTA_EXP_NAT_IPV4 |
|
NTA_EXP_NAT_PORT |
|
NTA_EXP_NAT_L4PROTO |
|
NTA_EXP_NAT_DIR |
|
NTA_EXP_HELPER_NAME |
|
NTA_EXP_FN |
|
NTA_EXP_MAX |
|
References ATTR_CONNLABELS, ATTR_GRP_MASTER_IPV4, ATTR_GRP_MASTER_IPV6, ATTR_GRP_MASTER_PORT, ATTR_GRP_ORIG_IPV4, ATTR_GRP_ORIG_IPV6, ATTR_HELPER_NAME, ATTR_L4PROTO, ATTR_MARK, ATTR_MASTER_L4PROTO, ATTR_REPL_IPV4_DST, ATTR_REPL_IPV4_SRC, ATTR_REPL_PORT_DST, ATTR_REPL_PORT_SRC, ATTR_STATUS, ATTR_TIMEOUT, CONFIG, nfct_attr_grp_is_set(), nfct_attr_is_set(), nfct_attr_is_set_array(), nfct_get_attr_u8(), nfct_getobjopt(), NFCT_GOPT_IS_DNAT, NFCT_GOPT_IS_DPAT, NFCT_GOPT_IS_SNAT, NFCT_GOPT_IS_SPAT, NTA_DNAT_IPV4, NTA_DPAT_PORT, NTA_HELPER_NAME, NTA_IPV4, NTA_IPV6, NTA_L4PROTO, NTA_MARK, NTA_MASTER_IPV4, NTA_MASTER_IPV6, NTA_MASTER_L4PROTO, NTA_MASTER_PORT, NTA_SNAT_IPV4, NTA_SPAT_PORT, NTA_STATUS, and NTA_TIMEOUT.
References ATTR_EXP_CLASS, ATTR_EXP_EXPECTED, ATTR_EXP_FLAGS, ATTR_EXP_FN, ATTR_EXP_HELPER_NAME, ATTR_EXP_MASK, ATTR_EXP_MASTER, ATTR_EXP_NAT_DIR, ATTR_EXP_NAT_TUPLE, ATTR_EXP_TIMEOUT, ATTR_GRP_ORIG_IPV4, ATTR_GRP_ORIG_IPV6, ATTR_L4PROTO, CONFIG, nfct_attr_grp_is_set(), nfct_get_attr_u8(), nfexp_attr_is_set(), nfexp_get_attr(), NTA_EXP_CLASS, NTA_EXP_EXPECT_IPV4, NTA_EXP_EXPECT_IPV6, NTA_EXP_EXPECT_L4PROTO, NTA_EXP_EXPECT_PORT, NTA_EXP_FLAGS, NTA_EXP_FN, NTA_EXP_HELPER_NAME, NTA_EXP_MASK_IPV4, NTA_EXP_MASK_IPV6, NTA_EXP_MASK_L4PROTO, NTA_EXP_MASK_PORT, NTA_EXP_MASTER_IPV4, NTA_EXP_MASTER_IPV6, NTA_EXP_MASTER_L4PROTO, NTA_EXP_MASTER_PORT, NTA_EXP_NAT_DIR, NTA_EXP_NAT_IPV4, NTA_EXP_NAT_L4PROTO, NTA_EXP_NAT_PORT, NTA_EXP_TIMEOUT, and NULL.
References ATTR_NETWORK2HOST, nethdr::len, len, ct_parser::max_size, NETHDR_DATA, NETHDR_SIZ, netattr::nta_attr, NTA_DATA, netattr::nta_len, NTA_LENGTH, NTA_MAX, NTA_NEXT, NULL, ct_parser::parse, ct_parser::parse2, ct_parser::size, and ssizeof.
References ATTR_EXP_CLASS, ATTR_EXP_EXPECTED, ATTR_EXP_FLAGS, ATTR_EXP_FN, ATTR_EXP_HELPER_NAME, ATTR_EXP_MASK, ATTR_EXP_MASTER, ATTR_EXP_NAT_DIR, ATTR_EXP_NAT_TUPLE, ATTR_EXP_TIMEOUT, ATTR_NETWORK2HOST, nethdr::len, len, mask, nf_conntrack::master, NETHDR_DATA, NETHDR_SIZ, nfct_destroy(), nfct_new(), nfexp_set_attr(), netattr::nta_attr, NTA_DATA, netattr::nta_len, NTA_LENGTH, NTA_MAX, NTA_NEXT, NULL, and ssizeof.
int nethdr_align |
( |
int |
len | ) |
|
int nethdr_size |
( |
int |
len | ) |
|
int nethdr_track_is_seq_set |
( |
void |
| ) |
|
int nethdr_track_seq |
( |
uint32_t |
seq, |
|
|
uint32_t * |
exp_seq |
|
) |
| |
void nethdr_track_update_seq |
( |
uint32_t |
seq | ) |
|