51 const uint8_t *pkt, uint32_t
len)
62 p->
pppoedh = (PPPOEDiscoveryHdr *)pkt;
86 SCLogDebug(
"pppoe_length %"PRIu32
", packet_length %"PRIu32
"",
98 uint32_t tag_length = 0;
103 PPPOEDiscoveryTag *pppoedt = (PPPOEDiscoveryTag *)pkt_pppoedt;
104 uint16_t tag_type =
SCNtohs(pppoedt->pppoe_tag_type);
106 tag_length =
SCNtohs(pppoedt->pppoe_tag_length);
108 SCLogDebug (
"PPPoE Tag type %x, length %"PRIu32, tag_type, tag_length);
112 pkt_pppoedt = pkt_pppoedt + (4 + tag_length);
126 const uint8_t *pkt, uint32_t
len)
139 SCLogDebug(
"PPPOE VERSION %" PRIu32
" TYPE %" PRIu32
" CODE %" PRIu32
" SESSIONID %" PRIu32
" LENGTH %" PRIu32
"",
151 if (ppp_protocol & 0x0100) {
159 if (
len < pppoesh_len) {
165 SCLogDebug(
"Protocol %" PRIu16
" len %" PRIu8
"", ppp_protocol, pppoesh_len);
167 switch (ppp_protocol) {
239 SCLogDebug(
"unknown PPP protocol: %" PRIx32
"", ppp_protocol);
252 static int DecodePPPOEtest01 (
void)
255 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x00, 0x00 };
276 static int DecodePPPOEtest02 (
void)
279 uint8_t raw_pppoe[] = {
280 0x11, 0x00, 0x00, 0x01, 0x00, 0x40, 0x00, 0x21,
281 0x45, 0x00, 0x00, 0x3c, 0x05, 0x5c, 0x00, 0x00,
282 0x20, 0x01, 0xff, 0x30, 0xc0, 0xa8, 0x0a, 0x7f,
283 0xc0, 0xa8, 0x0a, 0x65, 0xab, 0xcd, 0x16, 0x5e,
284 0x02, 0x00, 0x37, 0x00, 0x41, 0x42, 0x43, 0x44,
285 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c,
286 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54,
287 0x55, 0x56, 0x57, 0x41, 0x42, 0x43, 0x44, 0x45,
288 0x46, 0x47, 0x48, 0x49 };
317 static int DecodePPPOEtest03 (
void)
321 uint8_t raw_pppoe[] = {
322 0x11, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x01,
323 0x00, 0x00, 0x01, 0x02, 0x00, 0x18, 0x47, 0x6f,
324 0x20, 0x52, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b,
325 0x20, 0x2d, 0x20, 0x65, 0x73, 0x68, 0x73, 0x68,
326 0x65, 0x73, 0x68, 0x6f, 0x6f, 0x74
348 static int DecodePPPOEtest04 (
void)
352 uint8_t raw_pppoe[] = {
353 0x11, 0xbb, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01,
377 static int DecodePPPOEtest05 (
void)
381 uint8_t raw_pppoe[] = {
382 0x11, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x01,
383 0x00, 0x00, 0x01, 0x02, 0x00, 0x18, 0x47, 0x6f,
384 0x20, 0x52, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b,
385 0x20, 0x2d, 0x20, 0x65, 0x73, 0x68, 0x73, 0x68
410 static int DecodePPPOEtest06 (
void)
414 PPPOEDiscoveryHdr pppoedh;
416 pppoedh.pppoe_version_type = 0xCD;
429 static int DecodePPPOEtest07(
void)
432 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x1c, 0x21, 0x45, 0x00, 0x00, 0x1d, 0x97,
433 0xc3, 0x00, 0x00, 0x40, 0x01, 0x47, 0x0f, 0x0a, 0x64, 0x00, 0x00, 0xc0, 0xa8, 0xd1, 0x01,
434 0x08, 0x00, 0xd4, 0x4c, 0x1f, 0x32, 0x04, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
435 0x00, 0x00, 0x00, 0x00 };
456 static int DecodePPPOEtest08(
void)
459 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x3d, 0x21, 0x45, 0x00, 0x00, 0x3c, 0x00,
460 0x00, 0x40, 0x00, 0x40, 0x06, 0xed, 0xda, 0x0a, 0x64, 0x00, 0x00, 0x8e, 0xfa, 0xb3, 0x83,
461 0xde, 0xb5, 0x00, 0x50, 0xd4, 0xbd, 0x76, 0x54, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0xfe,
462 0xcc, 0x74, 0x2f, 0x00, 0x00, 0x02, 0x04, 0x05, 0xac, 0x01, 0x03, 0x03, 0x07, 0x04, 0x02,
463 0x08, 0x0a, 0xcb, 0xae, 0x92, 0x63, 0x00, 0x00, 0x00, 0x00 };
484 static int DecodePPPOEtest09(
void)
487 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x1c, 0x00, 0x21, 0x45, 0x00, 0x00, 0x1d,
488 0x97, 0xc3, 0x00, 0x00, 0x40, 0x01, 0x47, 0x0f, 0x0a, 0x64, 0x00, 0x00, 0xc0, 0xa8, 0xd1,
489 0x01, 0x08, 0x00, 0xd4, 0x4c, 0x1f, 0x32, 0x04, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
490 0x00, 0x00, 0x00, 0x00, 0x00 };
511 static int DecodePPPOEtest10(
void)
514 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x2d, 0x00, 0x3d, 0x00, 0x21, 0x45, 0x00, 0x00, 0x3c,
515 0x00, 0x00, 0x40, 0x00, 0x40, 0x06, 0xed, 0xda, 0x0a, 0x64, 0x00, 0x00, 0x8e, 0xfa, 0xb3,
516 0x83, 0xde, 0xb5, 0x00, 0x50, 0xd4, 0xbd, 0x76, 0x54, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02,
517 0xfe, 0xcc, 0x74, 0x2f, 0x00, 0x00, 0x02, 0x04, 0x05, 0xac, 0x01, 0x03, 0x03, 0x07, 0x04,
518 0x02, 0x08, 0x0a, 0xcb, 0xae, 0x92, 0x63, 0x00, 0x00, 0x00, 0x00 };