Go to the documentation of this file.
79 static inline Packet *FlowForceReassemblyPseudoPacketSetup(
Packet *p,
84 const int orig_dir = direction;
87 p->
proto = IPPROTO_TCP;
88 FlowReference(&p->
flow, f);
99 DecodeSetNoPacketInspectionFlag(p);
102 DecodeSetNoPayloadInspectionFlag(p);
117 if (direction == 0) {
148 if (direction == 0) {
149 p->
ip4h->s_ip_src.s_addr = f->
src.addr_data32[0];
150 p->
ip4h->s_ip_dst.s_addr = f->
dst.addr_data32[0];
152 p->
ip4h->s_ip_src.s_addr = f->
dst.addr_data32[0];
153 p->
ip4h->s_ip_dst.s_addr = f->
src.addr_data32[0];
162 if (direction == 0) {
185 p->
ip6h->s_ip6_vfc = 0x60;
186 p->
ip6h->s_ip6_flow = 0;
187 p->
ip6h->s_ip6_nxt = IPPROTO_TCP;
188 p->
ip6h->s_ip6_plen = htons(20);
189 p->
ip6h->s_ip6_hlim = 64;
190 if (direction == 0) {
191 p->
ip6h->s_ip6_src[0] = f->
src.addr_data32[0];
192 p->
ip6h->s_ip6_src[1] = f->
src.addr_data32[1];
193 p->
ip6h->s_ip6_src[2] = f->
src.addr_data32[2];
194 p->
ip6h->s_ip6_src[3] = f->
src.addr_data32[3];
195 p->
ip6h->s_ip6_dst[0] = f->
dst.addr_data32[0];
196 p->
ip6h->s_ip6_dst[1] = f->
dst.addr_data32[1];
197 p->
ip6h->s_ip6_dst[2] = f->
dst.addr_data32[2];
198 p->
ip6h->s_ip6_dst[3] = f->
dst.addr_data32[3];
200 p->
ip6h->s_ip6_src[0] = f->
dst.addr_data32[0];
201 p->
ip6h->s_ip6_src[1] = f->
dst.addr_data32[1];
202 p->
ip6h->s_ip6_src[2] = f->
dst.addr_data32[2];
203 p->
ip6h->s_ip6_src[3] = f->
dst.addr_data32[3];
204 p->
ip6h->s_ip6_dst[0] = f->
src.addr_data32[0];
205 p->
ip6h->s_ip6_dst[1] = f->
src.addr_data32[1];
206 p->
ip6h->s_ip6_dst[2] = f->
src.addr_data32[2];
207 p->
ip6h->s_ip6_dst[3] = f->
src.addr_data32[3];
216 p->
tcph->th_offx2 = 0x50;
218 p->
tcph->th_win = 10;
223 p->
tcph->th_sport = htons(f->
sp);
224 p->
tcph->th_dport = htons(f->
dp);
231 p->
tcph->th_sport = htons(f->
dp);
232 p->
tcph->th_dport = htons(f->
sp);
239 p->
tcph->th_sum = TCPChecksum(p->
ip4h->s_ip_addrs,
240 (uint16_t *)p->
tcph, 20, 0);
246 p->
tcph->th_sum = TCPChecksum(p->
ip6h->s_ip6_addrs,
247 (uint16_t *)p->
tcph, 20, 0);
252 if (direction == 0) {
265 FlowDeReference(&p->
flow);
284 return FlowForceReassemblyPseudoPacketSetup(p, direction, f, ssn);
298 if (f == NULL || f->
protoctx == NULL) {
351 const int thread_id = (int)f->
thread_id[0];
370 static inline void FlowForceReassemblyForHash(
void)
401 RemoveFromHash(f, prev_f);
426 FlowForceReassemblyForHash();
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION
void FlowForceReassemblyForFlow(Flow *f)
#define FLOW_NOPAYLOAD_INSPECTION
void FlowForceReassembly(void)
Force reassembly for all the flows that have unprocessed segments.
#define FLOW_PKT_TOSERVER
int DatalinkGetGlobalType(void)
#define APP_LAYER_PARSER_EOF_TS
#define GET_PKT_DIRECT_MAX_SIZE(p)
#define FLOWLOCK_UNLOCK(fb)
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)
int FlowForceReassemblyNeedReassembly(Flow *f)
Check if a flow needs forced reassembly, or any other processing.
void PacketPoolWaitForN(int n)
Wait until we have the requested amount of packets in the pool.
#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)
#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)
Packet * FlowForceReassemblyPseudoPacketGet(int direction, Flow *f, TcpSession *ssn)
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NONE
struct LiveDevice_ * livedev
#define PACKET_PROFILING_START(p)
Packet * PacketPoolGetPacket(void)
Get a new packet from the packet pool.
#define FLOW_PKT_ESTABLISHED
#define FLOW_END_FLAG_SHUTDOWN
#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)