60 PPPOEDiscoveryHdr *pppoedh = (PPPOEDiscoveryHdr *)pkt;
63 switch (pppoedh->pppoe_code) {
75 SCLogDebug(
"unknown PPPOE code: 0x%0" PRIX8
"", pppoedh->pppoe_code);
94 uint32_t tag_length = 0;
99 PPPOEDiscoveryTag *pppoedt = (PPPOEDiscoveryTag *)pkt_pppoedt;
100 uint16_t tag_type =
SCNtohs(pppoedt->pppoe_tag_type);
102 tag_length =
SCNtohs(pppoedt->pppoe_tag_length);
104 SCLogDebug(
"PPPoE Tag type %x, length %" PRIu32, tag_type, tag_length);
108 pkt_pppoedt = pkt_pppoedt + (4 + tag_length);
135 SCLogDebug(
"PPPOE VERSION %" PRIu32
" TYPE %" PRIu32
" CODE %" PRIu32
" SESSIONID %" PRIu32
136 " LENGTH %" PRIu32
"",
146 uint16_t ppp_protocol;
149 if (proto_hi & 0x01) {
151 ppp_protocol = proto_hi;
156 if (
len < pppoesh_len) {
164 SCLogDebug(
"Protocol %" PRIu16
" len %" PRIu8
"", ppp_protocol, pppoesh_len);
166 switch (ppp_protocol) {
241 SCLogDebug(
"unknown PPP protocol: %" PRIx32
"", ppp_protocol);
254 static int DecodePPPOEtest01(
void)
257 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x00, 0x00 };
278 static int DecodePPPOEtest02(
void)
281 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x01, 0x00, 0x40, 0x00, 0x21, 0x45, 0x00, 0x00, 0x3c,
282 0x05, 0x5c, 0x00, 0x00, 0x20, 0x01, 0xff, 0x30, 0xc0, 0xa8, 0x0a, 0x7f, 0xc0, 0xa8, 0x0a,
283 0x65, 0xab, 0xcd, 0x16, 0x5e, 0x02, 0x00, 0x37, 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
284 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55,
285 0x56, 0x57, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49 };
313 static int DecodePPPOEtest03(
void)
316 uint8_t raw_pppoe[] = { 0x11, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x01, 0x00, 0x00, 0x01, 0x02,
317 0x00, 0x18, 0x47, 0x6f, 0x20, 0x52, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x20, 0x2d, 0x20,
318 0x65, 0x73, 0x68, 0x73, 0x68, 0x65, 0x73, 0x68, 0x6f, 0x6f, 0x74 };
339 static int DecodePPPOEtest04(
void)
343 uint8_t raw_pppoe[] = { 0x11, 0xbb, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01, 0x00, 0x00 };
365 static int DecodePPPOEtest05(
void)
369 uint8_t raw_pppoe[] = { 0x11, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x01, 0x00, 0x00, 0x01, 0x02,
370 0x00, 0x18, 0x47, 0x6f, 0x20, 0x52, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x20, 0x2d, 0x20,
371 0x65, 0x73, 0x68, 0x73, 0x68 };
395 static int DecodePPPOEtest06(
void)
399 PPPOEDiscoveryHdr pppoedh;
401 pppoedh.pppoe_version_type = 0xCD;
414 static int DecodePPPOEtest07(
void)
417 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x1c, 0x21, 0x45, 0x00, 0x00, 0x1d, 0x97,
418 0xc3, 0x00, 0x00, 0x40, 0x01, 0x47, 0x0f, 0x0a, 0x64, 0x00, 0x00, 0xc0, 0xa8, 0xd1, 0x01,
419 0x08, 0x00, 0xd4, 0x4c, 0x1f, 0x32, 0x04, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
420 0x00, 0x00, 0x00, 0x00 };
441 static int DecodePPPOEtest08(
void)
444 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x3d, 0x21, 0x45, 0x00, 0x00, 0x3c, 0x00,
445 0x00, 0x40, 0x00, 0x40, 0x06, 0xed, 0xda, 0x0a, 0x64, 0x00, 0x00, 0x8e, 0xfa, 0xb3, 0x83,
446 0xde, 0xb5, 0x00, 0x50, 0xd4, 0xbd, 0x76, 0x54, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0xfe,
447 0xcc, 0x74, 0x2f, 0x00, 0x00, 0x02, 0x04, 0x05, 0xac, 0x01, 0x03, 0x03, 0x07, 0x04, 0x02,
448 0x08, 0x0a, 0xcb, 0xae, 0x92, 0x63, 0x00, 0x00, 0x00, 0x00 };
469 static int DecodePPPOEtest09(
void)
472 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x1c, 0x00, 0x21, 0x45, 0x00, 0x00, 0x1d,
473 0x97, 0xc3, 0x00, 0x00, 0x40, 0x01, 0x47, 0x0f, 0x0a, 0x64, 0x00, 0x00, 0xc0, 0xa8, 0xd1,
474 0x01, 0x08, 0x00, 0xd4, 0x4c, 0x1f, 0x32, 0x04, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
475 0x00, 0x00, 0x00, 0x00, 0x00 };
496 static int DecodePPPOEtest10(
void)
499 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x3d, 0x00, 0x21, 0x45, 0x00, 0x00, 0x3c,
500 0x00, 0x00, 0x40, 0x00, 0x40, 0x06, 0xed, 0xda, 0x0a, 0x64, 0x00, 0x00, 0x8e, 0xfa, 0xb3,
501 0x83, 0xde, 0xb5, 0x00, 0x50, 0xd4, 0xbd, 0x76, 0x54, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02,
502 0xfe, 0xcc, 0x74, 0x2f, 0x00, 0x00, 0x02, 0x04, 0x05, 0xac, 0x01, 0x03, 0x03, 0x07, 0x04,
503 0x02, 0x08, 0x0a, 0xcb, 0xae, 0x92, 0x63, 0x00, 0x00, 0x00, 0x00 };
524 static int DecodePPPOEtest11(
void)
526 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x01, 0x00 };
547 static int DecodePPPOEtest12(
void)
549 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x01, 0x21 };