- off = ntohs(ip->ip_off);
- if ((off & 0x1fff) == 0) {
- cp = (const u_char *)ip + hlen;
- nh = ip->ip_p;
-
- if (nh != IPPROTO_TCP && nh != IPPROTO_UDP) {
- (void)printf("%s > %s: ", ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
- }
-again:
- switch (nh) {
-
-#ifndef IPPROTO_AH
-#define IPPROTO_AH 51
-#endif
- case IPPROTO_AH:
- nh = *cp;
- advance = ah_print(cp, (const u_char *)ip);
- cp += advance;
- len -= advance;
- goto again;
-
-#ifndef IPPROTO_ESP
-#define IPPROTO_ESP 50
-#endif
- case IPPROTO_ESP:
- {
- int enh;
- advance = esp_print(cp, (const u_char *)ip, &enh);
- cp += advance;
- len -= advance;
- if (enh < 0)
- break;
- nh = enh & 0xff;
- goto again;
- }
-
-#ifndef IPPROTO_IPCOMP
-#define IPPROTO_IPCOMP 108
-#endif
- case IPPROTO_IPCOMP:
- {
- int enh;
- advance = ipcomp_print(cp, (const u_char *)ip, &enh);
- cp += advance;
- len -= advance;
- if (enh < 0)
- break;
- nh = enh & 0xff;
- goto again;
- }
-
- case IPPROTO_TCP:
- tcp_print(cp, len, (const u_char *)ip);
- break;
-
- case IPPROTO_UDP:
- udp_print(cp, len, (const u_char *)ip);
- break;
-
- case IPPROTO_ICMP:
- icmp_print(cp, len, (const u_char *)ip);
- break;
-
-#ifndef IPPROTO_IGRP
-#define IPPROTO_IGRP 9
-#endif
- case IPPROTO_IGRP:
- igrp_print(cp, len, (const u_char *)ip);
- break;
-
- case IPPROTO_ND:
-#if 0
- (void)printf("%s > %s:", ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
-#endif
- (void)printf(" nd %d", len);
- break;
-
- case IPPROTO_EGP:
- egp_print(cp, len, (const u_char *)ip);
- break;
-
-#ifndef IPPROTO_OSPF
-#define IPPROTO_OSPF 89
-#endif
- case IPPROTO_OSPF:
- ospf_print(cp, len, (const u_char *)ip);
- break;
-
-#ifndef IPPROTO_IGMP
-#define IPPROTO_IGMP 2
-#endif
- case IPPROTO_IGMP:
- igmp_print(cp, len, (const u_char *)ip);
- break;
-
- 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)");
- return;
- }
- break;
-
-#ifdef INET6
-#ifndef IP6PROTO_ENCAP
-#define IP6PROTO_ENCAP 41
-#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
- ip6_print(cp, len);
- if (! vflag) {
- printf(" (encap)");
- return;
- }
- break;
-#endif /*INET6*/
-
-
-#ifndef 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);
- if (! vflag) {
- printf(" (gre encap)");
- return;
- }
- 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));
- mobile_print(cp, len);
- if (! vflag) {
- printf(" (mobile encap)");
- return;
- }
- break;
-
-#ifndef IPPROTO_PIM
-#define IPPROTO_PIM 103
-#endif
- case IPPROTO_PIM:
- pim_print(cp, len);
- break;