X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/c9d84d15c5c4dc8eca7594101fe5026080ed641e..2b4965f56167dfda7c60fc9db2d145698d948fd5:/print-igrp.c diff --git a/print-igrp.c b/print-igrp.c index 16dfc801..3cede7ec 100644 --- a/print-igrp.c +++ b/print-igrp.c @@ -22,27 +22,22 @@ */ #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-igrp.c,v 1.10 1999-10-30 05:11:14 itojun Exp $ (LBL)"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-igrp.c,v 1.21 2005-04-20 21:01:56 guy Exp $ (LBL)"; #endif -#include -#include /* concession to AIX */ -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include -#include -#include -#include -#include -#include +#include -#include #include #include "interface.h" #include "addrtoname.h" #include "igrp.h" +#include "ip.h" #include "extract.h" /* must come after interface.h */ static void @@ -82,19 +77,15 @@ static struct tok op2str[] = { }; void -igrp_print(register const u_char *bp, u_int length, register const u_char *bp2) +igrp_print(register const u_char *bp, u_int length, const u_char *bp2 _U_) { register struct igrphdr *hdr; - register struct ip *ip; register u_char *cp; u_int nint, nsys, next; hdr = (struct igrphdr *)bp; - ip = (struct ip *)bp2; cp = (u_char *)(hdr + 1); - (void)printf("%s > %s: igrp: ", - ipaddr_string(&ip->ip_src), - ipaddr_string(&ip->ip_dst)); + (void)printf("igrp:"); /* Header */ TCHECK(*hdr); @@ -103,8 +94,8 @@ igrp_print(register const u_char *bp, u_int length, register const u_char *bp2) next = EXTRACT_16BITS(&hdr->ig_nx); (void)printf(" %s V%d edit=%d AS=%d (%d/%d/%d)", - tok2str(op2str, "op-#%d", hdr->ig_op), - hdr->ig_v, + tok2str(op2str, "op-#%d", IGRP_OP(hdr->ig_vop)), + IGRP_V(hdr->ig_vop), hdr->ig_ed, EXTRACT_16BITS(&hdr->ig_as), nint, @@ -126,7 +117,7 @@ igrp_print(register const u_char *bp, u_int length, register const u_char *bp2) igrp_entry_print((struct igrprte *)cp, 0, 1); --next; } else { - (void)printf("[extra bytes %d]", length); + (void)printf(" [extra bytes %d]", length); break; } cp += IGRP_RTE_SIZE; @@ -135,5 +126,5 @@ igrp_print(register const u_char *bp, u_int length, register const u_char *bp2) if (nint == 0 && nsys == 0 && next == 0) return; trunc: - fputs("[|igrp]", stdout); + fputs(" [|igrp]", stdout); }