X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/88633a833719baba8be6525451e59306674322b4..a9a7c86c7875a38358a9ff1f2a35e93febf6f41e:/missing/getnameinfo.c diff --git a/missing/getnameinfo.c b/missing/getnameinfo.c index 01bd8364..c287221c 100644 --- a/missing/getnameinfo.c +++ b/missing/getnameinfo.c @@ -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 @@ -39,11 +39,11 @@ #ifdef HAVE_CONFIG_H #include -#endif +#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 $"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/missing/getnameinfo.c,v 1.11 2003-11-16 09:36:49 guy Exp $"; #endif #include @@ -58,10 +58,6 @@ static const char rcsid[] = #include #include -#ifndef HAVE_PORTABLE_PROTOTYPE -#include "cdecl_ext.h" -#endif - #ifdef NEED_ADDRINFO_H #include "addrinfo.h" #endif @@ -128,7 +124,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 +132,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; @@ -178,7 +174,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) flags |= NI_NUMERICHOST; v4a >>= IN_CLASSA_NSHIFT; if (v4a == 0) - flags |= NI_NUMERICHOST; + flags |= NI_NUMERICHOST; break; #ifdef INET6 case AF_INET6: