diff --git a/src/decode-ethernet.c b/src/decode-ethernet.c index 06c52a4c60..e5ee4b1e3c 100644 --- a/src/decode-ethernet.c +++ b/src/decode-ethernet.c @@ -27,11 +27,11 @@ void DecodeEthernet(ThreadVars *t, Packet *p, u_int8_t *pkt, u_int16_t len, Pack } else if(ntohs(ethh->eth_type) == ETHERNET_TYPE_IPV6) { //printf("DecodeEthernet ip6\n"); DecodeIPV6(t, p, pkt + ETHERNET_HEADER_LEN, len - ETHERNET_HEADER_LEN); - } else if(ntohs(ethh->eth_type) == ETHERNET_TYPE_PPPoE_SESS) { - //printf("DecodeEthernet PPPoE\n"); - PerfCounterIncr(COUNTER_DECODER_PPPOE, t->pca); - DecodePPPoE(t, p, pkt + PPPOE_HEADER_LEN, len - PPPOE_HEADER_LEN, pq); - } + } else if(ntohs(ethh->eth_type) == ETHERNET_TYPE_PPPoE_SESS) { + //printf("DecodeEthernet PPPoE\n"); + PerfCounterIncr(COUNTER_DECODER_PPPOE, t->pca); + DecodePPPoE(t, p, pkt + PPPOE_HEADER_LEN, len - PPPOE_HEADER_LEN, pq); + } return; } diff --git a/src/decode-events.h b/src/decode-events.h index 5776714393..6685c45f91 100644 --- a/src/decode-events.h +++ b/src/decode-events.h @@ -48,9 +48,8 @@ enum { PPPIPV6_PKT_TOO_SMALL, PPP_WRONG_TYPE, - /* PPPOE EVENTS */ + /* PPPOE EVENTS */ PPPOE_PKT_TOO_SMALL, - }; }; #endif /* __DECODE_EVENTS_H__ */ diff --git a/src/decode-pppoe.c b/src/decode-pppoe.c index 281d3f1b77..9b51bd1fa2 100644 --- a/src/decode-pppoe.c +++ b/src/decode-pppoe.c @@ -1,8 +1,8 @@ /** - * \file Copyright (c) 2009 Open Infosec Foundation + * \file Copyright (c) 2009 Open Information Security Foundation * \author James Riden * - * PPPoE Decoder + * \brief PPPoE Decoder */ #include "eidps.h" @@ -22,24 +22,24 @@ void DecodePPPoE(ThreadVars *t, Packet *p, u_int8_t *pkt, u_int16_t len, PacketQueue *pq) { #ifdef DEBUG - printf("DecodePPPoEPacket\n"); + printf("DecodePPPoEPacket\n"); #endif - if (len < PPPOE_HEADER_LEN) { - DECODER_SET_EVENT(p, PPPOE_PKT_TOO_SMALL); - return; - } + if (len < PPPOE_HEADER_LEN) { + DECODER_SET_EVENT(p, PPPOE_PKT_TOO_SMALL); + return; + } - p->pppoeh = (PPPoEHdr *)pkt; + p->pppoeh = (PPPoEHdr *)pkt; - if (p->pppoeh == NULL) - return; + if (p->pppoeh == NULL) + return; - if (p->pppoeh->pppoe_length>0) { - /* decode contained PPP packet */ - PerfCounterIncr(COUNTER_DECODER_PPP, t->pca); - DecodePPP(t, p, pkt + PPPOE_HEADER_LEN, len - PPPOE_HEADER_LEN, pq); - } + if (p->pppoeh->pppoe_length>0) { + /* decode contained PPP packet */ + PerfCounterIncr(COUNTER_DECODER_PPP, t->pca); + DecodePPP(t, p, pkt + PPPOE_HEADER_LEN, len - PPPOE_HEADER_LEN, pq); + } } @@ -49,9 +49,9 @@ void DecodePPPoE(ThreadVars *t, Packet *p, u_int8_t *pkt, u_int16_t len, PacketQ */ static int DecodePPPoEtest01 (void) { - /* 0000 ff ff ff ff ff ff 00 0a e4 13 31 a3 81 00 03 98 ..........1..... - 0010 81 00 00 80 88 63 11 09 00 00 00 08 01 01 00 00 .....c.......... - 0020 01 00 00 00 */ + /* 0000 ff ff ff ff ff ff 00 0a e4 13 31 a3 81 00 03 98 ..........1..... + 0010 81 00 00 80 88 63 11 09 00 00 00 08 01 01 00 00 .....c.......... + 0020 01 00 00 00 */ u_int8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x00, 0x00 }; Packet p; @@ -65,7 +65,7 @@ static int DecodePPPoEtest01 (void) { /* Function my returns here with expected value */ if(DECODER_ISSET_EVENT(&p,PPPOE_PKT_TOO_SMALL)) { - return 1; + return 1; } return 0; diff --git a/src/decode-pppoe.h b/src/decode-pppoe.h index dddd6c7e6f..009c904142 100644 --- a/src/decode-pppoe.h +++ b/src/decode-pppoe.h @@ -21,11 +21,11 @@ typedef struct _PPPoEHdr { - unsigned pppoe_version :4; - unsigned pppoe_type :4; - u_int8_t pppoe_code; - u_int16_t sessin_id; - u_int16_t pppoe_length; + unsigned pppoe_version :4; + unsigned pppoe_type :4; + u_int8_t pppoe_code; + u_int16_t sessin_id; + u_int16_t pppoe_length; } PPPoEHdr; #define PPPOE_CODE_PADI 0x09 diff --git a/src/decode.h b/src/decode.h index 5c888b1503..6ed2c47c86 100644 --- a/src/decode.h +++ b/src/decode.h @@ -28,7 +28,7 @@ #include "source-nfq.h" -#include "source-pcap.h" +#include "source-pcap.h" #include "action-globals.h" #include "decode-ethernet.h" diff --git a/src/eidps.c b/src/eidps.c index b3d5ecb31e..87ed043441 100644 --- a/src/eidps.c +++ b/src/eidps.c @@ -947,7 +947,7 @@ int main(int argc, char **argv) PerfRegisterTests(); DecodePPPRegisterTests(); HTTPParserRegisterTests(); - DecodePPPoERegisterTests(); + DecodePPPoERegisterTests(); UtRunTests(); UtCleanup(); exit(0);