aboutsummaryrefslogtreecommitdiff
path: root/analyzer/utils/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'analyzer/utils/tcp.c')
-rw-r--r--analyzer/utils/tcp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/analyzer/utils/tcp.c b/analyzer/utils/tcp.c
index a5d0366..8979483 100644
--- a/analyzer/utils/tcp.c
+++ b/analyzer/utils/tcp.c
@@ -56,7 +56,8 @@ TCPSegment get_segment_from_packet(const byte_t *packet, const struct pcap_pkthd
return segment;
// get TCP header
- const struct tcphdr *tcp_header = (const struct tcphdr *)(packet + eth_header_len + ip_header_len);
+ const struct tcphdr *tcp_header =
+ (const struct tcphdr *)(packet + eth_header_len + ip_header_len);
int tcp_header_len = tcp_header->th_off * 4;
// get TCP sequence number and client port
@@ -91,8 +92,9 @@ void remove_parsed_data(TCPStream *stream, size_t parsed_len) {
stream->seq += parsed_len;
}
-// get the index of the first relevant byte in segment (its tcp sequence number is the one stream is expecting)
-// return the index of the first relevant byte in payload or -1 if segment isn't directly connected to stream
+// get the index of the first relevant byte in segment (its tcp sequence number is the one stream is
+// expecting) return the index of the first relevant byte in payload or -1 if segment isn't directly
+// connected to stream
int get_first_relevant_byte_index(TCPStream stream, TCPSegment segment) {
// expected tcp sequence numbers for stream and segment
uint32_t stream_expected = stream.seq + stream.bytes.count;
@@ -124,7 +126,8 @@ void add_pending_segments(TCPStream *stream) {
top_changed = 1;
}
- // remove top if it was just added or no longer is in acceptable range (e.g. was contained within another one pending)
+ // remove top if it was just added or no longer is in acceptable range (e.g. was contained
+ // within another one pending)
if (top_changed || !in_acceptable_range(*stream, *top)) {
heap_top_remove(stream->pending);
}