Go to the documentation of this file.
81 static inline Packet *FlowPseudoPacketSetup(
84 const int orig_dir = direction;
87 p->
proto = IPPROTO_TCP;
88 FlowReference(&p->
flow, f);
98 DecodeSetNoPacketInspectionFlag(p);
101 DecodeSetNoPayloadInspectionFlag(p);
116 if (direction == 0) {
147 if (direction == 0) {
148 ip4h->s_ip_src.s_addr = f->
src.addr_data32[0];
149 ip4h->s_ip_dst.s_addr = f->
dst.addr_data32[0];
151 ip4h->s_ip_src.s_addr = f->
dst.addr_data32[0];
152 ip4h->s_ip_dst.s_addr = f->
src.addr_data32[0];
161 if (direction == 0) {
184 ip6h->s_ip6_vfc = 0x60;
185 ip6h->s_ip6_flow = 0;
186 ip6h->s_ip6_nxt = IPPROTO_TCP;
187 ip6h->s_ip6_plen = htons(20);
188 ip6h->s_ip6_hlim = 64;
189 if (direction == 0) {
190 ip6h->s_ip6_src[0] = f->
src.addr_data32[0];
191 ip6h->s_ip6_src[1] = f->
src.addr_data32[1];
192 ip6h->s_ip6_src[2] = f->
src.addr_data32[2];
193 ip6h->s_ip6_src[3] = f->
src.addr_data32[3];
194 ip6h->s_ip6_dst[0] = f->
dst.addr_data32[0];
195 ip6h->s_ip6_dst[1] = f->
dst.addr_data32[1];
196 ip6h->s_ip6_dst[2] = f->
dst.addr_data32[2];
197 ip6h->s_ip6_dst[3] = f->
dst.addr_data32[3];
199 ip6h->s_ip6_src[0] = f->
dst.addr_data32[0];
200 ip6h->s_ip6_src[1] = f->
dst.addr_data32[1];
201 ip6h->s_ip6_src[2] = f->
dst.addr_data32[2];
202 ip6h->s_ip6_src[3] = f->
dst.addr_data32[3];
203 ip6h->s_ip6_dst[0] = f->
src.addr_data32[0];
204 ip6h->s_ip6_dst[1] = f->
src.addr_data32[1];
205 ip6h->s_ip6_dst[2] = f->
src.addr_data32[2];
206 ip6h->s_ip6_dst[3] = f->
src.addr_data32[3];
244 const IPV6Hdr *ip6h = PacketGetIPv6(p);
246 TCPChecksum(ip6h->s_ip6_addrs, (uint16_t *)p->
l4.
hdrs.
tcph, 20, 0);
251 if (direction == 0) {
264 FlowDeReference(&p->
flow);
278 return FlowPseudoPacketSetup(p, direction, f, ssn);
291 if (f == NULL || f->
protoctx == NULL) {
323 if (frames_container) {
375 static inline void FlowRemoveHash(
void)
403 RemoveFromHash(f, prev_f);
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION
void FlowSendToLocalThread(Flow *f)
#define FLOW_NOPAYLOAD_INSPECTION
union PacketL3::Hdrs hdrs
#define FLOW_PKT_TOSERVER
Packet * FlowPseudoPacketGet(int direction, Flow *f, const TcpSession *ssn)
int DatalinkGetGlobalType(void)
#define APP_LAYER_PARSER_EOF_TS
#define GET_PKT_DIRECT_MAX_SIZE(p)
#define FLOWLOCK_UNLOCK(fb)
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NONE
void TmThreadsInjectFlowById(Flow *f, const int id)
inject a flow into a threads flow queue
#define FLOW_COPY_IPV6_ADDR_TO_PACKET(fa, pa)
AppLayerParserState * alparser
#define SET_PKT_LEN(p, len)
uint64_t AppLayerParserGetTransactionActive(const Flow *f, AppLayerParserState *pstate, uint8_t direction)
#define STREAM_HAS_SEEN_DATA(stream)
#define PKT_PSEUDO_STREAM_END
#define FLOWLOCK_WRLOCK(fb)
#define IPV4_GET_RAW_HLEN(ip4h)
uint8_t StreamNeedsReassembly(const TcpSession *ssn, uint8_t direction)
see what if any work the TCP session still needs
int PacketCallocExtPkt(Packet *p, int datalen)
void PacketPoolWait(void)
FramesContainer * AppLayerFramesGetContainer(Flow *f)
#define APP_LAYER_PARSER_EOF_TC
#define FBLOCK_UNLOCK(fb)
struct LiveDevice_ * livedev
Data structures and function prototypes for keeping state for the detection engine.
#define FLOW_PKT_TOCLIENT
void AppLayerParserStateSetFlag(AppLayerParserState *pstate, uint16_t flag)
struct LiveDevice_ * livedev
#define PACKET_PROFILING_START(p)
union PacketL4::L4Hdrs hdrs
Packet * PacketPoolGetPacket(void)
Get a new packet from the packet pool.
#define FLOW_PKT_ESTABLISHED
#define FLOW_END_FLAG_SHUTDOWN
uint16_t vlan_id[VLAN_MAX_LAYERS]
uint16_t vlan_id[VLAN_MAX_LAYERS]
bool FlowNeedsReassembly(Flow *f)
Check if a flow needs forced reassembly, or any other processing.
#define FLOW_NOPACKET_INSPECTION
AppProto alproto
application level protocol
#define FLOW_DIR_REVERSED
uint64_t AppLayerParserGetTxCnt(const Flow *f, void *alstate)
FlowThreadId thread_id[2]
#define FLOW_COPY_IPV4_ADDR_TO_PACKET(fa, pa)
void FlowWorkToDoCleanup(void)
Clean up all the flows that have unprocessed segments and have some work to do in the detection engin...