]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
u_int*_t types renamed to the more widely used uint*_t
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 6 Jul 2010 12:44:06 +0000 (14:44 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 6 Jul 2010 12:44:06 +0000 (14:44 +0200)
26 files changed:
compat/types.h
configure.in
doc/Programming-Guide/02_CodingConventions.dox
helpers/basic_auth/RADIUS/basic_radius_auth.cc
helpers/basic_auth/RADIUS/radius-util.cc
helpers/basic_auth/RADIUS/radius-util.h
helpers/ntlm_auth/SSPI/ntlm_sspi_auth.cc
helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc
include/squid_endian.h
lib/getnameinfo.c
lib/strtoll.c
libntlmauth/ntlmauth.cc
libntlmauth/ntlmauth.h
src/CacheDigest.cc
src/ICP.h
src/fs/coss/store_dir_coss.cc
src/fs/ufs/store_dir_ufs.cc
src/fs/ufs/ufscommon.h
src/htcp.cc
src/htcp.h
src/icmp/Icmp.cc
src/icmp/Icmp.h
src/icmp/Icmp4.h
src/icp_v2.cc
src/icp_v3.cc
src/wccp2.cc

index eb3eb95bd3489cc5bd60d70c598062690a408f73..66adb85e186b0efcd220583e21ae937a3369f25d 100644 (file)
@@ -129,14 +129,16 @@ typedef long long int64_t;
 #endif
 #endif
 
-/* u_int64_t */
-#ifndef HAVE_U_INT64_T
-#if HAVE_UINT64_T
-typedef uint64_t u_int64_t;
-#else
-typedef unsigned int64_t u_int64_t;
-#endif
-#endif
+/* uint64_t */
+#if !HAVE_UINT64_T
+#if HAVE_U_INT64_T
+typedef u_int64_t uint64_t;
+#define HAVE_UINT64_T 1
+#elif HAVE_INT64_T
+typedef unsigned int64_t uint64_t;
+#define HAVE_UINT64_T 1
+#endif /* HAVE_U_INT64_T */
+#endif /* HAVE_UINT64_T */
 
 /* int32_t */
 #ifndef HAVE_INT32_T
@@ -149,14 +151,16 @@ typedef long int32_t;
 #endif
 #endif
 
-/* u_int32_t */
-#ifndef HAVE_U_INT32_T
-#if HAVE_UINT32_T
-typedef uint32_t u_int32_t;
-#else
-typedef unsigned int32_t u_int32_t;
-#endif
-#endif
+/* uint32_t */
+#if !HAVE_UINT32_T
+#if HAVE_U_INT32_T
+typedef u_int32_t uint32_t;
+#define HAVE_UINT32_T 1
+#elif HAVE_INT32_T
+typedef unsigned int32_t uint32_t;
+#define HAVE_UINT32_T 1
+#endif /* HAVE_U_INT32_T */
+#endif /* HAVE_UINT32_T */
 
 /* int16_t */
 #ifndef HAVE_INT16_T
@@ -169,14 +173,16 @@ typedef int int16_t;
 #endif
 #endif
 
-/* u_int16_t */
-#ifndef HAVE_U_INT16_T
-#if HAVE_UINT16_T
-typedef uint16_t u_int16_t;
-#else
-typedef unsigned int16_t u_int16_t;
-#endif
-#endif
+/* uint16_t */
+#if !HAVE_UINT16_T
+#if HAVE_U_INT16_T
+typedef u_int16_t uint16_t;
+#define HAVE_UINT16_T 1
+#elif HAVE_INT16_T
+typedef unsigned int16_t uint16_t;
+#define HAVE_UINT16_T 1
+#endif /* HAVE_U_INT16_T */
+#endif /* HAVE_UINT16_T */
 
 /* int8_t */
 #ifndef HAVE_INT8_T
@@ -187,14 +193,16 @@ typedef char int8_t;
 #endif
 #endif
 
-/* u_int8_t */
-#ifndef HAVE_U_INT8_T
-#if HAVE_UINT8_T
-typedef uint8_t u_int8_t;
-#else
-typedef unsigned char u_int8_t;
-#endif
-#endif
+/* uint8_t */
+#if !HAVE_UINT8_T
+#if HAVE_U_INT8_T
+typedef u_int8_t uint8_t;
+#define HAVE_UINT8_T 1
+#elif HAVE_INT8_T
+typedef unsigned int8_t uint8_t;
+#define HAVE_UINT8_T 1
+#endif /* HAVE_U_INT8_T */
+#endif /* HAVE_UINT8_T */
 
 #ifndef HAVE_PID_T
 #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */
index 048055525660f41d6679092e684857ca0609278a..38444d4e15319bacf5bffb5dc7370398a88c36f6 100644 (file)
@@ -2350,18 +2350,17 @@ AC_CHECK_TYPE(char,[
 
 dnl unsigned 8 bit ints - u_int8_t
 dnl if this is defined we trust it to be 8 bits
-AC_CHECK_TYPE(u_int8_t,[
-  AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
-  AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
-  ],,SQUID_DEFAULT_INCLUDES)
-
-dnl fallback #1
-dnl if this is defined we trust it to be 8 bits
 AC_CHECK_TYPE(uint8_t,[
   AC_CHECK_SIZEOF(uint8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
   AC_DEFINE(HAVE_UINT8_T,1,[uint8_t is defined in system headers])
   ],,SQUID_DEFAULT_INCLUDES)
 
+dnl if this is defined we trust it to be 8 bits
+AC_CHECK_TYPE(u_int8_t,[
+  AC_CHECK_SIZEOF(u_int8_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
+  AC_DEFINE(HAVE_U_INT8_T,1,[u_int8_t is defined in system headers])
+  ],,SQUID_DEFAULT_INCLUDES)
+
 dnl 16 bit integers - int16_t
 dnl if this is defined we trust it to be 16 bits
 AC_CHECK_TYPE(int16_t,[
@@ -2381,20 +2380,19 @@ AC_CHECK_TYPE(int,[
   AC_DEFINE(HAVE_INT,1,[int is defined in system headers])
   ],,SQUID_DEFAULT_INCLUDES)
 
-dnl unsigned 16 bit ints - u_int16_t
-dnl if this is defined we trust it to be 16 bits
-AC_CHECK_TYPE(u_int16_t,[
-  AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
-  AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
-  ],,SQUID_DEFAULT_INCLUDES)
-
-dnl fallback #1
+dnl unsigned 16 bit ints - uint16_t
 dnl if this is defined we trust it to be 16 bits
 AC_CHECK_TYPE(uint16_t,[
   AC_CHECK_SIZEOF(uint16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
   AC_DEFINE(HAVE_UINT16_T,1,[uint16_t is defined in system headers])
   ],,SQUID_DEFAULT_INCLUDES)
 
+dnl if this is defined we trust it to be 16 bits
+AC_CHECK_TYPE(u_int16_t,[
+  AC_CHECK_SIZEOF(u_int16_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
+  AC_DEFINE(HAVE_U_INT16_T,1,[u_int16_t is defined in system headers])
+  ],,SQUID_DEFAULT_INCLUDES)
+
 dnl 32 bit signed int - int32_t
 dnl if this is defined we trust it to be 32 bits
 AC_CHECK_TYPE(int32_t,[
@@ -2408,20 +2406,19 @@ AC_CHECK_TYPE(long,[
   AC_DEFINE(HAVE_LONG,1,[long is defined in system headers])
   ],,SQUID_DEFAULT_INCLUDES)
 
-dnl 32 bit unsigned int - u_int32_t
-dnl if this is defined we trust it to be 32 bits
-AC_CHECK_TYPE(u_int32_t,[
-  AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
-  AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
-  ],,SQUID_DEFAULT_INCLUDES)
-
-dnl fallback #1
+dnl 32 bit unsigned int - uint32_t
 dnl if this is defined we trust it to be 32 bits
 AC_CHECK_TYPE(uint32_t,[
   AC_CHECK_SIZEOF(uint32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
   AC_DEFINE(HAVE_UINT32_T,1,[uint32_t is defined in system headers])
   ],,SQUID_DEFAULT_INCLUDES)
 
+dnl if this is defined we trust it to be 32 bits
+AC_CHECK_TYPE(u_int32_t,[
+  AC_CHECK_SIZEOF(u_int32_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
+  AC_DEFINE(HAVE_U_INT32_T,1,[u_int32_t is defined in system headers])
+  ],,SQUID_DEFAULT_INCLUDES)
+
 dnl 64 bit signed - int64_t
 dnl if this is defind we trust it to be 64 bits
 AC_CHECK_TYPE(int64_t,[
@@ -2449,7 +2446,7 @@ AC_CHECK_TYPE(u_int64_t,[
   AC_DEFINE(HAVE_U_INT64_T,1,[u_int64_t is defined in system headers])
   ],,SQUID_DEFAULT_INCLUDES)
 
-dnl fallback #1
+dnl 64 bit unsigned - uint64_t
 dnl if this is defind we trust it to be 64 bits
 AC_CHECK_TYPE(uint64_t,[
   AC_CHECK_SIZEOF(uint64_t,,SQUID_DEFAULT_SIZEOF_INCLUDES)
index defc6f8fc930b7223db84d550fb9f474144aaf14..bb99c8d2f859c40a66ccbe77731c3f1cd4bb2b85 100644 (file)
 
 \verbatim
         int16_t    -  16 bit signed.
-        u_int16_t  -  16 bit unsigned.
+        uint16_t  -  16 bit unsigned.
         int32_t    -  32 bit signed.
-        u_int32_t  -  32 bit unsigned.
+        uint32_t  -  32 bit unsigned.
         int64_t    -  64 bit signed.
-        u_int64_t  -  64 bit unsigned.
+        uint64_t  -  64 bit unsigned.
 \endverbatim
 
 \section Documentation Documentation Conventions
index 94a6f0b4a57aacd3d3637c42af520dfe36344734..5b2228a03c9cf7cfaea35511cb235f688f4f1a4d 100644 (file)
@@ -114,8 +114,8 @@ static char identifier[MAXLINE] = "";
 static char svc_name[MAXLINE] = "radius";
 static int nasport = 111;
 static int nasporttype = 0;
-static u_int32_t nas_ipaddr;
-static u_int32_t auth_ipaddr;
+static uint32_t nas_ipaddr;
+static uint32_t auth_ipaddr;
 static int retries = 30;
 
 char progname[] = "basic_radius_auth";
@@ -166,7 +166,7 @@ md5_calc(uint8_t out[16], void *in, size_t len)
  *    Receive and verify the result.
  */
 static int
-result_recv(u_int32_t host, u_short udp_port, char *buffer, int length)
+result_recv(uint32_t host, u_short udp_port, char *buffer, int length)
 {
     AUTH_HDR *auth;
     int totallen;
@@ -288,7 +288,7 @@ authenticate(int socket_fd, const char *username, const char *passwd)
     int secretlen;
     u_char cbc[AUTH_VECTOR_LEN];
     int i, j;
-    u_int32_t ui;
+    uint32_t ui;
     struct sockaddr_in saremote;
     fd_set readfds;
     socklen_t salen;
index d040766be6406c434bd3d766c49f85a057bf7576..bcc28f8d8b6b434ead529e812b79380280013cb4 100644 (file)
@@ -102,37 +102,37 @@ static int good_ipaddr(char *addr)
  *     Return an IP address in host long notation from
  *     one supplied in standard dot notation.
  */
-static u_int32_t ipstr2long(char *ip_str)
+static uint32_t ipstr2long(char *ip_str)
 {
     char       buf[6];
     char       *ptr;
     int        i;
     int        count;
-    u_int32_t  ipaddr;
+    uint32_t   ipaddr;
     int        cur_byte;
 
-    ipaddr = (u_int32_t)0;
+    ipaddr = (uint32_t)0;
     for (i = 0; i < 4; i++) {
         ptr = buf;
         count = 0;
         *ptr = '\0';
         while (*ip_str != '.' && *ip_str != '\0' && count < 4) {
             if (!isdigit(*ip_str)) {
-                return((u_int32_t)0);
+                return((uint32_t)0);
             }
             *ptr++ = *ip_str++;
             count++;
         }
         if (count >= 4 || count == 0) {
-            return((u_int32_t)0);
+            return((uint32_t)0);
         }
         *ptr = '\0';
         cur_byte = atoi(buf);
         if (cur_byte < 0 || cur_byte > 255) {
-            return((u_int32_t)0);
+            return((uint32_t)0);
         }
         ip_str++;
-        ipaddr = ipaddr << 8 | (u_int32_t)cur_byte;
+        ipaddr = ipaddr << 8 | (uint32_t)cur_byte;
     }
     return(ipaddr);
 }
@@ -141,14 +141,14 @@ static u_int32_t ipstr2long(char *ip_str)
  *     Return an IP address in host long notation from a host
  *     name or address in dot notation.
  */
-u_int32_t get_ipaddr(char *host)
+uint32_t get_ipaddr(char *host)
 {
     struct hostent     *hp;
 
     if (good_ipaddr(host) == 0) {
         return(ipstr2long(host));
     } else if ((hp = gethostbyname(host)) == (struct hostent *)NULL) {
-        return((u_int32_t)0);
+        return((uint32_t)0);
     }
-    return(ntohl(*(u_int32_t *)hp->h_addr));
+    return(ntohl(*(uint32_t *)hp->h_addr));
 }
index ee16bfe1e519a3facb2b8984c84772f041e6b001..5234e87de173798f5f27b288680f1af431ab50d9 100644 (file)
@@ -4,4 +4,4 @@
 #include "util.h"
 
 /* util.c */
-u_int32_t              get_ipaddr (char *);
+uint32_t               get_ipaddr (char *);
index 0d7739b3cba6180a9cf21f161edddfbad3632771..11494612a1eb695b72263f34e39208c5bcb39f03 100644 (file)
@@ -489,7 +489,7 @@ try_again:
             if (strlen(buf) > 3)
                 plen = (strlen(buf) - 3) * 3 / 4;              /* we only need it here. Optimization */
             else
-                plen = sizeof(ntlmhdr) + sizeof u_int32_t); /* local_nego only has header and flags set. */
+                plen = sizeof(ntlmhdr) + sizeof uint32_t); /* local_nego only has header and flags set. */
                 debug("attempting SSPI challenge retrieval\n");
                 if ((c = (char *) SSP_MakeChallenge((ntlm_negotiate *) decoded, plen)) != NULL ) {
                     if (NTLM_packet_debug_enabled) {
index 45be55f613c1cf3943021dd4e6561622414469af..2bd9a0d316b030830692a0f73aa9f807bef637aa 100644 (file)
@@ -223,12 +223,12 @@ make_challenge(char *domain, char *domain_controller)
         return NULL;
     }
     ntlm_challenge chal;
-    u_int32_t flags = NTLM_REQUEST_NON_NT_SESSION_KEY |
-                      NTLM_CHALLENGE_TARGET_IS_DOMAIN |
-                      NTLM_NEGOTIATE_ALWAYS_SIGN |
-                      NTLM_NEGOTIATE_USE_NTLM |
-                      NTLM_NEGOTIATE_USE_LM |
-                      NTLM_NEGOTIATE_ASCII;
+    uint32_t flags = NTLM_REQUEST_NON_NT_SESSION_KEY |
+                     NTLM_CHALLENGE_TARGET_IS_DOMAIN |
+                     NTLM_NEGOTIATE_ALWAYS_SIGN |
+                     NTLM_NEGOTIATE_USE_NTLM |
+                     NTLM_NEGOTIATE_USE_LM |
+                     NTLM_NEGOTIATE_ASCII;
     ntlm_make_challenge(&chal, my_domain, my_domain_controller, (char *)challenge, NTLM_NONCE_LEN, flags);
     int len = sizeof(chal) - sizeof(chal.payload) + le16toh(chal.target.maxlen);
     return base64_encode_bin((char *)&chal, len);
index 35280108e167c6dbf7e3472b287e4500a17e821b..54e0f9a6b8e0039d71cadc133a5cf442750996fd 100644 (file)
  * the following interface:
  *
  * // Byte-swap
- * u_int16_t bswap16(u_int16_t);
- * u_int32_t bswap32(u_int32_t);
+ * uint16_t bswap16(uint16_t);
+ * uint32_t bswap32(uint32_t);
  *
  * // Convert from host byte order to big-endian, and vice versa.
- * u_int16_t htobe16(u_int16_t); // equivalent to htons()
- * u_int32_t htobe32(u_int32_t); // equivalent to htonl()
- * u_int16_t be16toh(u_int16_t); // equivalent to ntohs()
- * u_int32_t be32toh(u_int32_t); // equivalent to ntohs()
+ * uint16_t htobe16(uint16_t); // equivalent to htons()
+ * uint32_t htobe32(uint32_t); // equivalent to htonl()
+ * uint16_t be16toh(uint16_t); // equivalent to ntohs()
+ * uint32_t be32toh(uint32_t); // equivalent to ntohs()
  *
  * // Convert from host byte order to little-endian, and vice versa.
- * u_int16_t htole16(u_int16_t);
- * u_int32_t htole32(u_int32_t);
- * u_int16_t le16toh(u_int16_t);
- * u_int32_t le32toh(u_int32_t);
+ * uint16_t htole16(uint16_t);
+ * uint32_t htole32(uint32_t);
+ * uint16_t le16toh(uint16_t);
+ * uint32_t le32toh(uint32_t);
  */
 
 #include "config.h"
@@ -86,7 +86,7 @@
 #    define bswap16(x) bswap_16(x)
 #  else
 #    define bswap16(x) \
-       (((((u_int16_t)(x)) >> 8) & 0xff) | ((((u_int16_t)(x)) & 0xff) << 8))
+       (((((uint16_t)(x)) >> 8) & 0xff) | ((((uint16_t)(x)) & 0xff) << 8))
 #  endif
 #endif /* ! HAVE_BSWAP16 && ! defined(bswap16) */
 #if ! HAVE_BSWAP32 && ! defined(bswap32)
 #    define bswap32(x) bswap_32(x)
 #  else
 #    define bswap32(x) \
-       (((((u_int32_t)(x)) & 0xff000000) >> 24) | \
-        ((((u_int32_t)(x)) & 0x00ff0000) >>  8) | \
-        ((((u_int32_t)(x)) & 0x0000ff00) <<  8) | \
-        ((((u_int32_t)(x)) & 0x000000ff) << 24))
+       (((((uint32_t)(x)) & 0xff000000) >> 24) | \
+        ((((uint32_t)(x)) & 0x00ff0000) >>  8) | \
+        ((((uint32_t)(x)) & 0x0000ff00) <<  8) | \
+        ((((uint32_t)(x)) & 0x000000ff) << 24))
 #  endif
 #endif /* ! HAVE_BSWAP32 && ! defined(bswap32) */
 
index 16aba171cef99d8c0d41a0214eb10b152199d22f..2d3d135b1f53dc322c59c3d91ad391dc785ac4b3 100644 (file)
@@ -162,7 +162,7 @@ int flags;
     u_short port;
     int family, i;
     const char *addr;
-    u_int32_t v4a;
+    uint32_t v4a;
     int h_error;
     char numserv[512];
 
@@ -218,7 +218,7 @@ found:
 
     switch (sa->sa_family) {
     case AF_INET:
-        v4a = (u_int32_t)
+        v4a = (uint32_t)
               ntohl(((const struct sockaddr_in *)sa)->sin_addr.s_addr);
         if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a))
             flags |= NI_NUMERICHOST;
index 666b0828d31fa2690efe95c667f4aac31dfd613b..da7fc5fb356471bfd01548fdf0b9914222f85d10 100644 (file)
@@ -75,9 +75,9 @@ int64_t
 strtoll (const char *nptr, char **endptr, int base)
 {
     register const char *s = nptr;
-    register u_int64_t acc;
+    register uint64_t acc;
     register int c;
-    register u_int64_t cutoff;
+    register uint64_t cutoff;
     register int neg = 0, any, cutlim;
 
     /*
@@ -118,9 +118,9 @@ strtoll (const char *nptr, char **endptr, int base)
      * Set any if any `digits' consumed; make it negative to indicate
      * overflow.
      */
-    cutoff = neg ? -(u_int64_t) INT64_MIN : INT64_MAX;
-    cutlim = cutoff % (u_int64_t) base;
-    cutoff /= (u_int64_t) base;
+    cutoff = neg ? -(uint64_t) INT64_MIN : INT64_MAX;
+    cutlim = cutoff % (uint64_t) base;
+    cutoff /= (uint64_t) base;
     for (acc = 0, any = 0;; c = *s++) {
         if (xisdigit(c))
             c -= '0';
index 553e1c25e44f091218999677da00bae13e64c276..03f3b58e22093c03696949251c5fa25b12e79cb0 100644 (file)
@@ -43,7 +43,7 @@
 
 /** Dumps NTLM flags to standard error for debugging purposes */
 void
-ntlm_dump_ntlmssp_flags(u_int32_t flags)
+ntlm_dump_ntlmssp_flags(uint32_t flags)
 {
     fprintf(stderr, "flags: %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
             (flags & NTLM_NEGOTIATE_UNICODE ? "Unicode " : ""),
@@ -113,7 +113,7 @@ ntlm_validate_packet(const ntlmhdr * hdr, const int type)
  * String may be either ASCII or UNICODE depending on whether flags contains NTLM_NEGOTIATE_ASCII
  */
 lstring
-ntlm_fetch_string(const ntlmhdr *packet, const int32_t packet_size, const strhdr * str, const u_int32_t flags)
+ntlm_fetch_string(const ntlmhdr *packet, const int32_t packet_size, const strhdr * str, const uint32_t flags)
 {
     int16_t l;                 /* length */
     int32_t o;                 /* offset */
@@ -225,7 +225,7 @@ void
 ntlm_make_challenge(ntlm_challenge *ch,
                     const char *domain, const char *domain_controller_UNUSED,
                     const char *challenge_nonce, const int challenge_nonce_len,
-                    const u_int32_t flags)
+                    const uint32_t flags)
 {
     int pl = 0;
     memset(ch, 0, sizeof(ntlm_challenge));     /* reset */
index 93c62d7d35f4a6246e8dc057f9f26ea91f9b5994..a55e178983137d3be5cfe70d736346d5a4b7eda7 100644 (file)
@@ -108,7 +108,7 @@ extern "C" {
     } lstring;
 
     /** Debug dump the given flags field to stderr */
-    void ntlm_dump_ntlmssp_flags(const u_int32_t flags);
+    void ntlm_dump_ntlmssp_flags(const uint32_t flags);
 
 
     /* ************************************************************************* */
@@ -136,7 +136,7 @@ extern "C" {
     lstring ntlm_fetch_string(const ntlmhdr *packet,
                               const int32_t packet_length,
                               const strhdr *str,
-                              const u_int32_t flags);
+                              const uint32_t flags);
 
     /** Append a string to the NTLM packet payload. */
     void ntlm_add_to_payload(const ntlmhdr *packet_hdr,
@@ -169,7 +169,7 @@ extern "C" {
     /** Negotiation request sent by client */
     typedef struct _ntlm_negotiate {
         ntlmhdr hdr;           /**< "NTLMSSP" , LSWAP(0x1) */
-        u_int32_t flags;       /**< Request flags */
+        uint32_t flags;        /**< Request flags */
         strhdr domain;         /**< Domain we wish to authenticate in */
         strhdr workstation;    /**< Client workstation name */
         char payload[256];     /**< String data */
@@ -191,10 +191,10 @@ extern "C" {
     typedef struct _ntlm_challenge {
         ntlmhdr hdr;           /**< "NTLMSSP" , LSWAP(0x2) */
         strhdr target;         /**< Authentication target (domain/server ...) */
-        u_int32_t flags;               /**< Request flags */
+        uint32_t flags;                /**< Request flags */
         u_char challenge[NTLM_NONCE_LEN];      /**< Challenge string */
-        u_int32_t context_low; /**< LS part of the server context handle */
-        u_int32_t context_high;        /**< MS part of the server context handle */
+        uint32_t context_low;  /**< LS part of the server context handle */
+        uint32_t context_high; /**< MS part of the server context handle */
         char payload[256];             /**< String data */
     } ntlm_challenge;
 
@@ -210,7 +210,7 @@ extern "C" {
                              const char *domain_controller,
                              const char *challenge_nonce,
                              const int challenge_nonce_len,
-                             const u_int32_t flags);
+                             const uint32_t flags);
 
 
     /* ************************************************************************* */
index 7f290ae83598e6c42fffaae3af238918546f912f..6f0988abbac90fcdd4850c27aac87a661a2504c4 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
 static void cacheDigestHashKey(const CacheDigest * cd, const cache_key * key);
 
 /* static array used by cacheDigestHashKey for optimization purposes */
-static u_int32_t hashed_keys[4];
+static uint32_t hashed_keys[4];
 
 static void
 cacheDigestInit(CacheDigest * cd, int capacity, int bpe)
index a1f1db3713a1d59ef7d9dc4224ce6475d167c3c3..c7d898208d4a16c9799ef9476a86dc2825830751 100644 (file)
--- a/src/ICP.h
+++ b/src/ICP.h
@@ -55,11 +55,11 @@ struct _icp_common_t {
     /** total length (bytes) */
     unsigned short length;
     /** req number (req'd for UDP) */
-    u_int32_t reqnum;
-    u_int32_t flags;
-    u_int32_t pad;
+    uint32_t reqnum;
+    uint32_t flags;
+    uint32_t pad;
     /** sender host id */
-    u_int32_t shostid;
+    uint32_t shostid;
 
 /// \todo I don't believe this header is included in non-c++ code anywhere
 ///            the struct should become a public POD class and kill these ifdef.
index bda27c7f056ca5aa5caa36f632f6c25f710068d2..64db7fe2066d838516540ae18298dc43a96e3400 100644 (file)
@@ -81,8 +81,8 @@ static StoreEntry *storeCossAddDiskRestore(CossSwapDir * SD, const cache_key * k
         time_t timestamp,
         time_t lastref,
         time_t lastmod,
-        u_int32_t refcount,
-        u_int16_t flags,
+        uint32_t refcount,
+        uint16_t flags,
         int clean);
 static void storeCossDirRebuild(CossSwapDir * sd);
 static void storeCossDirCloseTmpSwapLog(CossSwapDir * sd);
@@ -511,8 +511,8 @@ storeCossAddDiskRestore(CossSwapDir * SD, const cache_key * key,
                         time_t timestamp,
                         time_t lastref,
                         time_t lastmod,
-                        u_int32_t refcount,
-                        u_int16_t flags,
+                        uint32_t refcount,
+                        uint16_t flags,
                         int clean)
 {
     StoreEntry *e = NULL;
index 8f86832499aa707ac81f6034dc239a3e8cbfc506..51df97615c88b9ed96957b49217859caa70719a1 100644 (file)
@@ -687,8 +687,8 @@ UFSSwapDir::addDiskRestore(const cache_key * key,
                            time_t timestamp,
                            time_t lastref,
                            time_t lastmod,
-                           u_int32_t refcount,
-                           u_int16_t newFlags,
+                           uint32_t refcount,
+                           uint16_t newFlags,
                            int clean)
 {
     StoreEntry *e = NULL;
index 8d5363a1809831c6bf9c7005be640240a5556bf8..bd3588c52d97bbf6d1370ce99b3888348c9166c0 100644 (file)
@@ -96,8 +96,8 @@ public:
                                time_t timestamp,
                                time_t lastref,
                                time_t lastmod,
-                               u_int32_t refcount,
-                               u_int16_t flags,
+                               uint32_t refcount,
+                               uint16_t flags,
                                int clean);
     int validFileno(sfileno filn, int flag) const;
     int mapBitAllocate();
index fe6d5079890a2ce6a47b716000ed9aabdd59c221..c6975e509cd41e457b1a6046639e95ba1c3ca562 100644 (file)
@@ -62,18 +62,18 @@ typedef struct _htcpStuff htcpStuff;
 typedef struct _htcpDetail htcpDetail;
 
 struct _Countstr {
-    u_int16_t length;
+    uint16_t length;
     char *text;
 };
 
 struct _htcpHeader {
-    u_int16_t length;
+    uint16_t length;
     u_char major;
     u_char minor;
 };
 
 struct _htcpDataHeaderSquid {
-    u_int16_t length;
+    uint16_t length;
 
 #if !WORDS_BIGENDIAN
     unsigned int opcode:4;
@@ -93,41 +93,41 @@ struct _htcpDataHeaderSquid {
     unsigned int reserved:6;
 #endif
 
-    u_int32_t msg_id;
+    uint32_t msg_id;
 };
 
 struct _htcpDataHeader {
-    u_int16_t length;
+    uint16_t length;
 
 #if WORDS_BIGENDIAN
-u_int8_t opcode:
+uint8_t opcode:
     4;
-u_int8_t response:
+uint8_t response:
     4;
 #else
-u_int8_t response:
+uint8_t response:
     4;
-u_int8_t opcode:
+uint8_t opcode:
     4;
 #endif
 
 #if WORDS_BIGENDIAN
-u_int8_t reserved:
+uint8_t reserved:
     6;
-u_int8_t F1:
+uint8_t F1:
     1;
-u_int8_t RR:
+uint8_t RR:
     1;
 #else
-u_int8_t RR:
+uint8_t RR:
     1;
-u_int8_t F1:
+uint8_t F1:
     1;
-u_int8_t reserved:
+uint8_t reserved:
     6;
 #endif
 
-    u_int32_t msg_id;
+    uint32_t msg_id;
 };
 
 /* RR == 0 --> F1 = RESPONSE DESIRED FLAG */
@@ -136,7 +136,7 @@ u_int8_t reserved:
 /* RR == 1 --> RESPONSE */
 
 struct _htcpAuthHeader {
-    u_int16_t length;
+    uint16_t length;
     time_t sig_time;
     time_t sig_expire;
     Countstr key_name;
@@ -182,7 +182,7 @@ struct _htcpStuff {
     int f1;
     int response;
     int reason;
-    u_int32_t msg_id;
+    uint32_t msg_id;
     htcpSpecifier S;
     htcpDetail D;
 };
@@ -225,11 +225,11 @@ enum {
     RR_RESPONSE
 };
 
-static u_int32_t msg_id_counter = 0;
+static uint32_t msg_id_counter = 0;
 static int htcpInSocket = -1;
 static int htcpOutSocket = -1;
 #define N_QUERIED_KEYS 8192
-static u_int32_t queried_id[N_QUERIED_KEYS];
+static uint32_t queried_id[N_QUERIED_KEYS];
 static cache_key queried_keys[N_QUERIED_KEYS][SQUID_MD5_DIGEST_LENGTH];
 
 static Ip::Address queried_addr[N_QUERIED_KEYS];
@@ -306,7 +306,7 @@ htcpBuildAuth(char *buf, size_t buflen)
 {
     htcpAuthHeader auth;
     size_t copy_sz = 0;
-    assert(2 == sizeof(u_int16_t));
+    assert(2 == sizeof(uint16_t));
     auth.length = htons(2);
     copy_sz += 2;
     if (buflen < copy_sz)
@@ -318,7 +318,7 @@ htcpBuildAuth(char *buf, size_t buflen)
 static ssize_t
 htcpBuildCountstr(char *buf, size_t buflen, const char *s)
 {
-    u_int16_t length;
+    uint16_t length;
     size_t len;
     int off = 0;
 
@@ -334,7 +334,7 @@ htcpBuildCountstr(char *buf, size_t buflen, const char *s)
 
     debugs(31, 3, "htcpBuildCountstr: TEXT = {" << (s ? s : "<NULL>") << "}");
 
-    length = htons((u_int16_t) len);
+    length = htons((uint16_t) len);
 
     xmemcpy(buf + off, &length, 2);
 
@@ -509,7 +509,7 @@ htcpBuildData(char *buf, size_t buflen, htcpStuff * stuff)
 
     debugs(31, 3, "htcpBuildData: hdr.length = " << off);
 
-    hdr.length = (u_int16_t) off;
+    hdr.length = (uint16_t) off;
 
     hdr.opcode = stuff->op;
 
@@ -576,7 +576,7 @@ htcpBuildPacket(char *buf, size_t buflen, htcpStuff * stuff)
     }
 
     off += s;
-    hdr.length = htons((u_int16_t) off);
+    hdr.length = htons((uint16_t) off);
     hdr.major = 0;
 
     if (old_squid_format)
@@ -653,7 +653,7 @@ htcpUnpackSpecifier(char *buf, int sz)
     HttpRequestMethod method;
 
     /* Find length of METHOD */
-    u_int16_t l = ntohs(*(u_int16_t *) buf);
+    uint16_t l = ntohs(*(uint16_t *) buf);
     sz -= 2;
     buf += 2;
 
@@ -670,7 +670,7 @@ htcpUnpackSpecifier(char *buf, int sz)
     debugs(31, 6, "htcpUnpackSpecifier: METHOD (" << l << "/" << sz << ") '" << s->method << "'");
 
     /* Find length of URI */
-    l = ntohs(*(u_int16_t *) buf);
+    l = ntohs(*(uint16_t *) buf);
     sz -= 2;
 
     if (l > sz) {
@@ -690,7 +690,7 @@ htcpUnpackSpecifier(char *buf, int sz)
     debugs(31, 6, "htcpUnpackSpecifier: URI (" << l << "/" << sz << ") '" << s->uri << "'");
 
     /* Find length of VERSION */
-    l = ntohs(*(u_int16_t *) buf);
+    l = ntohs(*(uint16_t *) buf);
     sz -= 2;
 
     if (l > sz) {
@@ -710,7 +710,7 @@ htcpUnpackSpecifier(char *buf, int sz)
     debugs(31, 6, "htcpUnpackSpecifier: VERSION (" << l << "/" << sz << ") '" << s->version << "'");
 
     /* Find length of REQ-HDRS */
-    l = ntohs(*(u_int16_t *) buf);
+    l = ntohs(*(uint16_t *) buf);
     sz -= 2;
 
     if (l > sz) {
@@ -761,7 +761,7 @@ htcpUnpackDetail(char *buf, int sz)
     htcpDetail *d = static_cast<htcpDetail *>(htcpDetailPool->alloc());
 
     /* Find length of RESP-HDRS */
-    u_int16_t l = ntohs(*(u_int16_t *) buf);
+    uint16_t l = ntohs(*(uint16_t *) buf);
     sz -= 2;
     buf += 2;
 
@@ -779,7 +779,7 @@ htcpUnpackDetail(char *buf, int sz)
     sz -= l;
 
     /* Find length of ENTITY-HDRS */
-    l = ntohs(*(u_int16_t *) buf);
+    l = ntohs(*(uint16_t *) buf);
 
     sz -= 2;
 
@@ -802,7 +802,7 @@ htcpUnpackDetail(char *buf, int sz)
     sz -= l;
 
     /* Find length of CACHE-HDRS */
-    l = ntohs(*(u_int16_t *) buf);
+    l = ntohs(*(uint16_t *) buf);
 
     sz -= 2;
 
index 1e2e70ce4e943f80a5bc8c766e8a0c96614e5f6e..ba862f6cc79d396a8d6f8f7115c9a3ffa276b06a 100644 (file)
@@ -44,7 +44,7 @@ public:
     HtcpReplyData();
     int hit;
     HttpHeader hdr;
-    u_int32_t msg_id;
+    uint32_t msg_id;
     double version;
 
     struct cto_t {
index fe0a032cf756d2383cc3bd1c8f209817347e270f..329c64ddb273516a304d7dc6c18f981c582861ca 100644 (file)
@@ -107,7 +107,7 @@ Icmp::ipHops(int ttl)
 }
 
 void
-Icmp::Log(const Ip::Address &addr, const u_int8_t type, const char* pkt_str, const int rtt, const int hops)
+Icmp::Log(const Ip::Address &addr, const uint8_t type, const char* pkt_str, const int rtt, const int hops)
 {
     debugs(42, 2, "pingerLog: " << std::setw(9) << current_time.tv_sec  <<
            "." << std::setfill('0') << std::setw(6) <<
index 3484acd15ac3697f845850ea9f99473d2faa99d6..1dcc80ea8b8efdd2e565e56f0abc79aee0fc28fa 100644 (file)
@@ -137,7 +137,7 @@ protected:
     int ipHops(int ttl);
 
     /// Log the packet.
-    void Log(const Ip::Address &addr, const u_int8_t type, const char* pkt_str, const int rtt, const int hops);
+    void Log(const Ip::Address &addr, const uint8_t type, const char* pkt_str, const int rtt, const int hops);
 
     /* no use wasting memory */
     int icmp_sock;
index 4bf7b3753486036a2768d896bcdf44c2e09881d0..e34d06a85e49dcf6eac8455234ae51c6e49eed3b 100644 (file)
 /* IP Header */
 typedef struct iphdr {
 
-u_int8_t  ip_vhl:
+uint8_t  ip_vhl:
     4;          /* Length of the header in dwords */
 
-u_int8_t  version:
+uint8_t  version:
     4;  /* Version of IP                  */
-    u_int8_t  tos;              /* Type of service                */
-    u_int16_t total_len;        /* Length of the packet in dwords */
-    u_int16_t ident;            /* unique identifier              */
-    u_int16_t flags;            /* Flags                          */
-    u_int8_t  ip_ttl;           /* Time to live                   */
-    u_int8_t  proto;            /* Protocol number (TCP, UDP etc) */
-    u_int16_t checksum;         /* IP checksum                    */
-    u_int32_t source_ip;
-    u_int32_t dest_ip;
+    uint8_t  tos;              /* Type of service                */
+    uint16_t total_len;        /* Length of the packet in dwords */
+    uint16_t ident;            /* unique identifier              */
+    uint16_t flags;            /* Flags                          */
+    uint8_t  ip_ttl;           /* Time to live                   */
+    uint8_t  proto;            /* Protocol number (TCP, UDP etc) */
+    uint16_t checksum;         /* IP checksum                    */
+    uint32_t source_ip;
+    uint32_t dest_ip;
 } iphdr;
 
 /* ICMP header */
 typedef struct icmphdr {
-    u_int8_t  icmp_type;        /* ICMP packet type                 */
-    u_int8_t  icmp_code;        /* Type sub code                    */
-    u_int16_t icmp_cksum;
-    u_int16_t icmp_id;
-    u_int16_t icmp_seq;
-    u_int32_t timestamp;        /* not part of ICMP, but we need it */
+    uint8_t  icmp_type;        /* ICMP packet type                 */
+    uint8_t  icmp_code;        /* Type sub code                    */
+    uint16_t icmp_cksum;
+    uint16_t icmp_id;
+    uint16_t icmp_seq;
+    uint32_t timestamp;        /* not part of ICMP, but we need it */
 } icmphdr;
 
 #endif  /* _SQUID_MSWIN_ */
index 2afd304e893f7bf1857f7c49e6fcc687c6ea16fc..b8c4c8f98211b2357cecf73a44c744ce775ac43a 100644 (file)
@@ -135,7 +135,7 @@ public:
 
     int rtt;
     int src_rtt;
-    u_int32_t flags;
+    uint32_t flags;
 };
 
 ICP2State::~ICP2State()
@@ -239,7 +239,7 @@ _icp_common_t::createMessage(
     buf_len = sizeof(icp_common_t) + strlen(url) + 1;
 
     if (opcode == ICP_QUERY)
-        buf_len += sizeof(u_int32_t);
+        buf_len += sizeof(uint32_t);
 
     buf = (char *) xcalloc(buf_len, 1);
 
@@ -249,7 +249,7 @@ _icp_common_t::createMessage(
 
     headerp->version = ICP_VERSION_CURRENT;
 
-    headerp->length = (u_int16_t) htons(buf_len);
+    headerp->length = (uint16_t) htons(buf_len);
 
     headerp->reqnum = htonl(reqnum);
 
@@ -262,7 +262,7 @@ _icp_common_t::createMessage(
     urloffset = buf + sizeof(icp_common_t);
 
     if (opcode == ICP_QUERY)
-        urloffset += sizeof(u_int32_t);
+        urloffset += sizeof(uint32_t);
 
     xmemcpy(urloffset, url, strlen(url));
 
@@ -449,9 +449,9 @@ doV2Query(int fd, Ip::Address &from, char *buf, icp_common_t header)
 {
     int rtt = 0;
     int src_rtt = 0;
-    u_int32_t flags = 0;
+    uint32_t flags = 0;
     /* We have a valid packet */
-    char *url = buf + sizeof(icp_common_t) + sizeof(u_int32_t);
+    char *url = buf + sizeof(icp_common_t) + sizeof(uint32_t);
     HttpRequest *icp_request = icpGetRequest(url, header.reqnum, fd, from);
 
     if (!icp_request)
@@ -649,7 +649,7 @@ icpHandleUdp(int sock, void *data)
 void
 icpConnectionsOpen(void)
 {
-    u_int16_t port;
+    uint16_t port;
     Ip::Address addr;
 
     struct addrinfo *xai = NULL;
index 109e0feabced221b29953bc9ff370134bd703fa2..510dbcb005ecb15cf395ed38922becbd302bf5ea 100644 (file)
@@ -59,7 +59,7 @@ static void
 doV3Query(int fd, Ip::Address &from, char *buf, icp_common_t header)
 {
     /* We have a valid packet */
-    char *url = buf + sizeof(icp_common_t) + sizeof(u_int32_t);
+    char *url = buf + sizeof(icp_common_t) + sizeof(uint32_t);
     HttpRequest *icp_request = icpGetRequest (url, header.reqnum, fd, from);
 
     if (!icp_request)
index d4769339d0d2583c96024a39476c097a70543a4b..f9af664b1632336f90e9de95f3e7cd9d2cbda59e 100644 (file)
@@ -577,7 +577,7 @@ wccp2_get_service_by_id(int service, int service_id) {
 static char
 wccp2_update_md5_security(char *password, char *ptr, char *packet, int len)
 {
-    u_int8_t md5_digest[16];
+    uint8_t md5_digest[16];
     char pwd[WCCP2_PASSWORD_LEN];
     SquidMD5_CTX M;
 
@@ -631,7 +631,7 @@ wccp2_check_security(struct wccp2_service_list_t *srv, char *security, char *pac
 {
 
     struct wccp2_security_md5_t *ws = (struct wccp2_security_md5_t *) security;
-    u_int8_t md5_digest[16], md5_challenge[16];
+    uint8_t md5_digest[16], md5_challenge[16];
     char pwd[WCCP2_PASSWORD_LEN];
     SquidMD5_CTX M;