51 GRESreHdr *gsre = NULL;
52 GREPPtPHd *gre_pptp_h = NULL;
60 if (!PacketIncreaseCheckLayers(
p)) {
64 GREHdr *
greh = PacketSetGRE(
p, pkt);
102 if (header_len >
len) {
116 gsre = (GRESreHdr *)(pkt + header_len);
120 if ((
SCNtohs(gsre->af) == 0) && (gsre->sre_length == 0))
123 header_len += gsre->sre_length;
124 if (header_len >
len) {
181 gre_pptp_h = (GREPPtPHd *)pkt;
191 if (header_len >
len) {
216 if (gre_pptp_h && !gre_pptp_h->payload_length)
298 static int DecodeGREtest01 (
void)
300 uint8_t raw_gre[] = { 0x00 ,0x6e ,0x62 };
320 static int DecodeGREtest02 (
void)
322 uint8_t raw_gre[] = {
323 0x00, 0x6e, 0x62, 0xac, 0x40, 0x00, 0x40, 0x2f,
324 0xc2, 0xc7, 0x0a, 0x00, 0x00, 0x64, 0x0a, 0x00,
325 0x00, 0x8a, 0x30, 0x01, 0x0b, 0x00, 0x4e, 0x00,
326 0x00, 0x00, 0x18, 0x4a, 0x50, 0xff, 0x03, 0x00,
327 0x21, 0x45, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x40,
328 0x00, 0x40, 0x11, 0x94, 0x22, 0x50, 0x7e, 0x2b,
329 0x2d, 0xc2, 0x6d, 0x68, 0x68, 0x80, 0x0e, 0x00,
330 0x35, 0x00, 0x36, 0x9f, 0x18, 0xdb, 0xc4, 0x01,
331 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
332 0x01, 0x03, 0x73, 0x31, 0x36, 0x09, 0x73, 0x69,
333 0x74, 0x65, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x03,
334 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01,
335 0x00, 0x00, 0x29, 0x10, 0x00, 0x00, 0x00, 0x00,
357 static int DecodeGREtest03 (
void)
359 uint8_t raw_gre[] = {
360 0x00, 0x6e, 0x62, 0xac, 0x40, 0x00, 0x40, 0x2f,
361 0xc2, 0xc7, 0x0a, 0x00, 0x00, 0x64, 0x0a, 0x00,
362 0x00, 0x8a, 0x30, 0x01, 0x88, 0x0b, 0x00, 0x4e,
363 0x00, 0x00, 0x00, 0x18, 0x4a, 0x50, 0xff, 0x03,
364 0x00, 0x21, 0x45, 0x00, 0x00, 0x4a, 0x00, 0x00,
365 0x40, 0x00, 0x40, 0x11, 0x94, 0x22, 0x50, 0x7e,
366 0x2b, 0x2d, 0xc2, 0x6d, 0x68, 0x68, 0x80, 0x0e,
367 0x00, 0x35, 0x00, 0x36, 0x9f, 0x18, 0xdb, 0xc4,
368 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
369 0x00, 0x01, 0x03, 0x73, 0x31, 0x36, 0x09, 0x73,
370 0x69, 0x74, 0x65, 0x6d, 0x65, 0x74, 0x65, 0x72,
371 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00,
372 0x01, 0x00, 0x00, 0x29, 0x10, 0x00, 0x00, 0x00,
373 0x00, 0x00, 0x00, 0x00 };