diff options
-rw-r--r-- | include/arpa/inet.h | 12 | ||||
-rw-r--r-- | lib/libc/net/inet.3 | 10 | ||||
-rw-r--r-- | lib/libc/net/inet_addr.c | 4 | ||||
-rw-r--r-- | lib/libc/net/inet_lnaof.c | 6 | ||||
-rw-r--r-- | lib/libc/net/inet_makeaddr.c | 6 | ||||
-rw-r--r-- | lib/libc/net/inet_neta.c | 4 | ||||
-rw-r--r-- | lib/libc/net/inet_netof.c | 6 | ||||
-rw-r--r-- | lib/libc/net/inet_network.c | 7 | ||||
-rw-r--r-- | sys/netinet/in.h | 2 | ||||
-rw-r--r-- | sys/sys/types.h | 1 |
10 files changed, 33 insertions, 25 deletions
diff --git a/include/arpa/inet.h b/include/arpa/inet.h index e28b739..fe60747 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -84,13 +84,13 @@ struct in_addr; __BEGIN_DECLS int ascii2addr __P((int, const char *, void *)); char *addr2ascii __P((int, const void *, int, char *)); -unsigned long inet_addr __P((const char *)); +in_addr_t inet_addr __P((const char *)); int inet_aton __P((const char *, struct in_addr *)); -unsigned long inet_lnaof __P((struct in_addr)); -struct in_addr inet_makeaddr __P((u_long , u_long)); -char * inet_neta __P((u_long, char *, size_t)); -unsigned long inet_netof __P((struct in_addr)); -unsigned long inet_network __P((const char *)); +in_addr_t inet_lnaof __P((struct in_addr)); +struct in_addr inet_makeaddr __P((in_addr_t, in_addr_t)); +char * inet_neta __P((in_addr_t, char *, size_t)); +in_addr_t inet_netof __P((struct in_addr)); +in_addr_t inet_network __P((const char *)); char *inet_net_ntop __P((int, const void *, int, char *, size_t)); int inet_net_pton __P((int, const char *, void *, size_t)); char *inet_ntoa __P((struct in_addr)); diff --git a/lib/libc/net/inet.3 b/lib/libc/net/inet.3 index 3159fef..270f3dc 100644 --- a/lib/libc/net/inet.3 +++ b/lib/libc/net/inet.3 @@ -55,9 +55,9 @@ .Fd #include <arpa/inet.h> .Ft int .Fn inet_aton "const char *cp" "struct in_addr *pin" -.Ft unsigned long +.Ft in_addr_t .Fn inet_addr "const char *cp" -.Ft unsigned long +.Ft in_addr_t .Fn inet_network "const char *cp" .Ft char * .Fn inet_ntoa "struct in_addr in" @@ -66,10 +66,10 @@ .Ft int .Fn inet_pton "int af" "const char *src" "void *dst" .Ft struct in_addr -.Fn inet_makeaddr "unsigned long net" "unsigned long lna" -.Ft unsigned long +.Fn inet_makeaddr "in_addr_t net" "in_addr_t lna" +.Ft in_addr_t .Fn inet_lnaof "struct in_addr in" -.Ft unsigned long +.Ft in_addr_t .Fn inet_netof "struct in_addr in" .Sh DESCRIPTION The routines diff --git a/lib/libc/net/inet_addr.c b/lib/libc/net/inet_addr.c index 312c39b..bff7af8 100644 --- a/lib/libc/net/inet_addr.c +++ b/lib/libc/net/inet_addr.c @@ -72,7 +72,7 @@ static char rcsid[] = "$FreeBSD$"; * ASCII internet address interpretation routine. * The value returned is in network order. */ -u_long /* XXX should be struct in_addr :( */ +in_addr_t /* XXX should be struct in_addr :( */ inet_addr(cp) register const char *cp; { @@ -96,7 +96,7 @@ inet_aton(cp, addr) struct in_addr *addr; { u_long parts[4]; - u_long val; + in_addr_t val; char *c; char *endptr; int gotend, n; diff --git a/lib/libc/net/inet_lnaof.c b/lib/libc/net/inet_lnaof.c index 99024d9..9225928 100644 --- a/lib/libc/net/inet_lnaof.c +++ b/lib/libc/net/inet_lnaof.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -44,11 +46,11 @@ static char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93"; * internet address; handles class a/b/c network * number formats. */ -u_long +in_addr_t inet_lnaof(in) struct in_addr in; { - register u_long i = ntohl(in.s_addr); + register in_addr_t i = ntohl(in.s_addr); if (IN_CLASSA(i)) return ((i)&IN_CLASSA_HOST); diff --git a/lib/libc/net/inet_makeaddr.c b/lib/libc/net/inet_makeaddr.c index 8af7770..ffc01cc 100644 --- a/lib/libc/net/inet_makeaddr.c +++ b/lib/libc/net/inet_makeaddr.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -45,9 +47,9 @@ static char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93"; */ struct in_addr inet_makeaddr(net, host) - u_long net, host; + in_addr_t net, host; { - u_long addr; + in_addr_t addr; if (net < 128) addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST); diff --git a/lib/libc/net/inet_neta.c b/lib/libc/net/inet_neta.c index 2b8a84c..f92705c 100644 --- a/lib/libc/net/inet_neta.c +++ b/lib/libc/net/inet_neta.c @@ -38,7 +38,7 @@ static const char rcsid[] = "$FreeBSD$"; /* * char * * inet_neta(src, dst, size) - * format a u_long network number into presentation format. + * format a in_addr_t network number into presentation format. * return: * pointer to dst, or NULL if an error occurred (check errno). * note: @@ -48,7 +48,7 @@ static const char rcsid[] = "$FreeBSD$"; */ char * inet_neta(src, dst, size) - u_long src; + in_addr_t src; char *dst; size_t size; { diff --git a/lib/libc/net/inet_netof.c b/lib/libc/net/inet_netof.c index 37063f7..94f27a3 100644 --- a/lib/libc/net/inet_netof.c +++ b/lib/libc/net/inet_netof.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -43,11 +45,11 @@ static char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93"; * Return the network number from an internet * address; handles class a/b/c network #'s. */ -u_long +in_addr_t inet_netof(in) struct in_addr in; { - register u_long i = ntohl(in.s_addr); + register in_addr_t i = ntohl(in.s_addr); if (IN_CLASSA(i)) return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT); diff --git a/lib/libc/net/inet_network.c b/lib/libc/net/inet_network.c index e44257a..7cc30a5 100644 --- a/lib/libc/net/inet_network.c +++ b/lib/libc/net/inet_network.c @@ -47,13 +47,14 @@ static char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93"; * The library routines call this routine to interpret * network numbers. */ -u_long +in_addr_t inet_network(cp) register const char *cp; { - register u_long val, base, n, i; + register in_addr_t val, base, n; register char c; - u_long parts[4], *pp = parts; + in_addr_t parts[4], *pp = parts; + register int i; again: val = 0; base = 10; diff --git a/sys/netinet/in.h b/sys/netinet/in.h index e7ab99f..65f8a8e 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -232,7 +232,7 @@ * Internet address (a structure for historical reasons) */ struct in_addr { - u_int32_t s_addr; + in_addr_t s_addr; }; /* diff --git a/sys/sys/types.h b/sys/sys/types.h index f0c21f2..baae9a3 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -73,6 +73,7 @@ typedef int32_t daddr_t; /* disk address */ typedef u_int32_t u_daddr_t; /* unsigned disk address */ typedef u_int32_t fixpt_t; /* fixed point number */ typedef u_int32_t gid_t; /* group id */ +typedef u_int32_t in_addr_t; /* base type for internet address */ typedef u_int32_t ino_t; /* inode number */ typedef long key_t; /* IPC key (for Sys V IPC) */ typedef u_int16_t mode_t; /* permissions */ |