summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2018-07-22 14:29:51 +0300
committerDan McDonald <danmcd@joyent.com>2018-07-30 15:28:50 -0400
commit8a7aa2a592747bd90d85645126d80688e024a0e2 (patch)
tree7a6c84d942a965d07c6eb294f47cae56848fa273
parent7e3488dc6cdcb0c04e1ce167a1a3bfef83b5f2e0 (diff)
downloadillumos-joyent-8a7aa2a592747bd90d85645126d80688e024a0e2.tar.gz
9673 move internet address manipulation functions to libc
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/Makefile.lint1
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile8
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/in.ripngd/Makefile9
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile6
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile9
-rw-r--r--usr/src/lib/libc/Makefile.targ5
-rw-r--r--usr/src/lib/libc/amd64/Makefile12
-rw-r--r--usr/src/lib/libc/i386/Makefile.com12
-rw-r--r--usr/src/lib/libc/inc/thr_uberdata.h7
-rw-r--r--usr/src/lib/libc/port/inet/inet_lnaof.c (renamed from usr/src/lib/libsocket/inet/inet_lnaof.c)7
-rw-r--r--usr/src/lib/libc/port/inet/inet_makeaddr.c (renamed from usr/src/lib/libsocket/inet/inet_mkaddr.c)5
-rw-r--r--usr/src/lib/libc/port/inet/inet_network.c (renamed from usr/src/lib/libsocket/inet/inet_network.c)10
-rw-r--r--usr/src/lib/libc/port/inet/inet_ntoa.c (renamed from usr/src/lib/libnsl/rpc/inet_ntoa.c)41
-rw-r--r--usr/src/lib/libc/port/inet/inet_ntop.c (renamed from usr/src/lib/libnsl/nss/inet_ntop.c)40
-rw-r--r--usr/src/lib/libc/port/inet/inet_pton.c (renamed from usr/src/lib/libnsl/nss/inet_pton.c)35
-rw-r--r--usr/src/lib/libc/port/llib-lc22
-rw-r--r--usr/src/lib/libc/port/mapfile-vers37
-rw-r--r--usr/src/lib/libc/sparc/Makefile.com14
-rw-r--r--usr/src/lib/libc/sparcv9/Makefile.com12
-rw-r--r--usr/src/lib/libdhcputil/Makefile.com2
-rw-r--r--usr/src/lib/libdladm/Makefile.com2
-rw-r--r--usr/src/lib/libipadm/Makefile.com4
-rw-r--r--usr/src/lib/libiscsit/Makefile.com2
-rw-r--r--usr/src/lib/libnsl/Makefile.com10
-rw-r--r--usr/src/lib/libnsl/common/llib-lnsl18
-rw-r--r--usr/src/lib/libnsl/common/mapfile-vers35
-rw-r--r--usr/src/lib/libnwam/Makefile.com2
-rw-r--r--usr/src/lib/libresolv2/common/mapfile-vers2
-rw-r--r--usr/src/lib/libscf/Makefile.com2
-rw-r--r--usr/src/lib/libsocket/Makefile.com9
-rw-r--r--usr/src/lib/libsocket/common/mapfile-vers16
-rw-r--r--usr/src/lib/libvscan/Makefile.com4
-rw-r--r--usr/src/lib/libxnet/common/mapfile-vers18
-rw-r--r--usr/src/lib/libzonecfg/Makefile.com2
-rw-r--r--usr/src/lib/ncad_addr/Makefile.com2
-rw-r--r--usr/src/lib/nsswitch/files/Makefile.com6
-rw-r--r--usr/src/lib/nsswitch/ldap/Makefile.com11
-rw-r--r--usr/src/lib/nsswitch/mdns/Makefile.com9
-rw-r--r--usr/src/lib/nsswitch/nis/Makefile.com5
-rw-r--r--usr/src/man/man1m/route.1m4
-rw-r--r--usr/src/man/man3c/Makefile24
-rw-r--r--usr/src/man/man3c/inet.3c440
-rw-r--r--usr/src/man/man3head/inet.h.3head9
-rw-r--r--usr/src/man/man3lib/libnsl.3lib12
-rw-r--r--usr/src/man/man3socket/Makefile28
-rw-r--r--usr/src/man/man3socket/getipnodebyname.3socket10
-rw-r--r--usr/src/man/man3socket/inet.3socket330
-rw-r--r--usr/src/man/man3socket/sockaddr.3socket4
-rw-r--r--usr/src/man/man4/ncaport.conf.47
-rw-r--r--usr/src/pkg/manifests/system-library.man3c.inc13
-rw-r--r--usr/src/pkg/manifests/system-library.man3socket.inc13
51 files changed, 727 insertions, 620 deletions
diff --git a/usr/src/Makefile.lint b/usr/src/Makefile.lint
index 8e589d6626..b9c46fb093 100644
--- a/usr/src/Makefile.lint
+++ b/usr/src/Makefile.lint
@@ -293,7 +293,6 @@ COMMON_SUBDIRS = \
cmd/tabs \
cmd/tail \
cmd/th_tools \
- cmd/tip \
cmd/touch \
cmd/tr \
cmd/truss \
diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile
index bc2815c8d7..e1277f4e1d 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile
@@ -18,11 +18,11 @@
#
# CDDL HEADER END
#
+
+#
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/cmd-inet/usr.lib/in.ndpd/Makefile
-#
PROG= in.ndpd
OBJS= config.o main.o ndp.o tables.o trace.o
@@ -36,10 +36,10 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORKROUTING)
# in.ndpd uses the ancillary data feature which is available only through
# UNIX 98 standards version of Socket interface. This interface is supposed to
-# be accessed by -lxnet. In addition -lsocket and -lnsl are used to
+# be accessed by -lxnet. In addition -lsocket is used to
# capture new not-yet-standard interfaces. Someday -lxnet alone should be enough
# when IPv6 inspired new interfaces are part of standards.
-LDLIBS += -ldhcpagent -lxnet -lsocket -lnsl -lipadm
+LDLIBS += -ldhcpagent -lxnet -lsocket -lipadm
# these #defines are required to use UNIX 98 interfaces
_D_UNIX98_EXTN= -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/Makefile
index 3a83bbdb9f..acb1a9e7be 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/Makefile
@@ -18,14 +18,11 @@
#
# CDDL HEADER END
#
+
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/cmd-inet/usr.lib/in.ripngd/Makefile
-#
SVCMETHOD= svc-ripng
MANIFEST= ripng.xml
@@ -48,10 +45,10 @@ LINTFLAGS += $(_D_UNIX98_EXTN)
# in.ripngd uses the ancillary data feature which is available only through
# UNIX 98 standards version of Socket interface. This interface is supposed to
-# be accessed by -lxnet. In addition, -lsocket and -lnsl are used to
+# be accessed by -lxnet. In addition, -lsocket is used to
# capture new not-yet-standard interfaces. Someday -lxnet alone should be enough
# when IPv6 inspired new interfaces are part of standards.
-LDLIBS += -lxnet -lsocket -lnsl
+LDLIBS += -lxnet -lsocket
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile
index 905f389570..fbde8724c6 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile
@@ -33,10 +33,10 @@ $(ROOTUSRSBIN)/ping := FILEMODE= 04555
# Ping uses the ancillary data feature which is available only through
# UNIX 98 standards version of Socket interface. This interface is supposed to
-# be accessed by -lxnet. In addition -lsocket and -lnsl are used to
+# be accessed by -lxnet. In addition -lsocket and is used to
# capture new not-yet-standard interfaces. Someday -lxnet alone should be enough
# when IPv6 inspired new interfaces are part of standards.
-LDLIBS += -lxnet -lsocket -lnsl -lm -linetutil
+LDLIBS += -lxnet -lsocket -lm -linetutil
# These #defines are required to use SUSv3 interfaces
CPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
@@ -62,7 +62,7 @@ $(PROG): $(OBJS)
install: all $(ROOTUSRSBINPROG)
-clean:
+clean:
$(RM) $(OBJS)
lint: lint_SRCS
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile
index b3fa1a473a..dac6d08a21 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1988, 1989, 1990, 1991, 1992, 1995, 1996, 1997
-# The Regents of the University of California. All rights reserved.
+# The Regents of the University of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that: (1) source code distributions
@@ -22,7 +22,6 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# @(#) $Header: Makefile.in,v 1.24 97/04/22 13:31:20 leres Exp $ (LBL)
PROG= traceroute
OBJS= traceroute.o traceroute_aux.o traceroute_aux6.o
@@ -34,10 +33,10 @@ $(ROOTUSRSBIN)/traceroute := FILEMODE= 04555
# Traceroute uses the ancillary data feature which is available only through
# UNIX 98 standards version of Socket interface. This interface is supposed to
-# be accessed by -lxnet. In addition -lsocket and -lnsl are used to
+# be accessed by -lxnet. In addition -lsocket is used to
# capture new not-yet-standard interfaces. Someday -lxnet alone should be enough
# when IPv6 inspired new interfaces are part of standards.
-LDLIBS += -lxnet -lsocket -lnsl -linetutil
+LDLIBS += -lxnet -lsocket -linetutil
# These #defines are required to use UNIX 98 interfaces
CPPFLAGS += -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
@@ -65,7 +64,7 @@ $(PROG): $(OBJS)
install: all $(ROOTUSRSBINPROG)
-clean:
+clean:
$(RM) $(OBJS)
lint: lint_SRCS
diff --git a/usr/src/lib/libc/Makefile.targ b/usr/src/lib/libc/Makefile.targ
index cd34c5ae91..31992a9ee8 100644
--- a/usr/src/lib/libc/Makefile.targ
+++ b/usr/src/lib/libc/Makefile.targ
@@ -183,6 +183,11 @@ pics/%.o %.o: $(LIBCBASE)/../port/gen/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
+# inet rules
+pics/%.o %.o: $(LIBCBASE)/../port/inet/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
# locale rules
pics/%.o %.o: $(LIBCBASE)/../port/locale/%.c
$(COMPILE.c) -o $@ $<
diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile
index e9ee51e1ff..c4e99d26f3 100644
--- a/usr/src/lib/libc/amd64/Makefile
+++ b/usr/src/lib/libc/amd64/Makefile
@@ -24,7 +24,7 @@
# Copyright 2016 Joyent, Inc.
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2013 Garrett D'Amore <garrett@damore.org>
-# Copyright 2017 Nexenta Systems, Inc.
+# Copyright 2018 Nexenta Systems, Inc.
#
LIBCBASE= .
@@ -597,6 +597,14 @@ PORTGEN= \
xpg4.o \
xpg6.o
+PORTINET= \
+ inet_lnaof.o \
+ inet_makeaddr.o \
+ inet_network.o \
+ inet_ntoa.o \
+ inet_ntop.o \
+ inet_pton.o
+
PORTPRINT_W= \
doprnt_w.o
@@ -962,6 +970,7 @@ MOSTOBJS= \
$(PORTGEN64) \
$(PORTI18N) \
$(PORTI18N_COND) \
+ $(PORTINET) \
$(PORTLOCALE) \
$(PORTPRINT) \
$(PORTPRINT_W) \
@@ -1095,6 +1104,7 @@ SRCS= \
$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \
$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \
$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \
+ $(PORTINET:%.o=$(LIBCDIR)/port/inet/%.c) \
$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \
$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c) \
$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c) \
diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com
index c496bab9f1..4d43ab4a99 100644
--- a/usr/src/lib/libc/i386/Makefile.com
+++ b/usr/src/lib/libc/i386/Makefile.com
@@ -24,7 +24,7 @@
# Copyright 2016 Joyent, Inc.
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2013 Garrett D'Amore <garrett@damore.org>
-# Copyright 2017 Nexenta Systems, Inc.
+# Copyright 2018 Nexenta Systems, Inc.
#
LIBCDIR= $(SRC)/lib/libc
@@ -629,6 +629,14 @@ PORTGEN= \
xpg4.o \
xpg6.o
+PORTINET= \
+ inet_lnaof.o \
+ inet_makeaddr.o \
+ inet_network.o \
+ inet_ntoa.o \
+ inet_ntop.o \
+ inet_pton.o
+
PORTPRINT_W= \
doprnt_w.o
@@ -1001,6 +1009,7 @@ MOSTOBJS= \
$(PORTGEN64) \
$(PORTI18N) \
$(PORTI18N_COND) \
+ $(PORTINET) \
$(PORTLOCALE) \
$(PORTPRINT) \
$(PORTPRINT_C89) \
@@ -1158,6 +1167,7 @@ SRCS= \
$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \
$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \
$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \
+ $(PORTINET:%.o=$(LIBCDIR)/port/inet/%.c) \
$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \
$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c) \
$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c) \
diff --git a/usr/src/lib/libc/inc/thr_uberdata.h b/usr/src/lib/libc/inc/thr_uberdata.h
index cf06379ed7..81781fe04c 100644
--- a/usr/src/lib/libc/inc/thr_uberdata.h
+++ b/usr/src/lib/libc/inc/thr_uberdata.h
@@ -22,8 +22,10 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+
/*
* Copyright 2016 Joyent, Inc.
+ * Copyright 2018 Nexenta Systems, Inc.
*/
#ifndef _THR_UBERDATA_H
@@ -681,6 +683,7 @@ typedef struct ulwp {
#endif
tumem_t ul_tmem; /* used only by umem */
uint_t ul_ptinherit; /* pthreads sched inherit value */
+ char ul_ntoabuf[18]; /* thread-specific inet_ntoa buffer */
} ulwp_t;
#define ul_cursig ul_cp.s.cursig /* deferred signal number */
@@ -863,7 +866,7 @@ typedef struct {
typedef void (*_exithdlr_func_t) (void*);
typedef struct _exthdlr {
- struct _exthdlr *next; /* next in handler list */
+ struct _exthdlr *next; /* next in handler list */
_exithdlr_func_t hdlr; /* handler itself */
void *arg; /* argument to handler */
void *dso; /* DSO associated with handler */
@@ -901,7 +904,7 @@ typedef struct {
typedef void (*_quick_exithdlr_func_t)(void);
typedef struct _qexthdlr {
- struct _qexthdlr *next; /* next in handler list */
+ struct _qexthdlr *next; /* next in handler list */
_quick_exithdlr_func_t hdlr; /* handler itself */
} _qexthdlr_t;
diff --git a/usr/src/lib/libsocket/inet/inet_lnaof.c b/usr/src/lib/libc/port/inet/inet_lnaof.c
index eeadb0d6cd..ff24f7fbaf 100644
--- a/usr/src/lib/libsocket/inet/inet_lnaof.c
+++ b/usr/src/lib/libc/port/inet/inet_lnaof.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -37,9 +37,10 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+#include "lint.h"
#include <sys/types.h>
+
#include <netinet/in.h>
/*
@@ -47,7 +48,7 @@
* internet address; handles class a/b/c network
* number formats.
*/
-int
+in_addr_t
inet_lnaof(struct in_addr in)
{
uint32_t i = ntohl(in.s_addr);
diff --git a/usr/src/lib/libsocket/inet/inet_mkaddr.c b/usr/src/lib/libc/port/inet/inet_makeaddr.c
index 6c0127264d..017f426b0e 100644
--- a/usr/src/lib/libsocket/inet/inet_mkaddr.c
+++ b/usr/src/lib/libc/port/inet/inet_makeaddr.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -37,9 +37,10 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+#include "lint.h"
#include <sys/types.h>
+
#include <netinet/in.h>
/*
diff --git a/usr/src/lib/libsocket/inet/inet_network.c b/usr/src/lib/libc/port/inet/inet_network.c
index b7512dc228..8205a4795a 100644
--- a/usr/src/lib/libsocket/inet/inet_network.c
+++ b/usr/src/lib/libc/port/inet/inet_network.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -37,12 +37,14 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+#include "lint.h"
#include <sys/types.h>
-#include <ctype.h>
+
#include <netinet/in.h>
+#include <ctype.h>
+
/*
* Internet network address interpretation routine.
* The library routines call this routine to interpret
@@ -69,7 +71,7 @@ again:
while ((c = *cp) != NULL) {
if (isdigit(c)) {
if ((c - '0') >= base)
- break;
+ break;
val = (val * base) + (c - '0');
cp++;
continue;
diff --git a/usr/src/lib/libnsl/rpc/inet_ntoa.c b/usr/src/lib/libc/port/inet/inet_ntoa.c
index f68ed15e39..8cc18cdc47 100644
--- a/usr/src/lib/libnsl/rpc/inet_ntoa.c
+++ b/usr/src/lib/libc/port/inet/inet_ntoa.c
@@ -46,8 +46,8 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
@@ -102,8 +102,6 @@
* SOFTWARE.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Convert network-format internet address
* to base 256 d.d.d.d representation.
@@ -111,44 +109,34 @@
* Reentrant interface
*/
-#include "mt.h"
-#include "rpc_mt.h"
-#include <errno.h>
+#include "lint.h"
+#include "thr_uberdata.h"
+
#include <sys/types.h>
-#include <ctype.h>
+
#include <netinet/in.h>
+
+#include <ctype.h>
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-
char *
-inet_ntoa_r(in, b)
- struct in_addr in;
- char b[]; /* Assumed >= 18 bytes */
+inet_ntoa_r(struct in_addr in, char b[])
{
char *p;
p = (char *)&in;
#define UC(b) (((int)b)&0xff)
(void) sprintf(b, "%d.%d.%d.%d",
- UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3]));
+ UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3]));
return (b);
}
char *
-inet_ntoa(in)
- struct in_addr in;
+inet_ntoa(struct in_addr in)
{
- char *b;
- static char b_main[18];
- static pthread_key_t ntoa_key = PTHREAD_ONCE_KEY_NP;
-
- if (thr_main())
- b = b_main;
- else if ((b = thr_get_storage(&ntoa_key, 18, free)) == NULL)
- b = b_main;
-
- return (inet_ntoa_r(in, b));
+ return (inet_ntoa_r(in, curthread->ul_ntoabuf));
}
/*
@@ -167,7 +155,6 @@ inet_aton(const char *cp, struct in_addr *addr)
unsigned int parts[4];
unsigned int *pp = parts;
-
c = *cp;
for (;;) {
/*
@@ -273,7 +260,7 @@ inet_addr(const char *cp)
* Return the network number from an internet
* address; handles class a/b/c network #'s.
*/
-uint_t
+in_addr_t
inet_netof(struct in_addr in)
{
uint32_t i = ntohl(in.s_addr);
diff --git a/usr/src/lib/libnsl/nss/inet_ntop.c b/usr/src/lib/libc/port/inet/inet_ntop.c
index 28067cffa0..ef9cd8ea4b 100644
--- a/usr/src/lib/libnsl/nss/inet_ntop.c
+++ b/usr/src/lib/libc/port/inet/inet_ntop.c
@@ -1,9 +1,4 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -20,19 +15,25 @@
* SOFTWARE.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include "lint.h"
+
+#include <sys/socket.h>
-#include "mt.h"
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <strings.h>
-#include <netdb.h>
-#include <stdio.h>
#include <arpa/inet.h>
#include <netinet/in.h>
-#include <sys/socket.h>
+
+#include <ctype.h>
#include <errno.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
static const char *inet_ntop4(const uchar_t *, char *, socklen_t);
static const char *inet_ntop6(const uchar_t *, char *, socklen_t);
@@ -70,20 +71,13 @@ inet_ntop(int af, const void *src, char *dst, socklen_t size)
* (2) takes a uchar_t* not an in_addr as input
*/
-#ifdef SPRINTF_CHAR
-/* CSTYLED */
-#define SPRINTF(x) strlen(sprintf/**/x)
-#else
-#define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
static const char *
inet_ntop4(const uchar_t *src, char *dst, socklen_t size)
{
static const char fmt[] = "%u.%u.%u.%u";
char tmp[sizeof ("255.255.255.255")];
- if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
+ if (sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) > size) {
errno = ENOSPC;
return (NULL);
}
@@ -168,7 +162,7 @@ inet_ntop6(const uchar_t *src, char *dst, socklen_t size)
tp += strlen(tp);
break;
}
- tp += SPRINTF((tp, "%x", words[i]));
+ tp += sprintf(tp, "%x", words[i]);
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
diff --git a/usr/src/lib/libnsl/nss/inet_pton.c b/usr/src/lib/libc/port/inet/inet_pton.c
index ec94b1f5e5..41497a6f19 100644
--- a/usr/src/lib/libnsl/nss/inet_pton.c
+++ b/usr/src/lib/libc/port/inet/inet_pton.c
@@ -1,9 +1,4 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -20,19 +15,25 @@
* SOFTWARE.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include "lint.h"
+
+#include <sys/socket.h>
-#include "mt.h"
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <strings.h>
-#include <netdb.h>
-#include <stdio.h>
#include <arpa/inet.h>
#include <netinet/in.h>
-#include <sys/socket.h>
+
+#include <ctype.h>
#include <errno.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
static int inet_pton4(const char *src, uchar_t *dst);
static int inet_pton6(const char *src, uchar_t *dst);
@@ -131,13 +132,11 @@ inet_pton4(const char *src, uchar_t *dst)
* inspired by Mark Andrews.
*
*/
-
-
static int
inet_pton6(const char *src, uchar_t *dst)
{
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
+ static const char xdigits_l[] = "0123456789abcdef";
+ static const char xdigits_u[] = "0123456789ABCDEF";
uchar_t tmp[IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
int ch, saw_xdigit;
diff --git a/usr/src/lib/libc/port/llib-lc b/usr/src/lib/libc/port/llib-lc
index a63267fc54..b7521a2f86 100644
--- a/usr/src/lib/libc/port/llib-lc
+++ b/usr/src/lib/libc/port/llib-lc
@@ -21,7 +21,7 @@
/*
* Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2017 Nexenta Systems, Inc.
+ * Copyright 2018 Nexenta Systems, Inc.
* Copyright 2013 OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright (c) 2013 Gary Mills
* Copyright 2014 Garrett D'Amore <garrett@damore.org>
@@ -171,6 +171,8 @@
#include <stack_unwind.h>
#endif
#include <xlocale.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
/*
* This really comes from the crt*.s startup modules.
@@ -1429,7 +1431,6 @@ int pset_assign_forced(psetid_t pset, processorid_t cpu, psetid_t *opset);
int pset_info(psetid_t pset, int *type, u_int *numcpus, processorid_t *cpulist);
int pset_bind(psetid_t pset, idtype_t idtype, id_t id, psetid_t *opset);
int pset_bind_lwp(psetid_t pset, id_t id, pid_t, psetid_t *opset);
-
/* rctlsys.c */
int getrctl(const char *name, rctlblk_t *old_rblk, rctlblk_t *new_rblk,
@@ -1441,7 +1442,6 @@ int setprojrctl(const char *name, rctlblk_t *new_rblk, size_t size, int flags);
int rctlctl(const char *, rctlblk_t *, int);
size_t rctllist(char *, size_t);
-
/* semsys.c */
int semctl(int semid, int semnum, int cmd, ...);
int semget(key_t key, int nsems, int semflg);
@@ -1532,7 +1532,7 @@ size_t wcsxfrm(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
int wcscoll(const wchar_t *s1, const wchar_t *s2);
/* wcsftime.c */
-#if !defined(__amd64) /* XX64 - fix me */
+#if !defined(__amd64) /* XX64 - fix me */
size_t wcsftime(wchar_t *wcs, size_t maxsize,
const char *format, const struct tm *timeptr);
#endif /* __amd64 */
@@ -1631,7 +1631,7 @@ long double wcstold(const wchar_t *_RESTRICT_KYWD cp,
double wstod(const wchar_t *cp, wchar_t **ptr);
/* wstok.c */
-#if !defined(__amd64) /* XX64 - fix me */
+#if !defined(__amd64) /* XX64 - fix me */
wchar_t *wcstok(wchar_t *string, const wchar_t *sepset);
wchar_t *wstok(wchar_t *string, const wchar_t *sepset);
#endif /* __amd64 */
@@ -1848,3 +1848,15 @@ extern size_t u8_textprep_str(char *, size_t *, char *, size_t *, int, size_t,
/* private locale interfaces */
wint_t __nextwctype(wint_t, wctype_t);
int __iswrune(wint_t);
+
+/* inet_ntop.c */
+const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
+
+/* inet_pton.c */
+int inet_pton(int af, const char *src, void *dst);
+
+/* inet_ntoa.c */
+char *inet_ntoa_r(struct in_addr in, char b[]);
+char *inet_ntoa(struct in_addr in);
+in_addr_t inet_addr(const char *cp);
+in_addr_t inet_netof(struct in_addr in);
diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers
index 905de27667..705ae9902a 100644
--- a/usr/src/lib/libc/port/mapfile-vers
+++ b/usr/src/lib/libc/port/mapfile-vers
@@ -21,7 +21,7 @@
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright 2017 Nexenta Systems, Inc.
+# Copyright 2018 Nexenta Systems, Inc.
# Copyright (c) 2012 by Delphix. All rights reserved.
# Copyright 2016 Joyent, Inc.
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
@@ -52,21 +52,6 @@ $mapfile_version 2
# items and for the members of the malloc() family.
#
-#
-# README README README README README README: how to update this file
-# 1) each version of Solaris/OpenSolaris gets a version number.
-# (Actually since Solaris is actually a series of OpenSolaris releases
-# we'll just use OpenSolaris for this exercise.)
-# OpenSolaris 2008.11 gets 1.23
-# OpenSolaris 2009.04 gets 1.24
-# etc.
-# 2) each project integration uses a unique version number.
-# PSARC/2008/123 gets 1.24.1
-# PSARC/2008/456 gets 1.24.2
-# etc.
-#
-
-
# Mnemonic conditional input identifiers:
#
# - amd64, i386, sparc32, sparcv9: Correspond to ISA subdirectories used to
@@ -92,6 +77,20 @@ $if _x86 && _ELF64
$add amd64
$endif
+SYMBOL_VERSION ILLUMOS_0.25 { # inet_* moved from libnsl/libsocket
+ protected:
+ inet_addr;
+ inet_aton;
+ inet_lnaof;
+ inet_makeaddr;
+ inet_netof;
+ inet_network;
+ inet_ntoa;
+ inet_ntoa_r;
+ inet_ntop;
+ inet_pton;
+} ILLUMOS_0.24;
+
SYMBOL_VERSION ILLUMOS_0.24 { # openbsd compat
protected:
freezero;
@@ -1021,7 +1020,7 @@ $if i386
# Note: atomic_add_64_nv is also defined above. Here, we add the
# NODYNSORT attribute to it. On this platform, it is an aliases for
# atomic_add_64. If that is changed, this line should be removed.
- atomic_add_64_nv { FLAGS = NODYNSORT };
+ atomic_add_64_nv { FLAGS = NODYNSORT };
$endif
$if amd64
@@ -2778,7 +2777,7 @@ $endif
$if amd64
} SYSVABI_1.3;
-SYMBOL_VERSION SYSVABI_1.3 {
+SYMBOL_VERSION SYSVABI_1.3 {
$endif
global:
$if !_sparc
@@ -2919,7 +2918,7 @@ $endif
attr_to_data_type;
attr_to_name;
attr_to_option;
- attr_to_xattr_view;
+ attr_to_xattr_view;
_autofssys;
_bufsync;
_cladm;
diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com
index 89219b3abb..c0862da496 100644
--- a/usr/src/lib/libc/sparc/Makefile.com
+++ b/usr/src/lib/libc/sparc/Makefile.com
@@ -24,7 +24,7 @@
# Copyright 2016 Joyent, Inc.
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2013 Garrett D'Amore <garrett@damore.org>
-# Copyright 2017 Nexenta Systems, Inc.
+# Copyright 2018 Nexenta Systems, Inc.
#
LIBCDIR= $(SRC)/lib/libc
@@ -395,7 +395,7 @@ PORTFP= \
moddi3.o \
muldi3.o \
qdivrem.o \
- ucmpdi2.o \
+ ucmpdi2.o \
udivdi3.o \
umoddi3.o
@@ -657,6 +657,14 @@ PORTGEN= \
xpg4.o \
xpg6.o
+PORTINET= \
+ inet_lnaof.o \
+ inet_makeaddr.o \
+ inet_network.o \
+ inet_ntoa.o \
+ inet_ntop.o \
+ inet_pton.o
+
PORTPRINT_W= \
doprnt_w.o
@@ -1032,6 +1040,7 @@ MOSTOBJS= \
$(PORTGEN64) \
$(PORTI18N) \
$(PORTI18N_COND) \
+ $(PORTINET) \
$(PORTLOCALE) \
$(PORTPRINT) \
$(PORTPRINT_C89) \
@@ -1182,6 +1191,7 @@ SRCS= \
$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \
$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \
$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \
+ $(PORTINET:%.o=$(LIBCDIR)/port/inet/%.c) \
$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \
$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c) \
$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c) \
diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com
index 9440bd9815..b68eb5c903 100644
--- a/usr/src/lib/libc/sparcv9/Makefile.com
+++ b/usr/src/lib/libc/sparcv9/Makefile.com
@@ -25,7 +25,7 @@
# Copyright (c) 2015, Joyent, Inc. All rights reserved.
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2013 Garrett D'Amore <garrett@damore.org>
-# Copyright 2017 Nexenta Systems, Inc.
+# Copyright 2018 Nexenta Systems, Inc.
#
LIBCDIR= $(SRC)/lib/libc
@@ -615,6 +615,14 @@ PORTGEN= \
xpg4.o \
xpg6.o
+PORTINET= \
+ inet_lnaof.o \
+ inet_makeaddr.o \
+ inet_network.o \
+ inet_ntoa.o \
+ inet_ntop.o \
+ inet_pton.o
+
PORTPRINT_W= \
doprnt_w.o
@@ -975,6 +983,7 @@ MOSTOBJS= \
$(PORTGEN64) \
$(PORTI18N) \
$(PORTI18N_COND) \
+ $(PORTINET) \
$(PORTLOCALE) \
$(PORTPRINT) \
$(PORTPRINT_W) \
@@ -1112,6 +1121,7 @@ SRCS= \
$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \
$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \
$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \
+ $(PORTINET:%.o=$(LIBCDIR)/port/inet/%.c) \
$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \
$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c) \
$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c) \
diff --git a/usr/src/lib/libdhcputil/Makefile.com b/usr/src/lib/libdhcputil/Makefile.com
index c8a695b368..b32dc645ce 100644
--- a/usr/src/lib/libdhcputil/Makefile.com
+++ b/usr/src/lib/libdhcputil/Makefile.com
@@ -37,7 +37,7 @@ include ../../Makefile.rootfs
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -lc -lnsl -lgen -linetutil -ldlpi
+LDLIBS += -lc -lgen -linetutil -ldlpi
SRCDIR = ../common
SRCS = $(LOCOBJS:%.o=$(SRCDIR)/%.c) $(COMOBJS:%.o=$(COMDIR)/%.c)
diff --git a/usr/src/lib/libdladm/Makefile.com b/usr/src/lib/libdladm/Makefile.com
index b6fa5cad2e..8d036ccd27 100644
--- a/usr/src/lib/libdladm/Makefile.com
+++ b/usr/src/lib/libdladm/Makefile.com
@@ -36,7 +36,7 @@ include ../../Makefile.rootfs
LIBS = $(DYNLIB) $(LINTLIB)
LDLIBS += -ldevinfo -lc -linetutil -lsocket -lscf -lrcm -lnvpair \
- -lexacct -lnsl -lkstat -lpool
+ -lexacct -lkstat -lpool
SRCDIR = ../common
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
diff --git a/usr/src/lib/libipadm/Makefile.com b/usr/src/lib/libipadm/Makefile.com
index d195ea19c6..255dc3125b 100644
--- a/usr/src/lib/libipadm/Makefile.com
+++ b/usr/src/lib/libipadm/Makefile.com
@@ -35,8 +35,8 @@ include ../../Makefile.lib
include ../../Makefile.rootfs
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -lc -lnsl -linetutil -lsocket -ldlpi -lnvpair -ldhcpagent \
- -ldladm -lsecdb -ldhcputil
+LDLIBS += -lc -linetutil -lsocket -ldlpi -lnvpair -ldhcpagent \
+ -ldladm -lsecdb -ldhcputil
SRCDIR = ../common
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
diff --git a/usr/src/lib/libiscsit/Makefile.com b/usr/src/lib/libiscsit/Makefile.com
index 3388c07123..007a52fb76 100644
--- a/usr/src/lib/libiscsit/Makefile.com
+++ b/usr/src/lib/libiscsit/Makefile.com
@@ -41,7 +41,7 @@ INCS += -I$(SRCDIR)
CSTD= $(CSTD_GNU99)
C99LMODE= -Xc99=%all
-LDLIBS += -lc -lnvpair -lstmf -luuid -lnsl -lscf
+LDLIBS += -lc -lnvpair -lstmf -luuid -lscf
CPPFLAGS += $(INCS) -D_REENTRANT
CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/lib/libnsl/Makefile.com b/usr/src/lib/libnsl/Makefile.com
index 792e1cd24f..876c3681e9 100644
--- a/usr/src/lib/libnsl/Makefile.com
+++ b/usr/src/lib/libnsl/Makefile.com
@@ -21,7 +21,7 @@
#
# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc. All rights reserved.
#
LIBRARY= libnsl.a
@@ -43,7 +43,7 @@ NETDIR= netdir.o
NSS= \
gethostbyname_r.o gethostent.o gethostent_r.o gethostent6.o gethostby_door.o \
getipnodeby_door.o getipnodeby.o getrpcent.o getrpcent_r.o inet_matchaddr.o \
-inet_pton.o inet_ntop.o netdir_inet.o netdir_inet_sundry.o \
+netdir_inet.o netdir_inet_sundry.o \
parse.o getauthattr.o getprofattr.o getexecattr.o getuserattr.o getauuser.o
NETSELECT= netselect.o
@@ -55,7 +55,7 @@ t_connect.o t_error.o t_free.o t_getinfo.o t_getname.o \
t_getstate.o t_listen.o t_look.o t_open.o t_optmgmt.o \
t_rcv.o t_rcvconnect.o t_rcvdis.o t_rcvrel.o t_rcvudata.o \
t_rcvuderr.o t_snd.o t_snddis.o t_sndrel.o t_sndudata.o \
-t_sndv.o t_sndreldata.o t_rcvv.o t_rcvreldata.o t_sysconf.o \
+t_sndv.o t_sndreldata.o t_rcvv.o t_rcvreldata.o t_sysconf.o \
t_sndvudata.o t_rcvvudata.o t_sync.o t_unbind.o t_strerror.o \
xti_wrappers.o
@@ -67,7 +67,7 @@ auth_des.o auth_none.o auth_sys.o auth_time.o authdes_prot.o \
authsys_prot.o can_use_af.o \
clnt_bcast.o clnt_dg.o clnt_door.o clnt_generic.o clnt_perror.o \
clnt_raw.o clnt_simple.o clnt_vc.o fdsync.o getdname.o \
-inet_ntoa.o key_call.o key_prot.o mt_misc.o \
+key_call.o key_prot.o mt_misc.o \
netname.o netnamer.o pmap_clnt.o pmap_prot.o \
rpc_callmsg.o rpc_comdata.o rpc_generic.o rpc_prot.o rpc_sel2poll.o \
rpc_soc.o rpc_td.o rpcb_clnt.o rpcb_prot.o \
@@ -83,7 +83,7 @@ SAF= checkver.o doconfig.o
YP= \
dbm.o yp_all.o yp_b_clnt.o yp_b_xdr.o yp_bind.o \
yp_enum.o yp_master.o yp_match.o yp_order.o yp_update.o \
-yperr_string.o yp_xdr.o ypprot_err.o ypupd.o \
+yperr_string.o yp_xdr.o ypprot_err.o ypupd.o \
yp_rsvd.o \
yppasswd_xdr.o
diff --git a/usr/src/lib/libnsl/common/llib-lnsl b/usr/src/lib/libnsl/common/llib-lnsl
index 46f74824eb..8a1fba5b94 100644
--- a/usr/src/lib/libnsl/common/llib-lnsl
+++ b/usr/src/lib/libnsl/common/llib-lnsl
@@ -22,8 +22,10 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * Copyright 2016 Nexenta Systems, Inc.
+ */
+
+/*
+ * Copyright 2018 Nexenta Systems, Inc.
*/
@@ -442,12 +444,6 @@ struct rpcent *getrpcent_r(struct rpcent *result, char *buffer, int buflen);
/* inet_matchaddr.c */
int inet_matchaddr(const void *, const char *);
-/* inet_ntop.c */
-const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
-
-/* inet_pton.c */
-int inet_pton(int af, const char *src, void *dst);
-
/* netdir_inet.c */
int _get_hostserv_inetnetdir_byname(struct netconfig *nconf,
struct nss_netdirbyname_in *args,
@@ -568,12 +564,6 @@ int setdomainname(char *domain, int len);
/* gethostname.c */
int gethostname(char *hname, int hlen);
-/* inet_ntoa.c */
-char *inet_ntoa_r(struct in_addr in, char b[]);
-char *inet_ntoa(struct in_addr in);
-in_addr_t inet_addr(const char *cp);
-in_addr_t inet_netof(struct in_addr in);
-
/* key_call.c */
int key_setsecret(const char *secretkey);
int key_secretkey_is_set(void);
diff --git a/usr/src/lib/libnsl/common/mapfile-vers b/usr/src/lib/libnsl/common/mapfile-vers
index 9a0b25a16b..0b12140f41 100644
--- a/usr/src/lib/libnsl/common/mapfile-vers
+++ b/usr/src/lib/libnsl/common/mapfile-vers
@@ -18,9 +18,10 @@
#
# CDDL HEADER END
#
+
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright 2017 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.
#
#
@@ -39,7 +40,7 @@
$mapfile_version 2
-SYMBOL_VERSION ILLUMOS_0.1 { # Illumos additions
+SYMBOL_VERSION ILLUMOS_0.1 { # illumos additions
global:
svc_tp_create_addr;
} SUNW_1.10;
@@ -51,7 +52,7 @@ SYMBOL_VERSION SUNW_1.10 { # SunOS 5.11 (Solaris 11)
SYMBOL_VERSION SUNW_1.9.1 { # SunOS 5.10 (Solaris 10 update 5)
global:
- inet_aton;
+ inet_aton { TYPE = FUNCTION; FILTER = libc.so.1 };
} SUNW_1.9;
SYMBOL_VERSION SUNW_1.9 { # SunOS 5.10 (Solaris 10)
@@ -77,8 +78,8 @@ SYMBOL_VERSION SUNW_1.7 { # SunOS 5.8 (Solaris 8)
freehostent;
getipnodebyaddr;
getipnodebyname;
- inet_ntop;
- inet_pton;
+ inet_ntop { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_pton { TYPE = FUNCTION; FILTER = libc.so.1 };
} SUNW_1.6;
SYMBOL_VERSION SUNW_1.6 { # SunOS 5.7 (Solaris 7)
@@ -234,16 +235,16 @@ SYMBOL_VERSION SUNW_0.7 { # SunOS 5.3 (Solaris 2.3)
getrpcent;
getrpcent_r;
h_errno { FLAGS = NODIRECT };
- inet_ntoa_r;
+ inet_ntoa_r { TYPE = FUNCTION; FILTER = libc.so.1 };
key_secretkey_is_set;
maxbno;
nc_sperror;
netdir_perror;
netdir_sperror;
nextkey;
- nis_clone_object;
- nis_destroy_object;
- nis_dir_cmp;
+ nis_clone_object;
+ nis_destroy_object;
+ nis_dir_cmp;
nis_domain_of;
nis_leaf_of;
nis_leaf_of_r;
@@ -317,9 +318,9 @@ SYMBOL_VERSION SISCD_2.3 {
$endif
gethostbyaddr;
gethostbyname;
- inet_addr;
- inet_netof;
- inet_ntoa;
+ inet_addr { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_netof { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_ntoa { TYPE = FUNCTION; FILTER = libc.so.1 };
_null_auth;
rpc_broadcast_exp;
svc_fdset;
@@ -578,8 +579,8 @@ SYMBOL_VERSION SUNWprivate_1.1 {
__getnetnamebyuid;
__getpublickey_cached;
__getpublickey_cached_g;
- __getpublickey_flush;
- __getpublickey_flush_g;
+ __getpublickey_flush;
+ __getpublickey_flush_g;
getpublickey_g;
getsecretkey_g;
hashinc;
@@ -619,17 +620,17 @@ SYMBOL_VERSION SUNWprivate_1.1 {
__nis_get_mechanism_library;
__nis_get_mechanisms;
__nis_get_mechanism_symbol;
- nis_get_static_storage;
+ nis_get_static_storage;
__nis_gssprin2netname;
__nis_keyalg2authtype;
__nis_keyalg2mechalias;
__nis_mechalias2authtype;
__nis_mechname2alias;
- nis_read_obj;
+ nis_read_obj;
__nis_release_mechanisms;
__nis_rpc_domain;
__nis_translate_mechanism;
- nis_write_obj;
+ nis_write_obj;
__nsl_dom;
__nss2herrno;
nss_ioctl;
diff --git a/usr/src/lib/libnwam/Makefile.com b/usr/src/lib/libnwam/Makefile.com
index 41b2af85d0..bce8452d4b 100644
--- a/usr/src/lib/libnwam/Makefile.com
+++ b/usr/src/lib/libnwam/Makefile.com
@@ -44,7 +44,7 @@ include ../../Makefile.lib
include ../../Makefile.rootfs
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -lbsm -lc -ldladm -lnsl -lnvpair -lscf -lsecdb -lsocket \
+LDLIBS += -lbsm -lc -ldladm -lnvpair -lscf -lsecdb -lsocket \
-lipadm
SRCDIR = ../common
diff --git a/usr/src/lib/libresolv2/common/mapfile-vers b/usr/src/lib/libresolv2/common/mapfile-vers
index 28691e09c0..4eebdbb9ea 100644
--- a/usr/src/lib/libresolv2/common/mapfile-vers
+++ b/usr/src/lib/libresolv2/common/mapfile-vers
@@ -46,7 +46,7 @@ SYMBOL_VERSION SUNW_2.3 { # SunOS 5.11 (Solaris 11)
SYMBOL_VERSION SUNW_2.2.2 { # SunOS 5.10 (Solaris 10 Update 5)
global:
- inet_aton { TYPE = FUNCTION; FILTER = libnsl.so.1 };
+ inet_aton { TYPE = FUNCTION; FILTER = libc.so.1 };
} SUNW_2.2.1;
SYMBOL_VERSION SUNW_2.2.1 { # SunOS 5.10 (Solaris 10 Update 4)
diff --git a/usr/src/lib/libscf/Makefile.com b/usr/src/lib/libscf/Makefile.com
index 9388f9cfb1..a6e2657925 100644
--- a/usr/src/lib/libscf/Makefile.com
+++ b/usr/src/lib/libscf/Makefile.com
@@ -44,7 +44,7 @@ $(NATIVE_BUILD)VERS =
$(NATIVE_BUILD)LIBS = $(DYNLIB)
LDLIBS_i386 += -lsmbios
-LDLIBS += -luutil -lc -lgen -lnsl -lnvpair
+LDLIBS += -luutil -lc -lgen -lnvpair
LDLIBS += $(LDLIBS_$(MACH))
SRCDIR = ../common
diff --git a/usr/src/lib/libsocket/Makefile.com b/usr/src/lib/libsocket/Makefile.com
index 1d22540eee..ed741f39d8 100644
--- a/usr/src/lib/libsocket/Makefile.com
+++ b/usr/src/lib/libsocket/Makefile.com
@@ -27,12 +27,11 @@ LIBRARY = libsocket.a
VERS = .1
INETOBJS = bindresvport.o bootparams_getbyname.o ether_addr.o \
- getaddrinfo.o getnameinfo.o getnetent.o getnetent_r.o \
+ getaddrinfo.o getnameinfo.o getnetent.o getnetent_r.o \
getprotoent.o getprotoent_r.o getservbyname_r.o getservent.o \
- getservent_r.o inet_lnaof.o inet_mkaddr.o inet_network.o \
- inet6_opt.o inet6_rthdr.o interface_id.o link_addr.o \
- netmasks.o rcmd.o rexec.o ruserpass.o sourcefilter.o \
- getifaddrs.o
+ getservent_r.o inet6_opt.o inet6_rthdr.o interface_id.o \
+ link_addr.o netmasks.o rcmd.o rexec.o ruserpass.o \
+ sourcefilter.o getifaddrs.o
SOCKOBJS = _soutil.o sockatmark.o socket.o socketpair.o weaks.o
OBJECTS = $(INETOBJS) $(SOCKOBJS)
diff --git a/usr/src/lib/libsocket/common/mapfile-vers b/usr/src/lib/libsocket/common/mapfile-vers
index 471774b462..f44e54897a 100644
--- a/usr/src/lib/libsocket/common/mapfile-vers
+++ b/usr/src/lib/libsocket/common/mapfile-vers
@@ -18,10 +18,12 @@
#
# CDDL HEADER END
#
+
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
-#
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.
+#
#
# MAPFILE HEADER START
@@ -45,9 +47,9 @@ SYMBOL_VERSION ILLUMOS_0.2 { # reentrant ethers(3SOCKET)
ether_ntoa_r;
} ILLUMOS_0.1;
-SYMBOL_VERSION ILLUMOS_0.1 { # Illumos additions
+SYMBOL_VERSION ILLUMOS_0.1 { # illumos additions
global:
- accept4;
+ accept4;
} SUNW_1.7;
SYMBOL_VERSION SUNW_1.7 {
@@ -183,9 +185,9 @@ $endif
getservbyport;
getsockname;
getsockopt;
- inet_lnaof;
- inet_makeaddr;
- inet_network;
+ inet_lnaof { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_makeaddr { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_network { TYPE = FUNCTION; FILTER = libc.so.1 };
listen;
recv;
recvfrom;
@@ -203,7 +205,7 @@ $endif
SYMBOL_VERSION SUNWprivate_1.3 {
global:
- _accept4;
+ _accept4;
_link_aton;
_link_ntoa;
_nss_initf_ethers;
diff --git a/usr/src/lib/libvscan/Makefile.com b/usr/src/lib/libvscan/Makefile.com
index 8d856c1182..1f43359369 100644
--- a/usr/src/lib/libvscan/Makefile.com
+++ b/usr/src/lib/libvscan/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
LIBRARY= libvscan.a
VERS= .1
@@ -39,7 +37,7 @@ $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC)
# Reset the Makefile.lib macro ROOTLIBDIR to refer to usr/lib/vscan
ROOTLIBDIR = $(ROOT)/usr/lib/vscan
-LDLIBS += -lc -lscf -lsecdb -lnsl -lm
+LDLIBS += -lc -lscf -lsecdb -lm
CFLAGS += $(CCVERBOSE)
CPPFLAGS += -I$(SRCDIR)
diff --git a/usr/src/lib/libxnet/common/mapfile-vers b/usr/src/lib/libxnet/common/mapfile-vers
index a284ae3311..d4816d2093 100644
--- a/usr/src/lib/libxnet/common/mapfile-vers
+++ b/usr/src/lib/libxnet/common/mapfile-vers
@@ -48,8 +48,8 @@ SYMBOL_VERSION SUNW_1.3.1 {
freeaddrinfo { TYPE = FUNCTION; FILTER = libsocket.so.1 };
getaddrinfo { TYPE = FUNCTION; FILTER = libsocket.so.1 };
getnameinfo { TYPE = FUNCTION; FILTER = libsocket.so.1 };
- inet_ntop { TYPE = FUNCTION; FILTER = libnsl.so.1 };
- inet_pton { TYPE = FUNCTION; FILTER = libnsl.so.1 };
+ inet_ntop { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_pton { TYPE = FUNCTION; FILTER = libc.so.1 };
} SUNW_1.3;
SYMBOL_VERSION SUNW_1.3 {
@@ -144,13 +144,13 @@ SYMBOL_VERSION SUNW_1.1 {
};
htonl { TYPE = FUNCTION; FILTER = libc.so.1 };
htons { TYPE = FUNCTION; FILTER = libc.so.1 };
- inet_addr { TYPE = FUNCTION; FILTER = libnsl.so.1 };
- inet_lnaof { TYPE = FUNCTION; FILTER = libsocket.so.1 };
- inet_makeaddr { TYPE = FUNCTION; FILTER = libsocket.so.1 };
- inet_netof { TYPE = FUNCTION; FILTER = libnsl.so.1 };
- inet_network { TYPE = FUNCTION; FILTER = libsocket.so.1 };
- inet_ntoa { TYPE = FUNCTION; FILTER = libnsl.so.1 };
- listen { TYPE = FUNCTION; FILTER = libsocket.so.1 };
+ inet_addr { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_lnaof { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_makeaddr { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_netof { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_network { TYPE = FUNCTION; FILTER = libc.so.1 };
+ inet_ntoa { TYPE = FUNCTION; FILTER = libc.so.1 };
+ listen { TYPE = FUNCTION; FILTER = libsocket.so.1 };
ntohl { TYPE = FUNCTION; FILTER = libc.so.1 };
ntohs { TYPE = FUNCTION; FILTER = libc.so.1 };
recv { TYPE = FUNCTION; FILTER = libsocket.so.1 };
diff --git a/usr/src/lib/libzonecfg/Makefile.com b/usr/src/lib/libzonecfg/Makefile.com
index 0bee2fc908..880abfcc97 100644
--- a/usr/src/lib/libzonecfg/Makefile.com
+++ b/usr/src/lib/libzonecfg/Makefile.com
@@ -29,7 +29,7 @@ OBJECTS= libzonecfg.o getzoneent.o scratchops.o
include ../../Makefile.lib
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -lc -lsocket -lnsl -luuid -lnvpair -lsysevent -lsec -lbrand \
+LDLIBS += -lc -lsocket -luuid -lnvpair -lsysevent -lsec -lbrand \
-lpool -lscf -lproc -luutil -lbsm -lsecdb
# DYNLIB libraries do not have lint libs and are not linted
$(DYNLIB) := LDLIBS += -lxml2
diff --git a/usr/src/lib/ncad_addr/Makefile.com b/usr/src/lib/ncad_addr/Makefile.com
index f7c5994bba..a918a1a3a6 100644
--- a/usr/src/lib/ncad_addr/Makefile.com
+++ b/usr/src/lib/ncad_addr/Makefile.com
@@ -31,7 +31,7 @@ include ../../Makefile.lib
SRCDIR = ../common
LIBS = $(DYNLIB)
-LDLIBS += -lc -lnsl
+LDLIBS += -lc
CFLAGS += $(CCVERBOSE)
.KEEP_STATE:
diff --git a/usr/src/lib/nsswitch/files/Makefile.com b/usr/src/lib/nsswitch/files/Makefile.com
index 0d011e7807..1489badee6 100644
--- a/usr/src/lib/nsswitch/files/Makefile.com
+++ b/usr/src/lib/nsswitch/files/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
LIBRARY = libnss_files.a
VERS = .1
@@ -59,9 +57,9 @@ include ../../../Makefile.rootfs
CPPFLAGS += -I../../../common/inc
LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2
-LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2
+LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2
-LDLIBS += -lsocket -lnsl
+LDLIBS += -lnsl
DYNLIB1 = nss_files.so$(VERS)
all: $(DYNLIB1)
diff --git a/usr/src/lib/nsswitch/ldap/Makefile.com b/usr/src/lib/nsswitch/ldap/Makefile.com
index 9876ccc0f2..694bd5f023 100644
--- a/usr/src/lib/nsswitch/ldap/Makefile.com
+++ b/usr/src/lib/nsswitch/ldap/Makefile.com
@@ -18,15 +18,10 @@
#
# CDDL HEADER END
-
-#
-#
-#ident "%Z%%M% %I% %E% SMI"
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# lib/nsswitch/ldap/Makefile.com
LIBRARY = libnss_ldap.a
VERS = .1
@@ -61,7 +56,7 @@ OBJECTS = getauthattr.o \
include ../../Makefile.com
CPPFLAGS += -I../../../libsldap/common
-LDLIBS += -lsldap -lnsl -lsocket -lldap
-LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2
-LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2
+LDLIBS += -lsldap -lnsl -lldap
+LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2
+LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2
DYNLIB1 = nss_ldap.so$(VERS)
diff --git a/usr/src/lib/nsswitch/mdns/Makefile.com b/usr/src/lib/nsswitch/mdns/Makefile.com
index dcd10ade20..aa246a9f73 100644
--- a/usr/src/lib/nsswitch/mdns/Makefile.com
+++ b/usr/src/lib/nsswitch/mdns/Makefile.com
@@ -18,10 +18,11 @@
#
# CDDL HEADER END
#
+
+#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# lib/nsswitch/mdns/Makefile.com
LIBRARY = libnss_mdns.a
VERS = .1
@@ -33,8 +34,8 @@ OBJECTS = gethostent.o \
# include common nsswitch library definitions.
include ../../Makefile.com
-CSTD = $(CSTD_GNU99)
-LDLIBS += -lnsl -ldns_sd -lscf
+CSTD= $(CSTD_GNU99)
+LDLIBS += -ldns_sd -lscf
DYNLIB1 = nss_mdns.so$(VERS)
-lint := LDLIBS = $(LDLIBS.lib) -lc -lnsl -lscf -ldns_sd
+lint := LDLIBS = $(LDLIBS.lib) -lc -lscf -ldns_sd
diff --git a/usr/src/lib/nsswitch/nis/Makefile.com b/usr/src/lib/nsswitch/nis/Makefile.com
index 2b0180d0d2..cbccdfb764 100644
--- a/usr/src/lib/nsswitch/nis/Makefile.com
+++ b/usr/src/lib/nsswitch/nis/Makefile.com
@@ -22,9 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# lib/nsswitch/nis/Makefile.com
LIBRARY = libnss_nis.a
VERS = .1
@@ -60,5 +57,5 @@ include ../../../Makefile.rootfs
LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2
LINTFLAGS64 += -erroff=E_GLOBAL_COULD_BE_STATIC2
-LDLIBS += -lnsl -lsocket
+LDLIBS += -lnsl
DYNLIB1 = nss_nis.so$(VERS)
diff --git a/usr/src/man/man1m/route.1m b/usr/src/man/man1m/route.1m
index 3cafaee41a..6cd5a20cd1 100644
--- a/usr/src/man/man1m/route.1m
+++ b/usr/src/man/man1m/route.1m
@@ -382,7 +382,7 @@ mask can be specified. This can be specified in one of the following ways:
.ie t \(bu
.el o
IP address following the gateway address . This is typically specified in
-\fIdecimal dot\fR notation as for \fBinet_addr\fR(3SOCKET) rather than in
+\fIdecimal dot\fR notation as for \fBinet_addr\fR(3C) rather than in
symbolic form.
.RE
.RS +4
@@ -651,7 +651,7 @@ List of network names and addresses
.LP
\fBuname\fR(1), \fBin.ripngd\fR(1M), \fBin.routed\fR(1M), \fBnetstat\fR(1M),
\fBrouted\fR(1M), \fBioctl\fR(2), \fBgetipnodebyname\fR(3SOCKET),
-\fBgetnetbyname\fR(3SOCKET), \fBinet_addr\fR(3SOCKET), \fBdefaultrouter\fR(4),
+\fBgetnetbyname\fR(3SOCKET), \fBinet_addr\fR(3C), \fBdefaultrouter\fR(4),
\fBhosts\fR(4), \fBnetworks\fR(4), \fBattributes\fR(5), \fBARP\fR(7P),
\fBip\fR(7P), \fBroute\fR(7P), \fBrouting\fR(7P)
.SH DIAGNOSTICS
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile
index 47443e6fd8..dcdaad1271 100644
--- a/usr/src/man/man3c/Makefile
+++ b/usr/src/man/man3c/Makefile
@@ -11,7 +11,7 @@
#
# Copyright 2011, Richard Lowe
-# Copyright 2017 Nexenta Systems, Inc.
+# Copyright 2018 Nexenta Systems, Inc.
# Copyright 2013, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
# Copyright 2016 Joyent, Inc.
@@ -210,6 +210,7 @@ MANFILES= __fbufsize.3c \
imaxabs.3c \
imaxdiv.3c \
index.3c \
+ inet.3c \
initgroups.3c \
insque.3c \
is_system_labeled.3c \
@@ -884,6 +885,16 @@ MANLINKS= FD_CLR.3c \
htole16.3c \
htole32.3c \
htole64.3c \
+ inet6.3c \
+ inet_addr.3c \
+ inet_aton.3c \
+ inet_lnaof.3c \
+ inet_makeaddr.3c \
+ inet_netof.3c \
+ inet_network.3c \
+ inet_ntoa.3c \
+ inet_ntop.3c \
+ inet_pton.3c \
initstate.3c \
innetgr.3c \
isalnum.3c \
@@ -1878,6 +1889,17 @@ hdestroy.3c := LINKSRC = hsearch.3c
rindex.3c := LINKSRC = index.3c
+inet6.3c := LINKSRC = inet.3c
+inet_addr.3c := LINKSRC = inet.3c
+inet_aton.3c := LINKSRC = inet.3c
+inet_lnaof.3c := LINKSRC = inet.3c
+inet_makeaddr.3c := LINKSRC = inet.3c
+inet_netof.3c := LINKSRC = inet.3c
+inet_network.3c := LINKSRC = inet.3c
+inet_ntoa.3c := LINKSRC = inet.3c
+inet_ntop.3c := LINKSRC = inet.3c
+inet_pton.3c := LINKSRC = inet.3c
+
remque.3c := LINKSRC = insque.3c
finite.3c := LINKSRC = isnand.3c
diff --git a/usr/src/man/man3c/inet.3c b/usr/src/man/man3c/inet.3c
new file mode 100644
index 0000000000..3f0f87b3b0
--- /dev/null
+++ b/usr/src/man/man3c/inet.3c
@@ -0,0 +1,440 @@
+.\"
+.\" The contents of this file are subject to the terms of the
+.\" Common Development and Distribution License (the "License").
+.\" You may not use this file except in compliance with the License.
+.\"
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+.\" or http://www.opensolaris.org/os/licensing.
+.\" See the License for the specific language governing permissions
+.\" and limitations under the License.
+.\"
+.\" When distributing Covered Code, include this CDDL HEADER in each
+.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+.\" If applicable, add the following below this CDDL HEADER, with the
+.\" fields enclosed by brackets "[]" replaced with your own identifying
+.\" information: Portions Copyright [yyyy] [name of copyright owner]
+.\"
+.\"
+.\" Copyright 1989 AT&T
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 2018 Nexenta Systems, Inc.
+.\"
+.Dd July 22, 2018
+.Dt INET 3C
+.Os
+.Sh NAME
+.Nm inet ,
+.Nm inet6 ,
+.Nm inet_ntop ,
+.Nm inet_pton ,
+.Nm inet_aton ,
+.Nm inet_addr ,
+.Nm inet_network ,
+.Nm inet_makeaddr ,
+.Nm inet_lnaof ,
+.Nm inet_netof ,
+.Nm inet_ntoa
+.Nd Internet address manipulation
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In sys/types.h
+.In sys/socket.h
+.In netinet/in.h
+.In arpa/inet.h
+.Ft const char *
+.Fo inet_ntop
+.Fa "int af"
+.Fa "const void *addr"
+.Fa "char *cp"
+.Fa "size_t size"
+.Fc
+.Ft int
+.Fo inet_pton
+.Fa "int af"
+.Fa "const char *cp"
+.Fa "void *addr"
+.Fc
+.Ft int
+.Fo inet_aton
+.Fa "const char *cp"
+.Fa "struct in_addr *addr"
+.Fc
+.Ft in_addr_t
+.Fo inet_addr
+.Fa "const char *cp"
+.Fc
+.Ft in_addr_t
+.Fo inet_network
+.Fa "const char *cp"
+.Fc
+.Ft struct in_addr
+.Fo inet_makeaddr
+.Fa "const int net"
+.Fa "const int lna"
+.Fc
+.Ft in_addr_t
+.Fo inet_lnaof
+.Fa "const struct in_addr in"
+.Fc
+.Ft in_addr_t
+.Fo inet_netof
+.Fa "const struct in_addr in"
+.Fc
+.Ft char *
+.Fo inet_ntoa
+.Fa "const struct in_addr in"
+.Fc
+.Sh DESCRIPTION
+The
+.Fn inet_ntop
+and
+.Fn inet_pton
+functions can manipulate both IPv4 and IPv6 addresses.
+The
+.Fn inet_aton ,
+.Fn inet_addr ,
+.Fn inet_network ,
+.Fn inet_makeaddr ,
+.Fn inet_lnaof ,
+.Fn inet_netof ,
+and
+.Fn inet_ntoa
+functions can only manipulate IPv4 addresses.
+.Pp
+The
+.Fn inet_ntop
+function converts a numeric address into a string suitable for presentation.
+The
+.Fa af
+argument specifies the family of the address which can be
+.Dv AF_INET
+or
+.Dv AF_INET6 .
+The
+.Fa addr
+argument points to a buffer that holds an IPv4 address if the
+.Fa af
+argument is
+.Dv AF_INET .
+The
+.Fa addr
+argument points to a buffer that holds an IPv6 address if the
+.Fa af
+argument is
+.Dv AF_INET6 .
+The address must be in network byte order.
+The
+.Fa cp
+argument points to a buffer where the function stores the resulting string.
+The application must specify a non-NULL
+.Fa cp
+argument.
+The
+.Fa size
+argument specifies the size of this buffer.
+For IPv6 addresses, the buffer must be at least 46-octets.
+For IPv4 addresses, the buffer must be at least 16-octets.
+To allow applications to easily declare buffers of the proper size to store IPv4
+and IPv6 addresses in string form, the following two constants are defined in
+.In netinet/in.h :
+.Bd -literal
+#define INET_ADDRSTRLEN 16
+#define INET6_ADDRSTRLEN 46
+.Ed
+.Pp
+The
+.Fn inet_pton
+function converts the standard text presentation form of a function to the
+numeric binary form.
+The
+.Fa af
+argument specifies the family of the address.
+Currently, the
+.Dv AF_INET
+and
+.Dv AF_INET6
+address families are supported.
+The
+.Fa cp
+argument points to the string being passed in.
+The
+.Fa addr
+argument points to a buffer where the function stores the numeric address.
+The calling application must ensure that the buffer referred to by
+.Fa addr
+is large enough to hold the numeric address, at least 4 bytes for
+.Dv AF_INET
+or 16 bytes for
+.Dv AF_INET6 .
+.Pp
+The
+.Fn inet_aton ,
+.Fn inet_addr ,
+and
+.Fn inet_network
+functions interpret character strings that represent numbers expressed in the
+IPv4 standard
+.Ql \&.
+notation, returning numbers suitable for use as IPv4 addresses and IPv4 network
+numbers, respectively.
+The
+.Fn inet_makeaddr
+function uses an IPv4 network number and a local network address to construct
+an IPv4 address.
+The
+.Fn inet_netof
+and
+.Fn inet_lnaof
+functions break apart IPv4 host addresses, then return the network number and
+local network address, respectively.
+.Pp
+The
+.Fn inet_ntoa
+function returns a pointer to a string in the base 256 notation
+.Ql d.d.d.d .
+See the following section on IPv4 addresses.
+.Pp
+Internet addresses are returned in network order, bytes ordered from left to
+right.
+Network numbers and local address parts are returned as machine format integer
+values.
+.Ss IPv6 Addresses
+There are three conventional forms for representing IPv6 addresses as strings:
+.Bl -enum
+.It
+The preferred form is
+.Ql x:x:x:x:x:x:x:x ,
+where the
+.Li x No 's
+are the
+hexadecimal values of the eight 16-bit pieces of the address.
+For example,
+.Ql 1080:0:0:0:8:800:200C:417A .
+.Pp
+It is not necessary to write the leading zeros in an individual field.
+There must be at least one numeral in every field, except when the special
+syntax described in the following is used.
+.It
+It is common for addresses to contain long strings of zero bits in some
+methods used to allocate certain IPv6 address styles.
+A special syntax is available to compress the zeros.
+The use of
+.Ql ::
+indicates multiple groups of 16 bits of zeros.
+The
+.Ql ::
+may only appear once in an address.
+The
+.Ql ::
+can also be used to compress the leading and trailing zeros in an address.
+For example,
+.Ql 1080::8:800:200C:417A .
+.It
+The alternative form
+.Ql x:x:x:x:x:x:d.d.d.d
+is sometimes more convenient when dealing with a mixed environment of IPv4 and
+IPv6 nodes.
+The
+.Li x No 's
+in this form represent the hexadecimal values of the six high-order 16-bit
+pieces of the address.
+The
+.Li d No 's
+represent the decimal values of the four low-order 8-bit pieces of the standard
+IPv4 address.
+For example:
+.Bd -literal
+::FFFF:129.144.52.38 .
+::129.144.52.38
+.Ed
+.Pp
+The
+.Ql ::FFFF:d.d.d.d
+and
+.Ql ::d.d.d.d
+pieces are the general forms of an IPv4-mapped IPv6 address and an
+IPv4-compatible IPv6 address.
+.Pp
+The IPv4 portion must be in the
+.Ql d.d.d.d
+form.
+The following forms are invalid:
+.Bd -literal
+::FFFF:d.d.d
+::FFFF:d.d
+::d.d.d
+::d.d
+.Ed
+.Pp
+The
+.Ql ::FFFF:d
+form is a valid but unconventional representation of the IPv4-compatible IPv6
+address
+.Ql ::255.255.0.d .
+.Pp
+The
+.Ql ::d
+form corresponds to the general IPv6 address
+.Ql 0:0:0:0:0:0:0:d .
+.El
+.Ss IPv4 Addresses
+Values specified using
+.Ql \&.
+notation take one of the following forms:
+.Bd -literal
+d.d.d.d
+d.d.d
+d.d
+d
+.Ed
+.Pp
+When four parts are specified, each part is interpreted as a byte of data and
+assigned from left to right to the four bytes of an IPv4 address.
+.Pp
+When a three-part address is specified, the last part is interpreted as a
+16-bit quantity and placed in the right most two bytes of the network address.
+The three part address format is convenient for specifying Class B network
+addresses such as
+.Ql 128.net.host .
+.Pp
+When a two-part address is supplied, the last part is interpreted as a 24-bit
+quantity and placed in the right most three bytes of the network address.
+The two part address format is convenient for specifying Class A network
+addresses such as
+.Ql net.host .
+.Pp
+When only one part is given, the value is stored directly in the network
+address without any byte rearrangement.
+.Pp
+With the exception of
+.Fn inet_pton ,
+numbers supplied as parts in
+.Ql \&.
+notation may be decimal, octal, or hexadecimal, as specified in C language.
+For example, a leading
+.Ql 0x
+or
+.Ql 0X
+implies hexadecimal.
+A leading
+.Ql 0
+implies octal.
+Otherwise, the number is interpreted as decimal.
+.Pp
+For IPv4 addresses,
+.Fn inet_pton
+accepts only a string in standard IPv4 dot notation
+.Ql d.d.d.d .
+.Pp
+Each number has one to three digits with a decimal value between 0 and 255.
+.Pp
+The
+.Fn inet_addr
+function has been obsoleted by
+.Fn inet_aton .
+.Sh RETURN VALUES
+The
+.Fn inet_aton
+function returns nonzero if the address is valid,
+.Li 0
+if the address is invalid.
+.Pp
+The
+.Fn inet_ntop
+function returns a pointer to the buffer that contains a string if the
+conversion succeeds.
+Otherwise,
+.Dv NULL
+is returned.
+Upon failure,
+.Va errno
+is set to
+.Er EAFNOSUPPORT
+if the
+.Fa af
+argument is invalid or
+.Er ENOSPC
+if the size of the result buffer is inadequate.
+.Pp
+The
+.Fn inet_pton
+function returns
+.Li 1
+if the conversion succeeds,
+.Li 0
+if the input is not a valid IPv4 dotted-decimal string or a valid IPv6
+address string.
+The function returns
+.Li -1
+with
+.Va errno
+set to
+.Er EAFNOSUPPORT
+if the
+.Fa af
+argument is unknown.
+.Pp
+The value
+.Dv INADDR_NONE ,
+which is equivalent to
+.Li (in_addr_t)(-1) ,
+is returned by
+.Fn inet_addr
+and
+.Fn inet_network
+for malformed requests.
+.Pp
+The functions
+.Fn inet_netof
+and
+.Fn inet_lnaof
+break apart IPv4 host addresses, returning the network number and local network
+address part, respectively.
+.Pp
+The function
+.Fn inet_ntoa
+returns a pointer to a string in the base 256 notation
+.Ql d.d.d.d ,
+described in the section on IPv4 addresses.
+.Sh MT-LEVEL
+.Sy Safe
+.Sh INTERFACE STABILITY
+The
+.Fn inet_ntop ,
+.Fn inet_pton ,
+.Fn inet_aton ,
+.Fn inet_addr ,
+and
+.Fn inet_network
+functions are
+.Sy Committed .
+The
+.Fn inet_lnaof ,
+.Fn inet_makeaddr ,
+.Fn inet_netof ,
+and
+.Fn inet_network
+functions are
+.Sy Obsolete Committed .
+.Sh SEE ALSO
+.Xr inet.h 3HEAD ,
+.Xr gethostbyname 3NSL ,
+.Xr getipnodebyname 3SOCKET ,
+.Xr getnetbyname 3SOCKET ,
+.Xr hosts 4 ,
+.Xr networks 4 ,
+.Xr attributes 5
+.Sh NOTES
+The return value from
+.Fn inet_ntoa
+points to a buffer which is overwritten on each call.
+This buffer is implemented as thread-specific data in multithreaded
+applications.
+.Pp
+IPv4-mapped addresses are not recommended.
+.Sh BUGS
+The problem of host byte ordering versus network byte ordering is confusing.
+.Pp
+A simple way to specify Class C network addresses in a manner similar to that
+for Class B and Class A is needed.
diff --git a/usr/src/man/man3head/inet.h.3head b/usr/src/man/man3head/inet.h.3head
index 063b42d7ca..b0f2e257bd 100644
--- a/usr/src/man/man3head/inet.h.3head
+++ b/usr/src/man/man3head/inet.h.3head
@@ -53,7 +53,6 @@ inet.h, inet \- definitions for internet operations
.fi
.SH DESCRIPTION
-.sp
.LP
The <\fBarpa/inet.h\fR> header defines the type \fBin_port_t\fR, the type
\fBin_addr_t\fR, and the \fBin_addr\fR structure, as described in
@@ -78,7 +77,6 @@ char *inet_ntoa(struct in_addr);
.in -2
.SS "Default"
-.sp
.LP
For applications that do not require standard-conforming behavior (those that
use the socket interfaces described in section 3N of the reference manual; see
@@ -95,7 +93,6 @@ uint16_t ntohs(uint16_t);
.in -2
.SS "Standard conforming"
-.sp
.LP
For applications that require standard-conforming behavior (those that use the
socket interfaces described in section 3XN of the reference manual; see
@@ -112,7 +109,6 @@ in_port_t ntohs(in_port_t);
.in -2
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -128,8 +124,7 @@ Interface Stability Standard
.TE
.SH SEE ALSO
-.sp
.LP
-\fBIntro\fR(3), \fBhtonl\fR(3SOCKET), \fBhtonl\fR(3XNET),
-\fBinet_addr\fR(3SOCKET), \fBinet_addr\fR(3XNET), \fBin.h\fR(3HEAD),
+\fBIntro\fR(3), \fBhtonl\fR(3C), \fBhtonl\fR(3XNET),
+\fBinet_addr\fR(3C), \fBinet_addr\fR(3XNET), \fBin.h\fR(3HEAD),
\fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man3lib/libnsl.3lib b/usr/src/man/man3lib/libnsl.3lib
index 4d257f2ad9..226446caa2 100644
--- a/usr/src/man/man3lib/libnsl.3lib
+++ b/usr/src/man/man3lib/libnsl.3lib
@@ -13,7 +13,6 @@ cc [ \fIflag\fR... ] \fIfile\fR... \fB-lnsl\fR [ \fIlibrary\fR... ]
.fi
.SH DESCRIPTION
-.sp
.LP
Functions in this library provide routines that provide a transport-level
interface to networking services for applications, facilities for
@@ -27,7 +26,6 @@ example is the set of symbols beginning with the \fB_xti\fR prefix. Those
symbols are used in implementing the X/Open Transport Interface (\fBXTI)\fR
interfaces documented in \fBlibxnet\fR. See \fBlibxnet\fR(3LIB).
.SH INTERFACES
-.sp
.LP
The shared object \fBlibnsl.so.1\fR provides the public interfaces defined
below. See \fBIntro\fR(3) for additional information on shared object
@@ -97,9 +95,6 @@ l l .
\fBgetrpcent\fR \fBgetrpcent_r\fR
\fBgetrpcport\fR \fBgetsecretkey\fR
\fBh_errno\fR \fBhost2netname\fR
-\fBinet_addr\fR \fBinet_netof\fR
-\fBinet_ntoa\fR \fBinet_ntoa_r\fR
-\fBinet_ntop\fR \fBinet_pton\fR
\fBkey_decryptsession\fR \fBkey_encryptsession\fR
\fBkey_gendes\fR \fBkey_secretkey_is_set\fR
\fBkey_setsecret\fR \fBmaxbno\fR
@@ -234,7 +229,7 @@ l l .
\fByp_match\fR \fByp_next\fR
\fByp_order\fR \fByp_unbind\fR
\fByp_update\fR \fByperr_string\fR
-\fBypprot_err\fR
+\fBypprot_err\fR
.TE
.sp
@@ -245,11 +240,10 @@ The following interface is unique to the 32-bit version of this library:
.sp
.TS
l l .
-\fB_new_svc_fdset\fR
+\fB_new_svc_fdset\fR
.TE
.SH FILES
-.sp
.ne 2
.na
\fB\fB/lib/libnsl.so.1\fR\fR
@@ -268,7 +262,6 @@ shared object
.RE
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -284,7 +277,6 @@ MT-Level Safe with exceptions
.TE
.SH SEE ALSO
-.sp
.LP
\fBpvs\fR(1), \fBIntro\fR(2), \fBIntro\fR(3), \fBlibxnet\fR(3LIB),
\fBattributes\fR(5)
diff --git a/usr/src/man/man3socket/Makefile b/usr/src/man/man3socket/Makefile
index 5174020548..3422782a2a 100644
--- a/usr/src/man/man3socket/Makefile
+++ b/usr/src/man/man3socket/Makefile
@@ -11,15 +11,15 @@
#
# Copyright 2011, Richard Lowe
-# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.
# Copyright 2013, OmniTI Computer Consulting, Inc.
#
include $(SRC)/Makefile.master
-MANSECT= 3socket
+MANSECT= 3socket
-MANFILES= accept.3socket \
+MANFILES= accept.3socket \
bind.3socket \
byteorder.3socket \
connect.3socket \
@@ -36,7 +36,6 @@ MANFILES= accept.3socket \
getsourcefilter.3socket \
icmp6_filter.3socket \
if_nametoindex.3socket \
- inet.3socket \
inet6_opt.3socket \
inet6_rth.3socket \
listen.3socket \
@@ -97,7 +96,6 @@ MANLINKS= accept4.3socket \
if_freenameindex.3socket \
if_indextoname.3socket \
if_nameindex.3socket \
- inet6.3socket \
inet6_opt_append.3socket \
inet6_opt_find.3socket \
inet6_opt_finish.3socket \
@@ -111,15 +109,6 @@ MANLINKS= accept4.3socket \
inet6_rth_reverse.3socket \
inet6_rth_segments.3socket \
inet6_rth_space.3socket \
- inet_addr.3socket \
- inet_aton.3socket \
- inet_lnaof.3socket \
- inet_makeaddr.3socket \
- inet_netof.3socket \
- inet_network.3socket \
- inet_ntoa.3socket \
- inet_ntop.3socket \
- inet_pton.3socket \
ntohl.3socket \
ntohll.3socket \
ntohs.3socket \
@@ -207,17 +196,6 @@ if_freenameindex.3socket := LINKSRC = if_nametoindex.3socket
if_indextoname.3socket := LINKSRC = if_nametoindex.3socket
if_nameindex.3socket := LINKSRC = if_nametoindex.3socket
-inet6.3socket := LINKSRC = inet.3socket
-inet_addr.3socket := LINKSRC = inet.3socket
-inet_aton.3socket := LINKSRC = inet.3socket
-inet_lnaof.3socket := LINKSRC = inet.3socket
-inet_makeaddr.3socket := LINKSRC = inet.3socket
-inet_netof.3socket := LINKSRC = inet.3socket
-inet_network.3socket := LINKSRC = inet.3socket
-inet_ntoa.3socket := LINKSRC = inet.3socket
-inet_ntop.3socket := LINKSRC = inet.3socket
-inet_pton.3socket := LINKSRC = inet.3socket
-
inet6_opt_append.3socket := LINKSRC = inet6_opt.3socket
inet6_opt_find.3socket := LINKSRC = inet6_opt.3socket
inet6_opt_finish.3socket := LINKSRC = inet6_opt.3socket
diff --git a/usr/src/man/man3socket/getipnodebyname.3socket b/usr/src/man/man3socket/getipnodebyname.3socket
index 9b68ea15ff..7eca1e3892 100644
--- a/usr/src/man/man3socket/getipnodebyname.3socket
+++ b/usr/src/man/man3socket/getipnodebyname.3socket
@@ -29,7 +29,6 @@ getipnodebyname, getipnodebyaddr, freehostent \- get IP node entry
.fi
.SH PARAMETERS
-.sp
.ne 2
.na
\fB\fIaf\fR\fR
@@ -93,7 +92,6 @@ Pointer to \fBhostent\fR structure
.RE
.SH DESCRIPTION
-.sp
.LP
The \fBgetipnodebyname()\fR function searches the \fBipnodes\fR database from
the beginning. The function finds the first \fBh_name\fR member that matches
@@ -254,7 +252,7 @@ The special flags value, \fBAI_DEFAULT\fR, is defined as
.LP
The \fBgetipnodebyname()\fR function allows the \fIname\fR argument to be a
node name or a literal address string: a dotted-decimal IPv4 address or an IPv6
-hex address. Applications do not have to call \fBinet_pton\fR(3SOCKET) to
+hex address. Applications do not have to call \fBinet_pton\fR(3C) to
handle literal address strings.
.sp
.LP
@@ -310,7 +308,6 @@ terminated by a \fINULL\fR pointer.
.RE
.SH RETURN VALUES
-.sp
.LP
Upon successful completion, \fBgetipnodebyname()\fR and \fBgetipnodebyaddr()\fR
return a \fBhostent\fR structure. Otherwise they return \fINULL\fR.
@@ -489,7 +486,6 @@ hostname.
.in -2
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -507,13 +503,11 @@ MT-Level Safe
.TE
.SH SEE ALSO
-.sp
.LP
\fBgetaddrinfo\fR(3SOCKET), \fBgethostbyname\fR(3NSL), \fBhtonl\fR(3SOCKET),
\fBinet\fR(3SOCKET), \fBnetdb.h\fR(3HEAD), \fBhosts\fR(4),
\fBnsswitch.conf\fR(4), \fBattributes\fR(5)
.SH NOTES
-.sp
.LP
No enumeration functions are provided for IPv6. Existing enumeration functions
such as \fBsethostent\fR(3NSL) do not work in combination with the
@@ -544,6 +538,6 @@ addresses.
The form for an address of type \fBAF_INET\fR is a \fBstruct in_addr\fR defined
in <\fBnetinet/in.h\fR>. The form for an address of type \fBAF_INET6\fR is a
\fBstruct in6_addr\fR, also defined in <\fBnetinet/in.h\fR>. The functions
-described in \fBinet_ntop\fR(3SOCKET) and \fBinet_pton\fR(3SOCKET) that are
+described in \fBinet_ntop\fR(3C) and \fBinet_pton\fR(3C) that are
illustrated in the EXAMPLES section are helpful in constructing and
manipulating addresses in either of these forms.
diff --git a/usr/src/man/man3socket/inet.3socket b/usr/src/man/man3socket/inet.3socket
deleted file mode 100644
index 818fb98fdd..0000000000
--- a/usr/src/man/man3socket/inet.3socket
+++ /dev/null
@@ -1,330 +0,0 @@
-'\" te
-.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
-.\" Copyright 1989 AT&T
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH INET 3SOCKET "Nov 28, 2007"
-.SH NAME
-inet, inet6, inet_ntop, inet_pton, inet_aton, inet_addr, inet_network,
-inet_makeaddr, inet_lnaof, inet_netof, inet_ntoa \- Internet address
-manipulation
-.SH SYNOPSIS
-.LP
-.nf
-\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsocket\fR \fB -lnsl \fR [ \fIlibrary\fR... ]
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-\fBconst char *\fR\fBinet_ntop\fR(\fBint\fR \fIaf\fR, \fBconst void *\fR\fIaddr\fR, \fBchar *\fR\fIcp\fR,
- \fBsize_t\fR \fIsize\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBinet_pton\fR(\fBint\fR \fIaf\fR, \fBconst char *\fR\fIcp\fR, \fBvoid *\fR\fIaddr\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBinet_aton\fR(\fBconst char *\fR\fIcp\fR, \fBstruct in_addr *\fR\fIaddr\fR);
-.fi
-
-.LP
-.nf
-\fBin_addr_t\fR \fBinet_addr\fR(\fBconst char *\fR\fIcp\fR);
-.fi
-
-.LP
-.nf
-\fBin_addr_t\fR \fBinet_network\fR(\fBconst char *\fR\fIcp\fR);
-.fi
-
-.LP
-.nf
-\fBstruct in_addr\fR \fBinet_makeaddr\fR(\fBconst int\fR \fInet\fR, \fBconst int\fR \fIlna\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBinet_lnaof\fR(\fBconst struct in_addr\fR \fIin\fR);
-.fi
-
-.LP
-.nf
-\fBint\fR \fBinet_netof\fR(\fBconst struct in_addr\fR \fIin\fR);
-.fi
-
-.LP
-.nf
-\fBchar *\fR\fBinet_ntoa\fR(\fBconst struct in_addr\fR \fIin\fR);
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fBinet_ntop()\fR and \fBinet_pton()\fR functions can manipulate both IPv4
-and IPv6 addresses. The \fBinet_aton()\fR, \fBinet_addr()\fR,
-\fBinet_network()\fR, \fBinet_makeaddr()\fR, \fBinet_lnaof()\fR,
-\fBinet_netof()\fR, and \fBinet_ntoa()\fR functions can only manipulate IPv4
-addresses.
-.sp
-.LP
-The \fBinet_ntop()\fR function converts a numeric address into a string
-suitable for presentation. The \fIaf\fR argument specifies the family of the
-address which can be \fBAF_INET\fR or \fBAF_INET6\fR. The \fIaddr\fR argument
-points to a buffer that holds an IPv4 address if the \fIaf\fR argument is
-\fBAF_INET\fR. The \fIaddr\fR argument points to a buffer that holds an IPv6
-address if the \fIaf\fR argument is \fBAF_INET6\fR. The address must be in
-network byte order. The \fIcp\fR argument points to a buffer where the function
-stores the resulting string. The application must specify a non-\fINULL\fR
-\fIcp\fR argument. The \fIsize\fR argument specifies the size of this buffer.
-For IPv6 addresses, the buffer must be at least 46-octets. For IPv4 addresses,
-the buffer must be at least 16-octets. To allow applications to easily declare
-buffers of the proper size to store IPv4 and IPv6 addresses in string form, the
-following two constants are defined in <\fBnetinet/in.h\fR>:
-.sp
-.in +2
-.nf
-#define INET_ADDRSTRLEN 16
-#define INET6_ADDRSTRLEN 46
-.fi
-.in -2
-
-.sp
-.LP
-The \fBinet_pton()\fR function converts the standard text presentation form of
-a function to the numeric binary form. The \fIaf\fR argument specifies the
-family of the address. Currently, the \fBAF_INET\fR and \fBAF_INET6\fR address
-families are supported. The \fIcp\fR argument points to the string being passed
-in. The \fIaddr\fR argument points to a buffer where the function stores the
-numeric address. The calling application must ensure that the buffer referred
-to by \fIaddr\fR is large enough to hold the numeric address, at least 4 bytes
-for \fBAF_INET\fR or 16 bytes for \fBAF_INET6\fR.
-.sp
-.LP
-The \fBinet_aton()\fR, \fBinet_addr()\fR, and \fBinet_network()\fR functions
-interpret character strings that represent numbers expressed in the IPv4
-standard '\fB\&.\fR' notation, returning numbers suitable for use as IPv4
-addresses and IPv4 network numbers, respectively. The \fBinet_makeaddr()\fR
-function uses an IPv4 network number and a local network address to construct
-an IPv4 address. The \fBinet_netof()\fR and \fBinet_lnaof()\fR functions break
-apart IPv4 host addresses, then return the network number and local network
-address, respectively.
-.sp
-.LP
-The \fBinet_ntoa()\fR function returns a pointer to a string in the base 256
-notation \fBd.d.d.d\fR. See the following section on IPv4 addresses.
-.sp
-.LP
-Internet addresses are returned in network order, bytes ordered from left to
-right. Network numbers and local address parts are returned as machine format
-integer values.
-.SS "IPv6 Addresses"
-.sp
-.LP
-There are three conventional forms for representing IPv6 addresses as strings:
-.RS +4
-.TP
-1.
-The preferred form is \fBx:x:x:x:x:x:x:x\fR, where the 'x's are the
-hexadecimal values of the eight 16-bit pieces of the address. For example:
-.sp
-.in +2
-.nf
-1080:0:0:0:8:800:200C:417A
-.fi
-.in -2
-
-It is not necessary to write the leading zeros in an individual field. There
-must be at least one numeral in every field, except when the special syntax
-described in the following is used.
-.RE
-.RS +4
-.TP
-2.
-It is common for addresses to contain long strings of zero bits in some
-methods used to allocate certain IPv6 address styles. A special syntax is
-available to compress the zeros. The use of "\fB::\fR" indicates multiple
-groups of 16 bits of zeros. The \fB::\fR may only appear once in an address.
-The \fB::\fR can also be used to compress the leading and trailing zeros in an
-address. For example:
-.sp
-.in +2
-.nf
-1080::8:800:200C:417A
-.fi
-.in -2
-
-.RE
-.RS +4
-.TP
-3.
-The alternative form \fBx:x:x:x:x:x:d.d.d.d\fR is sometimes more convenient
-when dealing with a mixed environment of IPv4 and IPv6 nodes. The \fBx\fR's in
-this form represent the hexadecimal values of the six high-order 16-bit pieces
-of the address. The \fBd\fR's represent the decimal values of the four
-low-order 8-bit pieces of the standard IPv4 address. For example:
-.sp
-.in +2
-.nf
-::FFFF:129.144.52.38
-::129.144.52.38
-.fi
-.in -2
-
-The \fB::FFFF:d.d.d.d\fR and \fB::d.d.d.d\fR pieces are the general forms of an
-IPv4-mapped IPv6 address and an IPv4-compatible IPv6 address.
-.sp
-The IPv4 portion must be in the \fBd.d.d.d\fR form. The following forms are
-invalid:
-.sp
-.in +2
-.nf
-::FFFF:d.d.d
-::FFFF:d.d
-::d.d.d
-::d.d
-.fi
-.in -2
-
-The \fB::FFFF:d\fR form is a valid but unconventional representation of the
-IPv4-compatible IPv6 address \fB::255.255.0.d\fR.
-.sp
-The \fB::d\fR form corresponds to the general IPv6 address
-\fB0:0:0:0:0:0:0:d\fR.
-.RE
-.SS "IPv4 Addresses"
-.sp
-.LP
-Values specified using `\fB\&.\fR' notation take one of the following forms:
-.sp
-.in +2
-.nf
-d.d.d.d
-d.d.d
-d.d
-d
-.fi
-.in -2
-
-.sp
-.LP
-When four parts are specified, each part is interpreted as a byte of data and
-assigned from left to right to the four bytes of an IPv4 address.
-.sp
-.LP
-When a three-part address is specified, the last part is interpreted as a
-16-bit quantity and placed in the right most two bytes of the network address.
-The three part address format is convenient for specifying Class B network
-addresses such as \fB128.net.host\fR.
-.sp
-.LP
-When a two-part address is supplied, the last part is interpreted as a 24-bit
-quantity and placed in the right most three bytes of the network address. The
-two part address format is convenient for specifying Class A network addresses
-such as \fBnet.host\fR.
-.sp
-.LP
-When only one part is given, the value is stored directly in the network
-address without any byte rearrangement.
-.sp
-.LP
-With the exception of \fBinet_pton()\fR, numbers supplied as \fIparts\fR
-in '\fB\&.\fR' notation may be decimal, octal, or hexadecimal, as specified in C
-language. For example, a leading \fB0x\fR or \fB0X\fR implies hexadecimal. A
-leading \fB0\fR implies octal. Otherwise, the number is interpreted as decimal.
-.sp
-.LP
-For IPv4 addresses, \fBinet_pton()\fR accepts only a string in standard IPv4
-dot notation:
-.sp
-.in +2
-.nf
-d.d.d.d
-.fi
-.in -2
-
-.sp
-.LP
-Each number has one to three digits with a decimal value between 0 and 255.
-.sp
-.LP
-The \fBinet_addr()\fR function has been obsoleted by \fBinet_aton()\fR.
-.SH RETURN VALUES
-.sp
-.LP
-The \fBinet_aton()\fR function returns nonzero if the address is valid, \fB0\fR
-if the address is invalid.
-.sp
-.LP
-The \fBinet_ntop()\fR function returns a pointer to the buffer that contains a
-string if the conversion succeeds. Otherwise, \fINULL\fR is returned. Upon
-failure, \fIerrno\fR is set to \fBEAFNOSUPPORT\fR if the \fIaf\fR argument is
-invalid or \fBENOSPC\fR if the size of the result buffer is inadequate.
-.sp
-.LP
-The \fBinet_pton()\fR function returns \fB1\fR if the conversion succeeds,
-\fB0\fR if the input is not a valid IPv4 dotted-decimal string or a valid IPv6
-address string. The function returns \fB-1\fR with \fIerrno\fR set to
-\fBEAFNOSUPPORT\fR if the af argument is unknown.
-.sp
-.LP
-The value \fBINADDR_NONE\fR, which is equivalent to \fB(in_addr_t)(-1)\fR, is
-returned by \fBinet_addr()\fR and \fBinet_network()\fR for malformed requests.
-.sp
-.LP
-The functions \fBinet_netof()\fR and \fBinet_lnaof()\fR break apart IPv4 host
-addresses, returning the network number and local network address part,
-respectively.
-.sp
-.LP
-The function \fBinet_ntoa()\fR returns a pointer to a string in the base 256
-notation \fBd.d.d.d\fR, described in the section on IPv4 addresses.
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE ATTRIBUTE VALUE
-_
-Interface Stability See below.
-_
-MT-Level Safe
-.TE
-
-.sp
-.LP
-The \fBinet_ntop()\fR, \fBinet_pton()\fR, \fBinet_aton()\fR, \fBinet_addr()\fR,
-and \fBinet_network()\fR functions are Committed. The \fBinet_lnaof()\fR,
-\fBinet_makeaddr()\fR, \fBinet_netof()\fR, and \fBinet_network()\fR functions
-are Committed (Obsolete).
-.SH SEE ALSO
-.sp
-.LP
-\fBgethostbyname\fR(3NSL), \fBgetipnodebyname\fR(3SOCKET),
-\fBgetnetbyname\fR(3SOCKET), \fBinet.h\fR(3HEAD), \fBhosts\fR(4),
-\fBnetworks\fR(4), \fBattributes\fR(5)
-.SH NOTES
-.sp
-.LP
-The return value from \fBinet_ntoa()\fR points to a buffer which is overwritten
-on each call. This buffer is implemented as thread-specific data in
-multithreaded applications.
-.sp
-.LP
-IPv4-mapped addresses are not recommended.
-.SH BUGS
-.sp
-.LP
-The problem of host byte ordering versus network byte ordering is confusing. A
-simple way to specify Class C network addresses in a manner similar to that for
-Class B and Class A is needed.
diff --git a/usr/src/man/man3socket/sockaddr.3socket b/usr/src/man/man3socket/sockaddr.3socket
index 372721f461..740b80e4dd 100644
--- a/usr/src/man/man3socket/sockaddr.3socket
+++ b/usr/src/man/man3socket/sockaddr.3socket
@@ -206,7 +206,7 @@ The member
is the four byte IPv4 address.
It is also stored in network byte order.
The common way to write out the address is to use the function
-.Xr inet_pton 3SOCKET
+.Xr inet_pton 3C
which converts between a human readable IP address such as "10.1.2.3"
and the corresponding representation.
.Lp
@@ -271,7 +271,7 @@ The member
.Em sin6_addr
describes the 16-byte IPv6 address.
In addition to the function
-.Xr inet_pton 3SOCKET ,
+.Xr inet_pton 3C ,
the header file
.In netinet/in.h
defines many macros for manipulating and testing IPv6 addresses.
diff --git a/usr/src/man/man4/ncaport.conf.4 b/usr/src/man/man4/ncaport.conf.4
index be865fb174..1c85142dd9 100644
--- a/usr/src/man/man4/ncaport.conf.4
+++ b/usr/src/man/man4/ncaport.conf.4
@@ -13,14 +13,13 @@ ncaport.conf \- ncaport configuration file
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBncaport.conf\fR file is used to configure the IP addresses and ports
that the Solaris Network Cache and Acceleration (NCA) kernel module services.
The file contains two fields, key and value, in the format of
\fBncaport=\fIipaddress\fR/\fIport\fR\fR. IPv4 addresses must be in the dot
notation \fId\fR.\fId\fR.\fId\fR.\fId\fR. IPv6 addresses must be in one of the
-three conventional forms (see \fBinet_pton\fR(3SOCKET)). If an asterisk
+three conventional forms (see \fBinet_pton\fR(3C)). If an asterisk
(\fB*\fR) is used for an IP address, it is interpreted as \fBINADDR_ANY\fR,
which matches any IP address.
.sp
@@ -54,12 +53,10 @@ ncaport=*/9000
.sp
.SH SEE ALSO
-.sp
.LP
-\fBnca\fR(1), \fBbind\fR(3SOCKET), \fBinet_pton\fR(3SOCKET),
+\fBnca\fR(1), \fBbind\fR(3SOCKET), \fBinet_pton\fR(3C),
\fBncad_addr\fR(4), \fBattributes\fR(5)
.SH NOTES
-.sp
.LP
For those web servers that use \fBAF_NCA\fR sockets, the NCA port configuration
described here has no effect.
diff --git a/usr/src/pkg/manifests/system-library.man3c.inc b/usr/src/pkg/manifests/system-library.man3c.inc
index ce84471c6a..f5a26a2072 100644
--- a/usr/src/pkg/manifests/system-library.man3c.inc
+++ b/usr/src/pkg/manifests/system-library.man3c.inc
@@ -11,7 +11,7 @@
#
# Copyright 2011, Richard Lowe
-# Copyright 2017 Nexenta Systems, Inc.
+# Copyright 2018 Nexenta Systems, Inc.
# Copyright 2013 OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
#
@@ -205,6 +205,7 @@ file path=usr/share/man/man3c/iconv_open.3c
file path=usr/share/man/man3c/imaxabs.3c
file path=usr/share/man/man3c/imaxdiv.3c
file path=usr/share/man/man3c/index.3c
+file path=usr/share/man/man3c/inet.3c
file path=usr/share/man/man3c/initgroups.3c
file path=usr/share/man/man3c/insque.3c
file path=usr/share/man/man3c/is_system_labeled.3c
@@ -884,6 +885,16 @@ link path=usr/share/man/man3c/htobe64.3c target=endian.3c
link path=usr/share/man/man3c/htole16.3c target=endian.3c
link path=usr/share/man/man3c/htole32.3c target=endian.3c
link path=usr/share/man/man3c/htole64.3c target=endian.3c
+link path=usr/share/man/man3c/inet6.3c target=inet.3c
+link path=usr/share/man/man3c/inet_addr.3c target=inet.3c
+link path=usr/share/man/man3c/inet_aton.3c target=inet.3c
+link path=usr/share/man/man3c/inet_lnaof.3c target=inet.3c
+link path=usr/share/man/man3c/inet_makeaddr.3c target=inet.3c
+link path=usr/share/man/man3c/inet_netof.3c target=inet.3c
+link path=usr/share/man/man3c/inet_network.3c target=inet.3c
+link path=usr/share/man/man3c/inet_ntoa.3c target=inet.3c
+link path=usr/share/man/man3c/inet_ntop.3c target=inet.3c
+link path=usr/share/man/man3c/inet_pton.3c target=inet.3c
link path=usr/share/man/man3c/initstate.3c target=random.3c
link path=usr/share/man/man3c/innetgr.3c target=getnetgrent.3c
link path=usr/share/man/man3c/isalnum.3c target=ctype.3c
diff --git a/usr/src/pkg/manifests/system-library.man3socket.inc b/usr/src/pkg/manifests/system-library.man3socket.inc
index 6b1ea6641b..20a32905cb 100644
--- a/usr/src/pkg/manifests/system-library.man3socket.inc
+++ b/usr/src/pkg/manifests/system-library.man3socket.inc
@@ -11,7 +11,7 @@
#
# Copyright 2011, Richard Lowe
-# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2018 Nexenta Systems, Inc.
# Copyright 2013, OmniTI Computer Consulting, Inc.
#
@@ -32,7 +32,6 @@ file path=usr/share/man/man3socket/getsockopt.3socket
file path=usr/share/man/man3socket/getsourcefilter.3socket
file path=usr/share/man/man3socket/icmp6_filter.3socket
file path=usr/share/man/man3socket/if_nametoindex.3socket
-file path=usr/share/man/man3socket/inet.3socket
file path=usr/share/man/man3socket/inet6_opt.3socket
file path=usr/share/man/man3socket/inet6_rth.3socket
file path=usr/share/man/man3socket/listen.3socket
@@ -120,7 +119,6 @@ link path=usr/share/man/man3socket/if_indextoname.3socket \
target=if_nametoindex.3socket
link path=usr/share/man/man3socket/if_nameindex.3socket \
target=if_nametoindex.3socket
-link path=usr/share/man/man3socket/inet6.3socket target=inet.3socket
link path=usr/share/man/man3socket/inet6_opt_append.3socket \
target=inet6_opt.3socket
link path=usr/share/man/man3socket/inet6_opt_find.3socket \
@@ -147,15 +145,6 @@ link path=usr/share/man/man3socket/inet6_rth_segments.3socket \
target=inet6_rth.3socket
link path=usr/share/man/man3socket/inet6_rth_space.3socket \
target=inet6_rth.3socket
-link path=usr/share/man/man3socket/inet_addr.3socket target=inet.3socket
-link path=usr/share/man/man3socket/inet_aton.3socket target=inet.3socket
-link path=usr/share/man/man3socket/inet_lnaof.3socket target=inet.3socket
-link path=usr/share/man/man3socket/inet_makeaddr.3socket target=inet.3socket
-link path=usr/share/man/man3socket/inet_netof.3socket target=inet.3socket
-link path=usr/share/man/man3socket/inet_network.3socket target=inet.3socket
-link path=usr/share/man/man3socket/inet_ntoa.3socket target=inet.3socket
-link path=usr/share/man/man3socket/inet_ntop.3socket target=inet.3socket
-link path=usr/share/man/man3socket/inet_pton.3socket target=inet.3socket
link path=usr/share/man/man3socket/ntohl.3socket target=byteorder.3socket
link path=usr/share/man/man3socket/ntohll.3socket target=byteorder.3socket
link path=usr/share/man/man3socket/ntohs.3socket target=byteorder.3socket