ipds->nh = enh & 0xff;
goto again;
}
-
+
case IPPROTO_IPCOMP:
{
int enh;
case IPPROTO_DCCP:
dccp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len);
break;
-
+
case IPPROTO_TCP:
/* pass on the MF bit plus the offset to detect fragments */
tcp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
ipds->off & (IP_MF|IP_OFFMASK));
break;
-
+
case IPPROTO_UDP:
/* pass on the MF bit plus the offset to detect fragments */
udp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
ipds->off & (IP_MF|IP_OFFMASK));
break;
-
+
case IPPROTO_ICMP:
/* pass on the MF bit plus the offset to detect fragments */
icmp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
ipds->off & (IP_MF|IP_OFFMASK));
break;
-
+
case IPPROTO_PIGP:
/*
* XXX - the current IANA protocol number assignments
*/
igrp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
break;
-
+
case IPPROTO_EIGRP:
eigrp_print(ipds->cp, ipds->len);
break;
-
+
case IPPROTO_ND:
ND_PRINT((ndo, " nd %d", ipds->len));
break;
return;
}
break;
-
+
#ifdef INET6
case IPPROTO_IPV6:
/* ip6-in-ip encapsulation */
break;
default:
- if ((proto = getprotobynumber(ipds->nh)) != NULL)
+ if (ndo->ndo_nflag==0 && (proto = getprotobynumber(ipds->nh)) != NULL)
ND_PRINT((ndo, " %s", proto->p_name));
else
ND_PRINT((ndo, " ip-proto-%d", ipds->nh));
break;
}
}
-
+
void
ip_print_inner(netdissect_options *ndo,
const u_char *bp,
}
if (ipds->ip->ip_ttl >= 1)
- (void)printf(", ttl %u", ipds->ip->ip_ttl);
+ (void)printf(", ttl %u", ipds->ip->ip_ttl);
/*
* for the firewall guys, print id, offset.
if (ipds->off & 0x1fff) {
(void)printf("%s > %s:", ipaddr_string(&ipds->ip->ip_src),
ipaddr_string(&ipds->ip->ip_dst));
- if ((proto = getprotobynumber(ipds->ip->ip_p)) != NULL)
+ if (!ndo->ndo_nflag && (proto = getprotobynumber(ipds->ip->ip_p)) != NULL)
(void)printf(" %s", proto->p_name);
else
(void)printf(" ip-proto-%d", ipds->ip->ip_p);
- }
+ }
}
}