Go to the documentation of this file.
78 static inline Packet *FlowForceReassemblyPseudoPacketSetup(
Packet *p,
83 const int orig_dir = direction;
86 p->
proto = IPPROTO_TCP;
87 FlowReference(&p->
flow, f);
116 if (direction == 0) {
147 if (direction == 0) {
148 p->
ip4h->s_ip_src.s_addr = f->
src.addr_data32[0];
149 p->
ip4h->s_ip_dst.s_addr = f->
dst.addr_data32[0];
151 p->
ip4h->s_ip_src.s_addr = f->
dst.addr_data32[0];
152 p->
ip4h->s_ip_dst.s_addr = f->
src.addr_data32[0];
161 if (direction == 0) {
184 p->
ip6h->s_ip6_vfc = 0x60;
185 p->
ip6h->s_ip6_flow = 0;
186 p->
ip6h->s_ip6_nxt = IPPROTO_TCP;
187 p->
ip6h->s_ip6_plen = htons(20);
188 p->
ip6h->s_ip6_hlim = 64;
189 if (direction == 0) {
190 p->
ip6h->s_ip6_src[0] = f->
src.addr_data32[0];
191 p->
ip6h->s_ip6_src[1] = f->
src.addr_data32[1];
192 p->
ip6h->s_ip6_src[2] = f->
src.addr_data32[2];
193 p->
ip6h->s_ip6_src[3] = f->
src.addr_data32[3];
194 p->
ip6h->s_ip6_dst[0] = f->
dst.addr_data32[0];
195 p->
ip6h->s_ip6_dst[1] = f->
dst.addr_data32[1];
196 p->
ip6h->s_ip6_dst[2] = f->
dst.addr_data32[2];
197 p->
ip6h->s_ip6_dst[3] = f->
dst.addr_data32[3];
199 p->
ip6h->s_ip6_src[0] = f->
dst.addr_data32[0];
200 p->
ip6h->s_ip6_src[1] = f->
dst.addr_data32[1];
201 p->
ip6h->s_ip6_src[2] = f->
dst.addr_data32[2];
202 p->
ip6h->s_ip6_src[3] = f->
dst.addr_data32[3];
203 p->
ip6h->s_ip6_dst[0] = f->
src.addr_data32[0];
204 p->
ip6h->s_ip6_dst[1] = f->
src.addr_data32[1];
205 p->
ip6h->s_ip6_dst[2] = f->
src.addr_data32[2];
206 p->
ip6h->s_ip6_dst[3] = f->
src.addr_data32[3];
215 p->
tcph->th_offx2 = 0x50;
217 p->
tcph->th_win = 10;
222 p->
tcph->th_sport = htons(f->
sp);
223 p->
tcph->th_dport = htons(f->
dp);
230 p->
tcph->th_sport = htons(f->
dp);
231 p->
tcph->th_dport = htons(f->
sp);
238 p->
tcph->th_sum = TCPChecksum(p->
ip4h->s_ip_addrs,
239 (uint16_t *)p->
tcph, 20, 0);
245 p->
tcph->th_sum = TCPChecksum(p->
ip6h->s_ip6_addrs,
246 (uint16_t *)p->
tcph, 20, 0);
249 memset(&p->
ts, 0,
sizeof(
struct timeval));
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();
#define DecodeSetNoPacketInspectionFlag(p)
Set the No packet inspection Flag for the packet.
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
#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)
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NONE
uint64_t AppLayerParserGetTransactionActive(const Flow *f, AppLayerParserState *pstate, uint8_t direction)
#define STREAM_HAS_SEEN_DATA(stream)
#define PKT_PSEUDO_STREAM_END
#define DecodeSetNoPayloadInspectionFlag(p)
Set the No payload inspection Flag for the packet.
#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
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION
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
Packet * FlowForceReassemblyPseudoPacketGet(int direction, Flow *f, TcpSession *ssn)
struct LiveDevice_ * livedev
#define PACKET_PROFILING_START(p)
Packet * PacketPoolGetPacket(void)
Get a new packet from the packet pool.
#define FLOW_PKT_ESTABLISHED
void TimeGet(struct timeval *tv)
#define FLOW_END_FLAG_SHUTDOWN
void AppLayerParserStateSetFlag(AppLayerParserState *pstate, uint8_t flag)
#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)