Victor Julien
6e23419665
decode/icmpv6: store embedded ip6h ptr as offset
...
Reduces direct pointer usage and reduces Packet size.
Ticket: #6938 .
2 years ago
Victor Julien
f2288ee39b
decode/icmpv4: store embedded ip4h ptr as offset
...
Reduces direct pointer usage and reduces Packet size.
Ticket: #6938 .
2 years ago
Victor Julien
d89d4ceb3c
decode/icmpv4: put embedded pointer first
...
Reduce gaps in the structure.
Ticket: #6938 .
2 years ago
Victor Julien
13281109e3
decode/tcp: reduce TCPVars by turning bools into bitfields
...
To reduce Packet size and make similar fields follow the same pattern.
Ticket: #6938 .
2 years ago
Victor Julien
8698610b4a
af-packet: fix eBPF/XDP compilation
2 years ago
Victor Julien
68804b8c4b
decode/tcp: move tcph into L4 packet data
...
To reduce Packet size.
Ticket: #6938 .
2 years ago
Victor Julien
28ac86096a
decode/udp: move udph into L4 packet data
...
To recude Packet size.
Ticket: #6938 .
2 years ago
Victor Julien
54362d44db
decode/ethernet: move ethh into L2 section
...
L2 section similar to L3 and L4 sections.
Ticket: #6938 .
2 years ago
Victor Julien
b2f7d3604b
decode/pppoe: localize pppoedh pointer
...
Remove from Packet struct as there were no users of it.
Ticket: #6938 .
2 years ago
Victor Julien
b4ef910aff
decode/pppoe: localize pppoesh header pointer
...
Remove header pointer from Packet as there were no users of it.
Ticket: #6938 .
2 years ago
Victor Julien
852ff83d70
decode/icmpv4: move icmpv4h into L4 packet data
...
To reduce Packet size.
Ticket: #6938 .
2 years ago
Victor Julien
b959d1dba8
decode/icmpv6: move icmpv6h into L4 packet data
...
Also start vars section in L4 for icmpv6vars.
To reduce Packet size.
Ticket: #6938 .
2 years ago
Victor Julien
30ae13f2c3
decode/esp: move esph into L4 packet data
...
To reduce Packet size.
Ticket: #6938 .
2 years ago
Victor Julien
7d04216cad
decode/gre: move greh into L4 packet data
...
To reduce Packet size.
Ticket: #6938 .
2 years ago
Victor Julien
20b8c79259
decode/sctp: move sctph into L4 packet data
...
Reduces Packet size.
Ticket: #6938 .
2 years ago
Victor Julien
2137bbbf9a
decode/icmpv6: add and use PacketIsICMPv6 inline func
...
For better readability and type checking.
Ticket: #5517 .
2 years ago
Victor Julien
3a1e60745e
decode/icmpv6: switch ptr checks to PKT_IS_ICMPV6
...
For better readability and type checking.
Ticket: #5517 .
2 years ago
Victor Julien
1002068e39
decode/icmpv4: add and use PacketIsICMPv4 inline func
...
For better readability and type checking.
Ticket: #5517 .
2 years ago
Victor Julien
5c3036bea8
decode/udp: add and use PacketIsUDP inline func
...
Replace PKT_IS_UDP macro with PacketIsUDP inline function.
For better readability and type checking.
Ticket: #5517 .
2 years ago
Victor Julien
cca912e9b3
decode/tcp: add and use PacketIsTCP inline func
...
To prepare future changes to the Packet header pointers.
Ticket: #5517 .
2 years ago
Victor Julien
329fb2affa
decode: start l4 packet area; convert csum handling
2 years ago
Victor Julien
54b9f344b7
decode/icmpv4: switch ptr checks to PKT_IS_ICMPV4
...
To prepare future changes to the Packet header pointers.
Ticket: #5517 .
2 years ago
Victor Julien
c9ef85e620
decode: refactor L3 checkum handling
...
Use a flag to indicate a calculated csum is available.
Allows packet reset to just use memset.
2 years ago
Victor Julien
2001ddc583
decode: use macro's instead of direct ptr checks
...
To prepare future changes to the Packet header pointers.
Ticket: #5517 .
2 years ago
Victor Julien
769b020a55
decode/icmpv6: improve packet vars layout
...
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
18d49c27ae
decode/icmpv6: remove unused error_ptr field
...
Was only set, never checked.
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
4b492c2ded
decode/icmpv6: remove embedded address storage
...
Only used in tests. For the tests, switch to getting headers from embedded IPv6 header.
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
521c968079
decode/icmpv6: remove unused L4 header pointers from Packet
...
Not used, so no need to keep them.
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
a22047b770
decode/icmpv4: shrink icmpv4 packet vars
...
Remove unused L4 header pointers.
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
9ef5af291b
decode/icmpv4: remove unused Packet members
...
Addresses are pulled from embedded IPv4 header directly.
Embeded hlen was unused.
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
1777e0314e
decode/tcp: remove unused macro
...
SET_OPTS is now unused, so remove.
2 years ago
Victor Julien
6b8093d7b8
decode/tcp: reduce size needed for SACK tracking
...
No longer use a pointer, but rather an offset.
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
81c4b10dc8
decode/tcp: minor struct layout optimization
...
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
7be0678c3a
decode/tcp: reduce size needed for tracking WSCALE
...
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
6cab2480e5
decode/tcp: reduce space needed for tracking TFO
...
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
6a23fafa5f
decode/tcp: reduce space needed for MSS tracking
...
Part of effort to make Packet more compact.
Ticket: #6938 .
2 years ago
Victor Julien
9632c2f570
decode/tcp: optimize SACKOK storage
...
Take less space in the TCPVars for tracking if SACKOK is set.
Reduces size by 16 bytes.
Ticket: #6938 .
2 years ago
Victor Julien
3c17d5d73c
decode/ipv4: minor test cleanups
2 years ago
Victor Julien
a40d6f5c4f
decode/ipv6: prep for turning ip4h/ip6h into union
...
Store IPv6 decoder vars in a new Packet::l3 section in the packet.
Use inline functions instead of the often multi-layer macro's for
various IPv6 header getters.
Ticket: #6938 .
2 years ago
Victor Julien
2d5c381c3b
decode/ipv4: prep for turning ip4h/ip6h into union
...
Store IPv4 decoder vars in a new Packet::l3 section in the packet.
Use inline functions instead of the often multi-layer macro's for
various IPv4 header getters.
Ticket: #6938 .
2 years ago
Victor Julien
79e6f7018f
decode: minor style cleanup in the header ptrs
2 years ago
Victor Julien
1535c88601
validate: remove ip4h/ip6h check
...
In preparation of making them union members.
2 years ago
Victor Julien
0e99e8a7fa
defrag: track ip hdr offset in tracker
...
In preparation of future Packet structure changes.
Ticket: #6938 .
2 years ago
Victor Julien
c4a6ee1647
decode: reduce macro use in IPv4/IPv6
...
Improve readability by setting up data/data_len once before
passing on to the other decoders.
Work in preparation of other decoder changes.
Ticket: #5517 .
2 years ago
Victor Julien
9d9ae62b6e
flow: avoid direct IP header checks
...
To prepare future changes to the Packet header pointers.
Ticket: #5517 .
2 years ago
Victor Julien
eb3ca643c1
decode: reduce PKT_IS_IPV4/PKT_IS_IPV6 use
...
Replace it with inline functions. Adds inline functions to
wrap PKT_IS_IPV4/PKT_IS_IPV6.
This is in preparation of removing the macro's, and cleaning up the
header pointers.
Ticket: #5517 .
2 years ago
Victor Julien
813147755d
decode: rename IP_GET_IPPROTO to PacketGetIPProto
...
To match function naming style.
Ticket: #5517 .
2 years ago
Victor Julien
61df76a57d
decode: implement IP_GET_IPPROTO as inline func
...
For better readability and type checking.
Ticket: #5517 .
2 years ago
Shivani Bhardwaj
14e2c579f6
tls/random: fix incorrect direction handling
...
The connp objects were incorrectly set per direction leading to
incorrect matches on respective directions.
Bug 6989
2 years ago
Victor Julien
a51b6fa6bd
pcap: address codeql warning
...
Use of potentially dangerous function: localtime
Windows localtime is thread safe and no localtime_r is availabe on
Windows, so use separate logic for Windows.
2 years ago