54 if (p == NULL || seg == NULL) {
60 const uint8_t *seg_data;
63 if (seg_data == NULL || seg_datalen == 0)
66 const TCPHdr *tcph = PacketGetTCP(p);
72 }
else if (
SEQ_GT(pkt_seq, (seg->
seq + seg_datalen))) {
80 uint32_t seg_seq = seg->
seq;
85 uint32_t seg_end = seg_seq + seg_datalen;
86 SCLogDebug(
"pkt_end %u, seg_end %u", pkt_end, seg_end);
89 uint32_t end =
SEQ_MIN(seg_end, pkt_end);
95 uint32_t pkt_off =
seq - pkt_seq;
96 uint32_t seg_off =
seq - seg_seq;
97 SCLogDebug(
"pkt_off %u, seg_off %u", pkt_off, seg_off);
99 uint32_t range = end -
seq;
126 const TCPHdr *tcph = PacketGetTCP(p);
128 uint32_t tseq = seg->
seq;
137 const uint8_t *seg_data;
138 uint32_t seg_datalen;
142 uint32_t tend = tseq + seg_datalen;
146 uint32_t end = (
SEQ_GT(pend, tend)) ? tend : pend;
148 uint32_t
seq = (
SEQ_LT(pseq, tseq)) ? tseq : pseq;
151 uint32_t poff =
seq - pseq;
152 uint32_t toff =
seq - tseq;
155 uint32_t range = end -
seq;
162 memcpy(p->
payload+poff, seg_data+toff, range);