X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/9d45fb750b14e7def999e9252592d0dbef12983d..47fc89d711eec0a073d9b3b293a1af901b5bd791:/ip.h diff --git a/ip.h b/ip.h index c5f399d1..fd8ee92b 100644 --- a/ip.h +++ b/ip.h @@ -1,4 +1,3 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.6 2000-10-03 03:14:46 itojun Exp $ (LBL) */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -34,29 +33,6 @@ * @(#)ip.h 8.2 (Berkeley) 6/1/94 */ -#ifndef BYTE_ORDER -#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */ -#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ -#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/ - -#ifdef WORDS_BIGENDIAN -#define BYTE_ORDER BIG_ENDIAN -#else -#define BYTE_ORDER LITTLE_ENDIAN -#endif /* WORDS_BIGENDIAN */ -#endif /* BYTE_ORDER */ - -#if !defined(BYTE_ORDER) || \ - (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \ - BYTE_ORDER != PDP_ENDIAN) - /* you must determine what the correct bit order is for - * your compiler - the next line is an intentional error - * which will force your compiles to bomb until you fix - * the above macros. - */ - #error "Undefined or invalid BYTE_ORDER"; -#endif - /* * Definitions for internet protocol version 4. * Per RFC 791, September 1981. @@ -85,7 +61,7 @@ struct ip { u_int8_t ip_p; /* protocol */ u_int16_t ip_sum; /* checksum */ struct in_addr ip_src,ip_dst; /* source and dest address */ -}; +} UNALIGNED; #define IP_MAXPACKET 65535 /* maximum packet size */ @@ -125,10 +101,12 @@ 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. @@ -155,7 +133,7 @@ struct ip_timestamp { u_int32_t ipt_time; } ipt_ta[1]; } ipt_timestamp; -}; +} UNALIGNED; /* flag bits for ipt_flg */ #define IPOPT_TS_TSONLY 0 /* timestamps only */ @@ -180,3 +158,6 @@ struct ip_timestamp { #define IPTTLDEC 1 /* subtracted when forwarding */ #define IP_MSS 576 /* default maximum segment size */ + +/* in print-ip.c */ +extern int nextproto4_cksum(const struct ip *, const u_int8_t *, u_int, u_int);