Convert tabs to spaces in PPPoE code.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 8817364ef6
commit 2e4cc2ad3d

@ -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;
}

@ -48,9 +48,8 @@ enum {
PPPIPV6_PKT_TOO_SMALL,
PPP_WRONG_TYPE,
/* PPPOE EVENTS */
/* PPPOE EVENTS */
PPPOE_PKT_TOO_SMALL,
};
};
#endif /* __DECODE_EVENTS_H__ */

@ -1,8 +1,8 @@
/**
* \file Copyright (c) 2009 Open Infosec Foundation
* \file Copyright (c) 2009 Open Information Security Foundation
* \author James Riden <jamesr@europe.com>
*
* 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;

@ -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

@ -28,7 +28,7 @@
#include "source-nfq.h"
#include "source-pcap.h"
#include "source-pcap.h"
#include "action-globals.h"
#include "decode-ethernet.h"

@ -947,7 +947,7 @@ int main(int argc, char **argv)
PerfRegisterTests();
DecodePPPRegisterTests();
HTTPParserRegisterTests();
DecodePPPoERegisterTests();
DecodePPPoERegisterTests();
UtRunTests();
UtCleanup();
exit(0);

Loading…
Cancel
Save