Victor Julien
0dfa5793db
decode/icmpv4: rename ICMPV4_GET_EMB_IPV4 to PacketGetICMPv4EmbIPv4
...
Follows function nameing style.
Ticket: #5517 .
3 years ago
Victor Julien
f2288ee39b
decode/icmpv4: store embedded ip4h ptr as offset
...
Reduces direct pointer usage and reduces Packet size.
Ticket: #6938 .
3 years ago
Victor Julien
d89d4ceb3c
decode/icmpv4: put embedded pointer first
...
Reduce gaps in the structure.
Ticket: #6938 .
3 years ago
Victor Julien
852ff83d70
decode/icmpv4: move icmpv4h into L4 packet data
...
To reduce Packet size.
Ticket: #6938 .
3 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 .
3 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 .
3 years ago
Victor Julien
561b81dd9e
decode: don't clear computed csums twice
...
Already done in a generic way by PACKET_RESET_CHECKSUMS.
3 years ago
Victor Julien
a1a9b41a71
decode/icmpv4: no need to pack the structure
3 years ago
Jason Ish
44388f1b69
src: make include guards more library friendly
...
Include guards for libraries should use a prefix that is meaningful for
the library to avoid conflicts with other user code. For Suricata, use
SURICATA.
Additionally, remove the pattern of leading and trailing underscores as
these are reserved for the language implementation per the C and C++
standards.
3 years ago
Philippe Antoine
02f2602dde
src: rework includes as per cppclean
4 years ago
Philippe Antoine
c5cf2967b3
detect: fix integer warnings
...
Ticket: #4516
4 years ago
Victor Julien
002b335b4a
decode/checksums: constify pointer args
5 years ago
Jeff Lucovsky
988bb26828
decode: Improved handling of ICMPv4 messages
...
This commit improves handling of ICMPv4 messages, especially those with
variable sized headers.
This commit also adds a header length variable for use by the new
sticky buffer for the header.
6 years ago
Victor Julien
c662383b53
flow: track flow for ICMP
...
Change packet layout to allow for expected counterpart type.
9 years ago
Victor Julien
11be9bd971
mingw: add SCNtohl and SCNtohs macro's
...
On MinGW the result of ntohl needs to be casted to uint32_t and
the result of ntohs to uint16_t. To avoid doing this everywhere
add SCNtohl and SCNtohs macros.
9 years ago
Thomas Andrejak
18c9312380
Add macro for TCP and UDP header access
10 years ago
Victor Julien
c9756caeef
packet: make tcp/udp/icmp vars union non-anonymous
...
Clean the whole thing after use.
10 years ago
Victor Julien
083f22f6d6
icmpv4: remove unused header fields
11 years ago
Victor Julien
375092da85
icmpv4: remove unused declarations
11 years ago
Victor Julien
fe445367bd
icmpv4: improve dest unreachable logic
...
When a ICMPv4 destination unreachable packet contains an embedded packet
this packet is parsed. When it's found to be invalid, the whole ICMP
packet is tagged as invalid.
In some cases the unreachable packet would still be used.
This patch fixes this by checking the packet is invalid flag as well
in the ICMPV4_DEST_UNREACH_IS_VALID macro.
11 years ago
Ken Steele
c91b7fd3bc
More structures that need to be marked Packed.
...
These structures are cast from raw packet data, so they should be packed.
The case is:
typedef struct Foo_ {
} Foo;
Foo *f = (Foo *)pkt;
12 years ago
Ken Steele
f16b339fc4
Rename checksums to level3_comp_csum and level4_comp_csum.
...
This will also sharing even more memory in the Packet_ structure.
13 years ago
Ken Steele
c6a8d0ab6b
Share Packet checksum values for TCP, UDP, IPv6. ICMPv4 and ICMPv6
...
Keep a separate checksum for IPV4, since a packet can have both an IPV4
checksum and a TCPV4 checksum, or IPV4 and UDPV4 checksum.
This will allow future sharing of more values.
Use PACKET_RESET_CHECKSUMS() in Unit Tests in place of setting the
individual checksum values.
13 years ago
Anoop Saldanha
98a8234e0a
csum function fixes. Improves alert accuracy. FPs on invalid-csums decoder rules fixed
15 years ago
Victor Julien
e1d4e16645
Simplify packet decoding macro's.
16 years ago
Eric Leblond
8be92fdd99
SCTP support: add parsing of sctp
...
This patch adds support of SCTP in all part of the code in charge
of decoding packets.
16 years ago
Victor Julien
6519a86ec7
Move packet pool to ringbuffer, update packet pool api and ringbuffer api. Remove memset usage from PACKET_RECYCLE, add proper cleanup macros.
17 years ago
William Metcalf
2eef905c07
GPL and Copyright header updates.
17 years ago
Victor Julien
548a3b2c93
Improve flow hash debugging functions. Make sure ICMP errors don't create flows. Handle ICMP DEST UNREACH errors in the flow they are sending the error about.
17 years ago
William Metcalf
ce01927515
Import of GPLv2 Header 050410
17 years ago
Pablo Rincon
779f154fc6
Moving inline functions to the .h files, so gcc can inline them correctly
17 years ago
Victor Julien
cec124df10
Fix icmp_id keyword and improve icmp_seq keyword logic.
17 years ago
Breno Silva
1d055b0e09
ICMP Seq Rule Keyword
17 years ago
Gerardo Iglesias Galvan
7e87f373b9
Add icmp_id keyword support
17 years ago
Jamie
0dc471db9c
looking inside ICMP packets
17 years ago
Jamie
a297225157
victor must be getting sick of PPPoE and ICMP
17 years ago
Victor Julien
03d084858c
Add macro's for access to ICMPv(4|6) type & code.
17 years ago
Anoop Saldanha
22c0ec2bc5
Added support for the csum-<protocol> rules keyword to the detection engine. Keywords added are ipv4-csum, tcpv4-csum, tcpv6-csum, udpv4-csum, udpv6-csum, icmpv4-csum and icmpv6-csum
17 years ago
Jamie
fdbd09db6c
add perfcounter to pppoe
17 years ago
Jamie
afa8a6766e
test cases for PPPoE, ICMPv4
17 years ago
Brian Rectanus
fa5939ca91
64 bit cleanup part2
17 years ago
Victor Julien
689bbfdc45
Rename all structure definitions in the "typedef struct _SomeStruct" format to "typedef struct SomeStruct_" to make the Doxygen output more useful.
...
Remove the Trie multi pattern matcher code. It wasn't used anymore.
17 years ago
William Metcalf
817d0e0855
added macros for ICMP defines
17 years ago
Victor Julien
bab4b62376
Initial add of the files.
17 years ago