From 4102a5db28172e402b6aaeef581ab2fc93a2f7eb Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Wed, 9 Nov 2005 15:43:39 +0000 Subject: [PATCH] Various changes to header files for tcpdump. --- include/ctype.h | 3 +++ include/netinet/in.h | 12 ++++++++++++ include/sys/param.h | 4 +--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/ctype.h b/include/ctype.h index 2467557ab..f9d16e1fa 100755 --- a/include/ctype.h +++ b/include/ctype.h @@ -35,6 +35,7 @@ _PROTOTYPE( int isupper, (int _c) ); /* upper-case letter [A-Z] */ _PROTOTYPE( int isxdigit,(int _c) ); /* hex digit [0-9], [a-f], [A-F] */ _PROTOTYPE( int tolower, (int _c) ); /* convert to lower-case */ _PROTOTYPE( int toupper, (int _c) ); /* convert to upper-case */ +_PROTOTYPE( int toascii, (int _c) ); /* convert to 7-bit ASCII */ /* Macros for identifying character classes. */ #define isalnum(c) ((__ctype+1)[c]&(_U|_L|_N)) @@ -51,4 +52,6 @@ _PROTOTYPE( int toupper, (int _c) ); /* convert to upper-case */ #define isprint(c) ((unsigned) ((c)-' ') < 95) #define isascii(c) ((unsigned) (c) < 128) +#define toascii(c) ((c) & 0x7f) + #endif /* _CTYPE_H */ diff --git a/include/netinet/in.h b/include/netinet/in.h index ca35c9134..f5ca7d4d1 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -29,7 +29,9 @@ typedef uint8_t sa_family_t; /* Protocols */ #define IPPROTO_IP 0 /* Dummy protocol */ +#define IPPROTO_ICMP 1 /* ICMP */ #define IPPROTO_TCP 6 /* TCP */ +#define IPPROTO_EGP 8 /* exterior gateway protocol */ #define IPPROTO_UDP 17 /* UDP */ /* setsockopt options at IP level */ @@ -57,4 +59,14 @@ struct ip_mreq struct in_addr imr_interface; }; +/* Definitions that are not part of the Open Group Base Specifications */ +#define IN_CLASSA(i) (((uint32_t)(i) & 0x80000000) == 0) +#define IN_CLASSA_NET 0xff000000 + +#define IN_CLASSB(i) (((uint32_t)(i) & 0xc0000000) == 0x80000000) +#define IN_CLASSB_NET 0xffff0000 + +#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) +#define IN_CLASSC_NET 0xffffff00 + #endif /* _NETINET__IN_H */ diff --git a/include/sys/param.h b/include/sys/param.h index 0ef24f643..3cbc066a2 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -2,6 +2,4 @@ sys/param.h */ -/* Do we need this header file? Maybe an empty one is sufficient to avoid - * compilations errors. - */ +#define MAXHOSTNAMELEN 256 /* max hostname size */ -- 2.44.0