51 const uint8_t *pkt, uint32_t
len)
60 p->
pppoedh = (PPPOEDiscoveryHdr *)pkt;
85 uint32_t tag_length = 0;
91 SCLogDebug(
"pppoe_length %"PRIu32
", packet_length %"PRIu32
"",
100 while (pppoedt < (PPPOEDiscoveryTag*) (pkt + (
len -
sizeof(PPPOEDiscoveryTag))) &&
pppoe_length >=4 && packet_length >=4)
103 uint16_t tag_type =
SCNtohs(pppoedt->pppoe_tag_type);
105 tag_length =
SCNtohs(pppoedt->pppoe_tag_length);
107 SCLogDebug (
"PPPoE Tag type %x, length %"PRIu32, tag_type, tag_length);
115 if (packet_length >= 4 + tag_length) {
116 packet_length -= (4 + tag_length);
121 pppoedt = pppoedt + (4 + tag_length);
131 const uint8_t *pkt, uint32_t
len)
144 SCLogDebug(
"PPPOE VERSION %" PRIu32
" TYPE %" PRIu32
" CODE %" PRIu32
" SESSIONID %" PRIu32
" LENGTH %" PRIu32
"",
239 static int DecodePPPOEtest01 (
void)
242 uint8_t raw_pppoe[] = { 0x11, 0x00, 0x00, 0x00, 0x00 };
267 static int DecodePPPOEtest02 (
void)
270 uint8_t raw_pppoe[] = {
271 0x11, 0x00, 0x00, 0x01, 0x00, 0x40, 0x00, 0x21,
272 0x45, 0x00, 0x00, 0x3c, 0x05, 0x5c, 0x00, 0x00,
273 0x20, 0x01, 0xff, 0x30, 0xc0, 0xa8, 0x0a, 0x7f,
274 0xc0, 0xa8, 0x0a, 0x65, 0xab, 0xcd, 0x16, 0x5e,
275 0x02, 0x00, 0x37, 0x00, 0x41, 0x42, 0x43, 0x44,
276 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c,
277 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54,
278 0x55, 0x56, 0x57, 0x41, 0x42, 0x43, 0x44, 0x45,
279 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
352 static int DecodePPPOEtest04 (
void)
356 uint8_t raw_pppoe[] = {
357 0x11, 0xbb, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01,
385 static int DecodePPPOEtest05 (
void)
389 uint8_t raw_pppoe[] = {
390 0x11, 0x07, 0x00, 0x00, 0x00, 0x20, 0x01, 0x01,
391 0x00, 0x00, 0x01, 0x02, 0x00, 0x18, 0x47, 0x6f,
392 0x20, 0x52, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b,
393 0x20, 0x2d, 0x20, 0x65, 0x73, 0x68, 0x73, 0x68
422 static int DecodePPPOEtest06 (
void)
426 PPPOEDiscoveryHdr pppoedh;
428 pppoedh.pppoe_version_type = 0xCD;
431 printf(
"Error, PPPOE macro pppoe_session_get_version failed: ");
435 printf(
"Error, PPPOE macro pppoe_session_get_type failed: ");
439 printf(
"Error, PPPOE macro pppoe_discovery_get_version failed: ");
443 printf(
"Error, PPPOE macro pppoe_discovery_get_type failed: ");