X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/2c98bd5d6f08377f666629a784d3be018419edf2..5c77a341d4e766eef8beebaecd9e69bd2cc7b59b:/print-gre.c diff --git a/print-gre.c b/print-gre.c index fc090a4a..4a03dd39 100644 --- a/print-gre.c +++ b/print-gre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-gre.c,v 1.5 2002/09/18 20:40:06 jason Exp $ */ +/* $OpenBSD: print-gre.c,v 1.6 2002/10/30 03:04:04 fgsch Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -37,8 +37,8 @@ */ #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.17 2002-09-20 22:42:21 itojun Exp $ (LBL)"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.24 2003-11-16 09:36:21 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -67,6 +67,7 @@ static const char rcsid[] = #define GREPROTO_IP 0x0800 /* IP */ #define GREPROTO_PPP 0x880b /* PPTP */ +#define GREPROTO_ISO 0x00fe /* OSI */ /* source route entry types */ #define GRESRE_IP 0x0800 /* IP */ @@ -150,7 +151,7 @@ gre_print_0(const u_char *bp, u_int length) if (flags & GRE_SP) { if (len < 4) goto trunc; - printf("seq=0x%x ", EXTRACT_32BITS(bp)); + printf("seq %u ", EXTRACT_32BITS(bp)); bp += 4; len -= 4; } @@ -185,6 +186,9 @@ gre_print_0(const u_char *bp, u_int length) case GREPROTO_IP: ip_print(bp, len); break; + case GREPROTO_ISO: + isoclns_print(bp, len, len); + break; default: printf("gre-proto-0x%x", prot); } @@ -221,19 +225,19 @@ gre_print_1(const u_char *bp, u_int length) bp += 2; if (flags & GRE_CP) { - printf("cpset! "); + printf("cpset!"); return; } if (flags & GRE_RP) { - printf("rpset! "); + printf("rpset!"); return; } - if ((flags & GRE_KP) != 0) { - printf("kpunset! "); + if ((flags & GRE_KP) == 0) { + printf("kpunset!"); return; } if (flags & GRE_sP) { - printf("spset! "); + printf("spset!"); return; } @@ -243,7 +247,7 @@ gre_print_1(const u_char *bp, u_int length) if (len < 4) goto trunc; k = EXTRACT_32BITS(bp); - printf("key=0x%x call=0x%x ", (k >> 16) & 0xffff, k & 0xffff); + printf("call %d ", k & 0xffff); len -= 4; bp += 4; } @@ -251,7 +255,7 @@ gre_print_1(const u_char *bp, u_int length) if (flags & GRE_SP) { if (len < 4) goto trunc; - printf("seq=0x%x ", EXTRACT_32BITS(bp)); + printf("seq %u ", EXTRACT_32BITS(bp)); bp += 4; len -= 4; } @@ -259,22 +263,22 @@ gre_print_1(const u_char *bp, u_int length) if (flags & GRE_AP) { if (len < 4) goto trunc; - printf("ack=0x%x ", EXTRACT_32BITS(bp)); + printf("ack %u ", EXTRACT_32BITS(bp)); bp += 4; len -= 4; } if ((flags & GRE_SP) == 0) { - printf("no-payload "); + printf("no-payload"); return; } switch (prot) { case GREPROTO_PPP: - printf("gre-ppp-payload "); + printf("gre-ppp-payload"); break; default: - printf("gre-proto-0x%x ", prot); + printf("gre-proto-0x%x", prot); break; } return;