]> The Tcpdump Group git mirrors - tcpdump/blobdiff - ip.h
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / ip.h
diff --git a/ip.h b/ip.h
index dd8bad60b5526faa5649cd21d677c30ff6a16a07..c1be0e66f177ae20efe02a6eb018becf585cf30b 100644 (file)
--- a/ip.h
+++ b/ip.h
@@ -1,4 +1,3 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.8 2002-07-28 04:14:21 fenner Exp $ (LBL) */
 /*
  * Copyright (c) 1982, 1986, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -34,6 +33,9 @@
  *     @(#)ip.h        8.2 (Berkeley) 6/1/94
  */
 
+#ifndef netdissect_ip_h
+#define netdissect_ip_h
+
 /*
  * Definitions for internet protocol version 4.
  * Per RFC 791, September 1981.
  * against negative integers quite easily, and fail in subtle ways.
  */
 struct ip {
-       u_int8_t        ip_vhl;         /* header length, version */
-#define IP_V(ip)       (((ip)->ip_vhl & 0xf0) >> 4)
-#define IP_HL(ip)      ((ip)->ip_vhl & 0x0f)
-       u_int8_t        ip_tos;         /* type of service */
-       u_int16_t       ip_len;         /* total length */
-       u_int16_t       ip_id;          /* identification */
-       u_int16_t       ip_off;         /* fragment offset field */
-#define        IP_DF 0x4000                    /* dont fragment flag */
+       nd_uint8_t      ip_vhl;         /* header length, version */
+#define IP_V(ip)       ((GET_U_1((ip)->ip_vhl) & 0xf0) >> 4)
+#define IP_HL(ip)      (GET_U_1((ip)->ip_vhl) & 0x0f)
+       nd_uint8_t      ip_tos;         /* type of service */
+       nd_uint16_t     ip_len;         /* total length */
+       nd_uint16_t     ip_id;          /* identification */
+       nd_uint16_t     ip_off;         /* fragment offset field */
+#define        IP_DF 0x4000                    /* don't fragment flag */
 #define        IP_MF 0x2000                    /* more fragments flag */
 #define        IP_OFFMASK 0x1fff               /* mask for fragmenting bits */
-       u_int8_t        ip_ttl;         /* time to live */
-       u_int8_t        ip_p;           /* protocol */
-       u_int16_t       ip_sum;         /* checksum */
-       struct  in_addr ip_src,ip_dst;  /* source and dest address */
+       nd_uint8_t      ip_ttl;         /* time to live */
+       nd_uint8_t      ip_p;           /* protocol */
+       nd_uint16_t     ip_sum;         /* checksum */
+       nd_ipv4         ip_src,ip_dst;  /* source and dest address */
 };
 
 #define        IP_MAXPACKET    65535           /* maximum packet size */
@@ -102,10 +104,11 @@ struct ip {
 
 #define        IPOPT_RR                7               /* record packet route */
 #define        IPOPT_TS                68              /* timestamp */
+#define        IPOPT_RFC1393           82              /* traceroute RFC 1393 */
 #define        IPOPT_SECURITY          130             /* provide s,c,h,tcc */
 #define        IPOPT_LSRR              131             /* loose source route */
-#define        IPOPT_SATID             136             /* satnet id */
 #define        IPOPT_SSRR              137             /* strict source route */
+#define IPOPT_RA                148             /* router-alert, rfc2113 */
 
 /*
  * Offsets to fields in options other than EOL and NOP.
@@ -119,17 +122,17 @@ struct ip {
  * Time stamp option structure.
  */
 struct ip_timestamp {
-       u_int8_t        ipt_code;       /* IPOPT_TS */
-       u_int8_t        ipt_len;        /* size of structure (variable) */
-       u_int8_t        ipt_ptr;        /* index of current entry */
-       u_int8_t        ipt_oflwflg;    /* flags, overflow counter */
+       nd_uint8_t      ipt_code;       /* IPOPT_TS */
+       nd_uint8_t      ipt_len;        /* size of structure (variable) */
+       nd_uint8_t      ipt_ptr;        /* index of current entry */
+       nd_uint8_t      ipt_oflwflg;    /* flags, overflow counter */
 #define IPTS_OFLW(ip)  (((ipt)->ipt_oflwflg & 0xf0) >> 4)
 #define IPTS_FLG(ip)   ((ipt)->ipt_oflwflg & 0x0f)
        union ipt_timestamp {
-               u_int32_t ipt_time[1];
+               nd_uint32_t ipt_time[1];
                struct  ipt_ta {
-                       struct in_addr ipt_addr;
-                       u_int32_t ipt_time;
+                       nd_ipv4 ipt_addr;
+                       nd_uint32_t ipt_time;
                } ipt_ta[1];
        } ipt_timestamp;
 };
@@ -157,6 +160,4 @@ struct      ip_timestamp {
 #define        IPTTLDEC        1               /* subtracted when forwarding */
 
 #define        IP_MSS          576             /* default maximum segment size */
-
-/* in print-ip.c */
-extern u_int32_t ip_finddst(const struct ip *);
+#endif /* netdissect_ip_h */