75 #ifndef _YAF_DECODE_H_ 76 #define _YAF_DECODE_H_ 78 #include <yaf/autoinc.h> 106 #define YF_MPLS_LABEL_COUNT_MAX 3 121 uint32_t mpls_label[YF_MPLS_LABEL_COUNT_MAX];
157 struct pcap_pkthdr pcap_hdr;
175 # if defined(YAF_ENABLE_P0F) || defined(YAF_ENABLE_FPEXPORT) 190 #define YF_PBUFLEN_NOL2INFO offsetof(yfPBuf_t, l2info) 193 #define YF_PBUFLEN_NOPAYLOAD offsetof(yfPBuf_t, paylen) 196 #define YF_PBUFLEN_BASE offsetof(yfPBuf_t, payload) 198 struct yfDecodeCtx_st;
200 typedef struct yfDecodeCtx_st yfDecodeCtx_t;
203 #define YF_TYPE_IPv4 0x0800 205 #define YF_TYPE_IPv6 0x86DD 210 #define YF_TYPE_IPANY 0x0000 213 #define YF_PROTO_IP6_HOP 0 215 #define YF_PROTO_ICMP 1 217 #define YF_PROTO_TCP 6 219 #define YF_PROTO_UDP 17 221 #define YF_PROTO_IP6_ROUTE 43 223 #define YF_PROTO_IP6_FRAG 44 225 #define YF_PROTO_GRE 47 227 #define YF_PROTO_ICMP6 58 229 #define YF_PROTO_IP6_NONEXT 59 231 #define YF_PROTO_IP6_DOPT 60 234 #define YF_TF_FIN 0x01 236 #define YF_TF_SYN 0x02 238 #define YF_TF_RST 0x04 240 #define YF_TF_PSH 0x08 242 #define YF_TF_ACK 0x10 244 #define YF_TF_URG 0x20 246 #define YF_TF_ECE 0x40 248 #define YF_TF_CWR 0x80 251 #define YF_MF_PRIO_CHANGE 0x01 253 #define YF_MF_PRIORITY 0x02 255 #define YF_MF_FAIL 0x04 257 #define YF_MF_FASTCLOSE 0x08 277 yfDecodeCtx_t *yfDecodeCtxAlloc(
287 void yfDecodeCtxFree(
325 gboolean yfDecodeToPBuf(
342 uint64_t yfDecodeTimeval(
343 const struct timeval *tv);
353 uint64_t yfDecodeTimeNTP(
363 void yfDecodeDumpStats(
365 uint64_t packetTotal);
373 void yfDecodeResetOffset(
382 uint32_t yfGetDecodeStats(
399 gboolean yfDefragTCP(
uint16_t pcap_caplist
caplist
Definition: decode.h:163
uint8_t flags
TCP flags.
Definition: decode.h:143
uint8_t flags
flags
Definition: decode.h:133
uint64_t idsn
initial dsn
Definition: decode.h:127
yfMPTCPInfo_t mptcp
MPTCP Info.
Definition: decode.h:145
uint16_t l4hlen
Decoded header length.
Definition: decode.h:93
uint16_t iplen
Packet IP length.
Definition: decode.h:165
uint8_t frag
flag for determining if the packet was fragmented 0-no, 1-yes, 2-not fully assembled ...
Definition: decode.h:170
#define YFP_IPTCPHEADER_SIZE
This is the size of the packet to store away for use primarily in passive OS fingerprinting, this value is only used if application labeling is enabled.
Definition: yafcore.h:188
uint32_t token
token
Definition: decode.h:129
uint32_t ipid
Fragment ID.
Definition: decode.h:84
uint32_t mpls_count
MPLS label count.
Definition: decode.h:119
uint16_t mss
maximum segment size
Definition: decode.h:131
uint8_t more
More fragments flag.
Definition: decode.h:102
yfFlowKey_t key
Flow key containing decoded IP and transport headers.
Definition: decode.h:153
TCP information structure.
Definition: decode.h:139
uint8_t frag
Fragmented packet flag.
Definition: decode.h:98
yfTCPInfo_t tcpinfo
TCP information structure.
Definition: decode.h:172
size_t allHeaderLen
Length of all headers, L2, L3, L4.
Definition: decode.h:155
size_t paylen
Length of payload available in captured payload buffer.
Definition: decode.h:182
uint64_t ptime
Packet timestamp in epoch milliseconds.
Definition: decode.h:151
Packet decoding interface for YAF.
Definition: decode.h:82
yfL2Info_t l2info
Decoded layer 2 information.
Definition: decode.h:174
uint32_t seq
TCP sequence number.
Definition: decode.h:141
A YAF flow key.
Definition: yafcore.h:208
Datalink layer information structure.
Definition: decode.h:109
uint16_t vlan_tag
VLAN tag.
Definition: decode.h:117
MPTCP information structure.
Definition: decode.h:125
pcap_t * pcapt
pcap struct
Definition: decode.h:159
Full packet information structure.
Definition: decode.h:149
uint16_t iphlen
IP header length.
Definition: decode.h:88
uint64_t pcap_offset
offset into pcap
Definition: decode.h:161
uint16_t offset
Fragment offset within the reassembled datagram.
Definition: decode.h:86
uint16_t ifnum
Interface number packet was decoded from.
Definition: decode.h:167
uint16_t l2hlen
Layer 2 Header Length.
Definition: decode.h:115