]> The Tcpdump Group git mirrors - tcpdump/blobdiff - missing/getnameinfo.c
document SIGUSR1 in manual page
[tcpdump] / missing / getnameinfo.c
index 01bd836407f62686334870aa00af6ca8390b678b..63aba7310487348522c8ac66f7e62db88f1b361a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -13,7 +13,7 @@
  * 3. Neither the name of the project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif 
-
-#ifndef lint
-static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/missing/getnameinfo.c,v 1.7 2000-10-07 05:20:24 itojun Exp $";
 #endif
 
 #include <sys/types.h>
@@ -58,10 +53,6 @@ static const char rcsid[] =
 #include <stddef.h>
 #include <errno.h>
 
-#ifndef HAVE_PORTABLE_PROTOTYPE
-#include "cdecl_ext.h"
-#endif 
-
 #ifdef NEED_ADDRINFO_H
 #include "addrinfo.h"
 #endif
@@ -116,7 +107,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
        u_short port;
        int family, i;
        char *addr, *p;
-       u_int32_t v4a;
+       uint32_t v4a;
        int h_error;
        char numserv[512];
        char numaddr[512];
@@ -128,7 +119,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
        if (sa->sa_len != salen)
                return ENI_SALEN;
 #endif
-       
+
        family = sa->sa_family;
        for (i = 0; afdl[i].a_af; i++)
                if (afdl[i].a_af == family) {
@@ -136,11 +127,11 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
                        goto found;
                }
        return ENI_FAMILY;
-       
+
  found:
        if (salen != afd->a_socklen)
                return ENI_SALEN;
-       
+
        port = ((struct sockinet *)sa)->si_port; /* network byte order */
        addr = (char *)sa + afd->a_off;
 
@@ -172,13 +163,13 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
 
        switch (sa->sa_family) {
        case AF_INET:
-               v4a = (u_int32_t)
+                v4a = (uint32_t)
                        ntohl(((struct sockaddr_in *)sa)->sin_addr.s_addr);
                if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a))
                        flags |= NI_NUMERICHOST;
                v4a >>= IN_CLASSA_NSHIFT;
                if (v4a == 0)
-                       flags |= NI_NUMERICHOST;                        
+                       flags |= NI_NUMERICHOST;
                break;
 #ifdef INET6
        case AF_INET6: