Finish converting over to having the caller print the IP address
(except for UDP, TCP and SCTP). This consists mostly of removing
places where the IP address is printed, both in the big "case"
in ip_print() and in the individual printers.
Also fix a couple of spacing bugs.
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.26 2000-09-29 04:58:36 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.27 2001-06-15 22:17:31 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
egp = (struct egp_packet *)bp;
ip = (struct ip *)bp2;
egp = (struct egp_packet *)bp;
ip = (struct ip *)bp2;
- (void)printf("%s > %s: egp: ",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
if (egp->egp_version != EGP_VERSION) {
printf("[version %d]", egp->egp_version);
if (egp->egp_version != EGP_VERSION) {
printf("[version %d]", egp->egp_version);
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.12 2001-03-13 01:03:17 fenner Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.13 2001-06-15 22:17:31 fenner Exp $";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
TCHECK(gre->proto);
flags = EXTRACT_16BITS(&gre->flags);
proto = EXTRACT_16BITS(&gre->proto);
TCHECK(gre->proto);
flags = EXTRACT_16BITS(&gre->flags);
proto = EXTRACT_16BITS(&gre->proto);
if (flags) {
/* Decode the flags */
if (flags) {
/* Decode the flags */
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.58 2001-01-28 09:53:18 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.59 2001-06-15 22:17:32 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
ip = (struct ip *)bp2;
str = buf;
ip = (struct ip *)bp2;
str = buf;
-#if 0
- (void)printf("%s > %s: ",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
-#endif
-
TCHECK(dp->icmp_code);
switch (dp->icmp_type) {
TCHECK(dp->icmp_code);
switch (dp->icmp_type) {
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.54 2001-06-01 23:01:04 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.55 2001-06-15 22:17:32 fenner Exp $";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
char buf[256];
int icmp6len, prot;
char buf[256];
int icmp6len, prot;
-#if 0
-#define TCHECK(var) if ((u_char *)&(var) > ep - sizeof(var)) goto trunc
-#endif
-
dp = (struct icmp6_hdr *)bp;
ip = (struct ip6_hdr *)bp2;
oip = (struct ip6_hdr *)(dp + 1);
dp = (struct icmp6_hdr *)bp;
ip = (struct ip6_hdr *)bp2;
oip = (struct ip6_hdr *)(dp + 1);
else /* XXX: jumbo payload case... */
icmp6len = snapend - bp;
else /* XXX: jumbo payload case... */
icmp6len = snapend - bp;
-#if 0
- (void)printf("%s > %s: ",
- ip6addr_string(&ip->ip6_src),
- ip6addr_string(&ip->ip6_dst));
-#endif
-
TCHECK(dp->icmp6_code);
switch (dp->icmp6_type) {
case ICMP6_DST_UNREACH:
TCHECK(dp->icmp6_code);
switch (dp->icmp6_type) {
case ICMP6_DST_UNREACH:
return;
trunc:
fputs("[|icmp6]", stdout);
return;
trunc:
fputs("[|icmp6]", stdout);
-#if 0
-#undef TCHECK
-#endif
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-igrp.c,v 1.15 2000-09-29 04:58:40 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-igrp.c,v 1.16 2001-06-15 22:17:32 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
hdr = (struct igrphdr *)bp;
ip = (struct ip *)bp2;
cp = (u_char *)(hdr + 1);
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));
/* Header */
TCHECK(*hdr);
/* Header */
TCHECK(*hdr);
igrp_entry_print((struct igrprte *)cp, 0, 1);
--next;
} else {
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;
break;
}
cp += IGRP_RTE_SIZE;
if (nint == 0 && nsys == 0 && next == 0)
return;
trunc:
if (nint == 0 && nsys == 0 && next == 0)
return;
trunc:
- fputs("[|igrp]", stdout);
+ fputs(" [|igrp]", stdout);
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.97 2001-05-29 15:35:20 mcr Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.98 2001-06-15 22:17:33 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
-#if 0
- (void)printf("%s > %s:", ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
-#endif
(void)printf(" nd %d", len);
break;
(void)printf(" nd %d", len);
break;
case 4:
/* DVMRP multicast tunnel (ip-in-ip encapsulation) */
case 4:
/* DVMRP multicast tunnel (ip-in-ip encapsulation) */
-#if 0
- if (vflag)
- (void)printf("%s > %s: ",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
-#endif
ip_print(cp, len);
if (! vflag) {
printf(" (ipip-proto-4)");
ip_print(cp, len);
if (! vflag) {
printf(" (ipip-proto-4)");
#endif
case IP6PROTO_ENCAP:
/* ip6-in-ip encapsulation */
#endif
case IP6PROTO_ENCAP:
/* ip6-in-ip encapsulation */
-#if 0
- if (vflag)
- (void)printf("%s > %s: ",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
-#endif
- if (! vflag) {
- printf(" (encap)");
- return;
- }
#define IPPROTO_GRE 47
#endif
case IPPROTO_GRE:
#define IPPROTO_GRE 47
#endif
case IPPROTO_GRE:
- if (vflag)
- (void)printf("gre %s > %s: ",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
/* do it */
gre_print(cp, len);
/* do it */
gre_print(cp, len);
- if (! vflag) {
- printf(" (gre encap)");
- return;
- }
break;
#ifndef IPPROTO_MOBILE
#define IPPROTO_MOBILE 55
#endif
case IPPROTO_MOBILE:
break;
#ifndef IPPROTO_MOBILE
#define IPPROTO_MOBILE 55
#endif
case IPPROTO_MOBILE:
- if (vflag)
- (void)printf("mobile %s > %s: ",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
- if (! vflag) {
- printf(" (mobile encap)");
- return;
- }
break;
#ifndef IPPROTO_PIM
break;
#ifndef IPPROTO_PIM
#define IPPROTO_VRRP 112
#endif
case IPPROTO_VRRP:
#define IPPROTO_VRRP 112
#endif
case IPPROTO_VRRP:
- if (vflag)
- (void)printf("vrrp %s > %s: ",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
vrrp_print(cp, len, ip->ip_ttl);
break;
default:
vrrp_print(cp, len, ip->ip_ttl);
break;
default:
-#if 0
- (void)printf("%s > %s:", ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
-#endif
(void)printf(" ip-proto-%d %d", nh, len);
break;
}
(void)printf(" ip-proto-%d %d", nh, len);
break;
}
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.5 2000-09-29 04:58:43 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.6 2001-06-15 22:17:33 fenner Exp $";
#endif
#include <sys/param.h>
#endif
#include <sys/param.h>
fputs("[|mobile]", stdout);
return;
}
fputs("[|mobile]", stdout);
return;
}
+ fputs("mobile: ", stdout);
proto = EXTRACT_16BITS(&mob->proto);
crc = EXTRACT_16BITS(&mob->hcheck);
proto = EXTRACT_16BITS(&mob->proto);
crc = EXTRACT_16BITS(&mob->hcheck);
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.29 2000-09-29 04:58:45 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.30 2001-06-15 22:17:34 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
op = (struct ospfhdr *)bp;
ip = (struct ip *)bp2;
op = (struct ospfhdr *)bp;
ip = (struct ip *)bp2;
- /* Print the source and destination address */
-#if 0
- (void) printf("%s > %s:",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
-#endif
/* XXX Before we do anything else, strip off the MD5 trailer */
TCHECK(op->ospf_authtype);
/* XXX Before we do anything else, strip off the MD5 trailer */
TCHECK(op->ospf_authtype);
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.27 2001-05-11 02:12:32 fenner Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.28 2001-06-15 22:17:34 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
enum pimv2_addrtype {
pimv2_unicast, pimv2_group, pimv2_source
};
enum pimv2_addrtype {
pimv2_unicast, pimv2_group, pimv2_source
};
-#if 0
-static char *addrtypestr[] = {
- "unicast", "group", "source"
-};
-#endif
/* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
/* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.17 2000-12-13 07:57:05 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.18 2001-06-15 22:17:34 fenner Exp $";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
/* 'ep' points to the end of available data. */
ep = snapend;
/* 'ep' points to the end of available data. */
ep = snapend;
-#if 0
- printf("%s > %s: ",
- ip6addr_string(&ip->ip6_src),
- ip6addr_string(&ip->ip6_dst));
-#endif
-
TCHECK(dp->ip6r_segleft);
printf("srcrt (len=%d", dp->ip6r_len); /*)*/
TCHECK(dp->ip6r_segleft);
printf("srcrt (len=%d", dp->ip6r_len); /*)*/
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.93 2001-03-17 04:41:51 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.94 2001-06-15 22:17:34 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
-#if 0
- (void)printf("%s.%s > %s.%s:",
- ipaddr_string(&ip->ip_src), udpport_string(sport),
- ipaddr_string(&ip->ip_dst), udpport_string(dport));
-#else
#ifdef INET6
if (ip6) {
if (ip6->ip6_nxt == IPPROTO_UDP) {
#ifdef INET6
if (ip6) {
if (ip6->ip6_nxt == IPPROTO_UDP) {
udpport_string(sport), udpport_string(dport));
}
}
udpport_string(sport), udpport_string(dport));
}
}
if (IP_V(ip) == 4 && vflag && !fragmented) {
int sum = up->uh_sum;
if (IP_V(ip) == 4 && vflag && !fragmented) {
int sum = up->uh_sum;