]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip.c
use the offical LMP port number as per rfc4204
[tcpdump] / print-ip.c
index 09debbf35b76519ddd2c841546e53a05102c433d..bdf8ccf94e52e45713480880a7da25cabcddb384 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.149.2.1 2005-05-20 21:15:46 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.149.2.5 2005-11-13 20:30:18 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -341,12 +341,6 @@ in_cksum_shouldbe(u_int16_t sum, u_int16_t computed_sum)
        return shouldbe;
 }
 
-#ifndef IP_MF
-#define IP_MF 0x2000
-#endif /* IP_MF */
-#ifndef IP_DF
-#define IP_DF 0x4000
-#endif /* IP_DF */
 #define IP_RES 0x8000
 
 static struct tok ip_frag_values[] = {
@@ -411,21 +405,27 @@ again:
        case IPPROTO_SCTP:
                sctp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len);
                break;
+
+       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 &~ 0x6000));
+                         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 &~ 0x6000));
+                         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 & 0x3fff));
+                          ipds->off & (IP_MF|IP_OFFMASK));
                break;
                
        case IPPROTO_PIGP:
@@ -665,7 +665,7 @@ ip_print(netdissect_options *ndo,
                ipds->nh = ipds->ip->ip_p;
 
                if (ipds->nh != IPPROTO_TCP && ipds->nh != IPPROTO_UDP &&
-                   ipds->nh != IPPROTO_SCTP) {
+                   ipds->nh != IPPROTO_SCTP && ipds->nh != IPPROTO_DCCP) {
                        (void)printf("%s > %s: ",
                                     ipaddr_string(&ipds->ip->ip_src),
                                     ipaddr_string(&ipds->ip->ip_dst));