61 PPPOEDiscoveryHdr *pppoedh = (PPPOEDiscoveryHdr *)pkt;
64 switch (pppoedh->pppoe_code) {
76 SCLogDebug(
"unknown PPPOE code: 0x%0" PRIX8
"", pppoedh->pppoe_code);
95 uint32_t tag_length = 0;
100 PPPOEDiscoveryTag *pppoedt = (PPPOEDiscoveryTag *)pkt_pppoedt;
101 uint16_t tag_type =
SCNtohs(pppoedt->pppoe_tag_type);
103 tag_length =
SCNtohs(pppoedt->pppoe_tag_length);
105 SCLogDebug(
"PPPoE Tag type %x, length %" PRIu32, tag_type, tag_length);
109 pkt_pppoedt = pkt_pppoedt + (4 + tag_length);
136 SCLogDebug(
"PPPOE VERSION %" PRIu32
" TYPE %" PRIu32
" CODE %" PRIu32
" SESSIONID %" PRIu32
137 " LENGTH %" PRIu32
"",
147 uint16_t ppp_protocol;
150 if (proto_hi & 0x01) {
152 ppp_protocol = proto_hi;
157 if (
len < pppoesh_len) {
165 SCLogDebug(
"Protocol %" PRIu16
" len %" PRIu8
"", ppp_protocol, pppoesh_len);
167 switch (ppp_protocol) {
242 SCLogDebug(
"unknown PPP protocol: %" PRIx32
"", ppp_protocol);
255 static int DecodePPPOEtest01(
void)
258 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x00, 0x00 };
279 static int DecodePPPOEtest02(
void)
282 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x01, 0x00, 0x40, 0x00, 0x21, 0x45, 0x00, 0x00, 0x3c,
283 0x05, 0x5c, 0x00, 0x00, 0x20, 0x01, 0xff, 0x30, 0xc0, 0xa8, 0x0a, 0x7f, 0xc0, 0xa8, 0x0a,
284 0x65, 0xab, 0xcd, 0x16, 0x5e, 0x02, 0x00, 0x37, 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
285 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55,
286 0x56, 0x57, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49 };
314 static int DecodePPPOEtest03(
void)
317 uint8_t raw_pppoe[] = { 0x11, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x01, 0x00, 0x00, 0x01, 0x02,
318 0x00, 0x18, 0x47, 0x6f, 0x20, 0x52, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x20, 0x2d, 0x20,
319 0x65, 0x73, 0x68, 0x73, 0x68, 0x65, 0x73, 0x68, 0x6f, 0x6f, 0x74 };
340 static int DecodePPPOEtest04(
void)
344 uint8_t raw_pppoe[] = { 0x11, 0xbb, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01, 0x00, 0x00 };
366 static int DecodePPPOEtest05(
void)
370 uint8_t raw_pppoe[] = { 0x11, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x01, 0x00, 0x00, 0x01, 0x02,
371 0x00, 0x18, 0x47, 0x6f, 0x20, 0x52, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x20, 0x2d, 0x20,
372 0x65, 0x73, 0x68, 0x73, 0x68 };
396 static int DecodePPPOEtest06(
void)
400 PPPOEDiscoveryHdr pppoedh;
402 pppoedh.pppoe_version_type = 0xCD;
415 static int DecodePPPOEtest07(
void)
418 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x1c, 0x21, 0x45, 0x00, 0x00, 0x1d, 0x97,
419 0xc3, 0x00, 0x00, 0x40, 0x01, 0x47, 0x0f, 0x0a, 0x64, 0x00, 0x00, 0xc0, 0xa8, 0xd1, 0x01,
420 0x08, 0x00, 0xd4, 0x4c, 0x1f, 0x32, 0x04, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
421 0x00, 0x00, 0x00, 0x00 };
442 static int DecodePPPOEtest08(
void)
445 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x3d, 0x21, 0x45, 0x00, 0x00, 0x3c, 0x00,
446 0x00, 0x40, 0x00, 0x40, 0x06, 0xed, 0xda, 0x0a, 0x64, 0x00, 0x00, 0x8e, 0xfa, 0xb3, 0x83,
447 0xde, 0xb5, 0x00, 0x50, 0xd4, 0xbd, 0x76, 0x54, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0xfe,
448 0xcc, 0x74, 0x2f, 0x00, 0x00, 0x02, 0x04, 0x05, 0xac, 0x01, 0x03, 0x03, 0x07, 0x04, 0x02,
449 0x08, 0x0a, 0xcb, 0xae, 0x92, 0x63, 0x00, 0x00, 0x00, 0x00 };
470 static int DecodePPPOEtest09(
void)
473 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x1c, 0x00, 0x21, 0x45, 0x00, 0x00, 0x1d,
474 0x97, 0xc3, 0x00, 0x00, 0x40, 0x01, 0x47, 0x0f, 0x0a, 0x64, 0x00, 0x00, 0xc0, 0xa8, 0xd1,
475 0x01, 0x08, 0x00, 0xd4, 0x4c, 0x1f, 0x32, 0x04, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
476 0x00, 0x00, 0x00, 0x00, 0x00 };
497 static int DecodePPPOEtest10(
void)
500 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x3d, 0x00, 0x21, 0x45, 0x00, 0x00, 0x3c,
501 0x00, 0x00, 0x40, 0x00, 0x40, 0x06, 0xed, 0xda, 0x0a, 0x64, 0x00, 0x00, 0x8e, 0xfa, 0xb3,
502 0x83, 0xde, 0xb5, 0x00, 0x50, 0xd4, 0xbd, 0x76, 0x54, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02,
503 0xfe, 0xcc, 0x74, 0x2f, 0x00, 0x00, 0x02, 0x04, 0x05, 0xac, 0x01, 0x03, 0x03, 0x07, 0x04,
504 0x02, 0x08, 0x0a, 0xcb, 0xae, 0x92, 0x63, 0x00, 0x00, 0x00, 0x00 };
525 static int DecodePPPOEtest11(
void)
527 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x01, 0x00 };
548 static int DecodePPPOEtest12(
void)
550 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x01, 0x21 };