Add decoder events to ethernet and sll decoding.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent eb0a5d8762
commit 2c8df73d24

@ -2,11 +2,14 @@
#include "decode.h"
#include "decode-ethernet.h"
#include "decode-events.h"
void DecodeEthernet(ThreadVars *t, Packet *p, u_int8_t *pkt, u_int16_t len, PacketQueue *pq)
{
if (len < ETHERNET_HEADER_LEN)
if (len < ETHERNET_HEADER_LEN) {
DECODER_SET_EVENT(p,ETHERNET_PKT_TOO_SMALL);
return;
}
EthernetHdr *ethh = (EthernetHdr *)pkt;
if (ethh == NULL)

@ -35,6 +35,11 @@ enum {
UDP_HLEN_TOO_SMALL,
UDP_HLEN_INVALID,
/* SLL EVENTS */
SLL_PKT_TOO_SMALL,
/* ETHERNET EVENTS */
ETHERNET_PKT_TOO_SMALL,
};
#endif /* __DECODE_EVENTS_H__ */

@ -2,11 +2,14 @@
#include "decode.h"
#include "decode-sll.h"
#include "decode-events.h"
void DecodeSll(ThreadVars *t, Packet *p, u_int8_t *pkt, u_int16_t len, PacketQueue *pq)
{
if (len < SLL_HEADER_LEN)
if (len < SLL_HEADER_LEN) {
DECODER_SET_EVENT(p,SLL_PKT_TOO_SMALL);
return;
}
SllHdr *sllh = (SllHdr *)pkt;
if (sllh == NULL)

Loading…
Cancel
Save