diff --git a/ap/libc/glibc/glibc-2.22/inet/Makefile b/ap/libc/glibc/glibc-2.22/inet/Makefile
new file mode 100644
index 0000000..f1d871f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/Makefile
@@ -0,0 +1,91 @@
+# Copyright (C) 1991-2015 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <http://www.gnu.org/licenses/>.
+
+#
+#	Sub-makefile for inet portion of the library.
+#
+subdir	:= inet
+
+include ../Makeconfig
+
+headers	:= netinet/ether.h netinet/in.h netinet/in_systm.h \
+	   netinet/if_ether.h netinet/igmp.h \
+	   netinet/tcp.h netinet/ip.h $(wildcard arpa/*.h protocols/*.h) \
+	   aliases.h ifaddrs.h netinet/ip6.h netinet/icmp6.h bits/in.h
+
+routines := htonl htons		\
+	    inet_lnaof inet_mkadr	\
+	    inet_netof inet_ntoa inet_net herrno herrno-loc \
+	    gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \
+	    gethstbynm_r gethstent gethstent_r \
+	    getnetbyad getnetbyad_r getnetbynm getnetent getnetent_r \
+	    getnetbynm_r \
+	    getproto getproto_r getprtent getprtent_r getprtname getprtname_r \
+	    getsrvbynm getsrvbynm_r getsrvbypt getsrvbypt_r getservent \
+	    getservent_r	\
+	    ether_aton ether_aton_r ether_hton ether_line \
+	    ether_ntoa ether_ntoa_r ether_ntoh \
+	    rcmd rexec ruserpass \
+	    getnetgrent_r getnetgrent \
+	    getaliasent_r getaliasent getaliasname getaliasname_r \
+	    in6_addr getnameinfo if_index ifaddrs inet6_option \
+	    getipv4sourcefilter setipv4sourcefilter \
+	    getsourcefilter setsourcefilter inet6_opt inet6_rth
+
+aux := check_pf check_native ifreq
+
+tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
+	 tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \
+	 tst-getni1 tst-getni2 tst-inet6_rth tst-checks
+
+include ../Rules
+
+ifeq ($(have-thread-library),yes)
+
+CFLAGS-gethstbyad_r.c = -fexceptions
+CFLAGS-gethstbyad.c = -fexceptions
+CFLAGS-gethstbynm_r.c = -fexceptions
+CFLAGS-gethstbynm.c = -fexceptions
+CFLAGS-gethstbynm2_r.c = -fexceptions
+CFLAGS-gethstbynm2.c = -fexceptions
+CFLAGS-gethstent_r.c = -fexceptions
+CFLAGS-gethstent.c = -fexceptions
+CFLAGS-rcmd.c = -fexceptions
+CFLAGS-getnetbynm_r.c = -fexceptions
+CFLAGS-getnetbynm.c = -fexceptions
+CFLAGS-getnetbyad_r.c = -fexceptions
+CFLAGS-getnetbyad.c = -fexceptions
+CFLAGS-getnetent_r.c = -fexceptions
+CFLAGS-getnetent.c = -fexceptions
+CFLAGS-getaliasent_r.c = -fexceptions
+CFLAGS-getaliasent.c = -fexceptions
+CFLAGS-getrpcent_r.c = -fexceptions
+CFLAGS-getrpcent.c = -fexceptions
+CFLAGS-getservent_r.c = -fexceptions
+CFLAGS-getservent.c = -fexceptions
+CFLAGS-getprtent_r.c = -fexceptions
+CFLAGS-getprtent.c = -fexceptions
+CFLAGS-either_ntoh.c = -fexceptions
+CFLAGS-either_hton.c = -fexceptions
+CFLAGS-getnetgrent.c = -fexceptions
+CFLAGS-getnetgrent_r.c = -fexceptions
+
+endif
+
+ifeq ($(build-static-nss),yes)
+CFLAGS += -DSTATIC_NSS
+endif
diff --git a/ap/libc/glibc/glibc-2.22/inet/Versions b/ap/libc/glibc/glibc-2.22/inet/Versions
new file mode 100644
index 0000000..56eb274
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/Versions
@@ -0,0 +1,89 @@
+libc {
+  GLIBC_2.0 {
+    # functions with required interface outside normal name space
+    __ivaliduser; __check_rhosts_file; __rcmd_errstr;
+
+    # variables in normal name space
+    rexecoptions;
+
+    # e*
+    endaliasent; endhostent; endnetent; endnetgrent; endprotoent; endservent;
+
+    # e*
+    ether_aton; ether_aton_r; ether_hostton; ether_line; ether_ntoa;
+    ether_ntoa_r; ether_ntohost;
+
+    # g*
+    getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
+    getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname;
+    gethostbyname2; gethostbyname2_r; gethostbyname_r; gethostent;
+    gethostent_r; getnetbyaddr; getnetbyaddr_r; getnetbyname;
+    getnetbyname_r; getnetent; getnetent_r; getnetgrent; getnetgrent_r;
+    getprotobyname; getprotobyname_r; getprotobynumber;
+    getprotobynumber_r; getprotoent; getprotoent_r;
+    getservbyname; getservbyname_r; getservbyport;
+    getservbyport_r; getservent; getservent_r;
+
+    # h*
+    htonl; htons;
+
+    # i*
+    inet_addr; inet_aton; inet_lnaof; inet_makeaddr; inet_netof; inet_network;
+    inet_nsap_addr; inet_nsap_ntoa; inet_ntoa; inet_ntop; inet_pton; innetgr;
+    iruserok;
+
+    # n*
+    ntohl; ntohs;
+
+    # r*
+    rcmd; rexec; rresvport; ruserok; ruserpass;
+
+    # s*
+    setaliasent; setnetent; setnetgrent; setprotoent; setservent;
+  }
+  GLIBC_2.1 {
+    # variables in normal name space
+    in6addr_any; in6addr_loopback;
+
+    # i*
+    if_freenameindex; if_indextoname; if_nameindex; if_nametoindex;
+  }
+  GLIBC_2.1.2 {
+    # g*
+    getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r;
+    gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r;
+    getnetent_r; getnetgrent_r; getprotobyname_r; getprotobynumber_r;
+    getprotoent_r; getservbyname_r;
+  }
+  GLIBC_2.2 {
+    # i*
+    iruserok_af;
+    # r*
+    rcmd_af; rexec_af; rresvport_af; ruserok_af;
+  }
+  GLIBC_2.3 {
+    # f*
+    freeifaddrs;
+    # g*
+    getifaddrs;
+  }
+  GLIBC_2.3.3 {
+    inet6_option_space; inet6_option_init; inet6_option_append;
+    inet6_option_alloc; inet6_option_next; inet6_option_find;
+  }
+  GLIBC_2.3.4 {
+    getipv4sourcefilter; setipv4sourcefilter;
+    getsourcefilter; setsourcefilter;
+  }
+  GLIBC_2.5 {
+    inet6_opt_init; inet6_opt_append; inet6_opt_finish; inet6_opt_set_val;
+    inet6_opt_next; inet6_opt_find; inet6_opt_get_val;
+    inet6_rth_space; inet6_rth_init; inet6_rth_add; inet6_rth_reverse;
+    inet6_rth_segments; inet6_rth_getaddr;
+  }
+  GLIBC_PRIVATE {
+    # functions used in other libraries
+    __internal_endnetgrent; __internal_getnetgrent_r;
+    __internal_setnetgrent;
+  }
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/aliases.h b/ap/libc/glibc/glibc-2.22/inet/aliases.h
new file mode 100644
index 0000000..1b9fd38
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/aliases.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _ALIASES_H
+#define _ALIASES_H	1
+
+#include <features.h>
+
+#include <sys/types.h>
+
+
+__BEGIN_DECLS
+
+/* Structure to represent one entry of the alias data base.  */
+struct aliasent
+  {
+    char *alias_name;
+    size_t alias_members_len;
+    char **alias_members;
+    int alias_local;
+  };
+
+
+/* Open alias data base files.  */
+extern void setaliasent (void) __THROW;
+
+/* Close alias data base files.  */
+extern void endaliasent (void) __THROW;
+
+/* Get the next entry from the alias data base.  */
+extern struct aliasent *getaliasent (void) __THROW;
+
+/* Get the next entry from the alias data base and put it in RESULT_BUF.  */
+extern int getaliasent_r (struct aliasent *__restrict __result_buf,
+			  char *__restrict __buffer, size_t __buflen,
+			  struct aliasent **__restrict __result) __THROW;
+
+/* Get alias entry corresponding to NAME.  */
+extern struct aliasent *getaliasbyname (const char *__name) __THROW;
+
+/* Get alias entry corresponding to NAME and put it in RESULT_BUF.  */
+extern int getaliasbyname_r (const char *__restrict __name,
+			     struct aliasent *__restrict __result_buf,
+			     char *__restrict __buffer, size_t __buflen,
+			     struct aliasent **__restrict __result) __THROW;
+
+__END_DECLS
+
+#endif /* aliases.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/arpa/ftp.h b/ap/libc/glibc/glibc-2.22/inet/arpa/ftp.h
new file mode 100644
index 0000000..e5b340d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/arpa/ftp.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 1983, 1989, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ *
+ *	@(#)ftp.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ARPA_FTP_H
+#define	_ARPA_FTP_H 1
+
+/* Definitions for FTP; see RFC-765. */
+
+/*
+ * Reply codes.
+ */
+#define PRELIM		1	/* positive preliminary */
+#define COMPLETE	2	/* positive completion */
+#define CONTINUE	3	/* positive intermediate */
+#define TRANSIENT	4	/* transient negative completion */
+#define ERROR		5	/* permanent negative completion */
+
+/*
+ * Type codes
+ */
+#define	TYPE_A		1	/* ASCII */
+#define	TYPE_E		2	/* EBCDIC */
+#define	TYPE_I		3	/* image */
+#define	TYPE_L		4	/* local byte size */
+
+#ifdef FTP_NAMES
+char *typenames[] =  {"0", "ASCII", "EBCDIC", "Image", "Local" };
+#endif
+
+/*
+ * Form codes
+ */
+#define	FORM_N		1	/* non-print */
+#define	FORM_T		2	/* telnet format effectors */
+#define	FORM_C		3	/* carriage control (ASA) */
+#ifdef FTP_NAMES
+char *formnames[] =  {"0", "Nonprint", "Telnet", "Carriage-control" };
+#endif
+
+/*
+ * Structure codes
+ */
+#define	STRU_F		1	/* file (no record structure) */
+#define	STRU_R		2	/* record structure */
+#define	STRU_P		3	/* page structure */
+#ifdef FTP_NAMES
+char *strunames[] =  {"0", "File", "Record", "Page" };
+#endif
+
+/*
+ * Mode types
+ */
+#define	MODE_S		1	/* stream */
+#define	MODE_B		2	/* block */
+#define	MODE_C		3	/* compressed */
+#ifdef FTP_NAMES
+char *modenames[] =  {"0", "Stream", "Block", "Compressed" };
+#endif
+
+/*
+ * Record Tokens
+ */
+#define	REC_ESC		'\377'	/* Record-mode Escape */
+#define	REC_EOR		'\001'	/* Record-mode End-of-Record */
+#define REC_EOF		'\002'	/* Record-mode End-of-File */
+
+/*
+ * Block Header
+ */
+#define	BLK_EOR		0x80	/* Block is End-of-Record */
+#define	BLK_EOF		0x40	/* Block is End-of-File */
+#define BLK_ERRORS	0x20	/* Block is suspected of containing errors */
+#define	BLK_RESTART	0x10	/* Block is Restart Marker */
+
+#define	BLK_BYTECOUNT	2	/* Bytes in this block */
+
+#endif /* arpa/ftp.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/arpa/inet.h b/ap/libc/glibc/glibc-2.22/inet/arpa/inet.h
new file mode 100644
index 0000000..d81d87c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/arpa/inet.h
@@ -0,0 +1,105 @@
+/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _ARPA_INET_H
+#define	_ARPA_INET_H	1
+
+#include <features.h>
+#include <netinet/in.h>		/* To define `struct in_addr'.  */
+
+/* Type for length arguments in socket calls.  */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+__BEGIN_DECLS
+
+/* Convert Internet host address from numbers-and-dots notation in CP
+   into binary data in network byte order.  */
+extern in_addr_t inet_addr (const char *__cp) __THROW;
+
+/* Return the local host address part of the Internet address in IN.  */
+extern in_addr_t inet_lnaof (struct in_addr __in) __THROW;
+
+/* Make Internet host address in network byte order by combining the
+   network number NET with the local address HOST.  */
+extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
+     __THROW;
+
+/* Return network number part of the Internet address IN.  */
+extern in_addr_t inet_netof (struct in_addr __in) __THROW;
+
+/* Extract the network number in network byte order from the address
+   in numbers-and-dots natation starting at CP.  */
+extern in_addr_t inet_network (const char *__cp) __THROW;
+
+/* Convert Internet number in IN to ASCII representation.  The return value
+   is a pointer to an internal array containing the string.  */
+extern char *inet_ntoa (struct in_addr __in) __THROW;
+
+/* Convert from presentation format of an Internet number in buffer
+   starting at CP to the binary network format and store result for
+   interface type AF in buffer starting at BUF.  */
+extern int inet_pton (int __af, const char *__restrict __cp,
+		      void *__restrict __buf) __THROW;
+
+/* Convert a Internet address in binary network format for interface
+   type AF in buffer starting at CP to presentation form and place
+   result in buffer of length LEN astarting at BUF.  */
+extern const char *inet_ntop (int __af, const void *__restrict __cp,
+			      char *__restrict __buf, socklen_t __len)
+     __THROW;
+
+
+/* The following functions are not part of XNS 5.2.  */
+#ifdef __USE_MISC
+/* Convert Internet host address from numbers-and-dots notation in CP
+   into binary data and store the result in the structure INP.  */
+extern int inet_aton (const char *__cp, struct in_addr *__inp) __THROW;
+
+/* Format a network number NET into presentation format and place result
+   in buffer starting at BUF with length of LEN bytes.  */
+extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
+
+/* Convert network number for interface type AF in buffer starting at
+   CP to presentation format.  The result will specifiy BITS bits of
+   the number.  */
+extern char *inet_net_ntop (int __af, const void *__cp, int __bits,
+			    char *__buf, size_t __len) __THROW;
+
+/* Convert network number for interface type AF from presentation in
+   buffer starting at CP to network format and store result int
+   buffer starting at BUF of size LEN.  */
+extern int inet_net_pton (int __af, const char *__cp,
+			  void *__buf, size_t __len) __THROW;
+
+/* Convert ASCII representation in hexadecimal form of the Internet
+   address to binary form and place result in buffer of length LEN
+   starting at BUF.  */
+extern unsigned int inet_nsap_addr (const char *__cp,
+				    unsigned char *__buf, int __len) __THROW;
+
+/* Convert internet address in binary form in LEN bytes starting at CP
+   a presentation form and place result in BUF.  */
+extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp,
+			     char *__buf) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* arpa/inet.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/arpa/telnet.h b/ap/libc/glibc/glibc-2.22/inet/arpa/telnet.h
new file mode 100644
index 0000000..3774c89
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/arpa/telnet.h
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ *
+ *	@(#)telnet.h	8.2 (Berkeley) 12/15/93
+ */
+
+#ifndef _ARPA_TELNET_H
+#define	_ARPA_TELNET_H 1
+
+/*
+ * Definitions for the TELNET protocol.
+ */
+#define	IAC	255		/* interpret as command: */
+#define	DONT	254		/* you are not to use option */
+#define	DO	253		/* please, you use option */
+#define	WONT	252		/* I won't use option */
+#define	WILL	251		/* I will use option */
+#define	SB	250		/* interpret as subnegotiation */
+#define	GA	249		/* you may reverse the line */
+#define	EL	248		/* erase the current line */
+#define	EC	247		/* erase the current character */
+#define	AYT	246		/* are you there */
+#define	AO	245		/* abort output--but let prog finish */
+#define	IP	244		/* interrupt process--permanently */
+#define	BREAK	243		/* break */
+#define	DM	242		/* data mark--for connect. cleaning */
+#define	NOP	241		/* nop */
+#define	SE	240		/* end sub negotiation */
+#define EOR     239             /* end of record (transparent mode) */
+#define	ABORT	238		/* Abort process */
+#define	SUSP	237		/* Suspend process */
+#define	xEOF	236		/* End of file: EOF is already used... */
+
+#define SYNCH	242		/* for telfunc calls */
+
+#ifdef TELCMDS
+char *telcmds[] = {
+	"EOF", "SUSP", "ABORT", "EOR",
+	"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
+	"EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
+};
+#else
+extern char *telcmds[];
+#endif
+
+#define	TELCMD_FIRST	xEOF
+#define	TELCMD_LAST	IAC
+#define	TELCMD_OK(x)	((unsigned int)(x) <= TELCMD_LAST && \
+			 (unsigned int)(x) >= TELCMD_FIRST)
+#define	TELCMD(x)	telcmds[(x)-TELCMD_FIRST]
+
+/* telnet options */
+#define TELOPT_BINARY	0	/* 8-bit data path */
+#define TELOPT_ECHO	1	/* echo */
+#define	TELOPT_RCP	2	/* prepare to reconnect */
+#define	TELOPT_SGA	3	/* suppress go ahead */
+#define	TELOPT_NAMS	4	/* approximate message size */
+#define	TELOPT_STATUS	5	/* give status */
+#define	TELOPT_TM	6	/* timing mark */
+#define	TELOPT_RCTE	7	/* remote controlled transmission and echo */
+#define TELOPT_NAOL 	8	/* negotiate about output line width */
+#define TELOPT_NAOP 	9	/* negotiate about output page size */
+#define TELOPT_NAOCRD	10	/* negotiate about CR disposition */
+#define TELOPT_NAOHTS	11	/* negotiate about horizontal tabstops */
+#define TELOPT_NAOHTD	12	/* negotiate about horizontal tab disposition */
+#define TELOPT_NAOFFD	13	/* negotiate about formfeed disposition */
+#define TELOPT_NAOVTS	14	/* negotiate about vertical tab stops */
+#define TELOPT_NAOVTD	15	/* negotiate about vertical tab disposition */
+#define TELOPT_NAOLFD	16	/* negotiate about output LF disposition */
+#define TELOPT_XASCII	17	/* extended ascii character set */
+#define	TELOPT_LOGOUT	18	/* force logout */
+#define	TELOPT_BM	19	/* byte macro */
+#define	TELOPT_DET	20	/* data entry terminal */
+#define	TELOPT_SUPDUP	21	/* supdup protocol */
+#define	TELOPT_SUPDUPOUTPUT 22	/* supdup output */
+#define	TELOPT_SNDLOC	23	/* send location */
+#define	TELOPT_TTYPE	24	/* terminal type */
+#define	TELOPT_EOR	25	/* end or record */
+#define	TELOPT_TUID	26	/* TACACS user identification */
+#define	TELOPT_OUTMRK	27	/* output marking */
+#define	TELOPT_TTYLOC	28	/* terminal location number */
+#define	TELOPT_3270REGIME 29	/* 3270 regime */
+#define	TELOPT_X3PAD	30	/* X.3 PAD */
+#define	TELOPT_NAWS	31	/* window size */
+#define	TELOPT_TSPEED	32	/* terminal speed */
+#define	TELOPT_LFLOW	33	/* remote flow control */
+#define TELOPT_LINEMODE	34	/* Linemode option */
+#define TELOPT_XDISPLOC	35	/* X Display Location */
+#define TELOPT_OLD_ENVIRON 36	/* Old - Environment variables */
+#define	TELOPT_AUTHENTICATION 37/* Authenticate */
+#define	TELOPT_ENCRYPT	38	/* Encryption option */
+#define TELOPT_NEW_ENVIRON 39	/* New - Environment variables */
+#define	TELOPT_EXOPL	255	/* extended-options-list */
+
+
+#define	NTELOPTS	(1+TELOPT_NEW_ENVIRON)
+#ifdef TELOPTS
+char *telopts[NTELOPTS+1] = {
+	"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
+	"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
+	"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
+	"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
+	"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
+	"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
+	"TACACS UID", "OUTPUT MARKING", "TTYLOC",
+	"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
+	"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
+	"ENCRYPT", "NEW-ENVIRON",
+	0,
+};
+#define	TELOPT_FIRST	TELOPT_BINARY
+#define	TELOPT_LAST	TELOPT_NEW_ENVIRON
+#define	TELOPT_OK(x)	((unsigned int)(x) <= TELOPT_LAST)
+#define	TELOPT(x)	telopts[(x)-TELOPT_FIRST]
+#endif
+
+/* sub-option qualifiers */
+#define	TELQUAL_IS	0	/* option is... */
+#define	TELQUAL_SEND	1	/* send option */
+#define	TELQUAL_INFO	2	/* ENVIRON: informational version of IS */
+#define	TELQUAL_REPLY	2	/* AUTHENTICATION: client version of IS */
+#define	TELQUAL_NAME	3	/* AUTHENTICATION: client version of IS */
+
+#define	LFLOW_OFF		0	/* Disable remote flow control */
+#define	LFLOW_ON		1	/* Enable remote flow control */
+#define	LFLOW_RESTART_ANY	2	/* Restart output on any char */
+#define	LFLOW_RESTART_XON	3	/* Restart output only on XON */
+
+/*
+ * LINEMODE suboptions
+ */
+
+#define	LM_MODE		1
+#define	LM_FORWARDMASK	2
+#define	LM_SLC		3
+
+#define	MODE_EDIT	0x01
+#define	MODE_TRAPSIG	0x02
+#define	MODE_ACK	0x04
+#define MODE_SOFT_TAB	0x08
+#define MODE_LIT_ECHO	0x10
+
+#define	MODE_MASK	0x1f
+
+/* Not part of protocol, but needed to simplify things... */
+#define MODE_FLOW		0x0100
+#define MODE_ECHO		0x0200
+#define MODE_INBIN		0x0400
+#define MODE_OUTBIN		0x0800
+#define MODE_FORCE		0x1000
+
+#define	SLC_SYNCH	1
+#define	SLC_BRK		2
+#define	SLC_IP		3
+#define	SLC_AO		4
+#define	SLC_AYT		5
+#define	SLC_EOR		6
+#define	SLC_ABORT	7
+#define	SLC_EOF		8
+#define	SLC_SUSP	9
+#define	SLC_EC		10
+#define	SLC_EL		11
+#define	SLC_EW		12
+#define	SLC_RP		13
+#define	SLC_LNEXT	14
+#define	SLC_XON		15
+#define	SLC_XOFF	16
+#define	SLC_FORW1	17
+#define	SLC_FORW2	18
+
+#define	NSLC		18
+
+/*
+ * For backwards compatibility, we define SLC_NAMES to be the
+ * list of names if SLC_NAMES is not defined.
+ */
+#define	SLC_NAMELIST	"0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
+			"ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
+			"LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
+#ifdef	SLC_NAMES
+char *slc_names[] = {
+	SLC_NAMELIST
+};
+#else
+extern char *slc_names[];
+#define	SLC_NAMES SLC_NAMELIST
+#endif
+
+#define	SLC_NAME_OK(x)	((unsigned int)(x) <= NSLC)
+#define SLC_NAME(x)	slc_names[x]
+
+#define	SLC_NOSUPPORT	0
+#define	SLC_CANTCHANGE	1
+#define	SLC_VARIABLE	2
+#define	SLC_DEFAULT	3
+#define	SLC_LEVELBITS	0x03
+
+#define	SLC_FUNC	0
+#define	SLC_FLAGS	1
+#define	SLC_VALUE	2
+
+#define	SLC_ACK		0x80
+#define	SLC_FLUSHIN	0x40
+#define	SLC_FLUSHOUT	0x20
+
+#define	OLD_ENV_VAR	1
+#define	OLD_ENV_VALUE	0
+#define	NEW_ENV_VAR	0
+#define	NEW_ENV_VALUE	1
+#define	ENV_ESC		2
+#define ENV_USERVAR	3
+
+/*
+ * AUTHENTICATION suboptions
+ */
+
+/*
+ * Who is authenticating who ...
+ */
+#define	AUTH_WHO_CLIENT		0	/* Client authenticating server */
+#define	AUTH_WHO_SERVER		1	/* Server authenticating client */
+#define	AUTH_WHO_MASK		1
+
+/*
+ * amount of authentication done
+ */
+#define	AUTH_HOW_ONE_WAY	0
+#define	AUTH_HOW_MUTUAL		2
+#define	AUTH_HOW_MASK		2
+
+#define	AUTHTYPE_NULL		0
+#define	AUTHTYPE_KERBEROS_V4	1
+#define	AUTHTYPE_KERBEROS_V5	2
+#define	AUTHTYPE_SPX		3
+#define	AUTHTYPE_MINK		4
+#define	AUTHTYPE_CNT		5
+
+#define	AUTHTYPE_TEST		99
+
+#ifdef	AUTH_NAMES
+char *authtype_names[] = {
+	"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
+};
+#else
+extern char *authtype_names[];
+#endif
+
+#define	AUTHTYPE_NAME_OK(x)	((unsigned int)(x) < AUTHTYPE_CNT)
+#define	AUTHTYPE_NAME(x)	authtype_names[x]
+
+/*
+ * ENCRYPTion suboptions
+ */
+#define	ENCRYPT_IS		0	/* I pick encryption type ... */
+#define	ENCRYPT_SUPPORT		1	/* I support encryption types ... */
+#define	ENCRYPT_REPLY		2	/* Initial setup response */
+#define	ENCRYPT_START		3	/* Am starting to send encrypted */
+#define	ENCRYPT_END		4	/* Am ending encrypted */
+#define	ENCRYPT_REQSTART	5	/* Request you start encrypting */
+#define	ENCRYPT_REQEND		6	/* Request you send encrypting */
+#define	ENCRYPT_ENC_KEYID	7
+#define	ENCRYPT_DEC_KEYID	8
+#define	ENCRYPT_CNT		9
+
+#define	ENCTYPE_ANY		0
+#define	ENCTYPE_DES_CFB64	1
+#define	ENCTYPE_DES_OFB64	2
+#define	ENCTYPE_CNT		3
+
+#ifdef	ENCRYPT_NAMES
+char *encrypt_names[] = {
+	"IS", "SUPPORT", "REPLY", "START", "END",
+	"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
+	0,
+};
+char *enctype_names[] = {
+	"ANY", "DES_CFB64",  "DES_OFB64",  0,
+};
+#else
+extern char *encrypt_names[];
+extern char *enctype_names[];
+#endif
+
+
+#define	ENCRYPT_NAME_OK(x)	((unsigned int)(x) < ENCRYPT_CNT)
+#define	ENCRYPT_NAME(x)		encrypt_names[x]
+
+#define	ENCTYPE_NAME_OK(x)	((unsigned int)(x) < ENCTYPE_CNT)
+#define	ENCTYPE_NAME(x)		enctype_names[x]
+
+#endif /* arpa/telnet.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/arpa/tftp.h b/ap/libc/glibc/glibc-2.22/inet/arpa/tftp.h
new file mode 100644
index 0000000..86e0b6e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/arpa/tftp.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ *
+ *	@(#)tftp.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ARPA_TFTP_H
+#define	_ARPA_TFTP_H 1
+
+/*
+ * Trivial File Transfer Protocol (IEN-133)
+ */
+#define	SEGSIZE		512		/* data segment size */
+
+/*
+ * Packet types.
+ */
+#define	RRQ	01				/* read request */
+#define	WRQ	02				/* write request */
+#define	DATA	03				/* data packet */
+#define	ACK	04				/* acknowledgement */
+#define	ERROR	05				/* error code */
+
+struct	tftphdr {
+	short	th_opcode;			/* packet type */
+	union {
+		char	tu_padding[3];		/* sizeof() compat */
+		struct {
+			union {
+				unsigned short	tu_block;	/* block # */
+				short	tu_code;		/* error code */
+			} __attribute__ ((__packed__)) th_u3;
+			char tu_data[0];	/* data or error string */
+		} __attribute__ ((__packed__)) th_u2;
+		char	tu_stuff[0];		/* request packet stuff */
+	} __attribute__ ((__packed__)) th_u1;
+} __attribute__ ((__packed__));
+
+#define	th_block	th_u1.th_u2.th_u3.tu_block
+#define	th_code		th_u1.th_u2.th_u3.tu_code
+#define	th_stuff	th_u1.tu_stuff
+#define	th_data		th_u1.th_u2.tu_data
+#define	th_msg		th_u1.th_u2.tu_data
+
+/*
+ * Error codes.
+ */
+#define	EUNDEF		0		/* not defined */
+#define	ENOTFOUND	1		/* file not found */
+#define	EACCESS		2		/* access violation */
+#define	ENOSPACE	3		/* disk full or allocation exceeded */
+#define	EBADOP		4		/* illegal TFTP operation */
+#define	EBADID		5		/* unknown transfer ID */
+#define	EEXISTS		6		/* file already exists */
+#define	ENOUSER		7		/* no such user */
+
+#endif /* arpa/tftp.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/bug-if1.c b/ap/libc/glibc/glibc-2.22/inet/bug-if1.c
new file mode 100644
index 0000000..61bead4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/bug-if1.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2004-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <net/if.h>
+
+
+static int
+do_test (void)
+{
+  char buf[IF_NAMESIZE];
+  /* Index 0 is always invalid (see RFC 3493).  */
+  char *cp = if_indextoname (0, buf);
+  if (cp != NULL)
+    {
+      printf ("invalid index returned result \"%s\"\n", cp);
+      return 1;
+    }
+  else if (errno != ENXIO)
+    {
+      int err = errno;
+      char errbuf1[256];
+      char errbuf2[256];
+
+      printf ("errno = %d (%s), expected %d (%s)\n",
+	      err, strerror_r (err, errbuf1, sizeof (errbuf1)),
+	      ENXIO, strerror_r (ENXIO, errbuf2, sizeof (errbuf2)));
+      return 1;
+    }
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/check_native.c b/ap/libc/glibc/glibc-2.22/inet/check_native.c
new file mode 100644
index 0000000..ee65b12
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/check_native.c
@@ -0,0 +1,27 @@
+/* Determine whether interfaces use native transport.  Generic version.
+   Copyright (C) 2012-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ifaddrs.h>
+#include <stdint.h>
+
+void
+attribute_hidden
+__check_native (uint32_t a1_index, int *a1_native,
+		uint32_t a2_index, int *a2_native)
+{
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/check_pf.c b/ap/libc/glibc/glibc-2.22/inet/check_pf.c
new file mode 100644
index 0000000..3739a95
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/check_pf.c
@@ -0,0 +1,71 @@
+/* Determine protocol families for which interfaces exist.  Generic version.
+   Copyright (C) 2003-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ifaddrs.h>
+#include <netdb.h>
+#include <stdint.h>
+
+void
+attribute_hidden
+__check_pf (bool *seen_ipv4, bool *seen_ipv6,
+	    struct in6addrinfo **in6ai, size_t *in6ailen)
+{
+  /* By default we have no way to determine information about
+     deprecated and temporary addresses.  */
+  *in6ai = NULL;
+  *in6ailen = 0;
+
+  /* Get the interface list via getifaddrs.  */
+  struct ifaddrs *ifa = NULL;
+  if (getifaddrs (&ifa) != 0)
+    {
+      /* We cannot determine what interfaces are available.  Be
+	 pessimistic.  */
+      *seen_ipv4 = true;
+      *seen_ipv6 = true;
+      return;
+    }
+
+  *seen_ipv4 = false;
+  *seen_ipv6 = false;
+
+  struct ifaddrs *runp;
+  for (runp = ifa; runp != NULL; runp = runp->ifa_next)
+    if (runp->ifa_addr->sa_family == PF_INET)
+      *seen_ipv4 = true;
+    else if (runp->ifa_addr->sa_family == PF_INET6)
+      *seen_ipv6 = true;
+
+  (void) freeifaddrs (ifa);
+}
+
+
+void
+__free_in6ai (struct in6addrinfo *in6ai)
+{
+  /* Nothing to do.  */
+}
+
+
+#if IS_IN (nscd)
+uint32_t
+__bump_nl_timestamp (void)
+{
+  return 0;
+}
+#endif
diff --git a/ap/libc/glibc/glibc-2.22/inet/ether_aton.c b/ap/libc/glibc/glibc-2.22/inet/ether_aton.c
new file mode 100644
index 0000000..de6c2e5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ether_aton.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netinet/ether.h>
+
+
+struct ether_addr *
+ether_aton (const char *asc)
+{
+  static struct ether_addr result;
+
+  return ether_aton_r (asc, &result);
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/ether_aton_r.c b/ap/libc/glibc/glibc-2.22/inet/ether_aton_r.c
new file mode 100644
index 0000000..2d33f29
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ether_aton_r.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <netinet/ether.h>
+#include <netinet/if_ether.h>
+
+
+struct ether_addr *
+ether_aton_r (const char *asc, struct ether_addr *addr)
+{
+  size_t cnt;
+
+  for (cnt = 0; cnt < 6; ++cnt)
+    {
+      unsigned int number;
+      char ch;
+
+      ch = _tolower (*asc++);
+      if ((ch < '0' || ch > '9') && (ch < 'a' || ch > 'f'))
+	return NULL;
+      number = isdigit (ch) ? (ch - '0') : (ch - 'a' + 10);
+
+      ch = _tolower (*asc);
+      if ((cnt < 5 && ch != ':') || (cnt == 5 && ch != '\0' && !isspace (ch)))
+	{
+	  ++asc;
+	  if ((ch < '0' || ch > '9') && (ch < 'a' || ch > 'f'))
+	    return NULL;
+	  number <<= 4;
+	  number += isdigit (ch) ? (ch - '0') : (ch - 'a' + 10);
+
+	  ch = *asc;
+	  if (cnt < 5 && ch != ':')
+	    return NULL;
+	}
+
+      /* Store result.  */
+      addr->ether_addr_octet[cnt] = (unsigned char) number;
+
+      /* Skip ':'.  */
+      ++asc;
+    }
+
+  return addr;
+}
+libc_hidden_def (ether_aton_r)
diff --git a/ap/libc/glibc/glibc-2.22/inet/ether_hton.c b/ap/libc/glibc/glibc-2.22/inet/ether_hton.c
new file mode 100644
index 0000000..a1b31a3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ether_hton.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <netinet/ether.h>
+#include <netinet/if_ether.h>
+#include <string.h>
+
+#include "../nss/nsswitch.h"
+
+/* Type of the lookup function we need here.  */
+typedef int (*lookup_function) (const char *, struct etherent *, char *, int,
+				int *);
+
+/* The lookup function for the first entry of this service.  */
+extern int __nss_ethers_lookup (service_user **nip, const char *name,
+				void **fctp) internal_function;
+
+
+int
+ether_hostton (const char *hostname, struct ether_addr *addr)
+{
+  static service_user *startp;
+  static lookup_function start_fct;
+  service_user *nip;
+  union
+  {
+    lookup_function f;
+    void *ptr;
+  } fct;
+  int no_more;
+  enum nss_status status = NSS_STATUS_UNAVAIL;
+  struct etherent etherent;
+
+  if (startp == NULL)
+    {
+      no_more = __nss_ethers_lookup (&nip, "gethostton_r", &fct.ptr);
+      if (no_more)
+	startp = (service_user *) -1;
+      else
+	{
+	  startp = nip;
+	  start_fct = fct.f;
+	}
+    }
+  else
+    {
+      fct.f = start_fct;
+      no_more = (nip = startp) == (service_user *) -1;
+    }
+
+  while (no_more == 0)
+    {
+      char buffer[1024];
+
+      status = (*fct.f) (hostname, &etherent, buffer, sizeof buffer, &errno);
+
+      no_more = __nss_next2 (&nip, "gethostton_r", NULL, &fct.ptr, status, 0);
+    }
+
+  if (status == NSS_STATUS_SUCCESS)
+    memcpy (addr, etherent.e_addr.ether_addr_octet,
+	    sizeof (struct ether_addr));
+
+  return status == NSS_STATUS_SUCCESS ? 0 : -1;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/ether_line.c b/ap/libc/glibc/glibc-2.22/inet/ether_line.c
new file mode 100644
index 0000000..707b218
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ether_line.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <netinet/ether.h>
+#include <netinet/if_ether.h>
+
+
+int
+ether_line (const char *line, struct ether_addr *addr, char *hostname)
+{
+  for (size_t cnt = 0; cnt < 6; ++cnt)
+    {
+      unsigned int number;
+      char ch;
+
+      ch = _tolower (*line++);
+      if ((ch < '0' || ch > '9') && (ch < 'a' || ch > 'f'))
+	return -1;
+      number = isdigit (ch) ? (ch - '0') : (ch - 'a' + 10);
+
+      ch = _tolower (*line);
+      if ((cnt < 5 && ch != ':') || (cnt == 5 && ch != '\0' && !isspace (ch)))
+	{
+	  ++line;
+	  if ((ch < '0' || ch > '9') && (ch < 'a' || ch > 'f'))
+	    return -1;
+	  number <<= 4;
+	  number += isdigit (ch) ? (ch - '0') : (ch - 'a' + 10);
+
+	  ch = *line;
+	  if (cnt < 5 && ch != ':')
+	    return -1;
+	}
+
+      /* Store result.  */
+      addr->ether_addr_octet[cnt] = (unsigned char) number;
+
+      /* Skip ':'.  */
+      if (ch != '\0')
+	++line;
+    }
+
+  /* Skip initial whitespace.  */
+  while (isspace (*line))
+    ++line;
+
+  if (*line == '#' || *line == '\0')
+    /* No hostname.  */
+    return -1;
+
+  /* The hostname is up to the next non-space character.  */
+  /* XXX This can cause trouble because the hostname might be too long
+     but we have no possibility to check it here.  */
+  while (*line != '\0' && *line != '#' && !isspace (*line))
+    *hostname++ = *line++;
+  *hostname = '\0';
+
+  return 0;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/ether_ntoa.c b/ap/libc/glibc/glibc-2.22/inet/ether_ntoa.c
new file mode 100644
index 0000000..2988569
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ether_ntoa.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netinet/ether.h>
+#include <netinet/if_ether.h>
+
+
+char *
+ether_ntoa (const struct ether_addr *addr)
+{
+  static char asc[18];
+
+  return ether_ntoa_r (addr, asc);
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/ether_ntoa_r.c b/ap/libc/glibc/glibc-2.22/inet/ether_ntoa_r.c
new file mode 100644
index 0000000..edd2793
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ether_ntoa_r.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <netinet/ether.h>
+#include <netinet/if_ether.h>
+
+
+char *
+ether_ntoa_r (const struct ether_addr *addr, char *buf)
+{
+  sprintf (buf, "%x:%x:%x:%x:%x:%x",
+	   addr->ether_addr_octet[0], addr->ether_addr_octet[1],
+	   addr->ether_addr_octet[2], addr->ether_addr_octet[3],
+	   addr->ether_addr_octet[4], addr->ether_addr_octet[5]);
+  return buf;
+}
+libc_hidden_def (ether_ntoa_r)
diff --git a/ap/libc/glibc/glibc-2.22/inet/ether_ntoh.c b/ap/libc/glibc/glibc-2.22/inet/ether_ntoh.c
new file mode 100644
index 0000000..cf46b4e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ether_ntoh.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <netinet/ether.h>
+#include <netinet/if_ether.h>
+#include <string.h>
+
+#include <nss/nsswitch.h>
+
+
+/* Type of the lookup function we need here.  */
+typedef int (*lookup_function) (const struct ether_addr *, struct etherent *,
+				char *, size_t, int *);
+
+/* The lookup function for the first entry of this service.  */
+extern int __nss_ethers_lookup (service_user **nip, const char *name,
+				void **fctp) internal_function;
+
+
+int
+ether_ntohost (char *hostname, const struct ether_addr *addr)
+{
+  static service_user *startp;
+  static lookup_function start_fct;
+  service_user *nip;
+  union
+  {
+    lookup_function f;
+    void *ptr;
+  } fct;
+  int no_more;
+  enum nss_status status = NSS_STATUS_UNAVAIL;
+  struct etherent etherent;
+
+  if (startp == NULL)
+    {
+      no_more = __nss_ethers_lookup (&nip, "getntohost_r", &fct.ptr);
+      if (no_more)
+	startp = (service_user *) -1;
+      else
+	{
+	  startp = nip;
+	  start_fct = fct.f;
+	}
+    }
+  else
+    {
+      fct.f = start_fct;
+      no_more = (nip = startp) == (service_user *) -1;
+    }
+
+  while (no_more == 0)
+    {
+      char buffer[1024];
+
+      status = (*fct.f) (addr, &etherent, buffer, sizeof buffer, &errno);
+
+      no_more = __nss_next2 (&nip, "getntohost_r", NULL, &fct.ptr, status, 0);
+    }
+
+  if (status == NSS_STATUS_SUCCESS)
+    /* XXX This is a potential cause of trouble because the size of
+       the HOSTNAME buffer is not known but the interface does not
+       provide this information.  */
+    strcpy (hostname, etherent.e_name);
+
+  return status == NSS_STATUS_SUCCESS ? 0 : -1;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/getaliasent.c b/ap/libc/glibc/glibc-2.22/inet/getaliasent.c
new file mode 100644
index 0000000..5cfb51a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getaliasent.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <aliases.h>
+
+
+#define LOOKUP_TYPE	struct aliasent
+#define	GETFUNC_NAME	getaliasent
+#define BUFLEN		1024
+
+/* There is no nscd support for the aliases file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXent.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getaliasent_r.c b/ap/libc/glibc/glibc-2.22/inet/getaliasent_r.c
new file mode 100644
index 0000000..dfdf6c6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getaliasent_r.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <aliases.h>
+
+
+#define LOOKUP_TYPE		struct aliasent
+#define SETFUNC_NAME		setaliasent
+#define	GETFUNC_NAME		getaliasent
+#define	ENDFUNC_NAME		endaliasent
+#define DATABASE_NAME		aliases
+
+/* There is no nscd support for the aliases file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXent_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getaliasname.c b/ap/libc/glibc/glibc-2.22/inet/getaliasname.c
new file mode 100644
index 0000000..8b59b2b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getaliasname.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <aliases.h>
+
+
+#define LOOKUP_TYPE	struct aliasent
+#define FUNCTION_NAME	getaliasbyname
+#define DATABASE_NAME	aliases
+#define ADD_PARAMS	const char *name
+#define ADD_VARIABLES	name
+#define BUFLEN		1024
+
+/* There is no nscd support for the aliases file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getaliasname_r.c b/ap/libc/glibc/glibc-2.22/inet/getaliasname_r.c
new file mode 100644
index 0000000..dc3f5d6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getaliasname_r.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <aliases.h>
+
+
+#define LOOKUP_TYPE		struct aliasent
+#define FUNCTION_NAME		getaliasbyname
+#define DATABASE_NAME		aliases
+#define ADD_PARAMS		const char *name
+#define ADD_VARIABLES		name
+
+/* There is no nscd support for the aliases file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/gethstbyad.c b/ap/libc/glibc/glibc-2.22/inet/gethstbyad.c
new file mode 100644
index 0000000..d7c36d7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/gethstbyad.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct hostent
+#define FUNCTION_NAME	gethostbyaddr
+#define DATABASE_NAME	hosts
+#define ADD_PARAMS	const void *addr, socklen_t len, int type
+#define ADD_VARIABLES	addr, len, type
+#define BUFLEN		1024
+#define NEED_H_ERRNO	1
+
+#include "../nss/getXXbyYY.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/gethstbyad_r.c b/ap/libc/glibc/glibc-2.22/inet/gethstbyad_r.c
new file mode 100644
index 0000000..06d3906
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/gethstbyad_r.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+#include <string.h>
+
+
+#define LOOKUP_TYPE	struct hostent
+#define FUNCTION_NAME	gethostbyaddr
+#define DATABASE_NAME	hosts
+#define ADD_PARAMS	const void *addr, socklen_t len, int type
+#define ADD_VARIABLES	addr, len, type
+#define NEED_H_ERRNO	1
+#define NEED__RES	1
+#define NEED__RES_HCONF	1
+/* If the addr parameter is the IPv6 unspecified address no query must
+   be performed.  */
+#define PREPROCESS \
+  if (len == sizeof (struct in6_addr)					      \
+      && __builtin_expect (memcmp (&__in6addr_any, addr,		      \
+				   sizeof (struct in6_addr)), 1) == 0)	      \
+    {									      \
+      *h_errnop = HOST_NOT_FOUND;					      \
+      *result = NULL;							      \
+      return ENOENT;							      \
+    }
+#define POSTPROCESS \
+  if (status == NSS_STATUS_SUCCESS)					      \
+    {									      \
+      _res_hconf_reorder_addrs (resbuf);				      \
+      _res_hconf_trim_domains (resbuf);					      \
+    }
+
+/* Special name for the lookup function.  */
+#define DB_LOOKUP_FCT __nss_hosts_lookup2
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/gethstbynm.c b/ap/libc/glibc/glibc-2.22/inet/gethstbynm.c
new file mode 100644
index 0000000..cb12f2a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/gethstbynm.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+
+#define LOOKUP_TYPE	struct hostent
+#define FUNCTION_NAME	gethostbyname
+#define DATABASE_NAME	hosts
+#define ADD_PARAMS	const char *name
+#define ADD_VARIABLES	name
+#define BUFLEN		1024
+#define NEED_H_ERRNO	1
+
+#define HANDLE_DIGITS_DOTS	1
+
+#include <nss/getXXbyYY.c>
diff --git a/ap/libc/glibc/glibc-2.22/inet/gethstbynm2.c b/ap/libc/glibc/glibc-2.22/inet/gethstbynm2.c
new file mode 100644
index 0000000..4eae094
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/gethstbynm2.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+
+#define LOOKUP_TYPE	struct hostent
+#define FUNCTION_NAME	gethostbyname2
+#define DATABASE_NAME	hosts
+#define ADD_PARAMS	const char *name, int af
+#define ADD_VARIABLES	name, af
+#define BUFLEN		1024
+#define NEED_H_ERRNO	1
+
+#define HANDLE_DIGITS_DOTS	1
+#define HAVE_AF			1
+
+#include "../nss/getXXbyYY.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/gethstbynm2_r.c b/ap/libc/glibc/glibc-2.22/inet/gethstbynm2_r.c
new file mode 100644
index 0000000..d5fb50a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/gethstbynm2_r.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+
+#define LOOKUP_TYPE	struct hostent
+#define FUNCTION_NAME	gethostbyname2
+#define DATABASE_NAME	hosts
+#define ADD_PARAMS	const char *name, int af
+#define ADD_VARIABLES	name, af
+#define NEED_H_ERRNO	1
+#define NEED__RES_HCONF	1
+#define POSTPROCESS \
+  if (status == NSS_STATUS_SUCCESS)					      \
+    _res_hconf_reorder_addrs (resbuf);
+
+#define HANDLE_DIGITS_DOTS	1
+#define HAVE_LOOKUP_BUFFER	1
+#define HAVE_AF			1
+
+/* Special name for the lookup function.  */
+#define DB_LOOKUP_FCT __nss_hosts_lookup2
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/gethstbynm_r.c b/ap/libc/glibc/glibc-2.22/inet/gethstbynm_r.c
new file mode 100644
index 0000000..999c0bb
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/gethstbynm_r.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+
+#define LOOKUP_TYPE	struct hostent
+#define FUNCTION_NAME	gethostbyname
+#define DATABASE_NAME	hosts
+#define ADD_PARAMS	const char *name
+#define ADD_VARIABLES	name
+#define NEED_H_ERRNO	1
+#define NEED__RES_HCONF	1
+#define POSTPROCESS \
+  if (status == NSS_STATUS_SUCCESS)					      \
+    _res_hconf_reorder_addrs (resbuf);
+
+#define HANDLE_DIGITS_DOTS	1
+#define HAVE_LOOKUP_BUFFER	1
+
+/* Special name for the lookup function.  */
+#define DB_LOOKUP_FCT __nss_hosts_lookup2
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/gethstent.c b/ap/libc/glibc/glibc-2.22/inet/gethstent.c
new file mode 100644
index 0000000..62a0199
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/gethstent.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct hostent
+#define	GETFUNC_NAME	gethostent
+#define BUFLEN		1024
+#define NEED_H_ERRNO	1
+
+#include "../nss/getXXent.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/gethstent_r.c b/ap/libc/glibc/glibc-2.22/inet/gethstent_r.c
new file mode 100644
index 0000000..9255263
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/gethstent_r.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct hostent
+#define SETFUNC_NAME	sethostent
+#define	GETFUNC_NAME	gethostent
+#define	ENDFUNC_NAME	endhostent
+#define DATABASE_NAME	hosts
+#define STAYOPEN	int stayopen
+#define STAYOPEN_VAR	stayopen
+#define NEED_H_ERRNO	1
+#define NEED__RES	1
+
+/* Special name for the lookup function.  */
+#define DB_LOOKUP_FCT __nss_hosts_lookup2
+
+#include "../nss/getXXent_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getipv4sourcefilter.c b/ap/libc/glibc/glibc-2.22/inet/getipv4sourcefilter.c
new file mode 100644
index 0000000..b47f272
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getipv4sourcefilter.c
@@ -0,0 +1,32 @@
+/* Get source filter.  Stub version.
+   Copyright (C) 2004-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdint.h>
+#include <netinet/in.h>
+
+
+int
+getipv4sourcefilter (int s, struct in_addr interface, struct in_addr group,
+		     uint32_t *fmode, uint32_t *numsrc, struct in_addr *slist)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (getipv4sourcefilter)
diff --git a/ap/libc/glibc/glibc-2.22/inet/getnameinfo.c b/ap/libc/glibc/glibc-2.22/inet/getnameinfo.c
new file mode 100644
index 0000000..0126f20
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getnameinfo.c
@@ -0,0 +1,469 @@
+/* The Inner Net License, Version 2.00
+
+  The author(s) grant permission for redistribution and use in source and
+binary forms, with or without modification, of the software and documentation
+provided that the following conditions are met:
+
+0. If you receive a version of the software that is specifically labelled
+   as not being for redistribution (check the version message and/or README),
+   you are not permitted to redistribute that version of the software in any
+   way or form.
+1. All terms of the all other applicable copyrights and licenses must be
+   followed.
+2. Redistributions of source code must retain the authors' copyright
+   notice(s), this list of conditions, and the following disclaimer.
+3. Redistributions in binary form must reproduce the authors' copyright
+   notice(s), this list of conditions, and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+4. [The copyright holder has authorized the removal of this clause.]
+5. Neither the name(s) of the author(s) nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY ITS AUTHORS AND CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
+
+  If these license terms cause you a real problem, contact the author.  */
+
+/* This software is Copyright 1996 by Craig Metz, All Rights Reserved.  */
+
+#include <errno.h>
+#include <netdb.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <netinet/in.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/un.h>
+#include <sys/utsname.h>
+#include <bits/libc-lock.h>
+#include <scratch_buffer.h>
+
+#ifdef HAVE_LIBIDN
+# include <libidn/idna.h>
+extern int __idna_to_unicode_lzlz (const char *input, char **output,
+				   int flags);
+#endif
+
+#ifndef min
+# define min(x,y) (((x) > (y)) ? (y) : (x))
+#endif /* min */
+
+libc_freeres_ptr (static char *domain);
+
+
+static char *
+internal_function
+nrl_domainname (void)
+{
+  static int not_first;
+
+  if (! not_first)
+    {
+      __libc_lock_define_initialized (static, lock);
+      __libc_lock_lock (lock);
+
+      if (! not_first)
+	{
+	  char *c;
+	  struct hostent *h, th;
+	  int herror;
+	  struct scratch_buffer tmpbuf;
+
+	  scratch_buffer_init (&tmpbuf);
+	  not_first = 1;
+
+	  while (__gethostbyname_r ("localhost", &th,
+				    tmpbuf.data, tmpbuf.length,
+				    &h, &herror))
+	    {
+	      if (herror == NETDB_INTERNAL && errno == ERANGE)
+		{
+		  if (!scratch_buffer_grow (&tmpbuf))
+		    goto done;
+		}
+	      else
+		break;
+	    }
+
+	  if (h && (c = strchr (h->h_name, '.')))
+	    domain = __strdup (++c);
+	  else
+	    {
+	      /* The name contains no domain information.  Use the name
+		 now to get more information.  */
+	      while (__gethostname (tmpbuf.data, tmpbuf.length))
+		if (!scratch_buffer_grow (&tmpbuf))
+		  goto done;
+
+	      if ((c = strchr (tmpbuf.data, '.')))
+		domain = __strdup (++c);
+	      else
+		{
+		  /* We need to preserve the hostname.  */
+		  const char *hstname = strdupa (tmpbuf.data);
+
+		  while (__gethostbyname_r (hstname, &th,
+					    tmpbuf.data, tmpbuf.length,
+					    &h, &herror))
+		    {
+		      if (herror == NETDB_INTERNAL && errno == ERANGE)
+			{
+			  if (!scratch_buffer_grow (&tmpbuf))
+			    goto done;
+			}
+		      else
+			break;
+		    }
+
+		  if (h && (c = strchr(h->h_name, '.')))
+		    domain = __strdup (++c);
+		  else
+		    {
+		      struct in_addr in_addr;
+
+		      in_addr.s_addr = htonl (INADDR_LOOPBACK);
+
+		      while (__gethostbyaddr_r ((const char *) &in_addr,
+						sizeof (struct in_addr),
+						AF_INET, &th,
+						tmpbuf.data, tmpbuf.length,
+						&h, &herror))
+			{
+			  if (herror == NETDB_INTERNAL && errno == ERANGE)
+			    {
+			      if (!scratch_buffer_grow (&tmpbuf))
+				goto done;
+			    }
+			  else
+			    break;
+			}
+
+		      if (h && (c = strchr (h->h_name, '.')))
+			domain = __strdup (++c);
+		    }
+		}
+	    }
+	done:
+	  scratch_buffer_free (&tmpbuf);
+	}
+
+      __libc_lock_unlock (lock);
+    }
+
+  return domain;
+};
+
+
+int
+getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
+	     socklen_t hostlen, char *serv, socklen_t servlen,
+	     int flags)
+{
+  int serrno = errno;
+  int herrno;
+  struct hostent th;
+  int ok = 0;
+  struct scratch_buffer tmpbuf;
+
+  scratch_buffer_init (&tmpbuf);
+
+  if (flags & ~(NI_NUMERICHOST|NI_NUMERICSERV|NI_NOFQDN|NI_NAMEREQD|NI_DGRAM
+#ifdef HAVE_LIBIDN
+		|NI_IDN|NI_IDN_ALLOW_UNASSIGNED|NI_IDN_USE_STD3_ASCII_RULES
+#endif
+		))
+    return EAI_BADFLAGS;
+
+  if (sa == NULL || addrlen < sizeof (sa_family_t))
+    return EAI_FAMILY;
+
+  if ((flags & NI_NAMEREQD) && host == NULL && serv == NULL)
+    return EAI_NONAME;
+
+  switch (sa->sa_family)
+    {
+    case AF_LOCAL:
+      if (addrlen < (socklen_t) offsetof (struct sockaddr_un, sun_path))
+	return EAI_FAMILY;
+      break;
+    case AF_INET:
+      if (addrlen < sizeof (struct sockaddr_in))
+	return EAI_FAMILY;
+      break;
+    case AF_INET6:
+      if (addrlen < sizeof (struct sockaddr_in6))
+	return EAI_FAMILY;
+      break;
+    default:
+      return EAI_FAMILY;
+    }
+
+  if (host != NULL && hostlen > 0)
+    switch (sa->sa_family)
+      {
+      case AF_INET:
+      case AF_INET6:
+	if (!(flags & NI_NUMERICHOST))
+	  {
+	    struct hostent *h = NULL;
+	    if (sa->sa_family == AF_INET6)
+	      {
+		while (__gethostbyaddr_r ((const void *) &(((const struct sockaddr_in6 *) sa)->sin6_addr),
+					  sizeof(struct in6_addr),
+					  AF_INET6, &th,
+					  tmpbuf.data, tmpbuf.length,
+					  &h, &herrno))
+		  if (herrno == NETDB_INTERNAL && errno == ERANGE)
+		    {
+		      if (!scratch_buffer_grow (&tmpbuf))
+			{
+			  __set_h_errno (herrno);
+			  return EAI_MEMORY;
+			}
+		    }
+		  else
+		    break;
+	      }
+	    else
+	      {
+		while (__gethostbyaddr_r ((const void *) &(((const struct sockaddr_in *)sa)->sin_addr),
+					  sizeof(struct in_addr),
+					  AF_INET, &th,
+					  tmpbuf.data, tmpbuf.length,
+					  &h, &herrno))
+		  if (herrno == NETDB_INTERNAL && errno == ERANGE)
+		    {
+		      if (!scratch_buffer_grow (&tmpbuf))
+			{
+			  __set_h_errno (herrno);
+			  return EAI_MEMORY;
+			}
+		    }
+		  else
+		    break;
+	      }
+
+	    if (h == NULL)
+	      {
+		if (herrno == NETDB_INTERNAL)
+		  {
+		    __set_h_errno (herrno);
+		    return EAI_SYSTEM;
+		  }
+		if (herrno == TRY_AGAIN)
+		  {
+		    __set_h_errno (herrno);
+		    return EAI_AGAIN;
+		  }
+	      }
+
+	    if (h)
+	      {
+		char *c;
+		if ((flags & NI_NOFQDN)
+		    && (c = nrl_domainname ())
+		    && (c = strstr (h->h_name, c))
+		    && (c != h->h_name) && (*(--c) == '.'))
+		  /* Terminate the string after the prefix.  */
+		  *c = '\0';
+
+#ifdef HAVE_LIBIDN
+		/* If requested, convert from the IDN format.  */
+		if (flags & NI_IDN)
+		  {
+		    int idn_flags = 0;
+		    if  (flags & NI_IDN_ALLOW_UNASSIGNED)
+		      idn_flags |= IDNA_ALLOW_UNASSIGNED;
+		    if (flags & NI_IDN_USE_STD3_ASCII_RULES)
+		      idn_flags |= IDNA_USE_STD3_ASCII_RULES;
+
+		    char *out;
+		    int rc = __idna_to_unicode_lzlz (h->h_name, &out,
+						     idn_flags);
+		    if (rc != IDNA_SUCCESS)
+		      {
+			if (rc == IDNA_MALLOC_ERROR)
+			  return EAI_MEMORY;
+			if (rc == IDNA_DLOPEN_ERROR)
+			  return EAI_SYSTEM;
+			return EAI_IDN_ENCODE;
+		      }
+
+		    if (out != h->h_name)
+		      {
+			h->h_name = strdupa (out);
+			free (out);
+		      }
+		  }
+#endif
+
+		size_t len = strlen (h->h_name) + 1;
+		if (len > hostlen)
+		  return EAI_OVERFLOW;
+
+		memcpy (host, h->h_name, len);
+
+		ok = 1;
+	      }
+	  }
+
+	if (!ok)
+	  {
+	    if (flags & NI_NAMEREQD)
+	      {
+		__set_errno (serrno);
+		return EAI_NONAME;
+	      }
+	    else
+	      {
+		const char *c;
+		if (sa->sa_family == AF_INET6)
+		  {
+		    const struct sockaddr_in6 *sin6p;
+		    uint32_t scopeid;
+
+		    sin6p = (const struct sockaddr_in6 *) sa;
+
+		    c = inet_ntop (AF_INET6,
+				   (const void *) &sin6p->sin6_addr, host, hostlen);
+		    scopeid = sin6p->sin6_scope_id;
+		    if (scopeid != 0)
+		      {
+			/* Buffer is >= IFNAMSIZ+1.  */
+			char scopebuf[IFNAMSIZ + 1];
+			char *scopeptr;
+			int ni_numericscope = 0;
+			size_t real_hostlen = __strnlen (host, hostlen);
+			size_t scopelen = 0;
+
+			scopebuf[0] = SCOPE_DELIMITER;
+			scopebuf[1] = '\0';
+			scopeptr = &scopebuf[1];
+
+			if (IN6_IS_ADDR_LINKLOCAL (&sin6p->sin6_addr)
+			    || IN6_IS_ADDR_MC_LINKLOCAL (&sin6p->sin6_addr))
+			  {
+			    if (if_indextoname (scopeid, scopeptr) == NULL)
+			      ++ni_numericscope;
+			    else
+			      scopelen = strlen (scopebuf);
+			  }
+			else
+			  ++ni_numericscope;
+
+			if (ni_numericscope)
+			  scopelen = 1 + __snprintf (scopeptr,
+						     (scopebuf
+						      + sizeof scopebuf
+						      - scopeptr),
+						     "%u", scopeid);
+
+			if (real_hostlen + scopelen + 1 > hostlen)
+			  /* Signal the buffer is too small.  This is
+			     what inet_ntop does.  */
+			  c = NULL;
+			else
+			  memcpy (host + real_hostlen, scopebuf, scopelen + 1);
+		      }
+		  }
+		else
+		  c = inet_ntop (AF_INET,
+				 (const void *) &(((const struct sockaddr_in *) sa)->sin_addr),
+				 host, hostlen);
+		if (c == NULL)
+		  return EAI_OVERFLOW;
+	      }
+	    ok = 1;
+	  }
+	break;
+
+      case AF_LOCAL:
+	if (!(flags & NI_NUMERICHOST))
+	  {
+	    struct utsname utsname;
+
+	    if (!uname (&utsname))
+	      {
+		strncpy (host, utsname.nodename, hostlen);
+		break;
+	      };
+	  };
+
+	if (flags & NI_NAMEREQD)
+	   {
+	    __set_errno (serrno);
+	    return EAI_NONAME;
+	  }
+
+	strncpy (host, "localhost", hostlen);
+	break;
+
+      default:
+	return EAI_FAMILY;
+    }
+
+  if (serv && (servlen > 0))
+    switch (sa->sa_family)
+      {
+      case AF_INET:
+      case AF_INET6:
+	if (!(flags & NI_NUMERICSERV))
+	  {
+	    struct servent *s, ts;
+	    int e;
+	    while ((e = __getservbyport_r (((const struct sockaddr_in *) sa)->sin_port,
+					   ((flags & NI_DGRAM)
+					    ? "udp" : "tcp"), &ts,
+					   tmpbuf.data, tmpbuf.length, &s)))
+	      {
+		if (e == ERANGE)
+		  {
+		    if (!scratch_buffer_grow (&tmpbuf))
+		      return EAI_MEMORY;
+		  }
+		else
+		  break;
+	      }
+	    if (s)
+	      {
+		strncpy (serv, s->s_name, servlen);
+		break;
+	      }
+	  }
+
+	if (__snprintf (serv, servlen, "%d",
+			ntohs (((const struct sockaddr_in *) sa)->sin_port))
+	    + 1 > servlen)
+	  return EAI_OVERFLOW;
+
+	break;
+
+      case AF_LOCAL:
+	strncpy (serv, ((const struct sockaddr_un *) sa)->sun_path, servlen);
+	break;
+    }
+
+  if (host && (hostlen > 0))
+    host[hostlen-1] = 0;
+  if (serv && (servlen > 0))
+    serv[servlen-1] = 0;
+  errno = serrno;
+  return 0;
+}
+libc_hidden_def (getnameinfo)
diff --git a/ap/libc/glibc/glibc-2.22/inet/getnetbyad.c b/ap/libc/glibc/glibc-2.22/inet/getnetbyad.c
new file mode 100644
index 0000000..a03d1ec
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getnetbyad.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+#include <stdint.h>
+
+
+#define LOOKUP_TYPE	struct netent
+#define FUNCTION_NAME	getnetbyaddr
+#define DATABASE_NAME	networks
+#define ADD_PARAMS	uint32_t net, int type
+#define ADD_VARIABLES	net, type
+#define BUFLEN		1024
+#define NEED_H_ERRNO	1
+
+/* There is no nscd support for the networks file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getnetbyad_r.c b/ap/libc/glibc/glibc-2.22/inet/getnetbyad_r.c
new file mode 100644
index 0000000..909ebc7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getnetbyad_r.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+#include <stdint.h>
+
+
+#define LOOKUP_TYPE		struct netent
+#define FUNCTION_NAME		getnetbyaddr
+#define DATABASE_NAME		networks
+#define ADD_PARAMS		uint32_t net, int type
+#define ADD_VARIABLES		net, type
+#define NEED__RES		1
+#define NEED_H_ERRNO		1
+
+/* There is no nscd support for the networks file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getnetbynm.c b/ap/libc/glibc/glibc-2.22/inet/getnetbynm.c
new file mode 100644
index 0000000..5e92759
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getnetbynm.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct netent
+#define FUNCTION_NAME	getnetbyname
+#define DATABASE_NAME	networks
+#define ADD_PARAMS	const char *name
+#define ADD_VARIABLES	name
+#define BUFLEN		1024
+#define NEED_H_ERRNO	1
+
+/* There is no nscd support for the networks file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getnetbynm_r.c b/ap/libc/glibc/glibc-2.22/inet/getnetbynm_r.c
new file mode 100644
index 0000000..a10c4be
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getnetbynm_r.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE		struct netent
+#define FUNCTION_NAME		getnetbyname
+#define DATABASE_NAME		networks
+#define ADD_PARAMS		const char *name
+#define ADD_VARIABLES		name
+#define NEED__RES		1
+#define NEED_H_ERRNO		1
+
+/* There is no nscd support for the networks file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getnetent.c b/ap/libc/glibc/glibc-2.22/inet/getnetent.c
new file mode 100644
index 0000000..5858755
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getnetent.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct netent
+#define	GETFUNC_NAME	getnetent
+#define BUFLEN		1024
+#define NEED_H_ERRNO	1
+
+/* There is no nscd support for the networks file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXent.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getnetent_r.c b/ap/libc/glibc/glibc-2.22/inet/getnetent_r.c
new file mode 100644
index 0000000..539d79f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getnetent_r.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE		struct netent
+#define SETFUNC_NAME		setnetent
+#define	GETFUNC_NAME		getnetent
+#define	ENDFUNC_NAME		endnetent
+#define DATABASE_NAME		networks
+#define STAYOPEN		int stayopen
+#define STAYOPEN_VAR		stayopen
+#define NEED__RES		1
+#define NEED_H_ERRNO		1
+
+/* There is no nscd support for the networks file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXent_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getnetgrent.c b/ap/libc/glibc/glibc-2.22/inet/getnetgrent.c
new file mode 100644
index 0000000..094f34f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getnetgrent.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <netdb.h>
+#include <stdlib.h>
+#include <bits/libc-lock.h>
+
+/* Static buffer for return value.  We allocate it when needed.  */
+libc_freeres_ptr (static char *buffer);
+/* All three strings should fit in a block of 1kB size.  */
+#define BUFSIZE 1024
+
+
+
+static void
+allocate (void)
+{
+  buffer = (char *) malloc (BUFSIZE);
+}
+
+int
+getnetgrent (char **hostp, char **userp, char **domainp)
+{
+  __libc_once_define (static, once);
+  __libc_once (once, allocate);
+
+  if (buffer == NULL)
+    {
+      __set_errno (ENOMEM);
+      return -1;
+    }
+
+  return __getnetgrent_r (hostp, userp, domainp, buffer, BUFSIZE);
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/getnetgrent_r.c b/ap/libc/glibc/glibc-2.22/inet/getnetgrent_r.c
new file mode 100644
index 0000000..53ae648
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getnetgrent_r.c
@@ -0,0 +1,535 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <atomic.h>
+#include <bits/libc-lock.h>
+#include <errno.h>
+#include <netdb.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include "netgroup.h"
+#include "nsswitch.h"
+#include <sysdep.h>
+#include <nscd/nscd_proto.h>
+
+
+/* Protect above variable against multiple uses at the same time.  */
+__libc_lock_define_initialized (static, lock)
+
+/* The whole information for the set/get/endnetgrent functions are
+   kept in this structure.  */
+static struct __netgrent dataset;
+
+/* The lookup function for the first entry of this service.  */
+extern int __nss_netgroup_lookup (service_user **nipp, const char *name,
+				  void **fctp) internal_function;
+
+/* Set up NIP to run through the services.  Return nonzero if there are no
+   services (left).  */
+static int
+setup (void **fctp, service_user **nipp)
+{
+  /* Remember the first service_entry, it's always the same.  */
+  static bool startp_initialized;
+  static service_user *startp;
+  int no_more;
+
+  if (!startp_initialized)
+    {
+      /* Executing this more than once at the same time must yield the
+	 same result every time.  So we need no locking.  */
+      no_more = __nss_netgroup_lookup (nipp, "setnetgrent", fctp);
+      startp = no_more ? (service_user *) -1 : *nipp;
+#ifdef PTR_MANGLE
+      PTR_MANGLE (startp);
+#endif
+      atomic_write_barrier ();
+      startp_initialized = true;
+    }
+  else
+    {
+      service_user *nip = startp;
+#ifdef PTR_DEMANGLE
+      PTR_DEMANGLE (nip);
+#endif
+      if (nip == (service_user *) -1)
+	/* No services at all.  */
+	return 1;
+
+      /* Reset to the beginning of the service list.  */
+      *nipp = nip;
+      /* Look up the first function.  */
+      no_more = __nss_lookup (nipp, "setnetgrent", NULL, fctp);
+    }
+  return no_more;
+}
+
+/* Free used memory.  */
+static void
+free_memory (struct __netgrent *data)
+{
+  while (data->known_groups != NULL)
+    {
+      struct name_list *tmp = data->known_groups;
+      data->known_groups = data->known_groups->next;
+      free (tmp);
+    }
+
+  while (data->needed_groups != NULL)
+    {
+      struct name_list *tmp = data->needed_groups;
+      data->needed_groups = data->needed_groups->next;
+      free (tmp);
+    }
+}
+
+static void
+endnetgrent_hook (struct __netgrent *datap)
+{
+  enum nss_status (*endfct) (struct __netgrent *);
+
+  if (datap->nip == NULL || datap->nip == (service_user *) -1l)
+    return;
+
+  endfct = __nss_lookup_function (datap->nip, "endnetgrent");
+  if (endfct != NULL)
+    (void) (*endfct) (datap);
+  datap->nip = NULL;
+}
+
+static int
+internal_function
+__internal_setnetgrent_reuse (const char *group, struct __netgrent *datap,
+			      int *errnop)
+{
+  union
+  {
+    enum nss_status (*f) (const char *, struct __netgrent *);
+    void *ptr;
+  } fct;
+  enum nss_status status = NSS_STATUS_UNAVAIL;
+  struct name_list *new_elem;
+
+  /* Free data from previous service.  */
+  endnetgrent_hook (datap);
+
+  /* Cycle through all the services and run their setnetgrent functions.  */
+  int no_more = setup (&fct.ptr, &datap->nip);
+  while (! no_more)
+    {
+      assert (datap->data == NULL);
+
+      /* Ignore status, we force check in `__nss_next2'.  */
+      status = DL_CALL_FCT (*fct.f, (group, datap));
+
+      service_user *old_nip = datap->nip;
+      no_more = __nss_next2 (&datap->nip, "setnetgrent", NULL, &fct.ptr,
+			     status, 0);
+
+      if (status == NSS_STATUS_SUCCESS && ! no_more)
+	{
+	  enum nss_status (*endfct) (struct __netgrent *);
+
+	  endfct = __nss_lookup_function (old_nip, "endnetgrent");
+	  if (endfct != NULL)
+	    (void) DL_CALL_FCT (*endfct, (datap));
+	}
+    }
+
+  /* Add the current group to the list of known groups.  */
+  size_t group_len = strlen (group) + 1;
+  new_elem = (struct name_list *) malloc (sizeof (struct name_list)
+					  + group_len);
+  if (new_elem == NULL)
+    {
+      *errnop = errno;
+      status = NSS_STATUS_TRYAGAIN;
+    }
+  else
+    {
+      new_elem->next = datap->known_groups;
+      memcpy (new_elem->name, group, group_len);
+      datap->known_groups = new_elem;
+    }
+
+  return status == NSS_STATUS_SUCCESS;
+}
+
+int
+internal_function
+__internal_setnetgrent (const char *group, struct __netgrent *datap)
+{
+  /* Free list of all netgroup names from last run.  */
+  free_memory (datap);
+
+  return __internal_setnetgrent_reuse (group, datap, &errno);
+}
+libc_hidden_def (__internal_setnetgrent)
+
+static int
+nscd_setnetgrent (const char *group)
+{
+#ifdef USE_NSCD
+  if (__nss_not_use_nscd_netgroup > 0
+      && ++__nss_not_use_nscd_netgroup > NSS_NSCD_RETRY)
+    __nss_not_use_nscd_netgroup = 0;
+
+  if (!__nss_not_use_nscd_netgroup
+      && !__nss_database_custom[NSS_DBSIDX_netgroup])
+    return __nscd_setnetgrent (group, &dataset);
+#endif
+  return -1;
+}
+
+int
+setnetgrent (const char *group)
+{
+  int result;
+
+  __libc_lock_lock (lock);
+
+  result = nscd_setnetgrent (group);
+  if (result < 0)
+    result = __internal_setnetgrent (group, &dataset);
+
+  __libc_lock_unlock (lock);
+
+  return result;
+}
+
+void
+internal_function
+__internal_endnetgrent (struct __netgrent *datap)
+{
+  endnetgrent_hook (datap);
+  /* Now free list of all netgroup names from last run.  */
+  free_memory (datap);
+}
+libc_hidden_def (__internal_endnetgrent)
+
+
+void
+endnetgrent (void)
+{
+  __libc_lock_lock (lock);
+
+  __internal_endnetgrent (&dataset);
+
+  __libc_lock_unlock (lock);
+}
+
+#ifdef USE_NSCD
+static const char *
+get_nonempty_val (const char *in)
+{
+  if (*in == '\0')
+    return NULL;
+  return in;
+}
+
+static enum nss_status
+nscd_getnetgrent (struct __netgrent *datap, char *buffer, size_t buflen,
+		  int *errnop)
+{
+  if (datap->cursor >= datap->data + datap->data_size)
+    return NSS_STATUS_UNAVAIL;
+
+  datap->type = triple_val;
+  datap->val.triple.host = get_nonempty_val (datap->cursor);
+  datap->cursor = (char *) __rawmemchr (datap->cursor, '\0') + 1;
+  datap->val.triple.user = get_nonempty_val (datap->cursor);
+  datap->cursor = (char *) __rawmemchr (datap->cursor, '\0') + 1;
+  datap->val.triple.domain = get_nonempty_val (datap->cursor);
+  datap->cursor = (char *) __rawmemchr (datap->cursor, '\0') + 1;
+
+  return NSS_STATUS_SUCCESS;
+}
+#endif
+
+int
+internal_function
+__internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
+			  struct __netgrent *datap,
+			  char *buffer, size_t buflen, int *errnop)
+{
+  enum nss_status (*fct) (struct __netgrent *, char *, size_t, int *);
+
+  /* Initialize status to return if no more functions are found.  */
+  enum nss_status status = NSS_STATUS_NOTFOUND;
+
+  /* Run through available functions, starting with the same function last
+     run.  We will repeat each function as long as it succeeds, and then go
+     on to the next service action.  */
+  int no_more = datap->nip == NULL;
+  if (! no_more)
+    {
+#ifdef USE_NSCD
+      /* This bogus function pointer is a special marker left by
+	 __nscd_setnetgrent to tell us to use the data it left
+	 before considering any modules.  */
+      if (datap->nip == (service_user *) -1l)
+	fct = nscd_getnetgrent;
+      else
+#endif
+	{
+	  fct = __nss_lookup_function (datap->nip, "getnetgrent_r");
+	  no_more = fct == NULL;
+	}
+
+      while (! no_more)
+	{
+	  status = DL_CALL_FCT (*fct, (datap, buffer, buflen, &errno));
+
+	  if (status == NSS_STATUS_RETURN
+	      /* The service returned a NOTFOUND, but there are more groups that
+		 we need to resolve before we give up.  */
+	      || (status == NSS_STATUS_NOTFOUND && datap->needed_groups != NULL))
+	    {
+	      /* This was the last one for this group.  Look at next group
+		 if available.  */
+	      int found = 0;
+	      while (datap->needed_groups != NULL && ! found)
+		{
+		  struct name_list *tmp = datap->needed_groups;
+		  datap->needed_groups = datap->needed_groups->next;
+		  tmp->next = datap->known_groups;
+		  datap->known_groups = tmp;
+
+		  found = __internal_setnetgrent_reuse (datap->known_groups->name,
+							datap, errnop);
+		}
+
+	      if (found && datap->nip != NULL)
+		{
+		  fct = __nss_lookup_function (datap->nip, "getnetgrent_r");
+		  if (fct != NULL)
+		    continue;
+		}
+	    }
+	  else if (status == NSS_STATUS_SUCCESS && datap->type == group_val)
+	    {
+	      /* The last entry was a name of another netgroup.  */
+	      struct name_list *namep;
+
+	      /* Ignore if we've seen the name before.  */
+	      for (namep = datap->known_groups; namep != NULL;
+		   namep = namep->next)
+		if (strcmp (datap->val.group, namep->name) == 0)
+		  break;
+	      if (namep == NULL)
+		for (namep = datap->needed_groups; namep != NULL;
+		     namep = namep->next)
+		  if (strcmp (datap->val.group, namep->name) == 0)
+		    break;
+	      if (namep != NULL)
+		/* Really ignore.  */
+		continue;
+
+	      size_t group_len = strlen (datap->val.group) + 1;
+	      namep = (struct name_list *) malloc (sizeof (struct name_list)
+						  + group_len);
+	      if (namep == NULL)
+		/* We are out of memory.  */
+		status = NSS_STATUS_RETURN;
+	      else
+		{
+		  namep->next = datap->needed_groups;
+		  memcpy (namep->name, datap->val.group, group_len);
+		  datap->needed_groups = namep;
+		  /* And get the next entry.  */
+		  continue;
+		}
+	    }
+	  break;
+	}
+    }
+
+  if (status == NSS_STATUS_SUCCESS)
+    {
+      *hostp = (char *) datap->val.triple.host;
+      *userp = (char *) datap->val.triple.user;
+      *domainp = (char *) datap->val.triple.domain;
+    }
+
+  return status == NSS_STATUS_SUCCESS ? 1 : 0;
+}
+libc_hidden_def (__internal_getnetgrent_r)
+
+/* The real entry point.  */
+int
+__getnetgrent_r (char **hostp, char **userp, char **domainp,
+		 char *buffer, size_t buflen)
+{
+  enum nss_status status;
+
+  __libc_lock_lock (lock);
+
+  status = __internal_getnetgrent_r (hostp, userp, domainp, &dataset,
+				     buffer, buflen, &errno);
+
+  __libc_lock_unlock (lock);
+
+  return status;
+}
+weak_alias (__getnetgrent_r, getnetgrent_r)
+
+/* Test whether given (host,user,domain) triple is in NETGROUP.  */
+int
+innetgr (const char *netgroup, const char *host, const char *user,
+	 const char *domain)
+{
+#ifdef USE_NSCD
+  if (__nss_not_use_nscd_netgroup > 0
+      && ++__nss_not_use_nscd_netgroup > NSS_NSCD_RETRY)
+    __nss_not_use_nscd_netgroup = 0;
+
+  if (!__nss_not_use_nscd_netgroup
+      && !__nss_database_custom[NSS_DBSIDX_netgroup])
+    {
+      int result = __nscd_innetgr (netgroup, host, user, domain);
+      if (result >= 0)
+	return result;
+    }
+#endif
+
+  union
+  {
+    enum nss_status (*f) (const char *, struct __netgrent *);
+    void *ptr;
+  } setfct;
+  void (*endfct) (struct __netgrent *);
+  int (*getfct) (struct __netgrent *, char *, size_t, int *);
+  struct __netgrent entry;
+  int result = 0;
+  const char *current_group = netgroup;
+
+  memset (&entry, '\0', sizeof (entry));
+
+  /* Walk through the services until we found an answer or we shall
+     not work further.  We can do some optimization here.  Since all
+     services must provide the `setnetgrent' function we can do all
+     the work during one walk through the service list.  */
+  while (1)
+    {
+      int no_more = setup (&setfct.ptr, &entry.nip);
+      while (! no_more)
+	{
+	  assert (entry.data == NULL);
+
+	  /* Open netgroup.  */
+	  enum nss_status status = DL_CALL_FCT (*setfct.f,
+						(current_group, &entry));
+
+	  if (status == NSS_STATUS_SUCCESS
+	      && (getfct = __nss_lookup_function (entry.nip, "getnetgrent_r"))
+		 != NULL)
+	    {
+	      char buffer[1024];
+
+	      while (DL_CALL_FCT (*getfct,
+				  (&entry, buffer, sizeof buffer, &errno))
+		     == NSS_STATUS_SUCCESS)
+		{
+		  if (entry.type == group_val)
+		    {
+		      /* Make sure we haven't seen the name before.  */
+		      struct name_list *namep;
+
+		      for (namep = entry.known_groups; namep != NULL;
+			   namep = namep->next)
+			if (strcmp (entry.val.group, namep->name) == 0)
+			  break;
+		      if (namep == NULL)
+			for (namep = entry.needed_groups; namep != NULL;
+			     namep = namep->next)
+			  if (strcmp (entry.val.group, namep->name) == 0)
+			    break;
+		      if (namep == NULL
+			  && strcmp (netgroup, entry.val.group) != 0)
+			{
+			  size_t group_len = strlen (entry.val.group) + 1;
+			  namep =
+			    (struct name_list *) malloc (sizeof (*namep)
+							 + group_len);
+			  if (namep == NULL)
+			    {
+			      /* Out of memory, simply return.  */
+			      result = -1;
+			      break;
+			    }
+
+			  namep->next = entry.needed_groups;
+			  memcpy (namep->name, entry.val.group, group_len);
+			  entry.needed_groups = namep;
+			}
+		    }
+		  else
+		    {
+		      if ((entry.val.triple.host == NULL || host == NULL
+			   || __strcasecmp (entry.val.triple.host, host) == 0)
+			  && (entry.val.triple.user == NULL || user == NULL
+			      || strcmp (entry.val.triple.user, user) == 0)
+			  && (entry.val.triple.domain == NULL || domain == NULL
+			      || __strcasecmp (entry.val.triple.domain,
+					       domain) == 0))
+			{
+			  result = 1;
+			  break;
+			}
+		    }
+		}
+
+	      /* If we found one service which does know the given
+		 netgroup we don't try further.  */
+	      status = NSS_STATUS_RETURN;
+	    }
+
+	  /* Free all resources of the service.  */
+	  endfct = __nss_lookup_function (entry.nip, "endnetgrent");
+	  if (endfct != NULL)
+	    DL_CALL_FCT (*endfct, (&entry));
+
+	  if (result != 0)
+	    break;
+
+	  /* Look for the next service.  */
+	  no_more = __nss_next2 (&entry.nip, "setnetgrent", NULL,
+				 &setfct.ptr, status, 0);
+	}
+
+      if (result == 0 && entry.needed_groups != NULL)
+	{
+	  struct name_list *tmp = entry.needed_groups;
+	  entry.needed_groups = tmp->next;
+	  tmp->next = entry.known_groups;
+	  entry.known_groups = tmp;
+	  current_group = tmp->name;
+	  continue;
+	}
+
+      /* No way out.  */
+      break;
+    }
+
+  /* Free the memory.  */
+  free_memory (&entry);
+
+  return result == 1;
+}
+libc_hidden_def (innetgr)
diff --git a/ap/libc/glibc/glibc-2.22/inet/getproto.c b/ap/libc/glibc/glibc-2.22/inet/getproto.c
new file mode 100644
index 0000000..32dcd13
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getproto.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct protoent
+#define FUNCTION_NAME	getprotobynumber
+#define DATABASE_NAME	protocols
+#define ADD_PARAMS	int proto
+#define ADD_VARIABLES	proto
+#define BUFLEN		1024
+
+/* There is no nscd support for the protocols file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getproto_r.c b/ap/libc/glibc/glibc-2.22/inet/getproto_r.c
new file mode 100644
index 0000000..7dc08a7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getproto_r.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE		struct protoent
+#define FUNCTION_NAME		getprotobynumber
+#define DATABASE_NAME		protocols
+#define ADD_PARAMS		int proto
+#define ADD_VARIABLES		proto
+
+/* There is no nscd support for the protocols file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getprtent.c b/ap/libc/glibc/glibc-2.22/inet/getprtent.c
new file mode 100644
index 0000000..3c4f4e5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getprtent.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct protoent
+#define	GETFUNC_NAME	getprotoent
+#define BUFLEN		1024
+
+/* There is no nscd support for the protocols file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXent.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getprtent_r.c b/ap/libc/glibc/glibc-2.22/inet/getprtent_r.c
new file mode 100644
index 0000000..965e4b8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getprtent_r.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE		struct protoent
+#define SETFUNC_NAME		setprotoent
+#define	GETFUNC_NAME		getprotoent
+#define	ENDFUNC_NAME		endprotoent
+#define DATABASE_NAME		protocols
+#define STAYOPEN		int stayopen
+#define STAYOPEN_VAR		stayopen
+
+/* There is no nscd support for the protocols file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXent_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getprtname.c b/ap/libc/glibc/glibc-2.22/inet/getprtname.c
new file mode 100644
index 0000000..78a96df
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getprtname.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct protoent
+#define FUNCTION_NAME	getprotobyname
+#define DATABASE_NAME	protocols
+#define ADD_PARAMS	const char *name
+#define ADD_VARIABLES	name
+#define BUFLEN		1024
+
+/* There is no nscd support for the protocols file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getprtname_r.c b/ap/libc/glibc/glibc-2.22/inet/getprtname_r.c
new file mode 100644
index 0000000..9512261
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getprtname_r.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE		struct protoent
+#define FUNCTION_NAME		getprotobyname
+#define DATABASE_NAME		protocols
+#define ADD_PARAMS		const char *name
+#define ADD_VARIABLES		name
+
+/* There is no nscd support for the protocols file.  */
+#undef	USE_NSCD
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getservent.c b/ap/libc/glibc/glibc-2.22/inet/getservent.c
new file mode 100644
index 0000000..1c24ba4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getservent.c
@@ -0,0 +1,25 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct servent
+#define	GETFUNC_NAME	getservent
+#define BUFLEN		1024
+
+#include "../nss/getXXent.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getservent_r.c b/ap/libc/glibc/glibc-2.22/inet/getservent_r.c
new file mode 100644
index 0000000..b315c8d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getservent_r.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE		struct servent
+#define SETFUNC_NAME		setservent
+#define	GETFUNC_NAME		getservent
+#define	ENDFUNC_NAME		endservent
+#define DATABASE_NAME		services
+#define STAYOPEN		int stayopen
+#define STAYOPEN_VAR		stayopen
+
+#include "../nss/getXXent_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getsourcefilter.c b/ap/libc/glibc/glibc-2.22/inet/getsourcefilter.c
new file mode 100644
index 0000000..1fb9dc7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getsourcefilter.c
@@ -0,0 +1,32 @@
+/* Get source filter.  Stub version.
+   Copyright (C) 2004-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <netinet/in.h>
+#include <stdint.h>
+
+int
+getsourcefilter (int s, uint32_t interface, const struct sockaddr *group,
+		 socklen_t grouplen, uint32_t *fmode, uint32_t *numsrc,
+		 struct sockaddr_storage *slist)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (getsourcefilter)
diff --git a/ap/libc/glibc/glibc-2.22/inet/getsrvbynm.c b/ap/libc/glibc/glibc-2.22/inet/getsrvbynm.c
new file mode 100644
index 0000000..c367c9e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getsrvbynm.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct servent
+#define FUNCTION_NAME	getservbyname
+#define DATABASE_NAME	services
+#define ADD_PARAMS	const char *name, const char *proto
+#define ADD_VARIABLES	name, proto
+#define BUFLEN		1024
+
+#include "../nss/getXXbyYY.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getsrvbynm_r.c b/ap/libc/glibc/glibc-2.22/inet/getsrvbynm_r.c
new file mode 100644
index 0000000..498539d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getsrvbynm_r.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE		struct servent
+#define FUNCTION_NAME		getservbyname
+#define DATABASE_NAME		services
+#define ADD_PARAMS		const char *name, const char *proto
+#define ADD_VARIABLES		name, proto
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getsrvbypt.c b/ap/libc/glibc/glibc-2.22/inet/getsrvbypt.c
new file mode 100644
index 0000000..cde5986
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getsrvbypt.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE	struct servent
+#define FUNCTION_NAME	getservbyport
+#define DATABASE_NAME	services
+#define ADD_PARAMS	int port, const char *proto
+#define ADD_VARIABLES	port, proto
+#define BUFLEN		1024
+
+#include "../nss/getXXbyYY.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/getsrvbypt_r.c b/ap/libc/glibc/glibc-2.22/inet/getsrvbypt_r.c
new file mode 100644
index 0000000..7cde45d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/getsrvbypt_r.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE		struct servent
+#define FUNCTION_NAME		getservbyport
+#define DATABASE_NAME		services
+#define ADD_PARAMS		int port, const char *proto
+#define ADD_VARIABLES		port, proto
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/herrno-loc.c b/ap/libc/glibc/glibc-2.22/inet/herrno-loc.c
new file mode 100644
index 0000000..bff195c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/herrno-loc.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netdb.h>
+#include <tls.h>
+
+
+/* When threaded, h_errno may be a per-thread variable.  */
+int *
+weak_const_function
+__h_errno_location (void)
+{
+  return &h_errno;
+}
+libc_hidden_def (__h_errno_location)
diff --git a/ap/libc/glibc/glibc-2.22/inet/herrno.c b/ap/libc/glibc/glibc-2.22/inet/herrno.c
new file mode 100644
index 0000000..672a91d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/herrno.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <features.h>
+#include <netdb.h>
+#undef h_errno
+
+#include <tls.h>
+
+/* We need to have the error status variable of the resolver
+   accessible in the libc.  */
+
+__thread int __h_errno;
+extern __thread int __libc_h_errno __attribute__ ((alias ("__h_errno")))
+  attribute_hidden;
+#define h_errno __libc_h_errno
diff --git a/ap/libc/glibc/glibc-2.22/inet/htonl.c b/ap/libc/glibc/glibc-2.22/inet/htonl.c
new file mode 100644
index 0000000..f70283a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/htonl.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1993-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdint.h>
+#include <netinet/in.h>
+
+#undef	htonl
+#undef	ntohl
+
+uint32_t
+htonl (uint32_t x)
+{
+#if BYTE_ORDER == BIG_ENDIAN
+  return x;
+#elif BYTE_ORDER == LITTLE_ENDIAN
+  return __bswap_32 (x);
+#else
+# error "What kind of system is this?"
+#endif
+}
+weak_alias (htonl, ntohl)
diff --git a/ap/libc/glibc/glibc-2.22/inet/htons.c b/ap/libc/glibc/glibc-2.22/inet/htons.c
new file mode 100644
index 0000000..dd0186e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/htons.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1993-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netinet/in.h>
+
+#undef	htons
+#undef	ntohs
+
+uint16_t
+htons (uint16_t x)
+{
+#if BYTE_ORDER == BIG_ENDIAN
+  return x;
+#elif BYTE_ORDER == LITTLE_ENDIAN
+  return __bswap_16 (x);
+#else
+# error "What kind of system is this?"
+#endif
+}
+weak_alias (htons, ntohs)
diff --git a/ap/libc/glibc/glibc-2.22/inet/htontest.c b/ap/libc/glibc/glibc-2.22/inet/htontest.c
new file mode 100644
index 0000000..f99f012
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/htontest.c
@@ -0,0 +1,70 @@
+/* Test hton/ntoh functions.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <endian.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define TEST(orig, swapped, fct) \
+  if ((fct (orig)) != (orig)) {						      \
+    printf ("Failed for %s -> %#x\n", #fct "(" #orig ")", fct (orig));	      \
+    result = 1;								      \
+  }
+#elif BYTE_ORDER == LITTLE_ENDIAN
+# define TEST(orig, swapped, fct) \
+  if ((fct (orig)) != (swapped)) {					      \
+    printf ("Failed for %s -> %#x\n", #fct "(" #orig ")", fct (orig));	      \
+    result = 1;								      \
+  }
+#else
+# error "Bah, what kind of system do you use?"
+#endif
+
+u_int32_t lo = 0x67452301;
+u_int16_t foo = 0x1234;
+
+int
+main (void)
+{
+  int result = 0;
+
+  TEST (0x67452301, 0x01234567, htonl);
+  TEST (0x67452301, 0x01234567, (htonl));
+  TEST (0x67452301, 0x01234567, ntohl);
+  TEST (0x67452301, 0x01234567, (ntohl));
+
+  TEST (lo, 0x01234567, htonl);
+  TEST (lo, 0x01234567, (htonl));
+  TEST (lo, 0x01234567, ntohl);
+  TEST (lo, 0x01234567, (ntohl));
+
+  TEST (0x1234, 0x3412, htons);
+  TEST (0x1234, 0x3412, (htons));
+  TEST (0x1234, 0x3412, ntohs);
+  TEST (0x1234, 0x3412, (ntohs));
+
+  TEST (foo, 0x3412, htons);
+  TEST (foo, 0x3412, (htons));
+  TEST (foo, 0x3412, ntohs);
+  TEST (foo, 0x3412, (ntohs));
+
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/if_index.c b/ap/libc/glibc/glibc-2.22/inet/if_index.c
new file mode 100644
index 0000000..73b1efe
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/if_index.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <net/if.h>
+#include <errno.h>
+#include <stddef.h>
+
+unsigned int
+__if_nametoindex (const char *ifname)
+{
+  __set_errno (ENOSYS);
+  return 0;
+}
+libc_hidden_def (__if_nametoindex)
+weak_alias (__if_nametoindex, if_nametoindex)
+libc_hidden_weak (if_nametoindex)
+stub_warning (if_nametoindex)
+
+char *
+__if_indextoname (unsigned int ifindex, char *ifname)
+{
+  __set_errno (ENOSYS);
+  return NULL;
+}
+weak_alias (__if_indextoname, if_indextoname)
+libc_hidden_weak (if_indextoname)
+stub_warning (if_indextoname)
+
+void
+__if_freenameindex (struct if_nameindex *ifn)
+{
+}
+libc_hidden_def (__if_freenameindex)
+weak_alias (__if_freenameindex, if_freenameindex)
+libc_hidden_weak (if_freenameindex)
+stub_warning (if_freenameindex)
+
+struct if_nameindex *
+__if_nameindex (void)
+{
+  __set_errno (ENOSYS);
+  return NULL;
+}
+weak_alias (__if_nameindex, if_nameindex)
+libc_hidden_weak (if_nameindex)
+stub_warning (if_nameindex)
+
+#if 0
+void
+internal_function
+__protocol_available (int *have_inet, int *have_inet6)
+{
+  /* By default we assume that IPv4 is available, IPv6 not.  */
+  *have_inet = 1;
+  *have_inet6 = 0;
+}
+#endif
diff --git a/ap/libc/glibc/glibc-2.22/inet/ifaddrs.c b/ap/libc/glibc/glibc-2.22/inet/ifaddrs.c
new file mode 100644
index 0000000..3b47804
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ifaddrs.c
@@ -0,0 +1,47 @@
+/* getifaddrs -- get names and addresses of all network interfaces
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ifaddrs.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* Create a linked list of `struct ifaddrs' structures, one for each
+   network interface on the host machine.  If successful, store the
+   list in *IFAP and return 0.  On errors, return -1 and set `errno'.  */
+int
+__getifaddrs (struct ifaddrs **ifap)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+weak_alias (__getifaddrs, getifaddrs)
+libc_hidden_weak (getifaddrs)
+stub_warning (getifaddrs)
+
+void
+__freeifaddrs (struct ifaddrs *ifa)
+{
+  if (ifa == NULL)
+    return;			/* a la free, why not? */
+
+  /* Can't be called properly if getifaddrs never succeeded.  */
+  abort ();
+}
+weak_alias (__freeifaddrs, freeifaddrs)
+libc_hidden_weak (freeifaddrs)
+stub_warning (freeifaddrs)
diff --git a/ap/libc/glibc/glibc-2.22/inet/ifaddrs.h b/ap/libc/glibc/glibc-2.22/inet/ifaddrs.h
new file mode 100644
index 0000000..222a0a1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ifaddrs.h
@@ -0,0 +1,73 @@
+/* ifaddrs.h -- declarations for getting network interface addresses
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _IFADDRS_H
+#define _IFADDRS_H	1
+
+#include <features.h>
+#include <sys/socket.h>
+
+__BEGIN_DECLS
+
+/* The `getifaddrs' function generates a linked list of these structures.
+   Each element of the list describes one network interface.  */
+struct ifaddrs
+{
+  struct ifaddrs *ifa_next;	/* Pointer to the next structure.  */
+
+  char *ifa_name;		/* Name of this network interface.  */
+  unsigned int ifa_flags;	/* Flags as from SIOCGIFFLAGS ioctl.  */
+
+  struct sockaddr *ifa_addr;	/* Network address of this interface.  */
+  struct sockaddr *ifa_netmask; /* Netmask of this interface.  */
+  union
+  {
+    /* At most one of the following two is valid.  If the IFF_BROADCAST
+       bit is set in `ifa_flags', then `ifa_broadaddr' is valid.  If the
+       IFF_POINTOPOINT bit is set, then `ifa_dstaddr' is valid.
+       It is never the case that both these bits are set at once.  */
+    struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
+    struct sockaddr *ifu_dstaddr; /* Point-to-point destination address.  */
+  } ifa_ifu;
+  /* These very same macros are defined by <net/if.h> for `struct ifaddr'.
+     So if they are defined already, the existing definitions will be fine.  */
+# ifndef ifa_broadaddr
+#  define ifa_broadaddr	ifa_ifu.ifu_broadaddr
+# endif
+# ifndef ifa_dstaddr
+#  define ifa_dstaddr	ifa_ifu.ifu_dstaddr
+# endif
+
+  void *ifa_data;		/* Address-specific data (may be unused).  */
+};
+
+
+/* Create a linked list of `struct ifaddrs' structures, one for each
+   network interface on the host machine.  If successful, store the
+   list in *IFAP and return 0.  On errors, return -1 and set `errno'.
+
+   The storage returned in *IFAP is allocated dynamically and can
+   only be properly freed by passing it to `freeifaddrs'.  */
+extern int getifaddrs (struct ifaddrs **__ifap) __THROW;
+
+/* Reclaim the storage allocated by a previous `getifaddrs' call.  */
+extern void freeifaddrs (struct ifaddrs *__ifa)  __THROW;
+
+__END_DECLS
+
+#endif /* ifaddrs.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/ifreq.c b/ap/libc/glibc/glibc-2.22/inet/ifreq.c
new file mode 100644
index 0000000..398e445
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ifreq.c
@@ -0,0 +1,26 @@
+/* Collect network interface list.  Stub version.
+   Copyright (C) 2013-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "ifreq.h"
+
+void
+__ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
+{
+  *num_ifs = 0;
+  *ifreqs = NULL;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/in6_addr.c b/ap/libc/glibc/glibc-2.22/inet/in6_addr.c
new file mode 100644
index 0000000..fb77290
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/in6_addr.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <netinet/in.h>
+
+const struct in6_addr __in6addr_any =
+{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
+libc_hidden_data_def (__in6addr_any)
+weak_alias (__in6addr_any, in6addr_any)
+libc_hidden_data_weak (in6addr_any)
+const struct in6_addr __in6addr_loopback =
+{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
+libc_hidden_data_def (__in6addr_loopback)
+weak_alias (__in6addr_loopback, in6addr_loopback)
+libc_hidden_data_weak (in6addr_loopback)
diff --git a/ap/libc/glibc/glibc-2.22/inet/inet6_opt.c b/ap/libc/glibc/glibc-2.22/inet/inet6_opt.c
new file mode 100644
index 0000000..9a6bb0a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/inet6_opt.c
@@ -0,0 +1,281 @@
+/* Copyright (C) 2006-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <string.h>
+#include <netinet/in.h>
+#include <netinet/ip6.h>
+
+
+/* RFC 3542, 10.1
+
+   This function returns the number of bytes needed for the empty
+   extension header i.e., without any options.  If EXTBUF is not NULL it
+   also initializes the extension header to have the correct length
+   field.  In that case if the EXTLEN value is not a positive (i.e.,
+   non-zero) multiple of 8 the function fails and returns -1.  */
+int
+inet6_opt_init (void *extbuf, socklen_t extlen)
+{
+  if (extbuf != NULL)
+    {
+      if (extlen <= 0 || (extlen % 8) != 0 || extlen > 256 * 8)
+	return -1;
+
+      /* Fill in the length in units of 8 octets.  */
+      struct ip6_hbh *extp = (struct ip6_hbh *) extbuf;
+
+      /* RFC 2460 requires that the header extension length is the
+	 length of the option header in 8-byte units, not including
+	 the first 8 bytes.  Hence we have to subtract one.  */
+      extp->ip6h_len = extlen / 8 - 1;
+    }
+
+  return sizeof (struct ip6_hbh);
+}
+
+
+static void
+add_padding (uint8_t *extbuf, int offset, int npad)
+{
+  if (npad == 1)
+    extbuf[offset] = IP6OPT_PAD1;
+  else if (npad > 0)
+    {
+      struct ip6_opt *pad_opt = (struct ip6_opt *) (extbuf + offset);
+
+      pad_opt->ip6o_type = IP6OPT_PADN;
+      pad_opt->ip6o_len = npad - sizeof (struct ip6_opt);
+      /* Clear the memory used by the padding.  */
+      memset (pad_opt + 1, '\0', pad_opt->ip6o_len);
+    }
+}
+
+
+
+/* RFC 3542, 10.2
+
+   This function returns the updated total length taking into account
+   adding an option with length 'len' and alignment 'align'.  If
+   EXTBUF is not NULL then, in addition to returning the length, the
+   function inserts any needed pad option, initializes the option
+   (setting the type and length fields) and returns a pointer to the
+   location for the option content in databufp.  If the option does
+   not fit in the extension header buffer the function returns -1.  */
+int
+inet6_opt_append (void *extbuf, socklen_t extlen, int offset, uint8_t type,
+		  socklen_t len, uint8_t align, void **databufp)
+{
+  /* Check minimum offset.  */
+  if (offset < sizeof (struct ip6_hbh))
+    return -1;
+
+  /* One cannot add padding options.  */
+  if (type == IP6OPT_PAD1 || type == IP6OPT_PADN)
+    return -1;
+
+  /* The option length must fit in one octet.  */
+  if (len > 255)
+    return -1;
+
+  /* The alignment can only by 1, 2, 4, or 8 and must not exceed the
+     option length.  */
+  if (align == 0 || align > 8 || (align & (align - 1)) != 0 || align > len)
+    return -1;
+
+  /* Determine the needed padding for alignment.  Following the
+     current content of the buffer we have the is the IPv6 option type
+     and length, followed immediately by the data.  The data has the
+     alignment constraints.  Therefore padding must be inserted in the
+     form of padding options before the new option. */
+  int data_offset = offset + sizeof (struct ip6_opt);
+  int npad = (align - data_offset % align) & (align - 1);
+
+  if (extbuf != NULL)
+    {
+      /* Now we can check whether the buffer is large enough.  */
+      if (data_offset + npad + len > extlen)
+	return -1;
+
+      add_padding (extbuf, offset, npad);
+
+      offset += npad;
+
+      /* Now prepare the option itself.  */
+      struct ip6_opt *opt = (struct ip6_opt *) ((uint8_t *) extbuf + offset);
+
+      opt->ip6o_type = type;
+      opt->ip6o_len = len;
+
+      *databufp = opt + 1;
+    }
+  else
+    offset += npad;
+
+  return offset + sizeof (struct ip6_opt) + len;
+}
+
+
+/* RFC 3542, 10.3
+
+   This function returns the updated total length taking into account
+   the final padding of the extension header to make it a multiple of
+   8 bytes.  If EXTBUF is not NULL the function also initializes the
+   option by inserting a Pad1 or PadN option of the proper length.  */
+int
+inet6_opt_finish (void *extbuf, socklen_t extlen, int offset)
+{
+  /* Check minimum offset.  */
+  if (offset < sizeof (struct ip6_hbh))
+    return -1;
+
+  /* Required padding at the end.  */
+  int npad = (8 - (offset & 7)) & 7;
+
+  if (extbuf != NULL)
+    {
+      /* Make sure the buffer is large enough.  */
+      if (offset + npad > extlen)
+	return -1;
+
+      add_padding (extbuf, offset, npad);
+    }
+
+  return offset + npad;
+}
+
+
+/* RFC 3542, 10.4
+
+   This function inserts data items of various sizes in the data
+   portion of the option.  VAL should point to the data to be
+   inserted.  OFFSET specifies where in the data portion of the option
+   the value should be inserted; the first byte after the option type
+   and length is accessed by specifying an offset of zero.  */
+int
+inet6_opt_set_val (void *databuf, int offset, void *val, socklen_t vallen)
+{
+  memcpy ((uint8_t *) databuf + offset, val, vallen);
+
+  return offset + vallen;
+}
+
+
+/* RFC 3542, 10.5
+
+   This function parses received option extension headers returning
+   the next option.  EXTBUF and EXTLEN specifies the extension header.
+   OFFSET should either be zero (for the first option) or the length
+   returned by a previous call to 'inet6_opt_next' or
+   'inet6_opt_find'.  It specifies the position where to continue
+   scanning the extension buffer.  */
+int
+inet6_opt_next (void *extbuf, socklen_t extlen, int offset, uint8_t *typep,
+		socklen_t *lenp, void **databufp)
+{
+  if (offset == 0)
+    offset = sizeof (struct ip6_hbh);
+  else if (offset < sizeof (struct ip6_hbh))
+    return -1;
+
+  while (offset < extlen)
+    {
+      struct ip6_opt *opt = (struct ip6_opt *) ((uint8_t *) extbuf + offset);
+
+      if (opt->ip6o_type == IP6OPT_PAD1)
+	/* Single byte padding.  */
+	++offset;
+      else if (opt->ip6o_type == IP6OPT_PADN)
+	offset += sizeof (struct ip6_opt) + opt->ip6o_len;
+      else
+	{
+	  /* Check whether the option is valid.  */
+	  offset += sizeof (struct ip6_opt) + opt->ip6o_len;
+	  if (offset > extlen)
+	    return -1;
+
+	  *typep = opt->ip6o_type;
+	  *lenp = opt->ip6o_len;
+	  *databufp = opt + 1;
+	  return offset;
+	}
+    }
+
+  return -1;
+}
+
+
+/* RFC 3542, 10.6
+
+   This function is similar to the previously described
+   'inet6_opt_next' function, except this function lets the caller
+   specify the option type to be searched for, instead of always
+   returning the next option in the extension header.  */
+int
+inet6_opt_find (void *extbuf, socklen_t extlen, int offset, uint8_t type,
+		socklen_t *lenp, void **databufp)
+{
+  if (offset == 0)
+    offset = sizeof (struct ip6_hbh);
+  else if (offset < sizeof (struct ip6_hbh))
+    return -1;
+
+  while (offset < extlen)
+    {
+      struct ip6_opt *opt = (struct ip6_opt *) ((uint8_t *) extbuf + offset);
+
+      if (opt->ip6o_type == IP6OPT_PAD1)
+	{
+	  /* Single byte padding.  */
+	  ++offset;
+	  if (type == IP6OPT_PAD1)
+	    {
+	      *lenp = 0;
+	      *databufp = (uint8_t *) extbuf + offset;
+	      return offset;
+	    }
+	}
+      else if (opt->ip6o_type != type)
+	offset += sizeof (struct ip6_opt) + opt->ip6o_len;
+      else
+	{
+	  /* Check whether the option is valid.  */
+	  offset += sizeof (struct ip6_opt) + opt->ip6o_len;
+	  if (offset > extlen)
+	    return -1;
+
+	  *lenp = opt->ip6o_len;
+	  *databufp = opt + 1;
+	  return offset;
+	}
+    }
+
+  return -1;
+}
+
+
+/* RFC 3542, 10.7
+
+   This function extracts data items of various sizes in the data
+   portion of the option.  */
+int
+inet6_opt_get_val (void *databuf, int offset, void *val, socklen_t vallen)
+{
+  memcpy (val, (uint8_t *) databuf + offset, vallen);
+
+  return offset + vallen;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/inet6_option.c b/ap/libc/glibc/glibc-2.22/inet/inet6_option.c
new file mode 100644
index 0000000..47ca82f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/inet6_option.c
@@ -0,0 +1,365 @@
+/* Copyright (C) 2003-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <string.h>
+#include <netinet/in.h>
+#include <netinet/ip6.h>
+#include <sys/param.h>
+
+
+static void
+internal_function
+add_pad (struct cmsghdr *cmsg, int len)
+{
+  unsigned char *p = CMSG_DATA (cmsg) + cmsg->cmsg_len - CMSG_LEN (0);
+
+  if (len == 1)
+    /* Special handling for 1, a one-byte solution.  */
+    *p++ = IP6OPT_PAD1;
+  else if (len != 0)
+    {
+      /* Multibyte padding.  */
+      *p++ = IP6OPT_PADN;
+      *p++ = len - 2;	/* Discount the two header bytes.  */
+      /* The rest is filled with zero.  */
+      memset (p, '\0', len - 2);
+      p += len - 2;
+    }
+
+  /* Account for the bytes.  */
+  cmsg->cmsg_len += len;
+}
+
+
+static int
+get_opt_end (const uint8_t **result, const uint8_t *startp,
+	     const uint8_t *endp)
+{
+  if (startp >= endp)
+    /* Out of bounds.  */
+    return -1;
+
+  if (*startp == IP6OPT_PAD1)
+    {
+      /* Just this one byte.  */
+      *result = startp + 1;
+      return 0;
+    }
+
+  /* Now we know there must be at least two bytes.  */
+  if (startp + 2 > endp
+      /* Now we can get the length byte.  */
+      || startp + startp[1] + 2 > endp)
+    return -1;
+
+  *result = startp + startp[1] + 2;
+
+  return 0;
+}
+
+
+static uint8_t *option_alloc (struct cmsghdr *cmsg, int datalen, int multx,
+			      int plusy);
+
+
+/* RFC 2292, 6.3.1
+
+   This function returns the number of bytes required to hold an option
+   when it is stored as ancillary data, including the cmsghdr structure
+   at the beginning, and any padding at the end (to make its size a
+   multiple of 8 bytes).  The argument is the size of the structure
+   defining the option, which must include any pad bytes at the
+   beginning (the value y in the alignment term "xn + y"), the type
+   byte, the length byte, and the option data.  */
+int
+inet6_option_space (nbytes)
+     int nbytes;
+{
+  /* Add room for the extension header.  */
+  nbytes += sizeof (struct ip6_ext);
+
+  return CMSG_SPACE (roundup (nbytes, 8));
+}
+link_warning (inet6_option_space,
+	      "inet6_option_space is obsolete, use the RFC 3542 interfaces")
+
+
+/* RFC 2292, 6.3.2
+
+   This function is called once per ancillary data object that will
+   contain either Hop-by-Hop or Destination options.  It returns 0 on
+   success or -1 on an error.  */
+int
+inet6_option_init (bp, cmsgp, type)
+     void *bp;
+     struct cmsghdr **cmsgp;
+     int type;
+{
+  /* Only Hop-by-Hop or Destination options allowed.  */
+  if (type != IPV6_HOPOPTS && type != IPV6_DSTOPTS)
+    return -1;
+
+  /* BP is a pointer to the previously allocated space.  */
+  struct cmsghdr *newp = (struct cmsghdr *) bp;
+
+  /* Initialize the message header.
+
+     Length: No data yet, only the cmsghdr struct.  */
+  newp->cmsg_len = CMSG_LEN (0);
+  /* Originating protocol: obviously IPv6.  */
+  newp->cmsg_level = IPPROTO_IPV6;
+  /* Message type.  */
+  newp->cmsg_type = type;
+
+  /* Pass up the result.  */
+  *cmsgp = newp;
+
+  return 0;
+}
+link_warning (inet6_option_init,
+	      "inet6_option_init is obsolete, use the RFC 3542 interfaces")
+
+
+/* RFC 2292, 6.3.3
+
+   This function appends a Hop-by-Hop option or a Destination option
+   into an ancillary data object that has been initialized by
+   inet6_option_init().  This function returns 0 if it succeeds or -1 on
+   an error.  */
+int
+inet6_option_append (cmsg, typep, multx, plusy)
+     struct cmsghdr *cmsg;
+     const uint8_t *typep;
+     int multx;
+     int plusy;
+{
+  /* typep is a pointer to the 8-bit option type.  It is assumed that this
+     field is immediately followed by the 8-bit option data length field,
+     which is then followed immediately by the option data.
+
+     The option types IP6OPT_PAD1 and IP6OPT_PADN also must be handled.  */
+  int len = typep[0] == IP6OPT_PAD1 ? 1 : typep[1] + 2;
+
+  /* Get the pointer to the space in the message.  */
+  uint8_t *ptr = option_alloc (cmsg, len, multx, plusy);
+  if (ptr == NULL)
+    /* Some problem with the parameters.  */
+    return -1;
+
+  /* Copy the content.  */
+  memcpy (ptr, typep, len);
+
+  return 0;
+}
+link_warning (inet6_option_append,
+	      "inet6_option_append is obsolete, use the RFC 3542 interfaces")
+
+
+/* RFC 2292, 6.3.4
+
+   This function appends a Hop-by-Hop option or a Destination option
+   into an ancillary data object that has been initialized by
+   inet6_option_init().  This function returns a pointer to the 8-bit
+   option type field that starts the option on success, or NULL on an
+   error.  */
+static uint8_t *
+option_alloc (struct cmsghdr *cmsg, int datalen, int multx, int plusy)
+{
+  /* The RFC limits the value of the alignment values.  */
+  if ((multx != 1 && multx != 2 && multx != 4 && multx != 8)
+      || ! (plusy >= 0 && plusy <= 7))
+    return NULL;
+
+  /* Current data size.  */
+  int dsize = cmsg->cmsg_len - CMSG_LEN (0);
+
+  /* The first two bytes of the option are for the extended header.  */
+  if (__glibc_unlikely (dsize == 0))
+    {
+      cmsg->cmsg_len += sizeof (struct ip6_ext);
+      dsize = sizeof (struct ip6_ext);
+    }
+
+  /* First add padding.  */
+  add_pad (cmsg, ((multx - (dsize & (multx - 1))) & (multx - 1)) + plusy);
+
+  /* Return the pointer to the start of the option space.  */
+  uint8_t *result = CMSG_DATA (cmsg) + cmsg->cmsg_len - CMSG_LEN (0);
+  cmsg->cmsg_len += datalen;
+
+  /* The extended option header length is measured in 8-byte groups.
+     To represent the current length we might have to add padding.  */
+  dsize = cmsg->cmsg_len - CMSG_LEN (0);
+  add_pad (cmsg, (8 - (dsize & (8 - 1))) & (8 - 1));
+
+  /* Record the new length of the option.  */
+  assert (((cmsg->cmsg_len - CMSG_LEN (0)) % 8) == 0);
+  int len8b = (cmsg->cmsg_len - CMSG_LEN (0)) / 8 - 1;
+  if (len8b >= 256)
+    /* Too long.  */
+    return NULL;
+
+  struct ip6_ext *ie = (void *) CMSG_DATA (cmsg);
+  ie->ip6e_len = len8b;
+
+  return result;
+}
+
+
+uint8_t *
+inet6_option_alloc (cmsg, datalen, multx, plusy)
+     struct cmsghdr *cmsg;
+     int datalen;
+     int multx;
+     int plusy;
+{
+  return option_alloc (cmsg, datalen, multx, plusy);
+}
+link_warning (inet6_option_alloc,
+	      "inet6_option_alloc is obsolete, use the RFC 3542 interfaces")
+
+
+/* RFC 2292, 6.3.5
+
+   This function processes the next Hop-by-Hop option or Destination
+   option in an ancillary data object.  If another option remains to be
+   processed, the return value of the function is 0 and *tptrp points to
+   the 8-bit option type field (which is followed by the 8-bit option
+   data length, followed by the option data).  If no more options remain
+   to be processed, the return value is -1 and *tptrp is NULL.  If an
+   error occurs, the return value is -1 and *tptrp is not NULL.  */
+int
+inet6_option_next (cmsg, tptrp)
+     const struct cmsghdr *cmsg;
+     uint8_t **tptrp;
+{
+  /* Make sure it is an option of the right type.  */
+  if (cmsg->cmsg_level != IPPROTO_IPV6
+      || (cmsg->cmsg_type != IPV6_HOPOPTS && cmsg->cmsg_type != IPV6_DSTOPTS))
+    return -1;
+
+  /* Pointer to the extension header.  We only compute the address, we
+     don't access anything yet.  */
+  const struct ip6_ext *ip6e = (const struct ip6_ext *) CMSG_DATA (cmsg);
+
+  /* Make sure the message is long enough.  */
+  if (cmsg->cmsg_len < CMSG_LEN (sizeof (struct ip6_ext))
+      /* Now we can access the extension header.  */
+      || cmsg->cmsg_len < CMSG_LEN ((ip6e->ip6e_len + 1) * 8))
+    /* Too small.  */
+    return -1;
+
+  /* Determine the address of the byte past the message.  */
+  const uint8_t *endp = CMSG_DATA (cmsg) + (ip6e->ip6e_len + 1) * 8;
+
+  const uint8_t *result;
+  if (*tptrp == NULL)
+    /* This is the first call, return the first option if there is one.  */
+    result = (const uint8_t *) (ip6e + 1);
+  else
+    {
+      /* Make sure *TPTRP points to a beginning of a new option in
+	 the message.  The upper limit is checked in get_opt_end.  */
+      if (*tptrp < (const uint8_t *) (ip6e + 1))
+	return -1;
+
+      /* Get the beginning of the next option.  */
+      if (get_opt_end (&result, *tptrp, endp) != 0)
+	return -1;
+    }
+
+  /* We know where the next option starts.  */
+  *tptrp = (uint8_t *) result;
+
+  /* Check the option is fully represented in the message.  */
+  return get_opt_end (&result, result, endp);
+}
+link_warning (inet6_option_next,
+	      "inet6_option_next is obsolete, use the RFC 3542 interfaces")
+
+
+/* RFC 2292, 6.3.6
+
+   This function is similar to the previously described
+   inet6_option_next() function, except this function lets the caller
+   specify the option type to be searched for, instead of always
+   returning the next option in the ancillary data object.  cmsg is a
+   pointer to cmsghdr structure of which cmsg_level equals IPPROTO_IPV6
+   and cmsg_type equals either IPV6_HOPOPTS or IPV6_DSTOPTS.  */
+int
+inet6_option_find (cmsg, tptrp, type)
+     const struct cmsghdr *cmsg;
+     uint8_t **tptrp;
+     int type;
+{
+  /* Make sure it is an option of the right type.  */
+  if (cmsg->cmsg_level != IPPROTO_IPV6
+      || (cmsg->cmsg_type != IPV6_HOPOPTS && cmsg->cmsg_type != IPV6_DSTOPTS))
+    return -1;
+
+  /* Pointer to the extension header.  We only compute the address, we
+     don't access anything yet.  */
+  const struct ip6_ext *ip6e = (const struct ip6_ext *) CMSG_DATA (cmsg);
+
+  /* Make sure the message is long enough.  */
+  if (cmsg->cmsg_len < CMSG_LEN (sizeof (struct ip6_ext))
+      /* Now we can access the extension header.  */
+      || cmsg->cmsg_len < CMSG_LEN ((ip6e->ip6e_len + 1) * 8))
+    /* Too small.  */
+    return -1;
+
+  /* Determine the address of the byte past the message.  */
+  const uint8_t *endp = CMSG_DATA (cmsg) + (ip6e->ip6e_len + 1) * 8;
+
+  const uint8_t *next;
+  if (*tptrp == NULL)
+    /* This is the first call, return the first option if there is one.  */
+    next = (const uint8_t *) (ip6e + 1);
+  else
+    {
+      /* Make sure *TPTRP points to a beginning of a new option in
+	 the message.  The upper limit is checked in get_opt_end.  */
+      if (*tptrp < (const uint8_t *) (ip6e + 1))
+	return -1;
+
+      /* Get the beginning of the next option.  */
+      if (get_opt_end (&next, *tptrp, endp) != 0)
+	return -1;
+    }
+
+  /* Now search for the appropriate typed entry.  */
+  const uint8_t *result;
+  do
+    {
+      result = next;
+
+      /* Get the end of this entry.  */
+      if (get_opt_end (&next, result, endp) != 0)
+	return -1;
+    }
+  while (*result != type);
+
+  /* We know where the next option starts.  */
+  *tptrp = (uint8_t *) result;
+
+  /* Success.  */
+  return 0;
+}
+link_warning (inet6_option_find,
+	      "inet6_option_find is obsolete, use the RFC 3542 interfaces")
diff --git a/ap/libc/glibc/glibc-2.22/inet/inet6_rth.c b/ap/libc/glibc/glibc-2.22/inet/inet6_rth.c
new file mode 100644
index 0000000..4094b7d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/inet6_rth.c
@@ -0,0 +1,196 @@
+/* Copyright (C) 2006-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <string.h>
+#include <netinet/in.h>
+#include <netinet/ip6.h>
+
+
+/* RFC 3542, 7.1
+
+   This function returns the number of bytes required to hold a
+   Routing header of the specified type containing the specified
+   number of segments (addresses).  For an IPv6 Type 0 Routing header,
+   the number of segments must be between 0 and 127, inclusive.  */
+socklen_t
+inet6_rth_space (int type, int segments)
+{
+  switch (type)
+    {
+    case IPV6_RTHDR_TYPE_0:
+      if (segments < 0 || segments > 127)
+	return 0;
+
+      return sizeof (struct ip6_rthdr0) + segments * sizeof (struct in6_addr);
+    }
+
+  return 0;
+}
+
+
+/* RFC 3542, 7.2
+
+   This function initializes the buffer pointed to by BP to contain a
+   Routing header of the specified type and sets ip6r_len based on the
+   segments parameter.  */
+void *
+inet6_rth_init (void *bp, socklen_t bp_len, int type, int segments)
+{
+  struct ip6_rthdr *rthdr = (struct ip6_rthdr *) bp;
+
+  switch (type)
+    {
+    case IPV6_RTHDR_TYPE_0:
+      /* Make sure the parameters are valid and the buffer is large enough.  */
+      if (segments < 0 || segments > 127)
+	break;
+
+      socklen_t len = (sizeof (struct ip6_rthdr0)
+		       + segments * sizeof (struct in6_addr));
+      if (len > bp_len)
+	break;
+
+      /* Some implementations seem to initialize the whole memory area.  */
+      memset (bp, '\0', len);
+
+      /* Length in units of 8 octets.  */
+      rthdr->ip6r_len = segments * sizeof (struct in6_addr) / 8;
+      rthdr->ip6r_type = IPV6_RTHDR_TYPE_0;
+      return bp;
+    }
+
+  return NULL;
+}
+
+
+/* RFC 3542, 7.3
+
+   This function adds the IPv6 address pointed to by addr to the end of
+   the Routing header being constructed.  */
+int
+inet6_rth_add (void *bp, const struct in6_addr *addr)
+{
+  struct ip6_rthdr *rthdr = (struct ip6_rthdr *) bp;
+
+  switch (rthdr->ip6r_type)
+    {
+      struct ip6_rthdr0 *rthdr0;
+    case IPV6_RTHDR_TYPE_0:
+      rthdr0 = (struct ip6_rthdr0 *) rthdr;
+      if (rthdr0->ip6r0_len * 8 / sizeof (struct in6_addr)
+	  - rthdr0->ip6r0_segleft < 1)
+        return -1;
+
+      memcpy (&rthdr0->ip6r0_addr[rthdr0->ip6r0_segleft++],
+	      addr, sizeof (struct in6_addr));
+
+      return 0;
+    }
+
+  return -1;
+}
+
+
+/* RFC 3542, 7.4
+
+   This function takes a Routing header extension header (pointed to by
+   the first argument) and writes a new Routing header that sends
+   datagrams along the reverse of that route.  The function reverses the
+   order of the addresses and sets the segleft member in the new Routing
+   header to the number of segments.  */
+int
+inet6_rth_reverse (const void *in, void *out)
+{
+  struct ip6_rthdr *in_rthdr = (struct ip6_rthdr *) in;
+
+  switch (in_rthdr->ip6r_type)
+    {
+      struct ip6_rthdr0 *in_rthdr0;
+      struct ip6_rthdr0 *out_rthdr0;
+    case IPV6_RTHDR_TYPE_0:
+      in_rthdr0 = (struct ip6_rthdr0 *) in;
+      out_rthdr0 = (struct ip6_rthdr0 *) out;
+
+      /* Copy header, not the addresses.  The memory regions can overlap.  */
+      memmove (out_rthdr0, in_rthdr0, sizeof (struct ip6_rthdr0));
+
+      int total = in_rthdr0->ip6r0_len * 8 / sizeof (struct in6_addr);
+      for (int i = 0; i < total / 2; ++i)
+	{
+	  /* Remember, IN_RTHDR0 and OUT_RTHDR0 might overlap.  */
+	  struct in6_addr temp = in_rthdr0->ip6r0_addr[i];
+	  out_rthdr0->ip6r0_addr[i] = in_rthdr0->ip6r0_addr[total - 1 - i];
+	  out_rthdr0->ip6r0_addr[total - 1 - i] = temp;
+	}
+      if (total % 2 != 0 && in != out)
+	out_rthdr0->ip6r0_addr[total / 2] = in_rthdr0->ip6r0_addr[total / 2];
+
+      out_rthdr0->ip6r0_segleft = total;
+
+      return 0;
+    }
+
+  return -1;
+}
+
+
+/* RFC 3542, 7.5
+
+   This function returns the number of segments (addresses) contained in
+   the Routing header described by BP.  */
+int
+inet6_rth_segments (const void *bp)
+{
+  struct ip6_rthdr *rthdr = (struct ip6_rthdr *) bp;
+
+  switch (rthdr->ip6r_type)
+    {
+    case IPV6_RTHDR_TYPE_0:
+
+      return rthdr->ip6r_len * 8 / sizeof (struct in6_addr);
+    }
+
+  return -1;
+}
+
+
+/* RFC 3542, 7.6
+
+   This function returns a pointer to the IPv6 address specified by
+   index (which must have a value between 0 and one less than the
+   value returned by 'inet6_rth_segments') in the Routing header
+   described by BP.  */
+struct in6_addr *
+inet6_rth_getaddr (const void *bp, int index)
+{
+  struct ip6_rthdr *rthdr = (struct ip6_rthdr *) bp;
+
+  switch (rthdr->ip6r_type)
+    {
+       struct ip6_rthdr0 *rthdr0;
+    case IPV6_RTHDR_TYPE_0:
+      rthdr0 = (struct ip6_rthdr0 *) rthdr;
+
+      if (index >= rthdr0->ip6r0_len * 8 / sizeof (struct in6_addr))
+	break;
+
+      return &rthdr0->ip6r0_addr[index];
+    }
+
+  return NULL;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/inet_lnaof.c b/ap/libc/glibc/glibc-2.22/inet/inet_lnaof.c
new file mode 100644
index 0000000..c993c8b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/inet_lnaof.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)inet_lnaof.c	8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+/*
+ * Return the local network address portion of an
+ * internet address; handles class a/b/c network
+ * number formats.
+ */
+in_addr_t
+inet_lnaof(in)
+	struct in_addr in;
+{
+	u_int32_t i = ntohl(in.s_addr);
+
+	if (IN_CLASSA(i))
+		return ((i)&IN_CLASSA_HOST);
+	else if (IN_CLASSB(i))
+		return ((i)&IN_CLASSB_HOST);
+	else
+		return ((i)&IN_CLASSC_HOST);
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/inet_mkadr.c b/ap/libc/glibc/glibc-2.22/inet/inet_mkadr.c
new file mode 100644
index 0000000..580a9cd
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/inet_mkadr.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)inet_makeaddr.c	8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+/*
+ * Formulate an Internet address from network + host.  Used in
+ * building addresses stored in the ifnet structure.
+ */
+struct in_addr
+__inet_makeaddr(net, host)
+	in_addr_t net, host;
+{
+	struct in_addr in;
+
+	if (net < 128)
+		in.s_addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
+	else if (net < 65536)
+		in.s_addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
+	else if (net < 16777216L)
+		in.s_addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
+	else
+		in.s_addr = net | host;
+	in.s_addr = htonl(in.s_addr);
+	return in;
+}
+libc_hidden_def (__inet_makeaddr)
+weak_alias (__inet_makeaddr, inet_makeaddr)
diff --git a/ap/libc/glibc/glibc-2.22/inet/inet_net.c b/ap/libc/glibc/glibc-2.22/inet/inet_net.c
new file mode 100644
index 0000000..b28fdb1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/inet_net.c
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ */
+
+/* Copyright (C) 2013-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)inet_network.c	8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <ctype.h>
+
+/*
+ * Internet network address interpretation routine.
+ * The library routines call this routine to interpret
+ * network numbers.
+ */
+u_int32_t
+inet_network(cp)
+	const char *cp;
+{
+	u_int32_t val, base, n, i;
+	char c;
+	u_int32_t parts[4], *pp = parts;
+	int digit;
+
+again:
+	val = 0; base = 10; digit = 0;
+	if (*cp == '0')
+		digit = 1, base = 8, cp++;
+	if (*cp == 'x' || *cp == 'X')
+		digit = 0, base = 16, cp++;
+	while ((c = *cp) != 0) {
+		if (isdigit(c)) {
+			if (base == 8 && (c == '8' || c == '9'))
+				return (INADDR_NONE);
+			val = (val * base) + (c - '0');
+			cp++;
+			digit = 1;
+			continue;
+		}
+		if (base == 16 && isxdigit(c)) {
+			val = (val << 4) + (tolower (c) + 10 - 'a');
+			cp++;
+			digit = 1;
+			continue;
+		}
+		break;
+	}
+	if (!digit)
+		return (INADDR_NONE);
+	if (pp >= parts + 4 || val > 0xff)
+		return (INADDR_NONE);
+	if (*cp == '.') {
+		*pp++ = val, cp++;
+		goto again;
+	}
+	while (isspace(*cp))
+		cp++;
+	if (*cp)
+		return (INADDR_NONE);
+	if (pp >= parts + 4 || val > 0xff)
+		return (INADDR_NONE);
+	*pp++ = val;
+	n = pp - parts;
+	for (val = 0, i = 0; i < n; i++) {
+		val <<= 8;
+		val |= parts[i] & 0xff;
+	}
+	return (val);
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/inet_netof.c b/ap/libc/glibc/glibc-2.22/inet/inet_netof.c
new file mode 100644
index 0000000..9b0aed9
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/inet_netof.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)inet_netof.c	8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+/*
+ * Return the network number from an internet
+ * address; handles class a/b/c network #'s.
+ */
+in_addr_t
+inet_netof(in)
+	struct in_addr in;
+{
+	u_int32_t i = ntohl(in.s_addr);
+
+	if (IN_CLASSA(i))
+		return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
+	else if (IN_CLASSB(i))
+		return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
+	else
+		return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
+}
+libc_hidden_def (inet_netof)
diff --git a/ap/libc/glibc/glibc-2.22/inet/inet_ntoa.c b/ap/libc/glibc/glibc-2.22/inet/inet_ntoa.c
new file mode 100644
index 0000000..306e12f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/inet_ntoa.c
@@ -0,0 +1,38 @@
+/* Convert Inet number to ASCII representation.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <arpa/inet.h>
+
+/* The interface of this function is completely stupid, it requires a
+   static buffer.  We relax this a bit in that we allow one buffer for
+   each thread.  */
+static __thread char buffer[18];
+
+
+char *
+inet_ntoa (struct in_addr in)
+{
+  unsigned char *bytes = (unsigned char *) &in;
+  __snprintf (buffer, sizeof (buffer), "%d.%d.%d.%d",
+	      bytes[0], bytes[1], bytes[2], bytes[3]);
+
+  return buffer;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/netgroup.h b/ap/libc/glibc/glibc-2.22/inet/netgroup.h
new file mode 100644
index 0000000..3022f5a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/netgroup.h
@@ -0,0 +1,85 @@
+/* Internal header for netgroup related functions.
+   Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NETGROUP_H
+#define _NETGROUP_H	1
+
+#include <nsswitch.h>
+
+/* A netgroup can consist of names of other netgroups.  We have to
+   track which netgroups were read and which still have to be read.  */
+struct name_list
+{
+  struct name_list *next;
+  char name[];
+};
+
+
+/* Dataset for iterating netgroups.  */
+struct __netgrent
+{
+  enum { triple_val, group_val } type;
+
+  union
+  {
+    struct
+    {
+      const char *host;
+      const char *user;
+      const char *domain;
+    }
+    triple;
+
+    const char *group;
+  } val;
+
+  /* Room for the data kept between the calls to the netgroup
+     functions.  We must avoid global variables.  */
+  char *data;
+  size_t data_size;
+  union
+  {
+    char *cursor;
+    unsigned long int position;
+  };
+  int first;
+
+  struct name_list *known_groups;
+  struct name_list *needed_groups;
+
+  /* This handle for the NSS data base is shared between all
+     set/get/endXXXent functions.  */
+  service_user *nip;
+};
+
+
+/* The internal netgroup handling functions might be called from outside.  */
+extern int __internal_setnetgrent (const char *group,
+				   struct __netgrent *datap)
+  internal_function;
+libc_hidden_proto (__internal_setnetgrent)
+extern void __internal_endnetgrent (struct __netgrent *datap)
+  internal_function;
+libc_hidden_proto (__internal_endnetgrent)
+extern int __internal_getnetgrent_r (char **hostp, char **userp,
+				     char **domainp, struct __netgrent *datap,
+				     char *buffer, size_t buflen, int *errnop)
+  internal_function;
+libc_hidden_proto (__internal_getnetgrent_r)
+
+#endif /* netgroup.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/netinet/ether.h b/ap/libc/glibc/glibc-2.22/inet/netinet/ether.h
new file mode 100644
index 0000000..f0e3821
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/netinet/ether.h
@@ -0,0 +1,53 @@
+/* Functions for storing Ethernet addresses in ASCII and mapping to hostnames.
+   Copyright (C) 1996-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NETINET_ETHER_H
+#define _NETINET_ETHER_H	1
+
+#include <features.h>
+
+/* Get definition of `struct ether_addr'.  */
+#include <netinet/if_ether.h>
+
+__BEGIN_DECLS
+
+/* Convert 48 bit Ethernet ADDRess to ASCII.  */
+extern char *ether_ntoa (const struct ether_addr *__addr) __THROW;
+extern char *ether_ntoa_r (const struct ether_addr *__addr, char *__buf)
+     __THROW;
+
+/* Convert ASCII string S to 48 bit Ethernet address.  */
+extern struct ether_addr *ether_aton (const char *__asc) __THROW;
+extern struct ether_addr *ether_aton_r (const char *__asc,
+					struct ether_addr *__addr) __THROW;
+
+/* Map 48 bit Ethernet number ADDR to HOSTNAME.  */
+extern int ether_ntohost (char *__hostname, const struct ether_addr *__addr)
+     __THROW;
+
+/* Map HOSTNAME to 48 bit Ethernet address.  */
+extern int ether_hostton (const char *__hostname, struct ether_addr *__addr)
+     __THROW;
+
+/* Scan LINE and set ADDR and HOSTNAME.  */
+extern int ether_line (const char *__line, struct ether_addr *__addr,
+		       char *__hostname) __THROW;
+
+__END_DECLS
+
+#endif /* netinet/ether.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/netinet/icmp6.h b/ap/libc/glibc/glibc-2.22/inet/netinet/icmp6.h
new file mode 100644
index 0000000..dfdf4bb
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/netinet/icmp6.h
@@ -0,0 +1,345 @@
+/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NETINET_ICMP6_H
+#define _NETINET_ICMP6_H 1
+
+#include <inttypes.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#define ICMP6_FILTER 1
+
+#define ICMP6_FILTER_BLOCK		1
+#define ICMP6_FILTER_PASS		2
+#define ICMP6_FILTER_BLOCKOTHERS	3
+#define ICMP6_FILTER_PASSONLY		4
+
+struct icmp6_filter
+  {
+    uint32_t icmp6_filt[8];
+  };
+
+struct icmp6_hdr
+  {
+    uint8_t     icmp6_type;   /* type field */
+    uint8_t     icmp6_code;   /* code field */
+    uint16_t    icmp6_cksum;  /* checksum field */
+    union
+      {
+	uint32_t  icmp6_un_data32[1]; /* type-specific field */
+	uint16_t  icmp6_un_data16[2]; /* type-specific field */
+	uint8_t   icmp6_un_data8[4];  /* type-specific field */
+      } icmp6_dataun;
+  };
+
+#define icmp6_data32    icmp6_dataun.icmp6_un_data32
+#define icmp6_data16    icmp6_dataun.icmp6_un_data16
+#define icmp6_data8     icmp6_dataun.icmp6_un_data8
+#define icmp6_pptr      icmp6_data32[0]  /* parameter prob */
+#define icmp6_mtu       icmp6_data32[0]  /* packet too big */
+#define icmp6_id        icmp6_data16[0]  /* echo request/reply */
+#define icmp6_seq       icmp6_data16[1]  /* echo request/reply */
+#define icmp6_maxdelay  icmp6_data16[0]  /* mcast group membership */
+
+#define ICMP6_DST_UNREACH             1
+#define ICMP6_PACKET_TOO_BIG          2
+#define ICMP6_TIME_EXCEEDED           3
+#define ICMP6_PARAM_PROB              4
+
+#define ICMP6_INFOMSG_MASK  0x80    /* all informational messages */
+
+#define ICMP6_ECHO_REQUEST          128
+#define ICMP6_ECHO_REPLY            129
+#define MLD_LISTENER_QUERY          130
+#define MLD_LISTENER_REPORT         131
+#define MLD_LISTENER_REDUCTION      132
+
+#define ICMP6_DST_UNREACH_NOROUTE     0 /* no route to destination */
+#define ICMP6_DST_UNREACH_ADMIN       1 /* communication with destination */
+                                        /* administratively prohibited */
+#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
+#define ICMP6_DST_UNREACH_ADDR        3 /* address unreachable */
+#define ICMP6_DST_UNREACH_NOPORT      4 /* bad port */
+
+#define ICMP6_TIME_EXCEED_TRANSIT     0 /* Hop Limit == 0 in transit */
+#define ICMP6_TIME_EXCEED_REASSEMBLY  1 /* Reassembly time out */
+
+#define ICMP6_PARAMPROB_HEADER        0 /* erroneous header field */
+#define ICMP6_PARAMPROB_NEXTHEADER    1 /* unrecognized Next Header */
+#define ICMP6_PARAMPROB_OPTION        2 /* unrecognized IPv6 option */
+
+#define ICMP6_FILTER_WILLPASS(type, filterp) \
+	((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
+
+#define ICMP6_FILTER_WILLBLOCK(type, filterp) \
+	((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
+
+#define ICMP6_FILTER_SETPASS(type, filterp) \
+	((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))))
+
+#define ICMP6_FILTER_SETBLOCK(type, filterp) \
+	((((filterp)->icmp6_filt[(type) >> 5]) |=  (1 << ((type) & 31))))
+
+#define ICMP6_FILTER_SETPASSALL(filterp) \
+	memset (filterp, 0, sizeof (struct icmp6_filter));
+
+#define ICMP6_FILTER_SETBLOCKALL(filterp) \
+	memset (filterp, 0xFF, sizeof (struct icmp6_filter));
+
+#define ND_ROUTER_SOLICIT           133
+#define ND_ROUTER_ADVERT            134
+#define ND_NEIGHBOR_SOLICIT         135
+#define ND_NEIGHBOR_ADVERT          136
+#define ND_REDIRECT                 137
+
+struct nd_router_solicit      /* router solicitation */
+  {
+    struct icmp6_hdr  nd_rs_hdr;
+    /* could be followed by options */
+  };
+
+#define nd_rs_type               nd_rs_hdr.icmp6_type
+#define nd_rs_code               nd_rs_hdr.icmp6_code
+#define nd_rs_cksum              nd_rs_hdr.icmp6_cksum
+#define nd_rs_reserved           nd_rs_hdr.icmp6_data32[0]
+
+struct nd_router_advert       /* router advertisement */
+  {
+    struct icmp6_hdr  nd_ra_hdr;
+    uint32_t   nd_ra_reachable;   /* reachable time */
+    uint32_t   nd_ra_retransmit;  /* retransmit timer */
+    /* could be followed by options */
+  };
+
+#define nd_ra_type               nd_ra_hdr.icmp6_type
+#define nd_ra_code               nd_ra_hdr.icmp6_code
+#define nd_ra_cksum              nd_ra_hdr.icmp6_cksum
+#define nd_ra_curhoplimit        nd_ra_hdr.icmp6_data8[0]
+#define nd_ra_flags_reserved     nd_ra_hdr.icmp6_data8[1]
+#define ND_RA_FLAG_MANAGED       0x80
+#define ND_RA_FLAG_OTHER         0x40
+#define ND_RA_FLAG_HOME_AGENT    0x20
+#define nd_ra_router_lifetime    nd_ra_hdr.icmp6_data16[1]
+
+struct nd_neighbor_solicit    /* neighbor solicitation */
+  {
+    struct icmp6_hdr  nd_ns_hdr;
+    struct in6_addr   nd_ns_target; /* target address */
+    /* could be followed by options */
+  };
+
+#define nd_ns_type               nd_ns_hdr.icmp6_type
+#define nd_ns_code               nd_ns_hdr.icmp6_code
+#define nd_ns_cksum              nd_ns_hdr.icmp6_cksum
+#define nd_ns_reserved           nd_ns_hdr.icmp6_data32[0]
+
+struct nd_neighbor_advert     /* neighbor advertisement */
+  {
+    struct icmp6_hdr  nd_na_hdr;
+    struct in6_addr   nd_na_target; /* target address */
+    /* could be followed by options */
+  };
+
+#define nd_na_type               nd_na_hdr.icmp6_type
+#define nd_na_code               nd_na_hdr.icmp6_code
+#define nd_na_cksum              nd_na_hdr.icmp6_cksum
+#define nd_na_flags_reserved     nd_na_hdr.icmp6_data32[0]
+#if     BYTE_ORDER == BIG_ENDIAN
+#define ND_NA_FLAG_ROUTER        0x80000000
+#define ND_NA_FLAG_SOLICITED     0x40000000
+#define ND_NA_FLAG_OVERRIDE      0x20000000
+#else   /* BYTE_ORDER == LITTLE_ENDIAN */
+#define ND_NA_FLAG_ROUTER        0x00000080
+#define ND_NA_FLAG_SOLICITED     0x00000040
+#define ND_NA_FLAG_OVERRIDE      0x00000020
+#endif
+
+struct nd_redirect            /* redirect */
+  {
+    struct icmp6_hdr  nd_rd_hdr;
+    struct in6_addr   nd_rd_target; /* target address */
+    struct in6_addr   nd_rd_dst;    /* destination address */
+    /* could be followed by options */
+  };
+
+#define nd_rd_type               nd_rd_hdr.icmp6_type
+#define nd_rd_code               nd_rd_hdr.icmp6_code
+#define nd_rd_cksum              nd_rd_hdr.icmp6_cksum
+#define nd_rd_reserved           nd_rd_hdr.icmp6_data32[0]
+
+struct nd_opt_hdr             /* Neighbor discovery option header */
+  {
+    uint8_t  nd_opt_type;
+    uint8_t  nd_opt_len;        /* in units of 8 octets */
+    /* followed by option specific data */
+  };
+
+#define ND_OPT_SOURCE_LINKADDR		1
+#define ND_OPT_TARGET_LINKADDR		2
+#define ND_OPT_PREFIX_INFORMATION	3
+#define ND_OPT_REDIRECTED_HEADER	4
+#define ND_OPT_MTU			5
+#define ND_OPT_RTR_ADV_INTERVAL		7
+#define ND_OPT_HOME_AGENT_INFO		8
+
+struct nd_opt_prefix_info     /* prefix information */
+  {
+    uint8_t   nd_opt_pi_type;
+    uint8_t   nd_opt_pi_len;
+    uint8_t   nd_opt_pi_prefix_len;
+    uint8_t   nd_opt_pi_flags_reserved;
+    uint32_t  nd_opt_pi_valid_time;
+    uint32_t  nd_opt_pi_preferred_time;
+    uint32_t  nd_opt_pi_reserved2;
+    struct in6_addr  nd_opt_pi_prefix;
+  };
+
+#define ND_OPT_PI_FLAG_ONLINK	0x80
+#define ND_OPT_PI_FLAG_AUTO	0x40
+#define ND_OPT_PI_FLAG_RADDR	0x20
+
+struct nd_opt_rd_hdr          /* redirected header */
+  {
+    uint8_t   nd_opt_rh_type;
+    uint8_t   nd_opt_rh_len;
+    uint16_t  nd_opt_rh_reserved1;
+    uint32_t  nd_opt_rh_reserved2;
+    /* followed by IP header and data */
+  };
+
+struct nd_opt_mtu             /* MTU option */
+  {
+    uint8_t   nd_opt_mtu_type;
+    uint8_t   nd_opt_mtu_len;
+    uint16_t  nd_opt_mtu_reserved;
+    uint32_t  nd_opt_mtu_mtu;
+  };
+
+struct mld_hdr
+  {
+    struct icmp6_hdr    mld_icmp6_hdr;
+    struct in6_addr     mld_addr; /* multicast address */
+  };
+
+#define mld_type        mld_icmp6_hdr.icmp6_type
+#define mld_code        mld_icmp6_hdr.icmp6_code
+#define mld_cksum       mld_icmp6_hdr.icmp6_cksum
+#define mld_maxdelay    mld_icmp6_hdr.icmp6_data16[0]
+#define mld_reserved    mld_icmp6_hdr.icmp6_data16[1]
+
+#define ICMP6_ROUTER_RENUMBERING    138
+
+struct icmp6_router_renum    /* router renumbering header */
+  {
+    struct icmp6_hdr    rr_hdr;
+    uint8_t             rr_segnum;
+    uint8_t             rr_flags;
+    uint16_t            rr_maxdelay;
+    uint32_t            rr_reserved;
+  };
+
+#define rr_type		rr_hdr.icmp6_type
+#define rr_code         rr_hdr.icmp6_code
+#define rr_cksum        rr_hdr.icmp6_cksum
+#define rr_seqnum       rr_hdr.icmp6_data32[0]
+
+/* Router renumbering flags */
+#define ICMP6_RR_FLAGS_TEST             0x80
+#define ICMP6_RR_FLAGS_REQRESULT        0x40
+#define ICMP6_RR_FLAGS_FORCEAPPLY       0x20
+#define ICMP6_RR_FLAGS_SPECSITE         0x10
+#define ICMP6_RR_FLAGS_PREVDONE         0x08
+
+struct rr_pco_match    /* match prefix part */
+  {
+    uint8_t             rpm_code;
+    uint8_t             rpm_len;
+    uint8_t             rpm_ordinal;
+    uint8_t             rpm_matchlen;
+    uint8_t             rpm_minlen;
+    uint8_t             rpm_maxlen;
+    uint16_t            rpm_reserved;
+    struct in6_addr     rpm_prefix;
+  };
+
+/* PCO code values */
+#define RPM_PCO_ADD             1
+#define RPM_PCO_CHANGE          2
+#define RPM_PCO_SETGLOBAL       3
+
+struct rr_pco_use      /* use prefix part */
+  {
+    uint8_t             rpu_uselen;
+    uint8_t             rpu_keeplen;
+    uint8_t             rpu_ramask;
+    uint8_t             rpu_raflags;
+    uint32_t            rpu_vltime;
+    uint32_t            rpu_pltime;
+    uint32_t            rpu_flags;
+    struct in6_addr     rpu_prefix;
+  };
+
+#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK  0x20
+#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO    0x10
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
+# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
+#elif BYTE_ORDER == LITTLE_ENDIAN
+# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
+# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
+#endif
+
+struct rr_result       /* router renumbering result message */
+  {
+    uint16_t            rrr_flags;
+    uint8_t             rrr_ordinal;
+    uint8_t             rrr_matchedlen;
+    uint32_t            rrr_ifid;
+    struct in6_addr     rrr_prefix;
+  };
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define ICMP6_RR_RESULT_FLAGS_OOB       0x0002
+# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
+#elif BYTE_ORDER == LITTLE_ENDIAN
+# define ICMP6_RR_RESULT_FLAGS_OOB       0x0200
+# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
+#endif
+
+/* Mobile IPv6 extension: Advertisement Interval.  */
+struct nd_opt_adv_interval
+  {
+    uint8_t   nd_opt_adv_interval_type;
+    uint8_t   nd_opt_adv_interval_len;
+    uint16_t  nd_opt_adv_interval_reserved;
+    uint32_t  nd_opt_adv_interval_ival;
+  };
+
+/* Mobile IPv6 extension: Home Agent Info.  */
+struct nd_opt_home_agent_info
+  {
+    uint8_t   nd_opt_home_agent_info_type;
+    uint8_t   nd_opt_home_agent_info_len;
+    uint16_t  nd_opt_home_agent_info_reserved;
+    uint16_t  nd_opt_home_agent_info_preference;
+    uint16_t  nd_opt_home_agent_info_lifetime;
+  };
+
+#endif /* netinet/icmpv6.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/netinet/igmp.h b/ap/libc/glibc/glibc-2.22/inet/netinet/igmp.h
new file mode 100644
index 0000000..55988f9
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/netinet/igmp.h
@@ -0,0 +1,125 @@
+/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NETINET_IGMP_H
+#define	_NETINET_IGMP_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#ifdef __USE_MISC
+
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+
+/*
+ * Copyright (c) 1988 Stephen Deering.
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Stephen Deering of Stanford University.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ *
+ *	@(#)igmp.h	8.1 (Berkeley) 6/10/93
+ *	$FreeBSD$
+ */
+
+struct igmp {
+  u_int8_t igmp_type;             /* IGMP type */
+  u_int8_t igmp_code;             /* routing code */
+  u_int16_t igmp_cksum;           /* checksum */
+  struct in_addr igmp_group;      /* group address */
+};
+
+#define IGMP_MINLEN			8
+
+/*
+ * Message types, including version number.
+ */
+#define IGMP_MEMBERSHIP_QUERY   	0x11	/* membership query         */
+#define IGMP_V1_MEMBERSHIP_REPORT	0x12	/* Ver. 1 membership report */
+#define IGMP_V2_MEMBERSHIP_REPORT	0x16	/* Ver. 2 membership report */
+#define IGMP_V2_LEAVE_GROUP		0x17	/* Leave-group message	    */
+
+#define IGMP_DVMRP			0x13	/* DVMRP routing message    */
+#define IGMP_PIM			0x14	/* PIM routing message      */
+#define IGMP_TRACE			0x15
+
+#define IGMP_MTRACE_RESP		0x1e	/* traceroute resp.(to sender)*/
+#define IGMP_MTRACE			0x1f	/* mcast traceroute messages  */
+
+#define IGMP_MAX_HOST_REPORT_DELAY	10	/* max delay for response to     */
+						/*  query (in seconds) according */
+						/*  to RFC1112                   */
+#define IGMP_TIMER_SCALE		10	/* denotes that the igmp code field */
+						/* specifies time in 10th of seconds*/
+
+/*
+ * States for the IGMP v2 state table.
+ */
+#define IGMP_DELAYING_MEMBER	1
+#define IGMP_IDLE_MEMBER	2
+#define IGMP_LAZY_MEMBER	3
+#define IGMP_SLEEPING_MEMBER	4
+#define IGMP_AWAKENING_MEMBER	5
+
+/*
+ * States for IGMP router version cache.
+ */
+#define IGMP_v1_ROUTER		1
+#define IGMP_v2_ROUTER		2
+
+/*
+ * The following four defininitions are for backwards compatibility.
+ * They should be removed as soon as all applications are updated to
+ * use the new constant names.
+ */
+#define IGMP_HOST_MEMBERSHIP_QUERY	IGMP_MEMBERSHIP_QUERY
+#define IGMP_HOST_MEMBERSHIP_REPORT	IGMP_V1_MEMBERSHIP_REPORT
+#define IGMP_HOST_NEW_MEMBERSHIP_REPORT	IGMP_V2_MEMBERSHIP_REPORT
+#define IGMP_HOST_LEAVE_MESSAGE		IGMP_V2_LEAVE_GROUP
+
+__END_DECLS
+
+#endif
+
+#endif	/* netinet/igmp.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/netinet/in.h b/ap/libc/glibc/glibc-2.22/inet/netinet/in.h
new file mode 100644
index 0000000..f541c58
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/netinet/in.h
@@ -0,0 +1,631 @@
+/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_NETINET_IN_H
+#define	_NETINET_IN_H	1
+
+#include <features.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <bits/types.h>
+
+
+__BEGIN_DECLS
+
+/* Internet address.  */
+typedef uint32_t in_addr_t;
+struct in_addr
+  {
+    in_addr_t s_addr;
+  };
+
+/* Get system-specific definitions.  */
+#include <bits/in.h>
+
+/* Standard well-defined IP protocols.  */
+enum
+  {
+    IPPROTO_IP = 0,	   /* Dummy protocol for TCP.  */
+#define IPPROTO_IP		IPPROTO_IP
+    IPPROTO_ICMP = 1,	   /* Internet Control Message Protocol.  */
+#define IPPROTO_ICMP		IPPROTO_ICMP
+    IPPROTO_IGMP = 2,	   /* Internet Group Management Protocol. */
+#define IPPROTO_IGMP		IPPROTO_IGMP
+    IPPROTO_IPIP = 4,	   /* IPIP tunnels (older KA9Q tunnels use 94).  */
+#define IPPROTO_IPIP		IPPROTO_IPIP
+    IPPROTO_TCP = 6,	   /* Transmission Control Protocol.  */
+#define IPPROTO_TCP		IPPROTO_TCP
+    IPPROTO_EGP = 8,	   /* Exterior Gateway Protocol.  */
+#define IPPROTO_EGP		IPPROTO_EGP
+    IPPROTO_PUP = 12,	   /* PUP protocol.  */
+#define IPPROTO_PUP		IPPROTO_PUP
+    IPPROTO_UDP = 17,	   /* User Datagram Protocol.  */
+#define IPPROTO_UDP		IPPROTO_UDP
+    IPPROTO_IDP = 22,	   /* XNS IDP protocol.  */
+#define IPPROTO_IDP		IPPROTO_IDP
+    IPPROTO_TP = 29,	   /* SO Transport Protocol Class 4.  */
+#define IPPROTO_TP		IPPROTO_TP
+    IPPROTO_DCCP = 33,	   /* Datagram Congestion Control Protocol.  */
+#define IPPROTO_DCCP		IPPROTO_DCCP
+    IPPROTO_IPV6 = 41,     /* IPv6 header.  */
+#define IPPROTO_IPV6		IPPROTO_IPV6
+    IPPROTO_RSVP = 46,	   /* Reservation Protocol.  */
+#define IPPROTO_RSVP		IPPROTO_RSVP
+    IPPROTO_GRE = 47,	   /* General Routing Encapsulation.  */
+#define IPPROTO_GRE		IPPROTO_GRE
+    IPPROTO_ESP = 50,      /* encapsulating security payload.  */
+#define IPPROTO_ESP		IPPROTO_ESP
+    IPPROTO_AH = 51,       /* authentication header.  */
+#define IPPROTO_AH		IPPROTO_AH
+    IPPROTO_MTP = 92,	   /* Multicast Transport Protocol.  */
+#define IPPROTO_MTP		IPPROTO_MTP
+    IPPROTO_BEETPH = 94,   /* IP option pseudo header for BEET.  */
+#define IPPROTO_BEETPH		IPPROTO_BEETPH
+    IPPROTO_ENCAP = 98,	   /* Encapsulation Header.  */
+#define IPPROTO_ENCAP		IPPROTO_ENCAP
+    IPPROTO_PIM = 103,	   /* Protocol Independent Multicast.  */
+#define IPPROTO_PIM		IPPROTO_PIM
+    IPPROTO_COMP = 108,	   /* Compression Header Protocol.  */
+#define IPPROTO_COMP		IPPROTO_COMP
+    IPPROTO_SCTP = 132,	   /* Stream Control Transmission Protocol.  */
+#define IPPROTO_SCTP		IPPROTO_SCTP
+    IPPROTO_UDPLITE = 136, /* UDP-Lite protocol.  */
+#define IPPROTO_UDPLITE		IPPROTO_UDPLITE
+    IPPROTO_RAW = 255,	   /* Raw IP packets.  */
+#define IPPROTO_RAW		IPPROTO_RAW
+    IPPROTO_MAX
+  };
+
+/* If __USE_KERNEL_IPV6_DEFS is defined then the user has included the kernel
+   network headers first and we should use those ABI-identical definitions
+   instead of our own.  */
+#ifndef __USE_KERNEL_IPV6_DEFS
+enum
+  {
+    IPPROTO_HOPOPTS = 0,   /* IPv6 Hop-by-Hop options.  */
+#define IPPROTO_HOPOPTS		IPPROTO_HOPOPTS
+    IPPROTO_ROUTING = 43,  /* IPv6 routing header.  */
+#define IPPROTO_ROUTING		IPPROTO_ROUTING
+    IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header.  */
+#define IPPROTO_FRAGMENT	IPPROTO_FRAGMENT
+    IPPROTO_ICMPV6 = 58,   /* ICMPv6.  */
+#define IPPROTO_ICMPV6		IPPROTO_ICMPV6
+    IPPROTO_NONE = 59,     /* IPv6 no next header.  */
+#define IPPROTO_NONE		IPPROTO_NONE
+    IPPROTO_DSTOPTS = 60,  /* IPv6 destination options.  */
+#define IPPROTO_DSTOPTS		IPPROTO_DSTOPTS
+    IPPROTO_MH = 135       /* IPv6 mobility header.  */
+#define IPPROTO_MH		IPPROTO_MH
+  };
+#endif /* !__USE_KERNEL_IPV6_DEFS */
+
+/* Type to represent a port.  */
+typedef uint16_t in_port_t;
+
+/* Standard well-known ports.  */
+enum
+  {
+    IPPORT_ECHO = 7,		/* Echo service.  */
+    IPPORT_DISCARD = 9,		/* Discard transmissions service.  */
+    IPPORT_SYSTAT = 11,		/* System status service.  */
+    IPPORT_DAYTIME = 13,	/* Time of day service.  */
+    IPPORT_NETSTAT = 15,	/* Network status service.  */
+    IPPORT_FTP = 21,		/* File Transfer Protocol.  */
+    IPPORT_TELNET = 23,		/* Telnet protocol.  */
+    IPPORT_SMTP = 25,		/* Simple Mail Transfer Protocol.  */
+    IPPORT_TIMESERVER = 37,	/* Timeserver service.  */
+    IPPORT_NAMESERVER = 42,	/* Domain Name Service.  */
+    IPPORT_WHOIS = 43,		/* Internet Whois service.  */
+    IPPORT_MTP = 57,
+
+    IPPORT_TFTP = 69,		/* Trivial File Transfer Protocol.  */
+    IPPORT_RJE = 77,
+    IPPORT_FINGER = 79,		/* Finger service.  */
+    IPPORT_TTYLINK = 87,
+    IPPORT_SUPDUP = 95,		/* SUPDUP protocol.  */
+
+
+    IPPORT_EXECSERVER = 512,	/* execd service.  */
+    IPPORT_LOGINSERVER = 513,	/* rlogind service.  */
+    IPPORT_CMDSERVER = 514,
+    IPPORT_EFSSERVER = 520,
+
+    /* UDP ports.  */
+    IPPORT_BIFFUDP = 512,
+    IPPORT_WHOSERVER = 513,
+    IPPORT_ROUTESERVER = 520,
+
+    /* Ports less than this value are reserved for privileged processes.  */
+    IPPORT_RESERVED = 1024,
+
+    /* Ports greater this value are reserved for (non-privileged) servers.  */
+    IPPORT_USERRESERVED = 5000
+  };
+
+/* Definitions of the bits in an Internet address integer.
+
+   On subnets, host and network parts are found according to
+   the subnet mask, not these masks.  */
+
+#define	IN_CLASSA(a)		((((in_addr_t)(a)) & 0x80000000) == 0)
+#define	IN_CLASSA_NET		0xff000000
+#define	IN_CLASSA_NSHIFT	24
+#define	IN_CLASSA_HOST		(0xffffffff & ~IN_CLASSA_NET)
+#define	IN_CLASSA_MAX		128
+
+#define	IN_CLASSB(a)		((((in_addr_t)(a)) & 0xc0000000) == 0x80000000)
+#define	IN_CLASSB_NET		0xffff0000
+#define	IN_CLASSB_NSHIFT	16
+#define	IN_CLASSB_HOST		(0xffffffff & ~IN_CLASSB_NET)
+#define	IN_CLASSB_MAX		65536
+
+#define	IN_CLASSC(a)		((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000)
+#define	IN_CLASSC_NET		0xffffff00
+#define	IN_CLASSC_NSHIFT	8
+#define	IN_CLASSC_HOST		(0xffffffff & ~IN_CLASSC_NET)
+
+#define	IN_CLASSD(a)		((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
+#define	IN_MULTICAST(a)		IN_CLASSD(a)
+
+#define	IN_EXPERIMENTAL(a)	((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000)
+#define	IN_BADCLASS(a)		((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000)
+
+/* Address to accept any incoming messages.  */
+#define	INADDR_ANY		((in_addr_t) 0x00000000)
+/* Address to send to all hosts.  */
+#define	INADDR_BROADCAST	((in_addr_t) 0xffffffff)
+/* Address indicating an error return.  */
+#define	INADDR_NONE		((in_addr_t) 0xffffffff)
+
+/* Network number for local host loopback.  */
+#define	IN_LOOPBACKNET		127
+/* Address to loopback in software to local host.  */
+#ifndef INADDR_LOOPBACK
+# define INADDR_LOOPBACK	((in_addr_t) 0x7f000001) /* Inet 127.0.0.1.  */
+#endif
+
+/* Defines for Multicast INADDR.  */
+#define INADDR_UNSPEC_GROUP	((in_addr_t) 0xe0000000) /* 224.0.0.0 */
+#define INADDR_ALLHOSTS_GROUP	((in_addr_t) 0xe0000001) /* 224.0.0.1 */
+#define INADDR_ALLRTRS_GROUP    ((in_addr_t) 0xe0000002) /* 224.0.0.2 */
+#define INADDR_MAX_LOCAL_GROUP  ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */
+
+#ifndef __USE_KERNEL_IPV6_DEFS
+/* IPv6 address */
+struct in6_addr
+  {
+    union
+      {
+	uint8_t	__u6_addr8[16];
+#ifdef __USE_MISC
+	uint16_t __u6_addr16[8];
+	uint32_t __u6_addr32[4];
+#endif
+      } __in6_u;
+#define s6_addr			__in6_u.__u6_addr8
+#ifdef __USE_MISC
+# define s6_addr16		__in6_u.__u6_addr16
+# define s6_addr32		__in6_u.__u6_addr32
+#endif
+  };
+#endif /* !__USE_KERNEL_IPV6_DEFS */
+
+extern const struct in6_addr in6addr_any;        /* :: */
+extern const struct in6_addr in6addr_loopback;   /* ::1 */
+#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
+#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+
+#define INET_ADDRSTRLEN 16
+#define INET6_ADDRSTRLEN 46
+
+
+/* Structure describing an Internet socket address.  */
+struct sockaddr_in
+  {
+    __SOCKADDR_COMMON (sin_);
+    in_port_t sin_port;			/* Port number.  */
+    struct in_addr sin_addr;		/* Internet address.  */
+
+    /* Pad to size of `struct sockaddr'.  */
+    unsigned char sin_zero[sizeof (struct sockaddr) -
+			   __SOCKADDR_COMMON_SIZE -
+			   sizeof (in_port_t) -
+			   sizeof (struct in_addr)];
+  };
+
+#ifndef __USE_KERNEL_IPV6_DEFS
+/* Ditto, for IPv6.  */
+struct sockaddr_in6
+  {
+    __SOCKADDR_COMMON (sin6_);
+    in_port_t sin6_port;	/* Transport layer port # */
+    uint32_t sin6_flowinfo;	/* IPv6 flow information */
+    struct in6_addr sin6_addr;	/* IPv6 address */
+    uint32_t sin6_scope_id;	/* IPv6 scope-id */
+  };
+#endif /* !__USE_KERNEL_IPV6_DEFS */
+
+#ifdef __USE_MISC
+/* IPv4 multicast request.  */
+struct ip_mreq
+  {
+    /* IP multicast address of group.  */
+    struct in_addr imr_multiaddr;
+
+    /* Local IP address of interface.  */
+    struct in_addr imr_interface;
+  };
+
+struct ip_mreq_source
+  {
+    /* IP multicast address of group.  */
+    struct in_addr imr_multiaddr;
+
+    /* IP address of source.  */
+    struct in_addr imr_interface;
+
+    /* IP address of interface.  */
+    struct in_addr imr_sourceaddr;
+  };
+#endif
+
+#ifndef __USE_KERNEL_IPV6_DEFS
+/* Likewise, for IPv6.  */
+struct ipv6_mreq
+  {
+    /* IPv6 multicast address of group */
+    struct in6_addr ipv6mr_multiaddr;
+
+    /* local interface */
+    unsigned int ipv6mr_interface;
+  };
+#endif /* !__USE_KERNEL_IPV6_DEFS */
+
+#ifdef __USE_MISC
+/* Multicast group request.  */
+struct group_req
+  {
+    /* Interface index.  */
+    uint32_t gr_interface;
+
+    /* Group address.  */
+    struct sockaddr_storage gr_group;
+  };
+
+struct group_source_req
+  {
+    /* Interface index.  */
+    uint32_t gsr_interface;
+
+    /* Group address.  */
+    struct sockaddr_storage gsr_group;
+
+    /* Source address.  */
+    struct sockaddr_storage gsr_source;
+  };
+
+
+/* Full-state filter operations.  */
+struct ip_msfilter
+  {
+    /* IP multicast address of group.  */
+    struct in_addr imsf_multiaddr;
+
+    /* Local IP address of interface.  */
+    struct in_addr imsf_interface;
+
+    /* Filter mode.  */
+    uint32_t imsf_fmode;
+
+    /* Number of source addresses.  */
+    uint32_t imsf_numsrc;
+    /* Source addresses.  */
+    struct in_addr imsf_slist[1];
+  };
+
+#define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \
+				  - sizeof (struct in_addr)		      \
+				  + (numsrc) * sizeof (struct in_addr))
+
+struct group_filter
+  {
+    /* Interface index.  */
+    uint32_t gf_interface;
+
+    /* Group address.  */
+    struct sockaddr_storage gf_group;
+
+    /* Filter mode.  */
+    uint32_t gf_fmode;
+
+    /* Number of source addresses.  */
+    uint32_t gf_numsrc;
+    /* Source addresses.  */
+    struct sockaddr_storage gf_slist[1];
+};
+
+#define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \
+				   - sizeof (struct sockaddr_storage)	      \
+				   + ((numsrc)				      \
+				      * sizeof (struct sockaddr_storage)))
+#endif
+
+/* Functions to convert between host and network byte order.
+
+   Please note that these functions normally take `unsigned long int' or
+   `unsigned short int' values as arguments and also return them.  But
+   this was a short-sighted decision since on different systems the types
+   may have different representations but the values are always the same.  */
+
+extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__));
+extern uint16_t ntohs (uint16_t __netshort)
+     __THROW __attribute__ ((__const__));
+extern uint32_t htonl (uint32_t __hostlong)
+     __THROW __attribute__ ((__const__));
+extern uint16_t htons (uint16_t __hostshort)
+     __THROW __attribute__ ((__const__));
+
+#include <endian.h>
+
+/* Get machine dependent optimized versions of byte swapping functions.  */
+#include <bits/byteswap.h>
+
+#ifdef __OPTIMIZE__
+/* We can optimize calls to the conversion functions.  Either nothing has
+   to be done or we are using directly the byte-swapping functions which
+   often can be inlined.  */
+# if __BYTE_ORDER == __BIG_ENDIAN
+/* The host byte order is the same as network byte order,
+   so these functions are all just identity.  */
+# define ntohl(x)	(x)
+# define ntohs(x)	(x)
+# define htonl(x)	(x)
+# define htons(x)	(x)
+# else
+#  if __BYTE_ORDER == __LITTLE_ENDIAN
+#   define ntohl(x)	__bswap_32 (x)
+#   define ntohs(x)	__bswap_16 (x)
+#   define htonl(x)	__bswap_32 (x)
+#   define htons(x)	__bswap_16 (x)
+#  endif
+# endif
+#endif
+
+#ifdef __GNUC__
+# define IN6_IS_ADDR_UNSPECIFIED(a) \
+  (__extension__							      \
+   ({ const struct in6_addr *__a = (const struct in6_addr *) (a);	      \
+      __a->s6_addr32[0] == 0						      \
+      && __a->s6_addr32[1] == 0						      \
+      && __a->s6_addr32[2] == 0						      \
+      && __a->s6_addr32[3] == 0; }))
+
+# define IN6_IS_ADDR_LOOPBACK(a) \
+  (__extension__							      \
+   ({ const struct in6_addr *__a = (const struct in6_addr *) (a);	      \
+      __a->s6_addr32[0] == 0						      \
+      && __a->s6_addr32[1] == 0						      \
+      && __a->s6_addr32[2] == 0						      \
+      && __a->s6_addr32[3] == htonl (1); }))
+
+# define IN6_IS_ADDR_LINKLOCAL(a) \
+  (__extension__							      \
+   ({ const struct in6_addr *__a = (const struct in6_addr *) (a);	      \
+      (__a->s6_addr32[0] & htonl (0xffc00000)) == htonl (0xfe800000); }))
+
+# define IN6_IS_ADDR_SITELOCAL(a) \
+  (__extension__							      \
+   ({ const struct in6_addr *__a = (const struct in6_addr *) (a);	      \
+      (__a->s6_addr32[0] & htonl (0xffc00000)) == htonl (0xfec00000); }))
+
+# define IN6_IS_ADDR_V4MAPPED(a) \
+  (__extension__							      \
+   ({ const struct in6_addr *__a = (const struct in6_addr *) (a);	      \
+      __a->s6_addr32[0] == 0						      \
+      && __a->s6_addr32[1] == 0						      \
+      && __a->s6_addr32[2] == htonl (0xffff); }))
+
+# define IN6_IS_ADDR_V4COMPAT(a) \
+  (__extension__							      \
+   ({ const struct in6_addr *__a = (const struct in6_addr *) (a);	      \
+      __a->s6_addr32[0] == 0						      \
+      && __a->s6_addr32[1] == 0						      \
+      && __a->s6_addr32[2] == 0						      \
+      && ntohl (__a->s6_addr32[3]) > 1; }))
+
+# define IN6_ARE_ADDR_EQUAL(a,b) \
+  (__extension__							      \
+   ({ const struct in6_addr *__a = (const struct in6_addr *) (a);	      \
+      const struct in6_addr *__b = (const struct in6_addr *) (b);	      \
+      __a->s6_addr32[0] == __b->s6_addr32[0]				      \
+      && __a->s6_addr32[1] == __b->s6_addr32[1]				      \
+      && __a->s6_addr32[2] == __b->s6_addr32[2]				      \
+      && __a->s6_addr32[3] == __b->s6_addr32[3]; }))
+#else
+# define IN6_IS_ADDR_UNSPECIFIED(a) \
+	(((const uint32_t *) (a))[0] == 0				      \
+	 && ((const uint32_t *) (a))[1] == 0				      \
+	 && ((const uint32_t *) (a))[2] == 0				      \
+	 && ((const uint32_t *) (a))[3] == 0)
+
+# define IN6_IS_ADDR_LOOPBACK(a) \
+	(((const uint32_t *) (a))[0] == 0				      \
+	 && ((const uint32_t *) (a))[1] == 0				      \
+	 && ((const uint32_t *) (a))[2] == 0				      \
+	 && ((const uint32_t *) (a))[3] == htonl (1))
+
+# define IN6_IS_ADDR_LINKLOCAL(a) \
+	((((const uint32_t *) (a))[0] & htonl (0xffc00000))		      \
+	 == htonl (0xfe800000))
+
+# define IN6_IS_ADDR_SITELOCAL(a) \
+	((((const uint32_t *) (a))[0] & htonl (0xffc00000))		      \
+	 == htonl (0xfec00000))
+
+# define IN6_IS_ADDR_V4MAPPED(a) \
+	((((const uint32_t *) (a))[0] == 0)				      \
+	 && (((const uint32_t *) (a))[1] == 0)				      \
+	 && (((const uint32_t *) (a))[2] == htonl (0xffff)))
+
+# define IN6_IS_ADDR_V4COMPAT(a) \
+	((((const uint32_t *) (a))[0] == 0)				      \
+	 && (((const uint32_t *) (a))[1] == 0)				      \
+	 && (((const uint32_t *) (a))[2] == 0)				      \
+	 && (ntohl (((const uint32_t *) (a))[3]) > 1))
+
+# define IN6_ARE_ADDR_EQUAL(a,b) \
+	((((const uint32_t *) (a))[0] == ((const uint32_t *) (b))[0])	      \
+	 && (((const uint32_t *) (a))[1] == ((const uint32_t *) (b))[1])      \
+	 && (((const uint32_t *) (a))[2] == ((const uint32_t *) (b))[2])      \
+	 && (((const uint32_t *) (a))[3] == ((const uint32_t *) (b))[3]))
+#endif
+
+#define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff)
+
+#ifdef __USE_MISC
+/* Bind socket to a privileged IP port.  */
+extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __THROW;
+
+/* The IPv6 version of this function.  */
+extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
+     __THROW;
+#endif
+
+
+#define IN6_IS_ADDR_MC_NODELOCAL(a) \
+	(IN6_IS_ADDR_MULTICAST(a)					      \
+	 && ((((const uint8_t *) (a))[1] & 0xf) == 0x1))
+
+#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
+	(IN6_IS_ADDR_MULTICAST(a)					      \
+	 && ((((const uint8_t *) (a))[1] & 0xf) == 0x2))
+
+#define IN6_IS_ADDR_MC_SITELOCAL(a) \
+	(IN6_IS_ADDR_MULTICAST(a)					      \
+	 && ((((const uint8_t *) (a))[1] & 0xf) == 0x5))
+
+#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
+	(IN6_IS_ADDR_MULTICAST(a)					      \
+	 && ((((const uint8_t *) (a))[1] & 0xf) == 0x8))
+
+#define IN6_IS_ADDR_MC_GLOBAL(a) \
+	(IN6_IS_ADDR_MULTICAST(a)					      \
+	 && ((((const uint8_t *) (a))[1] & 0xf) == 0xe))
+
+
+#ifdef __USE_GNU
+struct cmsghdr;			/* Forward declaration.  */
+
+#ifndef __USE_KERNEL_IPV6_DEFS
+/* IPv6 packet information.  */
+struct in6_pktinfo
+  {
+    struct in6_addr ipi6_addr;	/* src/dst IPv6 address */
+    unsigned int ipi6_ifindex;	/* send/recv interface index */
+  };
+
+/* IPv6 MTU information.  */
+struct ip6_mtuinfo
+  {
+    struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */
+    uint32_t ip6m_mtu;		   /* path MTU in host byte order */
+  };
+#endif /* !__USE_KERNEL_IPV6_DEFS */
+
+/* Obsolete hop-by-hop and Destination Options Processing (RFC 2292).  */
+extern int inet6_option_space (int __nbytes)
+     __THROW __attribute_deprecated__;
+extern int inet6_option_init (void *__bp, struct cmsghdr **__cmsgp,
+			      int __type) __THROW __attribute_deprecated__;
+extern int inet6_option_append (struct cmsghdr *__cmsg,
+				const uint8_t *__typep, int __multx,
+				int __plusy) __THROW __attribute_deprecated__;
+extern uint8_t *inet6_option_alloc (struct cmsghdr *__cmsg, int __datalen,
+				    int __multx, int __plusy)
+     __THROW __attribute_deprecated__;
+extern int inet6_option_next (const struct cmsghdr *__cmsg,
+			      uint8_t **__tptrp)
+     __THROW __attribute_deprecated__;
+extern int inet6_option_find (const struct cmsghdr *__cmsg,
+			      uint8_t **__tptrp, int __type)
+     __THROW __attribute_deprecated__;
+
+
+/* Hop-by-Hop and Destination Options Processing (RFC 3542).  */
+extern int inet6_opt_init (void *__extbuf, socklen_t __extlen) __THROW;
+extern int inet6_opt_append (void *__extbuf, socklen_t __extlen, int __offset,
+			     uint8_t __type, socklen_t __len, uint8_t __align,
+			     void **__databufp) __THROW;
+extern int inet6_opt_finish (void *__extbuf, socklen_t __extlen, int __offset)
+     __THROW;
+extern int inet6_opt_set_val (void *__databuf, int __offset, void *__val,
+			      socklen_t __vallen) __THROW;
+extern int inet6_opt_next (void *__extbuf, socklen_t __extlen, int __offset,
+			   uint8_t *__typep, socklen_t *__lenp,
+			   void **__databufp) __THROW;
+extern int inet6_opt_find (void *__extbuf, socklen_t __extlen, int __offset,
+			   uint8_t __type, socklen_t *__lenp,
+			   void **__databufp) __THROW;
+extern int inet6_opt_get_val (void *__databuf, int __offset, void *__val,
+			      socklen_t __vallen) __THROW;
+
+
+/* Routing Header Option (RFC 3542).  */
+extern socklen_t inet6_rth_space (int __type, int __segments) __THROW;
+extern void *inet6_rth_init (void *__bp, socklen_t __bp_len, int __type,
+			     int __segments) __THROW;
+extern int inet6_rth_add (void *__bp, const struct in6_addr *__addr) __THROW;
+extern int inet6_rth_reverse (const void *__in, void *__out) __THROW;
+extern int inet6_rth_segments (const void *__bp) __THROW;
+extern struct in6_addr *inet6_rth_getaddr (const void *__bp, int __index)
+     __THROW;
+
+
+/* Multicast source filter support.  */
+
+/* Get IPv4 source filter.  */
+extern int getipv4sourcefilter (int __s, struct in_addr __interface_addr,
+				struct in_addr __group, uint32_t *__fmode,
+				uint32_t *__numsrc, struct in_addr *__slist)
+     __THROW;
+
+/* Set IPv4 source filter.  */
+extern int setipv4sourcefilter (int __s, struct in_addr __interface_addr,
+				struct in_addr __group, uint32_t __fmode,
+				uint32_t __numsrc,
+				const struct in_addr *__slist)
+     __THROW;
+
+
+/* Get source filter.  */
+extern int getsourcefilter (int __s, uint32_t __interface_addr,
+			    const struct sockaddr *__group,
+			    socklen_t __grouplen, uint32_t *__fmode,
+			    uint32_t *__numsrc,
+			    struct sockaddr_storage *__slist) __THROW;
+
+/* Set source filter.  */
+extern int setsourcefilter (int __s, uint32_t __interface_addr,
+			    const struct sockaddr *__group,
+			    socklen_t __grouplen, uint32_t __fmode,
+			    uint32_t __numsrc,
+			    const struct sockaddr_storage *__slist) __THROW;
+#endif	/* use GNU */
+
+__END_DECLS
+
+#endif	/* netinet/in.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/netinet/ip6.h b/ap/libc/glibc/glibc-2.22/inet/netinet/ip6.h
new file mode 100644
index 0000000..30f7e74
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/netinet/ip6.h
@@ -0,0 +1,188 @@
+/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NETINET_IP6_H
+#define _NETINET_IP6_H 1
+
+#include <inttypes.h>
+#include <netinet/in.h>
+
+struct ip6_hdr
+  {
+    union
+      {
+	struct ip6_hdrctl
+	  {
+	    uint32_t ip6_un1_flow;   /* 4 bits version, 8 bits TC,
+					20 bits flow-ID */
+	    uint16_t ip6_un1_plen;   /* payload length */
+	    uint8_t  ip6_un1_nxt;    /* next header */
+	    uint8_t  ip6_un1_hlim;   /* hop limit */
+	  } ip6_un1;
+	uint8_t ip6_un2_vfc;       /* 4 bits version, top 4 bits tclass */
+      } ip6_ctlun;
+    struct in6_addr ip6_src;      /* source address */
+    struct in6_addr ip6_dst;      /* destination address */
+  };
+
+#define ip6_vfc   ip6_ctlun.ip6_un2_vfc
+#define ip6_flow  ip6_ctlun.ip6_un1.ip6_un1_flow
+#define ip6_plen  ip6_ctlun.ip6_un1.ip6_un1_plen
+#define ip6_nxt   ip6_ctlun.ip6_un1.ip6_un1_nxt
+#define ip6_hlim  ip6_ctlun.ip6_un1.ip6_un1_hlim
+#define ip6_hops  ip6_ctlun.ip6_un1.ip6_un1_hlim
+
+/* Generic extension header.  */
+struct ip6_ext
+  {
+    uint8_t  ip6e_nxt;		/* next header.  */
+    uint8_t  ip6e_len;		/* length in units of 8 octets.  */
+  };
+
+/* Hop-by-Hop options header.  */
+struct ip6_hbh
+  {
+    uint8_t  ip6h_nxt;		/* next header.  */
+    uint8_t  ip6h_len;		/* length in units of 8 octets.  */
+    /* followed by options */
+  };
+
+/* Destination options header */
+struct ip6_dest
+  {
+    uint8_t  ip6d_nxt;		/* next header */
+    uint8_t  ip6d_len;		/* length in units of 8 octets */
+    /* followed by options */
+  };
+
+/* Routing header */
+struct ip6_rthdr
+  {
+    uint8_t  ip6r_nxt;		/* next header */
+    uint8_t  ip6r_len;		/* length in units of 8 octets */
+    uint8_t  ip6r_type;		/* routing type */
+    uint8_t  ip6r_segleft;	/* segments left */
+    /* followed by routing type specific data */
+  };
+
+/* Type 0 Routing header */
+struct ip6_rthdr0
+  {
+    uint8_t  ip6r0_nxt;		/* next header */
+    uint8_t  ip6r0_len;		/* length in units of 8 octets */
+    uint8_t  ip6r0_type;	/* always zero */
+    uint8_t  ip6r0_segleft;	/* segments left */
+    uint8_t  ip6r0_reserved;	/* reserved field */
+    uint8_t  ip6r0_slmap[3];	/* strict/loose bit map */
+    /* followed by up to 127 struct in6_addr */
+    struct in6_addr ip6r0_addr[0];
+  };
+
+/* Fragment header */
+struct ip6_frag
+  {
+    uint8_t   ip6f_nxt;		/* next header */
+    uint8_t   ip6f_reserved;	/* reserved field */
+    uint16_t  ip6f_offlg;	/* offset, reserved, and flag */
+    uint32_t  ip6f_ident;	/* identification */
+  };
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define IP6F_OFF_MASK       0xfff8  /* mask out offset from _offlg */
+# define IP6F_RESERVED_MASK  0x0006  /* reserved bits in ip6f_offlg */
+# define IP6F_MORE_FRAG      0x0001  /* more-fragments flag */
+#else   /* BYTE_ORDER == LITTLE_ENDIAN */
+# define IP6F_OFF_MASK       0xf8ff  /* mask out offset from _offlg */
+# define IP6F_RESERVED_MASK  0x0600  /* reserved bits in ip6f_offlg */
+# define IP6F_MORE_FRAG      0x0100  /* more-fragments flag */
+#endif
+
+/* IPv6 options */
+struct ip6_opt
+  {
+    uint8_t  ip6o_type;
+    uint8_t  ip6o_len;
+  };
+
+/* The high-order 3 bits of the option type define the behavior
+ * when processing an unknown option and whether or not the option
+ * content changes in flight.
+ */
+#define IP6OPT_TYPE(o)		((o) & 0xc0)
+#define IP6OPT_TYPE_SKIP	0x00
+#define IP6OPT_TYPE_DISCARD	0x40
+#define IP6OPT_TYPE_FORCEICMP	0x80
+#define IP6OPT_TYPE_ICMP	0xc0
+#define IP6OPT_TYPE_MUTABLE	0x20
+
+/* Special option types for padding.  */
+#define IP6OPT_PAD1	0
+#define IP6OPT_PADN	1
+
+#define IP6OPT_JUMBO		0xc2
+#define IP6OPT_NSAP_ADDR	0xc3
+#define IP6OPT_TUNNEL_LIMIT	0x04
+#define IP6OPT_ROUTER_ALERT	0x05
+
+/* Jumbo Payload Option */
+struct ip6_opt_jumbo
+  {
+    uint8_t  ip6oj_type;
+    uint8_t  ip6oj_len;
+    uint8_t  ip6oj_jumbo_len[4];
+  };
+#define IP6OPT_JUMBO_LEN	6
+
+/* NSAP Address Option */
+struct ip6_opt_nsap
+  {
+    uint8_t  ip6on_type;
+    uint8_t  ip6on_len;
+    uint8_t  ip6on_src_nsap_len;
+    uint8_t  ip6on_dst_nsap_len;
+      /* followed by source NSAP */
+      /* followed by destination NSAP */
+  };
+
+/* Tunnel Limit Option */
+struct ip6_opt_tunnel
+  {
+    uint8_t  ip6ot_type;
+    uint8_t  ip6ot_len;
+    uint8_t  ip6ot_encap_limit;
+  };
+
+/* Router Alert Option */
+struct ip6_opt_router
+  {
+    uint8_t  ip6or_type;
+    uint8_t  ip6or_len;
+    uint8_t  ip6or_value[2];
+  };
+
+/* Router alert values (in network byte order) */
+#if BYTE_ORDER == BIG_ENDIAN
+# define IP6_ALERT_MLD	0x0000
+# define IP6_ALERT_RSVP	0x0001
+# define IP6_ALERT_AN	0x0002
+#else /* BYTE_ORDER == LITTLE_ENDING */
+# define IP6_ALERT_MLD	0x0000
+# define IP6_ALERT_RSVP	0x0100
+# define IP6_ALERT_AN	0x0200
+#endif
+
+#endif /* netinet/ip6.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/protocols/routed.h b/ap/libc/glibc/glibc-2.22/inet/protocols/routed.h
new file mode 100644
index 0000000..befd865
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/protocols/routed.h
@@ -0,0 +1,101 @@
+/*-
+ * Copyright (c) 1983, 1989, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ *
+ *	@(#)routed.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_ROUTED_H
+#define	_PROTOCOLS_ROUTED_H 1
+
+#include <sys/socket.h>
+/*
+ * Routing Information Protocol
+ *
+ * Derived from Xerox NS Routing Information Protocol
+ * by changing 32-bit net numbers to sockaddr's and
+ * padding stuff to 32-bit boundaries.
+ */
+#define	RIPVERSION	1
+
+struct netinfo {
+	struct	sockaddr rip_dst;	/* destination net/host */
+	int	rip_metric;		/* cost of route */
+};
+
+struct rip {
+	u_char	rip_cmd;		/* request/response */
+	u_char	rip_vers;		/* protocol version # */
+	u_char	rip_res1[2];		/* pad to 32-bit boundary */
+	union {
+		struct	netinfo ru_nets[1];	/* variable length... */
+		char	ru_tracefile[1];	/* ditto ... */
+	} ripun;
+#define	rip_nets	ripun.ru_nets
+#define	rip_tracefile	ripun.ru_tracefile
+};
+
+/*
+ * Packet types.
+ */
+#define	RIPCMD_REQUEST		1	/* want info */
+#define	RIPCMD_RESPONSE		2	/* responding to request */
+#define	RIPCMD_TRACEON		3	/* turn tracing on */
+#define	RIPCMD_TRACEOFF		4	/* turn it off */
+
+#define	RIPCMD_MAX		5
+#ifdef RIPCMDS
+char *ripcmds[RIPCMD_MAX] =
+  { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" };
+#endif
+
+#define	HOPCNT_INFINITY		16	/* per Xerox NS */
+#define	MAXPACKETSIZE		512	/* max broadcast size */
+
+/*
+ * Timer values used in managing the routing table.
+ * Complete tables are broadcast every SUPPLY_INTERVAL seconds.
+ * If changes occur between updates, dynamic updates containing only changes
+ * may be sent.  When these are sent, a timer is set for a random value
+ * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates
+ * are sent until the timer expires.
+ *
+ * Every update of a routing entry forces an entry's timer to be reset.
+ * After EXPIRE_TIME without updates, the entry is marked invalid,
+ * but held onto until GARBAGE_TIME so that others may
+ * see it "be deleted".
+ */
+#define	TIMER_RATE		30	/* alarm clocks every 30 seconds */
+
+#define	SUPPLY_INTERVAL		30	/* time to supply tables */
+#define	MIN_WAITTIME		2	/* min. interval to broadcast changes */
+#define	MAX_WAITTIME		5	/* max. time to delay changes */
+
+#define	EXPIRE_TIME		180	/* time to mark entry invalid */
+#define	GARBAGE_TIME		240	/* time to garbage collect */
+
+#endif /* protocols/routed.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/protocols/rwhod.h b/ap/libc/glibc/glibc-2.22/inet/protocols/rwhod.h
new file mode 100644
index 0000000..446d6f9
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/protocols/rwhod.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ *
+ *	@(#)rwhod.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_RWHOD_H
+#define	_PROTOCOLS_RWHOD_H 1
+
+#include <sys/types.h>
+
+/*
+ * rwho protocol packet format.
+ */
+struct	outmp {
+	char	out_line[8];		/* tty name */
+	char	out_name[8];		/* user id */
+	int32_t	out_time;		/* time on */
+};
+
+struct	whod {
+	char	wd_vers;		/* protocol version # */
+	char	wd_type;		/* packet type, see below */
+	char	wd_pad[2];
+	int	wd_sendtime;		/* time stamp by sender */
+	int	wd_recvtime;		/* time stamp applied by receiver */
+	char	wd_hostname[32];	/* hosts's name */
+	int	wd_loadav[3];		/* load average as in uptime */
+	int	wd_boottime;		/* time system booted */
+	struct	whoent {
+		struct	outmp we_utmp;	/* active tty info */
+		int	we_idle;	/* tty idle time */
+	} wd_we[1024 / sizeof (struct whoent)];
+};
+
+#define	WHODVERSION	1
+#define	WHODTYPE_STATUS	1		/* host status */
+
+/* We used to define _PATH_RWHODIR here but it's now in <paths.h>.  */
+#include <paths.h>
+
+#endif /* protocols/rwhod.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/protocols/talkd.h b/ap/libc/glibc/glibc-2.22/inet/protocols/talkd.h
new file mode 100644
index 0000000..a8f33b1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/protocols/talkd.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ *
+ *	@(#)talkd.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PROTOCOLS_TALKD_H
+#define	_PROTOCOLS_TALKD_H 1
+
+/*
+ * This describes the protocol used by the talk server and clients.
+ *
+ * The talk server acts a repository of invitations, responding to
+ * requests by clients wishing to rendezvous for the purpose of
+ * holding a conversation.  In normal operation, a client, the caller,
+ * initiates a rendezvous by sending a CTL_MSG to the server of
+ * type LOOK_UP.  This causes the server to search its invitation
+ * tables to check if an invitation currently exists for the caller
+ * (to speak to the callee specified in the message).  If the lookup
+ * fails, the caller then sends an ANNOUNCE message causing the server
+ * to broadcast an announcement on the callee's login ports requesting
+ * contact.  When the callee responds, the local server uses the
+ * recorded invitation to respond with the appropriate rendezvous
+ * address and the caller and callee client programs establish a
+ * stream connection through which the conversation takes place.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+/*
+ * Client->server request message format.
+ */
+typedef struct {
+	u_char	vers;		/* protocol version */
+	u_char	type;		/* request type, see below */
+	u_char	answer;		/* not used */
+	u_char	pad;
+	u_int32_t id_num;	/* message id */
+	struct	osockaddr addr;		/* old (4.3) style */
+	struct	osockaddr ctl_addr;	/* old (4.3) style */
+	int32_t	pid;		/* caller's process id */
+#define	NAME_SIZE	12
+	char	l_name[NAME_SIZE];/* caller's name */
+	char	r_name[NAME_SIZE];/* callee's name */
+#define	TTY_SIZE	16
+	char	r_tty[TTY_SIZE];/* callee's tty name */
+} CTL_MSG;
+
+/*
+ * Server->client response message format.
+ */
+typedef struct {
+	u_char	vers;		/* protocol version */
+	u_char	type;		/* type of request message, see below */
+	u_char	answer;		/* response to request message, see below */
+	u_char	pad;
+	u_int32_t id_num;	/* message id */
+	struct	osockaddr addr;	/* address for establishing conversation */
+} CTL_RESPONSE;
+
+#define	TALK_VERSION	1		/* protocol version */
+
+/* message type values */
+#define LEAVE_INVITE	0	/* leave invitation with server */
+#define LOOK_UP		1	/* check for invitation by callee */
+#define DELETE		2	/* delete invitation by caller */
+#define ANNOUNCE	3	/* announce invitation by caller */
+
+/* answer values */
+#define SUCCESS		0	/* operation completed properly */
+#define NOT_HERE	1	/* callee not logged in */
+#define FAILED		2	/* operation failed for unexplained reason */
+#define MACHINE_UNKNOWN	3	/* caller's machine name unknown */
+#define PERMISSION_DENIED 4	/* callee's tty doesn't permit announce */
+#define UNKNOWN_REQUEST	5	/* request has invalid type value */
+#define	BADVERSION	6	/* request has invalid protocol version */
+#define	BADADDR		7	/* request has invalid addr value */
+#define	BADCTLADDR	8	/* request has invalid ctl_addr value */
+
+/*
+ * Operational parameters.
+ */
+#define MAX_LIFE	60	/* max time daemon saves invitations */
+/* RING_WAIT should be 10's of seconds less than MAX_LIFE */
+#define RING_WAIT	30	/* time to wait before resending invitation */
+
+#endif /* protocols/talkd.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/protocols/timed.h b/ap/libc/glibc/glibc-2.22/inet/protocols/timed.h
new file mode 100644
index 0000000..b5d4702
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/protocols/timed.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ *
+ *	@(#)timed.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef	_PROTOCOLS_TIMED_H
+#define	_PROTOCOLS_TIMED_H 1
+
+#include <sys/types.h>
+#include <sys/time.h>
+
+/*
+ * Time Synchronization Protocol
+ */
+
+#define	TSPVERSION	1
+#define ANYADDR 	NULL
+#define MAXHOSTNAMELEN	64
+
+struct tsp {
+	u_char	tsp_type;
+	u_char	tsp_vers;
+	u_short	tsp_seq;
+	union {
+		struct timeval tspu_time;
+		char tspu_hopcnt;
+	} tsp_u;
+	char tsp_name[MAXHOSTNAMELEN];
+};
+
+#define	tsp_time	tsp_u.tspu_time
+#define	tsp_hopcnt	tsp_u.tspu_hopcnt
+
+/*
+ * Command types.
+ */
+#define	TSP_ANY			0	/* match any types */
+#define	TSP_ADJTIME		1	/* send adjtime */
+#define	TSP_ACK			2	/* generic acknowledgement */
+#define	TSP_MASTERREQ		3	/* ask for master's name */
+#define	TSP_MASTERACK		4	/* acknowledge master request */
+#define	TSP_SETTIME		5	/* send network time */
+#define	TSP_MASTERUP		6	/* inform slaves that master is up */
+#define	TSP_SLAVEUP		7	/* slave is up but not polled */
+#define	TSP_ELECTION		8	/* advance candidature for master */
+#define	TSP_ACCEPT		9	/* support candidature of master */
+#define	TSP_REFUSE		10	/* reject candidature of master */
+#define	TSP_CONFLICT		11	/* two or more masters present */
+#define	TSP_RESOLVE		12	/* masters' conflict resolution */
+#define	TSP_QUIT		13	/* reject candidature if master is up */
+#define	TSP_DATE		14	/* reset the time (date command) */
+#define	TSP_DATEREQ		15	/* remote request to reset the time */
+#define	TSP_DATEACK		16	/* acknowledge time setting  */
+#define	TSP_TRACEON		17	/* turn tracing on */
+#define	TSP_TRACEOFF		18	/* turn tracing off */
+#define	TSP_MSITE		19	/* find out master's site */
+#define	TSP_MSITEREQ		20	/* remote master's site request */
+#define	TSP_TEST		21	/* for testing election algo */
+#define	TSP_SETDATE		22	/* New from date command */
+#define	TSP_SETDATEREQ		23	/* New remote for above */
+#define	TSP_LOOP		24	/* loop detection packet */
+
+#define	TSPTYPENUMBER		25
+
+#ifdef TSPTYPES
+char *tsptype[TSPTYPENUMBER] =
+  { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
+  "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
+  "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
+  "TEST", "SETDATE", "SETDATEREQ", "LOOP" };
+#endif
+
+#endif /* protocols/timed.h */
diff --git a/ap/libc/glibc/glibc-2.22/inet/rcmd.c b/ap/libc/glibc/glibc-2.22/inet/rcmd.c
new file mode 100644
index 0000000..035cb0d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/rcmd.c
@@ -0,0 +1,855 @@
+/*
+ * Copyright (C) 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ */
+/*
+ * Copyright (c) 1983, 1993, 1994
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)rcmd.c	8.3 (Berkeley) 3/26/94";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/param.h>
+#include <sys/poll.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <alloca.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdio_ext.h>
+#include <ctype.h>
+#include <string.h>
+#include <libintl.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <sys/uio.h>
+
+
+int __ivaliduser (FILE *, u_int32_t, const char *, const char *);
+static int __validuser2_sa (FILE *, struct sockaddr *, size_t,
+			    const char *, const char *, const char *);
+static int ruserok2_sa (struct sockaddr *ra, size_t ralen,
+			int superuser, const char *ruser,
+			const char *luser, const char *rhost);
+static int ruserok_sa (struct sockaddr *ra, size_t ralen,
+			int superuser, const char *ruser,
+			const char *luser);
+int iruserok_af (const void *raddr, int superuser, const char *ruser,
+		 const char *luser, sa_family_t af);
+int iruserok (u_int32_t raddr, int superuser, const char *ruser,
+	      const char *luser);
+
+libc_hidden_proto (iruserok_af)
+
+libc_freeres_ptr(static char *ahostbuf);
+
+int
+rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
+	char **ahost;
+	u_short rport;
+	const char *locuser, *remuser, *cmd;
+	int *fd2p;
+	sa_family_t af;
+{
+	char paddr[INET6_ADDRSTRLEN];
+	struct addrinfo hints, *res, *ai;
+	union
+	{
+		struct sockaddr sa;
+		struct sockaddr_storage ss;
+		struct sockaddr_in sin;
+		struct sockaddr_in6 sin6;
+	} from;
+	struct pollfd pfd[2];
+	int32_t oldmask;
+	pid_t pid;
+	int s, lport, timo, error;
+	char c;
+	int refused;
+	char num[8];
+	ssize_t n;
+
+	if (af != AF_INET && af != AF_INET6 && af != AF_UNSPEC)
+	  {
+	    __set_errno (EAFNOSUPPORT);
+	    return -1;
+	  }
+
+	pid = __getpid();
+
+	memset(&hints, '\0', sizeof(hints));
+	hints.ai_flags = AI_CANONNAME;
+	hints.ai_family = af;
+	hints.ai_socktype = SOCK_STREAM;
+	(void)__snprintf(num, sizeof(num), "%d", ntohs(rport));
+	error = getaddrinfo(*ahost, num, &hints, &res);
+	if (error) {
+		if (error == EAI_NONAME && *ahost != NULL)
+			__fxprintf(NULL, "%s: Unknown host\n", *ahost);
+		else
+			__fxprintf(NULL, "rcmd: getaddrinfo: %s\n",
+				   gai_strerror(error));
+
+		return -1;
+	}
+
+	pfd[0].events = POLLIN;
+	pfd[1].events = POLLIN;
+
+	if (res->ai_canonname){
+		free (ahostbuf);
+		ahostbuf = strdup (res->ai_canonname);
+		if (ahostbuf == NULL) {
+			__fxprintf(NULL, "%s",
+				   _("rcmd: Cannot allocate memory\n"));
+			return -1;
+		}
+		*ahost = ahostbuf;
+	} else
+		*ahost = NULL;
+	ai = res;
+	refused = 0;
+	oldmask = __sigblock(sigmask(SIGURG));
+	for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
+		char errbuf[200];
+
+		s = rresvport_af(&lport, ai->ai_family);
+		if (s < 0) {
+			if (errno == EAGAIN)
+				__fxprintf(NULL, "%s", _("\
+rcmd: socket: All ports in use\n"));
+			else
+				__fxprintf(NULL, "rcmd: socket: %m\n");
+
+			__sigsetmask(oldmask);
+			freeaddrinfo(res);
+			return -1;
+		}
+		__fcntl(s, F_SETOWN, pid);
+		if (__connect(s, ai->ai_addr, ai->ai_addrlen) >= 0)
+			break;
+		(void)__close(s);
+		if (errno == EADDRINUSE) {
+			lport--;
+			continue;
+		}
+		if (errno == ECONNREFUSED)
+			refused = 1;
+		if (ai->ai_next != NULL) {
+			int oerrno = errno;
+			char *buf = NULL;
+
+			getnameinfo(ai->ai_addr, ai->ai_addrlen,
+				    paddr, sizeof(paddr),
+				    NULL, 0,
+				    NI_NUMERICHOST);
+
+			if (__asprintf (&buf, _("connect to address %s: "),
+					paddr) >= 0)
+			  {
+			    __fxprintf(NULL, "%s", buf);
+			    free (buf);
+			  }
+			__set_errno (oerrno);
+			perror(0);
+			ai = ai->ai_next;
+			getnameinfo(ai->ai_addr, ai->ai_addrlen,
+				    paddr, sizeof(paddr),
+				    NULL, 0,
+				    NI_NUMERICHOST);
+			if (__asprintf (&buf, _("Trying %s...\n"), paddr) >= 0)
+			  {
+			    __fxprintf (NULL, "%s", buf);
+			    free (buf);
+			  }
+			continue;
+		}
+		if (refused && timo <= 16) {
+			(void)__sleep(timo);
+			timo *= 2;
+			ai = res;
+			refused = 0;
+			continue;
+		}
+		freeaddrinfo(res);
+		(void)__fxprintf(NULL, "%s: %s\n", *ahost,
+				 __strerror_r(errno, errbuf, sizeof (errbuf)));
+		__sigsetmask(oldmask);
+		return -1;
+	}
+	lport--;
+	if (fd2p == 0) {
+		__write(s, "", 1);
+		lport = 0;
+	} else {
+		char num[8];
+		int s2 = rresvport_af(&lport, ai->ai_family), s3;
+		socklen_t len = ai->ai_addrlen;
+
+		if (s2 < 0)
+			goto bad;
+		__listen(s2, 1);
+		(void)__snprintf(num, sizeof(num), "%d", lport);
+		if (__write(s, num, strlen(num)+1) != (ssize_t)strlen(num)+1) {
+			char *buf = NULL;
+
+			if (__asprintf (&buf, _("\
+rcmd: write (setting up stderr): %m\n")) >= 0)
+			  {
+			    __fxprintf(NULL, "%s", buf);
+			    free (buf);
+			  }
+			(void)__close(s2);
+			goto bad;
+		}
+		pfd[0].fd = s;
+		pfd[1].fd = s2;
+		__set_errno (0);
+		if (__poll (pfd, 2, -1) < 1 || (pfd[1].revents & POLLIN) == 0){
+			char *buf = NULL;
+
+			if ((errno != 0
+			     && __asprintf(&buf, _("\
+rcmd: poll (setting up stderr): %m\n")) >= 0)
+			    || (errno == 0
+				&& __asprintf(&buf, _("\
+poll: protocol failure in circuit setup\n")) >= 0))
+			  {
+			    __fxprintf (NULL, "%s", buf);
+			    free  (buf);
+			  }
+			(void)__close(s2);
+			goto bad;
+		}
+		s3 = TEMP_FAILURE_RETRY (accept(s2, &from.sa, &len));
+		switch (from.sa.sa_family) {
+		case AF_INET:
+			rport = ntohs(from.sin.sin_port);
+			break;
+		case AF_INET6:
+			rport = ntohs(from.sin6.sin6_port);
+			break;
+		default:
+			rport = 0;
+			break;
+		}
+		(void)__close(s2);
+		if (s3 < 0) {
+			(void)__fxprintf(NULL, "rcmd: accept: %m\n");
+			lport = 0;
+			goto bad;
+		}
+		*fd2p = s3;
+
+		if (rport >= IPPORT_RESERVED || rport < IPPORT_RESERVED / 2){
+			char *buf = NULL;
+
+			if (__asprintf(&buf, _("\
+socket: protocol failure in circuit setup\n")) >= 0)
+			  {
+			    __fxprintf (NULL, "%s", buf);
+			    free (buf);
+			  }
+			goto bad2;
+		}
+	}
+	struct iovec iov[3] =
+	  {
+	    [0] = { .iov_base = (void *) locuser,
+		    .iov_len = strlen (locuser) + 1 },
+	    [1] = { .iov_base = (void *) remuser,
+		    .iov_len = strlen (remuser) + 1 },
+	    [2] = { .iov_base = (void *) cmd,
+		    .iov_len = strlen (cmd) + 1 }
+	  };
+	(void) TEMP_FAILURE_RETRY (__writev (s, iov, 3));
+	n = TEMP_FAILURE_RETRY (__read(s, &c, 1));
+	if (n != 1) {
+		char *buf = NULL;
+
+		if ((n == 0
+		     && __asprintf(&buf, _("rcmd: %s: short read"),
+				   *ahost) >= 0)
+		    || (n != 0
+			&& __asprintf(&buf, "rcmd: %s: %m\n", *ahost) >= 0))
+		  {
+		    __fxprintf (NULL, "%s", buf);
+		    free (buf);
+		  }
+		goto bad2;
+	}
+	if (c != 0) {
+		while (__read(s, &c, 1) == 1) {
+			(void)__write(STDERR_FILENO, &c, 1);
+			if (c == '\n')
+				break;
+		}
+		goto bad2;
+	}
+	__sigsetmask(oldmask);
+	freeaddrinfo(res);
+	return s;
+bad2:
+	if (lport)
+		(void)__close(*fd2p);
+bad:
+	(void)__close(s);
+	__sigsetmask(oldmask);
+	freeaddrinfo(res);
+	return -1;
+}
+libc_hidden_def (rcmd_af)
+
+int
+rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
+	char **ahost;
+	u_short rport;
+	const char *locuser, *remuser, *cmd;
+	int *fd2p;
+{
+  return rcmd_af (ahost, rport, locuser, remuser, cmd, fd2p, AF_INET);
+}
+
+int
+rresvport_af(alport, family)
+	int *alport;
+	sa_family_t family;
+{
+	union {
+		struct sockaddr generic;
+		struct sockaddr_in in;
+		struct sockaddr_in6 in6;
+	} ss;
+	int s;
+	size_t len;
+	uint16_t *sport;
+
+	switch(family){
+	case AF_INET:
+		len = sizeof(struct sockaddr_in);
+		sport = &ss.in.sin_port;
+		break;
+	case AF_INET6:
+		len = sizeof(struct sockaddr_in6);
+		sport = &ss.in6.sin6_port;
+		break;
+	default:
+		__set_errno (EAFNOSUPPORT);
+		return -1;
+	}
+	s = __socket(family, SOCK_STREAM, 0);
+	if (s < 0)
+		return -1;
+
+	memset (&ss, '\0', sizeof(ss));
+#ifdef SALEN
+	ss.generic.__ss_len = len;
+#endif
+	ss.generic.sa_family = family;
+
+	/* Ignore invalid values.  */
+	if (*alport < IPPORT_RESERVED / 2)
+		*alport = IPPORT_RESERVED / 2;
+	else if (*alport >= IPPORT_RESERVED)
+		*alport = IPPORT_RESERVED - 1;
+
+	int start = *alport;
+	do {
+		*sport = htons((uint16_t) *alport);
+		if (__bind(s, &ss.generic, len) >= 0)
+			return s;
+		if (errno != EADDRINUSE) {
+			(void)__close(s);
+			return -1;
+		}
+		if ((*alport)-- == IPPORT_RESERVED/2)
+			*alport = IPPORT_RESERVED - 1;
+	} while (*alport != start);
+	(void)__close(s);
+	__set_errno (EAGAIN);
+	return -1;
+}
+libc_hidden_def (rresvport_af)
+
+int
+rresvport(alport)
+	int *alport;
+{
+	return rresvport_af(alport, AF_INET);
+}
+
+int	__check_rhosts_file = 1;
+char	*__rcmd_errstr;
+
+int
+ruserok_af(rhost, superuser, ruser, luser, af)
+	const char *rhost, *ruser, *luser;
+	int superuser;
+	sa_family_t af;
+{
+	struct addrinfo hints, *res, *res0;
+	int gai;
+	int ret;
+
+	memset (&hints, '\0', sizeof(hints));
+	hints.ai_family = af;
+	gai = getaddrinfo(rhost, NULL, &hints, &res0);
+	if (gai)
+		return -1;
+	ret = -1;
+	for (res=res0; res; res=res->ai_next)
+		if (ruserok2_sa(res->ai_addr, res->ai_addrlen,
+				superuser, ruser, luser, rhost) == 0){
+			ret = 0;
+			break;
+		}
+	freeaddrinfo(res0);
+	return (ret);
+}
+libc_hidden_def (ruserok_af)
+
+int
+ruserok(rhost, superuser, ruser, luser)
+	const char *rhost, *ruser, *luser;
+	int superuser;
+{
+	return ruserok_af(rhost, superuser, ruser, luser, AF_INET);
+}
+
+/* Extremely paranoid file open function. */
+static FILE *
+iruserfopen (const char *file, uid_t okuser)
+{
+  struct stat64 st;
+  char *cp = NULL;
+  FILE *res = NULL;
+
+  /* If not a regular file, if owned by someone other than user or
+     root, if writeable by anyone but the owner, or if hardlinked
+     anywhere, quit.  */
+  if (__lxstat64 (_STAT_VER, file, &st))
+    cp = _("lstat failed");
+  else if (!S_ISREG (st.st_mode))
+    cp = _("not regular file");
+  else
+    {
+      res = fopen (file, "rce");
+      if (!res)
+	cp = _("cannot open");
+      else if (__fxstat64 (_STAT_VER, fileno (res), &st) < 0)
+	cp = _("fstat failed");
+      else if (st.st_uid && st.st_uid != okuser)
+	cp = _("bad owner");
+      else if (st.st_mode & (S_IWGRP|S_IWOTH))
+	cp = _("writeable by other than owner");
+      else if (st.st_nlink > 1)
+	cp = _("hard linked somewhere");
+    }
+
+  /* If there were any problems, quit.  */
+  if (cp != NULL)
+    {
+      __rcmd_errstr = cp;
+      if (res)
+	fclose (res);
+      return NULL;
+    }
+
+  /* No threads use this stream.  */
+  __fsetlocking (res, FSETLOCKING_BYCALLER);
+
+  return res;
+}
+
+/*
+ * New .rhosts strategy: We are passed an ip address. We spin through
+ * hosts.equiv and .rhosts looking for a match. When the .rhosts only
+ * has ip addresses, we don't have to trust a nameserver.  When it
+ * contains hostnames, we spin through the list of addresses the nameserver
+ * gives us and look for a match.
+ *
+ * Returns 0 if ok, -1 if not ok.
+ */
+static int
+ruserok2_sa (ra, ralen, superuser, ruser, luser, rhost)
+     struct sockaddr *ra;
+     size_t ralen;
+     int superuser;
+     const char *ruser, *luser, *rhost;
+{
+  FILE *hostf = NULL;
+  int isbad = -1;
+
+  if (!superuser)
+    hostf = iruserfopen (_PATH_HEQUIV, 0);
+
+  if (hostf)
+    {
+      isbad = __validuser2_sa (hostf, ra, ralen, luser, ruser, rhost);
+      fclose (hostf);
+
+      if (!isbad)
+	return 0;
+    }
+
+  if (__check_rhosts_file || superuser)
+    {
+      char *pbuf;
+      struct passwd pwdbuf, *pwd;
+      size_t dirlen;
+      size_t buflen = __sysconf (_SC_GETPW_R_SIZE_MAX);
+      char *buffer = __alloca (buflen);
+      uid_t uid;
+
+      if (__getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) != 0
+	  || pwd == NULL)
+	return -1;
+
+      dirlen = strlen (pwd->pw_dir);
+      pbuf = alloca (dirlen + sizeof "/.rhosts");
+      __mempcpy (__mempcpy (pbuf, pwd->pw_dir, dirlen),
+		 "/.rhosts", sizeof "/.rhosts");
+
+       /* Change effective uid while reading .rhosts.  If root and
+	  reading an NFS mounted file system, can't read files that
+	  are protected read/write owner only.  */
+       uid = __geteuid ();
+       seteuid (pwd->pw_uid);
+       hostf = iruserfopen (pbuf, pwd->pw_uid);
+
+       if (hostf != NULL)
+	 {
+	   isbad = __validuser2_sa (hostf, ra, ralen, luser, ruser, rhost);
+	   fclose (hostf);
+	 }
+
+       seteuid (uid);
+       return isbad;
+    }
+  return -1;
+}
+/*
+ * ruserok_sa() is now discussed on ipng, so
+ * currently disabled for external use
+ */
+static int ruserok_sa(ra, ralen, superuser, ruser, luser)
+     struct sockaddr *ra;
+     size_t ralen;
+     int superuser;
+     const char *ruser, *luser;
+{
+  return ruserok2_sa(ra, ralen, superuser, ruser, luser, "-");
+}
+
+/* This is the exported version.  */
+int
+iruserok_af (raddr, superuser, ruser, luser, af)
+     const void *raddr;
+     int superuser;
+     const char *ruser, *luser;
+     sa_family_t af;
+{
+  union {
+    struct sockaddr generic;
+    struct sockaddr_in in;
+    struct sockaddr_in6 in6;
+  } ra;
+  size_t ralen;
+
+  memset (&ra, '\0', sizeof(ra));
+  switch (af){
+  case AF_INET:
+    ra.in.sin_family = AF_INET;
+    memcpy (&ra.in.sin_addr, raddr, sizeof(struct in_addr));
+    ralen = sizeof(struct sockaddr_in);
+    break;
+  case AF_INET6:
+    ra.in6.sin6_family = AF_INET6;
+    memcpy (&ra.in6.sin6_addr, raddr, sizeof(struct in6_addr));
+    ralen = sizeof(struct sockaddr_in6);
+    break;
+  default:
+    return 0;
+  }
+  return ruserok_sa (&ra.generic, ralen, superuser, ruser, luser);
+}
+libc_hidden_def (iruserok_af)
+
+int
+iruserok (raddr, superuser, ruser, luser)
+     u_int32_t raddr;
+     int superuser;
+     const char *ruser, *luser;
+{
+  return iruserok_af (&raddr, superuser, ruser, luser, AF_INET);
+}
+
+/*
+ * XXX
+ * Don't make static, used by lpd(8).
+ *
+ * This function is not used anymore. It is only present because lpd(8)
+ * calls it (!?!). We simply call __invaliduser2() with an illegal rhost
+ * argument. This means that netgroups won't work in .rhost/hosts.equiv
+ * files. If you want lpd to work with netgroups, fix lpd to use ruserok()
+ * or PAM.
+ * Returns 0 if ok, -1 if not ok.
+ */
+int
+__ivaliduser(hostf, raddr, luser, ruser)
+	FILE *hostf;
+	u_int32_t raddr;
+	const char *luser, *ruser;
+{
+	struct sockaddr_in ra;
+	memset(&ra, '\0', sizeof(ra));
+	ra.sin_family = AF_INET;
+	ra.sin_addr.s_addr = raddr;
+	return __validuser2_sa(hostf, (struct sockaddr *)&ra, sizeof(ra),
+			       luser, ruser, "-");
+}
+
+
+/* Returns 1 on positive match, 0 on no match, -1 on negative match.  */
+static int
+internal_function
+__checkhost_sa (struct sockaddr *ra, size_t ralen, char *lhost,
+		const char *rhost)
+{
+	struct addrinfo hints, *res0, *res;
+	char raddr[INET6_ADDRSTRLEN];
+	int match;
+	int negate=1;    /* Multiply return with this to get -1 instead of 1 */
+
+	/* Check nis netgroup.  */
+	if (strncmp ("+@", lhost, 2) == 0)
+		return innetgr (&lhost[2], rhost, NULL, NULL);
+
+	if (strncmp ("-@", lhost, 2) == 0)
+		return -innetgr (&lhost[2], rhost, NULL, NULL);
+
+	/* -host */
+	if (strncmp ("-", lhost,1) == 0) {
+		negate = -1;
+		lhost++;
+	} else if (strcmp ("+",lhost) == 0) {
+		return 1;                    /* asking for trouble, but ok.. */
+	}
+
+	/* Try for raw ip address first. */
+	/* XXX */
+	if (getnameinfo(ra, ralen,
+			raddr, sizeof(raddr), NULL, 0,
+			NI_NUMERICHOST) == 0
+	    && strcmp(raddr, lhost) == 0)
+		return negate;
+
+	/* Better be a hostname. */
+	match = 0;
+	memset(&hints, '\0', sizeof(hints));
+	hints.ai_family = ra->sa_family;
+	if (getaddrinfo(lhost, NULL, &hints, &res0) == 0){
+		/* Spin through ip addresses. */
+		for (res = res0; res; res = res->ai_next)
+		  {
+		    if (res->ai_family == ra->sa_family
+			&& !memcmp(res->ai_addr, ra, res->ai_addrlen))
+		      {
+			match = 1;
+			break;
+		      }
+		  }
+		freeaddrinfo (res0);
+	}
+	return negate * match;
+}
+
+/* Returns 1 on positive match, 0 on no match, -1 on negative match.  */
+static int
+internal_function
+__icheckuser (const char *luser, const char *ruser)
+{
+    /*
+      luser is user entry from .rhosts/hosts.equiv file
+      ruser is user id on remote host
+      */
+
+    /* [-+]@netgroup */
+    if (strncmp ("+@", luser, 2) == 0)
+	return innetgr (&luser[2], NULL, ruser, NULL);
+
+    if (strncmp ("-@", luser,2) == 0)
+	return -innetgr (&luser[2], NULL, ruser, NULL);
+
+    /* -user */
+    if (strncmp ("-", luser, 1) == 0)
+	return -(strcmp (&luser[1], ruser) == 0);
+
+    /* + */
+    if (strcmp ("+", luser) == 0)
+	return 1;
+
+    /* simple string match */
+    return strcmp (ruser, luser) == 0;
+}
+
+/*
+ * Returns 1 for blank lines (or only comment lines) and 0 otherwise
+ */
+static int
+__isempty (char *p)
+{
+    while (*p && isspace (*p)) {
+	++p;
+    }
+
+    return (*p == '\0' || *p == '#') ? 1 : 0 ;
+}
+
+/*
+ * Returns 0 if positive match, -1 if _not_ ok.
+ */
+static int
+__validuser2_sa(hostf, ra, ralen, luser, ruser, rhost)
+	FILE *hostf;
+	struct sockaddr *ra;
+	size_t ralen;
+	const char *luser, *ruser, *rhost;
+{
+    const char *user;
+    char *p;
+    int hcheck, ucheck;
+    char *buf = NULL;
+    size_t bufsize = 0;
+    int retval = -1;
+
+    while (__getline (&buf, &bufsize, hostf) > 0) {
+	buf[bufsize - 1] = '\0'; /* Make sure it's terminated.  */
+	p = buf;
+
+	/* Skip empty or comment lines */
+	if (__isempty (p)) {
+	    continue;
+	}
+
+	for (;*p && !isspace(*p); ++p) {
+	    *p = _tolower (*p);
+	}
+
+	/* Next we want to find the permitted name for the remote user.  */
+	if (*p == ' ' || *p == '\t') {
+	    /* <nul> terminate hostname and skip spaces */
+	    for (*p++='\0'; *p && isspace (*p); ++p);
+
+	    user = p;                   /* this is the user's name */
+	    while (*p && !isspace (*p))
+		++p;                    /* find end of user's name */
+	} else
+	    user = p;
+
+	*p = '\0';              /* <nul> terminate username (+host?) */
+
+	/* buf -> host(?) ; user -> username(?) */
+	if (*buf == '\0')
+	  break;
+	if (*user == '\0')
+	  user = luser;
+
+	/* First check the user part.  In a naive implementation we
+	   would check the host part first, then the user.  However,
+	   if we check the user first and reject the entry we will
+	   have saved doing any host lookups to normalize the comparison
+	   and that likely saves several DNS queries.  Therefore we
+	   check the user first.  */
+	ucheck = __icheckuser (user, ruser);
+
+	/* Either we found the user, or we didn't and this is a
+	   negative host check.  We must do the negative host lookup
+	   in order to preserve the semantics of stopping on this line
+	   before processing others.  */
+	if (ucheck != 0 || *buf == '-') {
+
+	    /* Next check host part.  */
+	    hcheck = __checkhost_sa (ra, ralen, buf, rhost);
+
+	    /* Negative '-host user(?)' match?  */
+	    if (hcheck < 0)
+		break;
+
+	    /* Positive 'host user' match?  */
+	    if (hcheck > 0 && ucheck > 0) {
+		retval = 0;
+		break;
+	    }
+
+	    /* Negative 'host -user' match?  */
+	    if (hcheck > 0 && ucheck < 0)
+	      break;
+
+	    /* Neither, go on looking for match.  */
+	}
+    }
+
+    free (buf);
+
+    return retval;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/rexec.c b/ap/libc/glibc/glibc-2.22/inet/rexec.c
new file mode 100644
index 0000000..75bb470
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/rexec.c
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 1980, 1993
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)rexec.c	8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+
+#include <alloca.h>
+#include <stdio.h>
+#include <netdb.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/uio.h>
+
+int	rexecoptions;
+libc_freeres_ptr (static char *ahostbuf);
+
+int
+rexec_af(ahost, rport, name, pass, cmd, fd2p, af)
+	char **ahost;
+	int rport;
+	const char *name, *pass, *cmd;
+	int *fd2p;
+	sa_family_t af;
+{
+	struct sockaddr_storage from;
+	struct addrinfo hints, *res0;
+	const char *orig_name = name;
+	const char *orig_pass = pass;
+	u_short port = 0;
+	int s, timo = 1, s3;
+	char c;
+	int gai;
+	char servbuff[NI_MAXSERV];
+
+	__snprintf(servbuff, sizeof(servbuff), "%d", ntohs(rport));
+	servbuff[sizeof(servbuff) - 1] = '\0';
+
+	memset(&hints, '\0', sizeof(hints));
+	hints.ai_family = af;
+	hints.ai_socktype = SOCK_STREAM;
+	hints.ai_flags = AI_CANONNAME;
+	gai = getaddrinfo(*ahost, servbuff, &hints, &res0);
+	if (gai){
+		/* XXX: set errno? */
+		return -1;
+	}
+
+	if (res0->ai_canonname){
+		free (ahostbuf);
+		ahostbuf = strdup (res0->ai_canonname);
+		if (ahostbuf == NULL) {
+			perror ("rexec: strdup");
+			return (-1);
+		}
+		*ahost = ahostbuf;
+	} else {
+		*ahost = NULL;
+		__set_errno (ENOENT);
+		return -1;
+	}
+	ruserpass(res0->ai_canonname, &name, &pass);
+retry:
+	s = __socket(res0->ai_family, res0->ai_socktype, 0);
+	if (s < 0) {
+		perror("rexec: socket");
+		return (-1);
+	}
+	if (__connect(s, res0->ai_addr, res0->ai_addrlen) < 0) {
+		if (errno == ECONNREFUSED && timo <= 16) {
+			(void) __close(s);
+			__sleep(timo);
+			timo *= 2;
+			goto retry;
+		}
+		perror(res0->ai_canonname);
+		return (-1);
+	}
+	if (fd2p == 0) {
+		(void) __write(s, "", 1);
+		port = 0;
+	} else {
+		char num[32];
+		int s2;
+		union
+		{
+		  struct sockaddr_storage ss;
+		  struct sockaddr sa;
+		} sa2;
+		socklen_t sa2len;
+
+		s2 = __socket(res0->ai_family, res0->ai_socktype, 0);
+		if (s2 < 0) {
+			(void) __close(s);
+			return (-1);
+		}
+		__listen(s2, 1);
+		sa2len = sizeof (sa2);
+		if (__getsockname(s2, &sa2.sa, &sa2len) < 0) {
+			perror("getsockname");
+			(void) __close(s2);
+			goto bad;
+		} else if (sa2len != SA_LEN(&sa2.sa)) {
+			__set_errno(EINVAL);
+			(void) __close(s2);
+			goto bad;
+		}
+		port = 0;
+		if (!getnameinfo(&sa2.sa, sa2len,
+				 NULL, 0, servbuff, sizeof(servbuff),
+				 NI_NUMERICSERV))
+			port = atoi(servbuff);
+		(void) sprintf(num, "%u", port);
+		(void) __write(s, num, strlen(num)+1);
+		{ socklen_t len = sizeof (from);
+		  s3 = TEMP_FAILURE_RETRY (accept(s2, (struct sockaddr *)&from,
+						  &len));
+		  __close(s2);
+		  if (s3 < 0) {
+			perror("accept");
+			port = 0;
+			goto bad;
+		  }
+		}
+		*fd2p = s3;
+	}
+
+	struct iovec iov[3] =
+	  {
+	    [0] = { .iov_base = (void *) name, .iov_len = strlen (name) + 1 },
+	    /* should public key encypt the password here */
+	    [1] = { .iov_base = (void *) pass, .iov_len = strlen (pass) + 1 },
+	    [2] = { .iov_base = (void *) cmd, .iov_len = strlen (cmd) + 1 }
+	  };
+	(void) TEMP_FAILURE_RETRY (__writev (s, iov, 3));
+
+	/* We don't need the memory allocated for the name and the password
+	   in ruserpass anymore.  */
+	if (name != orig_name)
+	  free ((char *) name);
+	if (pass != orig_pass)
+	  free ((char *) pass);
+
+	if (__read(s, &c, 1) != 1) {
+		perror(*ahost);
+		goto bad;
+	}
+	if (c != 0) {
+		while (__read(s, &c, 1) == 1) {
+			(void) __write(2, &c, 1);
+			if (c == '\n')
+				break;
+		}
+		goto bad;
+	}
+	freeaddrinfo(res0);
+	return (s);
+bad:
+	if (port)
+		(void) __close(*fd2p);
+	(void) __close(s);
+	freeaddrinfo(res0);
+	return (-1);
+}
+libc_hidden_def (rexec_af)
+
+int
+rexec(ahost, rport, name, pass, cmd, fd2p)
+	char **ahost;
+	int rport;
+	const char *name, *pass, *cmd;
+	int *fd2p;
+{
+	return rexec_af(ahost, rport, name, pass, cmd, fd2p, AF_INET);
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/ruserpass.c b/ap/libc/glibc/glibc-2.22/inet/ruserpass.c
new file mode 100644
index 0000000..2669a88
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/ruserpass.c
@@ -0,0 +1,328 @@
+/*
+ * Copyright (c) 1985, 1993, 1994
+ *	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 the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)ruserpass.c	8.3 (Berkeley) 4/2/94";
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <ctype.h>
+#include <err.h>
+#include <errno.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <stdio_ext.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <libintl.h>
+
+/* #include "ftp_var.h" */
+
+static	int token (void);
+static	FILE *cfile;
+
+#define	DEFAULT	1
+#define	LOGIN	2
+#define	PASSWD	3
+#define	ACCOUNT 4
+#define MACDEF  5
+#define	ID	10
+#define	MACHINE	11
+
+static char tokval[100];
+
+static const char tokstr[] =
+{
+#define TOK_DEFAULT_IDX	0
+  "default\0"
+#define TOK_LOGIN_IDX	(TOK_DEFAULT_IDX + sizeof "default")
+  "login\0"
+#define TOK_PASSWORD_IDX (TOK_LOGIN_IDX + sizeof "login")
+  "password\0"
+#define TOK_PASSWD_IDX	(TOK_PASSWORD_IDX + sizeof "password")
+  "passwd\0"
+#define TOK_ACCOUNT_IDX	(TOK_PASSWD_IDX + sizeof "passwd")
+  "account\0"
+#define TOK_MACHINE_IDX	(TOK_ACCOUNT_IDX + sizeof "account")
+  "machine\0"
+#define TOK_MACDEF_IDX	(TOK_MACHINE_IDX + sizeof "machine")
+  "macdef"
+};
+
+static const struct toktab {
+	int tokstr_off;
+	int tval;
+} toktab[]= {
+	{ TOK_DEFAULT_IDX,	DEFAULT },
+	{ TOK_LOGIN_IDX,	LOGIN },
+	{ TOK_PASSWORD_IDX,	PASSWD },
+	{ TOK_PASSWD_IDX,	PASSWD },
+	{ TOK_ACCOUNT_IDX,	ACCOUNT },
+	{ TOK_MACHINE_IDX,	MACHINE },
+	{ TOK_MACDEF_IDX,	MACDEF }
+};
+
+
+
+int
+ruserpass(host, aname, apass)
+	const char *host, **aname, **apass;
+{
+	char *hdir, *buf, *tmp;
+	char myname[1024], *mydomain;
+	int t, usedefault = 0;
+	struct stat64 stb;
+
+	hdir = __libc_secure_getenv("HOME");
+	if (hdir == NULL) {
+		/* If we can't get HOME, fail instead of trying ".",
+		   which is no improvement. This really should call
+		   getpwuid(getuid()).  */
+		/*hdir = ".";*/
+		return -1;
+	}
+
+	buf = alloca (strlen (hdir) + 8);
+
+	__stpcpy (__stpcpy (buf, hdir), "/.netrc");
+	cfile = fopen(buf, "rce");
+	if (cfile == NULL) {
+		if (errno != ENOENT)
+			warn("%s", buf);
+		return (0);
+	}
+	/* No threads use this stream.  */
+	__fsetlocking (cfile, FSETLOCKING_BYCALLER);
+	if (__gethostname(myname, sizeof(myname)) < 0)
+		myname[0] = '\0';
+	mydomain = __strchrnul(myname, '.');
+next:
+	while ((t = token())) switch(t) {
+
+	case DEFAULT:
+		usedefault = 1;
+		/* FALL THROUGH */
+
+	case MACHINE:
+		if (!usedefault) {
+			if (token() != ID)
+				continue;
+			/*
+			 * Allow match either for user's input host name
+			 * or official hostname.  Also allow match of
+			 * incompletely-specified host in local domain.
+			 */
+			if (__strcasecmp(host, tokval) == 0)
+				goto match;
+/*			if (__strcasecmp(hostname, tokval) == 0)
+				goto match;
+			if ((tmp = strchr(hostname, '.')) != NULL &&
+			    __strcasecmp(tmp, mydomain) == 0 &&
+			    __strncasecmp(hostname, tokval, tmp-hostname) == 0 &&
+			    tokval[tmp - hostname] == '\0')
+				goto match; */
+			if ((tmp = strchr(host, '.')) != NULL &&
+			    __strcasecmp(tmp, mydomain) == 0 &&
+			    __strncasecmp(host, tokval, tmp - host) == 0 &&
+			    tokval[tmp - host] == '\0')
+				goto match;
+			continue;
+		}
+	match:
+		while ((t = token()) && t != MACHINE && t != DEFAULT) switch(t) {
+
+		case LOGIN:
+			if (token()) {
+				if (*aname == 0) {
+				  char *newp;
+				  newp = malloc((unsigned) strlen(tokval) + 1);
+				  if (newp == NULL)
+				    {
+				      warnx(_("out of memory"));
+				      goto bad;
+				    }
+				  *aname = strcpy(newp, tokval);
+				} else {
+					if (strcmp(*aname, tokval))
+						goto next;
+				}
+			}
+			break;
+		case PASSWD:
+			if (strcmp(*aname, "anonymous") &&
+			    fstat64(fileno(cfile), &stb) >= 0 &&
+			    (stb.st_mode & 077) != 0) {
+	warnx(_("Error: .netrc file is readable by others."));
+	warnx(_("Remove password or make file unreadable by others."));
+				goto bad;
+			}
+			if (token() && *apass == 0) {
+				char *newp;
+				newp = malloc((unsigned) strlen(tokval) + 1);
+				if (newp == NULL)
+				  {
+				    warnx(_("out of memory"));
+				    goto bad;
+				  }
+				*apass = strcpy(newp, tokval);
+			}
+			break;
+		case ACCOUNT:
+#if 0
+			if (fstat64(fileno(cfile), &stb) >= 0
+			    && (stb.st_mode & 077) != 0) {
+	warnx("Error: .netrc file is readable by others.");
+	warnx("Remove account or make file unreadable by others.");
+				goto bad;
+			}
+			if (token() && *aacct == 0) {
+				*aacct = malloc((unsigned) strlen(tokval) + 1);
+				(void) strcpy(*aacct, tokval);
+			}
+#endif
+			break;
+		case MACDEF:
+#if 0
+			if (proxy) {
+				(void) fclose(cfile);
+				return (0);
+			}
+			while ((c=getc_unlocked(cfile)) != EOF && c == ' '
+			       || c == '\t');
+			if (c == EOF || c == '\n') {
+				printf("Missing macdef name argument.\n");
+				goto bad;
+			}
+			if (macnum == 16) {
+				printf("Limit of 16 macros have already been defined\n");
+				goto bad;
+			}
+			tmp = macros[macnum].mac_name;
+			*tmp++ = c;
+			for (i=0; i < 8 && (c=getc_unlocked(cfile)) != EOF &&
+			    !isspace(c); ++i) {
+				*tmp++ = c;
+			}
+			if (c == EOF) {
+				printf("Macro definition missing null line terminator.\n");
+				goto bad;
+			}
+			*tmp = '\0';
+			if (c != '\n') {
+				while ((c=getc_unlocked(cfile)) != EOF
+				       && c != '\n');
+			}
+			if (c == EOF) {
+				printf("Macro definition missing null line terminator.\n");
+				goto bad;
+			}
+			if (macnum == 0) {
+				macros[macnum].mac_start = macbuf;
+			}
+			else {
+				macros[macnum].mac_start = macros[macnum-1].mac_end + 1;
+			}
+			tmp = macros[macnum].mac_start;
+			while (tmp != macbuf + 4096) {
+				if ((c=getc_unlocked(cfile)) == EOF) {
+				printf("Macro definition missing null line terminator.\n");
+					goto bad;
+				}
+				*tmp = c;
+				if (*tmp == '\n') {
+					if (*(tmp-1) == '\0') {
+					   macros[macnum++].mac_end = tmp - 1;
+					   break;
+					}
+					*tmp = '\0';
+				}
+				tmp++;
+			}
+			if (tmp == macbuf + 4096) {
+				printf("4K macro buffer exceeded\n");
+				goto bad;
+			}
+#endif
+			break;
+		default:
+			warnx(_("Unknown .netrc keyword %s"), tokval);
+			break;
+		}
+		goto done;
+	}
+done:
+	(void) fclose(cfile);
+	return (0);
+bad:
+	(void) fclose(cfile);
+	return (-1);
+}
+libc_hidden_def (ruserpass)
+
+static int
+token (void)
+{
+	char *cp;
+	int c;
+	int i;
+
+	if (feof_unlocked(cfile) || ferror_unlocked(cfile))
+		return (0);
+	while ((c = getc_unlocked(cfile)) != EOF &&
+	    (c == '\n' || c == '\t' || c == ' ' || c == ','))
+		continue;
+	if (c == EOF)
+		return (0);
+	cp = tokval;
+	if (c == '"') {
+		while ((c = getc_unlocked(cfile)) != EOF && c != '"') {
+			if (c == '\\')
+				c = getc_unlocked(cfile);
+			*cp++ = c;
+		}
+	} else {
+		*cp++ = c;
+		while ((c = getc_unlocked(cfile)) != EOF
+		    && c != '\n' && c != '\t' && c != ' ' && c != ',') {
+			if (c == '\\')
+				c = getc_unlocked(cfile);
+			*cp++ = c;
+		}
+	}
+	*cp = 0;
+	if (tokval[0] == 0)
+		return (0);
+	for (i = 0; i < (int) (sizeof (toktab) / sizeof (toktab[0])); ++i)
+		if (!strcmp(&tokstr[toktab[i].tokstr_off], tokval))
+			return toktab[i].tval;
+	return (ID);
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/setipv4sourcefilter.c b/ap/libc/glibc/glibc-2.22/inet/setipv4sourcefilter.c
new file mode 100644
index 0000000..1bcc728
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/setipv4sourcefilter.c
@@ -0,0 +1,33 @@
+/* Set source filter.  Stub version.
+   Copyright (C) 2004-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdint.h>
+#include <netinet/in.h>
+
+
+int
+setipv4sourcefilter (int s, struct in_addr interface, struct in_addr group,
+		     uint32_t fmode, uint32_t numsrc,
+		     const struct in_addr *slist)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (setipv4sourcefilter)
diff --git a/ap/libc/glibc/glibc-2.22/inet/setsourcefilter.c b/ap/libc/glibc/glibc-2.22/inet/setsourcefilter.c
new file mode 100644
index 0000000..4a2749b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/setsourcefilter.c
@@ -0,0 +1,33 @@
+/* Set source filter.  Stub version.
+   Copyright (C) 2004-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdint.h>
+#include <netinet/in.h>
+
+
+int
+setsourcefilter (int s, uint32_t interface, const struct sockaddr *group,
+		 socklen_t grouplen, uint32_t fmode, uint32_t numsrc,
+		 const struct sockaddr_storage *slist)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (setsourcefilter)
diff --git a/ap/libc/glibc/glibc-2.22/inet/test-ifaddrs.c b/ap/libc/glibc/glibc-2.22/inet/test-ifaddrs.c
new file mode 100644
index 0000000..6e6c015
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/test-ifaddrs.c
@@ -0,0 +1,99 @@
+/* Test listing of network interface addresses.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ifaddrs.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+static int failures;
+
+static const char *
+addr_string (struct sockaddr *sa, char *buf, size_t size)
+{
+  if (sa == NULL)
+    return "<none>";
+
+  switch (sa->sa_family)
+    {
+    case AF_INET:
+      return inet_ntop (AF_INET, &((struct sockaddr_in *) sa)->sin_addr,
+			buf, size);
+    case AF_INET6:
+      return inet_ntop (AF_INET6, &((struct sockaddr_in6 *) sa)->sin6_addr,
+			buf, size);
+#ifdef AF_LINK
+    case AF_LINK:
+      return "<link>";
+#endif
+    case AF_UNSPEC:
+      return "---";
+
+#ifdef AF_PACKET
+    case AF_PACKET:
+      return "<packet>";
+#endif
+
+    default:
+      ++failures;
+      printf ("sa_family=%d %08x\n", sa->sa_family,
+	      *(int*)&((struct sockaddr_in *) sa)->sin_addr.s_addr);
+      return "<unexpected sockaddr family>";
+    }
+}
+
+
+static int
+do_test (void)
+{
+  struct ifaddrs *ifaces, *ifa;
+
+  if (getifaddrs (&ifaces) < 0)
+    {
+      if (errno != ENOSYS)
+	{
+	  printf ("Couldn't get any interfaces: %s.\n", strerror (errno));
+	  exit (1);
+	}
+      /* The function is simply not implemented.  */
+      exit (0);
+    }
+
+  puts ("\
+Name           Flags   Address         Netmask         Broadcast/Destination");
+
+  for (ifa = ifaces; ifa != NULL; ifa = ifa->ifa_next)
+    {
+      char abuf[64], mbuf[64], dbuf[64];
+      printf ("%-15s%#.4x  %-15s %-15s %-15s\n",
+	      ifa->ifa_name, ifa->ifa_flags,
+	      addr_string (ifa->ifa_addr, abuf, sizeof (abuf)),
+	      addr_string (ifa->ifa_netmask, mbuf, sizeof (mbuf)),
+	      addr_string (ifa->ifa_broadaddr, dbuf, sizeof (dbuf)));
+    }
+
+  freeifaddrs (ifaces);
+
+  return failures ? 1 : 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/test-inet6_opt.c b/ap/libc/glibc/glibc-2.22/inet/test-inet6_opt.c
new file mode 100644
index 0000000..a7ebf00
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/test-inet6_opt.c
@@ -0,0 +1,211 @@
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+
+#define OPT_X	42
+#define OPT_Y	43
+#define OPT_Z	44
+
+static void *
+encode_inet6_opt (socklen_t *elp)
+{
+  void *eb = NULL;
+  socklen_t el;
+  int cl;
+  void *db;
+  int offset;
+  uint8_t val1;
+  uint16_t val2;
+  uint32_t val4;
+  uint64_t val8;
+
+  *elp = 0;
+#define CHECK() \
+  if (cl == -1)						\
+    {							\
+      printf ("cl == -1 on line %d\n", __LINE__);	\
+      free (eb);					\
+      return NULL;					\
+    }
+
+  /* Estimate the length */
+  cl = inet6_opt_init (NULL, 0);
+  CHECK ();
+  cl = inet6_opt_append (NULL, 0, cl, OPT_X, 12, 8, NULL);
+  CHECK ();
+  cl = inet6_opt_append (NULL, 0, cl, OPT_Y, 7, 4, NULL);
+  CHECK ();
+  cl = inet6_opt_append (NULL, 0, cl, OPT_Z, 7, 1, NULL);
+  CHECK ();
+  cl = inet6_opt_finish (NULL, 0, cl);
+  CHECK ();
+  el = cl;
+
+  eb = malloc (el + 8);
+  if (eb == NULL)
+    {
+      puts ("malloc failed");
+      return NULL;
+    }
+  /* Canary.  */
+  memcpy (eb + el, "deadbeef", 8);
+
+  cl = inet6_opt_init (eb, el);
+  CHECK ();
+
+  cl = inet6_opt_append (eb, el, cl, OPT_X, 12, 8, &db);
+  CHECK ();
+  val4 = 0x12345678;
+  offset = inet6_opt_set_val (db, 0, &val4, sizeof  (val4));
+  val8 = 0x0102030405060708LL;
+  inet6_opt_set_val (db, offset, &val8, sizeof  (val8));
+
+  cl = inet6_opt_append (eb, el, cl, OPT_Y, 7, 4, &db);
+  CHECK ();
+  val1 = 0x01;
+  offset = inet6_opt_set_val (db, 0, &val1, sizeof  (val1));
+  val2 = 0x1331;
+  offset = inet6_opt_set_val (db, offset, &val2, sizeof  (val2));
+  val4 = 0x01020304;
+  inet6_opt_set_val (db, offset, &val4, sizeof  (val4));
+
+  cl = inet6_opt_append (eb, el, cl, OPT_Z, 7, 1, &db);
+  CHECK ();
+  inet6_opt_set_val (db, 0, (void *) "abcdefg", 7);
+
+  cl = inet6_opt_finish (eb, el, cl);
+  CHECK ();
+
+  if (memcmp (eb + el, "deadbeef", 8) != 0)
+    {
+      puts ("Canary corrupted");
+      free (eb);
+      return NULL;
+    }
+  *elp = el;
+  return eb;
+}
+
+int
+decode_inet6_opt (void *eb, socklen_t el)
+{
+  int ret = 0;
+  int seq = 0;
+  int cl = 0;
+  int offset;
+  uint8_t type;
+  socklen_t len;
+  uint8_t val1;
+  uint16_t val2;
+  uint32_t val4;
+  uint64_t val8;
+  void *db;
+  char buf[8];
+
+  while ((cl = inet6_opt_next (eb, el, cl, &type, &len, &db)) != -1)
+    switch (type)
+      {
+      case OPT_X:
+	if (seq++ != 0)
+	  {
+	    puts ("OPT_X is not first");
+	    ret = 1;
+	  }
+	if (len != 12)
+	  {
+	    printf ("OPT_X's length %d != 12\n", len);
+	    ret = 1;
+	  }
+	offset = inet6_opt_get_val (db, 0, &val4, sizeof (val4));
+	if (val4 != 0x12345678)
+	  {
+	    printf ("OPT_X's val4 %x != 0x12345678\n", val4);
+	    ret = 1;
+	  }
+	offset = inet6_opt_get_val (db, offset, &val8, sizeof (val8));
+	if (offset != len || val8 != 0x0102030405060708LL)
+	  {
+	    printf ("OPT_X's val8 %llx != 0x0102030405060708\n",
+		    (long long) val8);
+	    ret = 1;
+	  }
+	break;
+      case OPT_Y:
+	if (seq++ != 1)
+	  {
+	    puts ("OPT_Y is not second");
+	    ret = 1;
+	  }
+	if (len != 7)
+	  {
+	    printf ("OPT_Y's length %d != 7\n", len);
+	    ret = 1;
+	  }
+	offset = inet6_opt_get_val (db, 0, &val1, sizeof (val1));
+	if (val1 != 0x01)
+	  {
+	    printf ("OPT_Y's val1 %x != 0x01\n", val1);
+	    ret = 1;
+	  }
+	offset = inet6_opt_get_val (db, offset, &val2, sizeof (val2));
+	if (val2 != 0x1331)
+	  {
+	    printf ("OPT_Y's val2 %x != 0x1331\n", val2);
+	    ret = 1;
+	  }
+	offset = inet6_opt_get_val (db, offset, &val4, sizeof (val4));
+	if (offset != len || val4 != 0x01020304)
+	  {
+	    printf ("OPT_Y's val4 %x != 0x01020304\n", val4);
+	    ret = 1;
+	  }
+	break;
+      case OPT_Z:
+	if (seq++ != 2)
+	  {
+	    puts ("OPT_Z is not third");
+	    ret = 1;
+	  }
+	if (len != 7)
+	  {
+	    printf ("OPT_Z's length %d != 7\n", len);
+	    ret = 1;
+	  }
+	offset = inet6_opt_get_val (db, 0, buf, 7);
+	if (offset != len || memcmp (buf, "abcdefg", 7) != 0)
+	  {
+	    buf[7] = '\0';
+	    printf ("OPT_Z's buf \"%s\" != \"abcdefg\"\n", buf);
+	    ret = 1;
+	  }
+	break;
+      default:
+	printf ("Unknown option %d\n", type);
+	ret = 1;
+	break;
+      }
+  if (seq != 3)
+    {
+      puts ("Didn't see all of OPT_X, OPT_Y and OPT_Z");
+      ret = 1;
+    }
+  return ret;
+}
+
+static int
+do_test (void)
+{
+  void *eb;
+  socklen_t el;
+  eb = encode_inet6_opt (&el);
+  if (eb == NULL)
+    return 1;
+  if (decode_inet6_opt (eb, el))
+    return 1;
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/test_ifindex.c b/ap/libc/glibc/glibc-2.22/inet/test_ifindex.c
new file mode 100644
index 0000000..ef4dbc4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/test_ifindex.c
@@ -0,0 +1,67 @@
+/* Test interface name <-> index conversions.
+   Copyright (C) 1997-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Philip Blundell <Philip.Blundell@pobox.com>.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <net/if.h>
+
+static int
+do_test (void)
+{
+  int failures = 0;
+  struct if_nameindex *idx = if_nameindex (), *p;
+  if (idx == NULL)
+    {
+      if (errno != ENOSYS)
+	{
+	  printf ("Couldn't get any interfaces.\n");
+	  exit (1);
+	}
+      /* The function is simply not implemented.  */
+      exit (0);
+    }
+
+  printf ("Idx            Name | Idx           Name\n");
+
+  for (p = idx; p->if_index || p->if_name; ++p)
+    {
+      char buf[IFNAMSIZ];
+      unsigned int ni;
+      int result;
+      printf ("%3d %15s | ", p->if_index, p->if_name);
+      printf ("%3d", ni = if_nametoindex (p->if_name));
+      printf ("%15s", if_indextoname (p->if_index, buf));
+      result = (ni != p->if_index || (strcmp (buf, p->if_name)));
+      if (ni == p->if_index)
+	/* We have to make sure that this is not an alias with the
+	   same interface number.  */
+	if (p->if_index == if_nametoindex (buf))
+	  result = 0;
+      printf ("%10s", result ? "fail" : "okay");
+      printf ("\n");
+      failures += result;
+    }
+  if_freenameindex (idx);
+  return failures ? 1 : 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/tst-checks.c b/ap/libc/glibc/glibc-2.22/inet/tst-checks.c
new file mode 100644
index 0000000..5d97564
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/tst-checks.c
@@ -0,0 +1,173 @@
+#include <stdio.h>
+#include <string.h>
+#include <netinet/in.h>
+
+
+static int
+do_test (void)
+{
+  int result = 0;
+  char buf[16];
+  memset (buf, '\0', 16);
+
+  if (! IN6_IS_ADDR_UNSPECIFIED (buf))
+    {
+      puts ("positive IN6_IS_ADDR_UNSPECIFIED failed");
+      result = 1;
+    }
+  for (size_t i = 0; i < 16; ++i)
+    {
+      buf[i] = 1;
+      if (IN6_IS_ADDR_UNSPECIFIED (buf))
+	{
+	  printf ("negative IN6_IS_ADDR_UNSPECIFIED with byte %zu failed\n",
+		  i);
+	  result = 1;
+	}
+      buf[i] = 0;
+    }
+
+  if (IN6_IS_ADDR_LOOPBACK (buf))
+    {
+      puts ("negative IN6_IS_ADDR_UNSPECIFIED failed");
+      result = 1;
+    }
+  buf[15] = 1;
+  if (! IN6_IS_ADDR_LOOPBACK (buf))
+    {
+      puts ("positive IN6_IS_ADDR_UNSPECIFIED failed");
+      result = 1;
+    }
+  buf[15] = 0;
+
+  buf[0] = 0xfe;
+  buf[1] = 0x80;
+  if (! IN6_IS_ADDR_LINKLOCAL (buf))
+    {
+      puts ("positive IN6_IS_ADDR_LINKLOCAL failed");
+      result = 1;
+    }
+  for (size_t i = 1; i < 16; ++i)
+    {
+      buf[i] ^= 1;
+      if (! IN6_IS_ADDR_LINKLOCAL (buf))
+	{
+	  printf ("positive IN6_IS_ADDR_LINKLOCAL byte %zu failed\n", i);
+	  result = 1;
+	}
+      buf[i] ^= 1;
+    }
+  buf[0] = 0xff;
+  buf[1] = 0x80;
+  if (IN6_IS_ADDR_LINKLOCAL (buf))
+    {
+      puts ("negative IN6_IS_ADDR_LINKLOCAL failed");
+      result = 1;
+    }
+  buf[0] = 0xfe;
+  buf[1] = 0xc0;
+  if (IN6_IS_ADDR_LINKLOCAL (buf))
+    {
+      puts ("negative IN6_IS_ADDR_LINKLOCAL #2 failed");
+      result = 1;
+    }
+
+  buf[0] = 0xfe;
+  buf[1] = 0xc0;
+  if (! IN6_IS_ADDR_SITELOCAL (buf))
+    {
+      puts ("positive IN6_IS_ADDR_SITELOCAL failed");
+      result = 1;
+    }
+  for (size_t i = 1; i < 16; ++i)
+    {
+      buf[i] ^= 1;
+      if (! IN6_IS_ADDR_SITELOCAL (buf))
+	{
+	  printf ("positive IN6_IS_ADDR_SITELOCAL byte %zu failed\n", i);
+	  result = 1;
+	}
+      buf[i] ^= 1;
+    }
+  buf[0] = 0xff;
+  buf[1] = 0x80;
+  if (IN6_IS_ADDR_SITELOCAL (buf))
+    {
+      puts ("negative IN6_IS_ADDR_SITELOCAL failed");
+      result = 1;
+    }
+  buf[0] = 0xf8;
+  buf[1] = 0xc0;
+  if (IN6_IS_ADDR_SITELOCAL (buf))
+    {
+      puts ("negative IN6_IS_ADDR_SITELOCAL #2 failed");
+      result = 1;
+    }
+
+  memset (buf, '\0', 16);
+  buf[10] = 0xff;
+  buf[11] = 0xff;
+  if (! IN6_IS_ADDR_V4MAPPED (buf))
+    {
+      puts ("positive IN6_IS_ADDR_V4MAPPED failed");
+      result = 1;
+    }
+  for (size_t i = 12; i < 16; ++i)
+    {
+      buf[i] ^= 1;
+      if (! IN6_IS_ADDR_V4MAPPED (buf))
+	{
+	  printf ("positive IN6_IS_ADDR_V4MAPPED byte %zu failed\n", i);
+	  result = 1;
+	}
+      buf[i] ^= 1;
+    }
+  for (size_t i = 0; i < 12; ++i)
+    {
+      buf[i] ^= 1;
+      if (IN6_IS_ADDR_V4MAPPED (buf))
+	{
+	  printf ("negative IN6_IS_ADDR_V4MAPPED byte %zu failed\n", i);
+	  result = 1;
+	}
+      buf[i] ^= 1;
+    }
+
+  memset (buf, '\0', 16);
+  for (size_t i = 12; i < 16; ++i)
+    {
+      buf[i] ^= 2;
+      if (! IN6_IS_ADDR_V4COMPAT (buf))
+	{
+	  printf ("positive IN6_IS_ADDR_V4COMPAT byte %zu failed\n", i);
+	  result = 1;
+	}
+      buf[i] ^= 2;
+    }
+  for (size_t i = 0; i < 12; ++i)
+    {
+      buf[i] ^= 1;
+      if (IN6_IS_ADDR_V4COMPAT (buf))
+	{
+	  printf ("negative IN6_IS_ADDR_V4COMPAT byte %zu failed\n", i);
+	  result = 1;
+	}
+      buf[i] ^= 1;
+    }
+  if (IN6_IS_ADDR_V4COMPAT (buf))
+    {
+      puts ("negative IN6_IS_ADDR_V4COMPAT #2 failed");
+      result = 1;
+    }
+  buf[15] = 1;
+  if (IN6_IS_ADDR_V4COMPAT (buf))
+    {
+      puts ("negative IN6_IS_ADDR_V4COMPAT #3 failed");
+      result = 1;
+    }
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/tst-ether_aton.c b/ap/libc/glibc/glibc-2.22/inet/tst-ether_aton.c
new file mode 100644
index 0000000..94ceec8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/tst-ether_aton.c
@@ -0,0 +1,57 @@
+#include <stdio.h>
+#include <string.h>
+#include <netinet/ether.h>
+
+int
+main (int argc, char *argv[])
+{
+  struct ether_addr *valp, val;
+  int result, r;
+  char hostname[32], buf[64], *p;
+
+  valp = ether_aton ("12:34:56:78:9a:bc");
+
+  printf ("ether_aton (\"12:34:56:78:9a:bc\") = %hhx:%hhx:%hhx:%hhx:%hhx:%hhx\n",
+	  valp->ether_addr_octet[0],
+	  valp->ether_addr_octet[1],
+	  valp->ether_addr_octet[2],
+	  valp->ether_addr_octet[3],
+	  valp->ether_addr_octet[4],
+	  valp->ether_addr_octet[5]);
+
+  result = (valp->ether_addr_octet[0] != 0x12
+	    || valp->ether_addr_octet[1] != 0x34
+	    || valp->ether_addr_octet[2] != 0x56
+	    || valp->ether_addr_octet[3] != 0x78
+	    || valp->ether_addr_octet[4] != 0x9a
+	    || valp->ether_addr_octet[5] != 0xbc);
+
+  if ((r = ether_line ("0:c0:f0:46:5f:97 host.ether.com \t# comment",
+		       &val, hostname)) == 0)
+    {
+      ether_ntoa_r (&val, buf);
+      p = strchr (buf, '\0');
+      *p++ = ' ';
+      strcpy (p, hostname);
+
+      printf ("ether_line (\"0:c0:f0:46:5f:97 host.ether.com\") = \"%s\"\n",
+	      buf);
+
+      result |= strcmp ("0:c0:f0:46:5f:97 host.ether.com", buf) != 0;
+    }
+  else
+    {
+      printf ("ether_line (\"0:c0:f0:46:5f:97 host.ether.com\") = %d\n", r);
+      result |= 1;
+    }
+
+  r = ether_line ("0:c0:2:d0 foo.bar   ", &val, hostname);
+  printf ("ether_line (\"0:c0:2:d0 foo.bar   \") = %d\n", r);
+  result |= r != -1;
+
+  r = ether_line ("0:c0:2:d0:1a:2a  ", &val, hostname);
+  printf ("ether_line (\"0:c0:2:d0:1a:2a  \") = %d\n", r);
+  result |= r != -1;
+
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.22/inet/tst-ether_line.c b/ap/libc/glibc/glibc-2.22/inet/tst-ether_line.c
new file mode 100644
index 0000000..ff0560b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/tst-ether_line.c
@@ -0,0 +1,38 @@
+#include <stdio.h>
+#include <string.h>
+#include <netinet/ether.h>
+
+
+static int
+do_test (void)
+{
+  struct ether_addr a;
+  char buf[1000];
+  if (ether_line ("00:01:02:03:04:05       aaaaa   \n", &a, buf) != 0)
+    {
+      puts ("ether_line failed");
+      return 1;
+    }
+
+  int res = 0;
+  int i;
+  for (i = 0; i < ETH_ALEN; ++i)
+    {
+      printf ("%02x%s",
+	      (int) a.ether_addr_octet[i], i + 1 == ETH_ALEN ? "" : ":");
+      if (a.ether_addr_octet[i] != i)
+	{
+	  printf ("octet %d is %d, expected %d\n",
+		  i, (int) a.ether_addr_octet[i], i);
+	  res = 1;
+	}
+    }
+
+  printf (" \"%s\"\n", buf);
+  res |= strcmp (buf, "aaaaa") != 0;
+
+  return res;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/tst-gethnm.c b/ap/libc/glibc/glibc-2.22/inet/tst-gethnm.c
new file mode 100644
index 0000000..dd3a547
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/tst-gethnm.c
@@ -0,0 +1,67 @@
+/* Based on a test case by grd@algonet.se.  */
+
+#include <netdb.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+static int
+do_test (void)
+{
+  struct hostent *ent;
+  struct in_addr hostaddr;
+  int result = 0;
+
+  inet_aton ("127.0.0.1", (struct in_addr *) &hostaddr.s_addr);
+  ent = gethostbyaddr (&hostaddr, sizeof (hostaddr), AF_INET);
+  if (ent == NULL)
+    puts ("gethostbyaddr (...) == NULL");
+  else
+    {
+      puts ("Using gethostbyaddr(..):");
+      printf ("h_name: %s\n", ent->h_name);
+
+      if (ent->h_aliases == NULL)
+	puts ("ent->h_aliases == NULL");
+      else
+	printf ("h_aliases[0]: %s\n", ent->h_aliases[0]);
+    }
+
+  ent = gethostbyname ("127.0.0.1");
+  if (ent == NULL)
+    {
+      puts ("gethostbyname (\"127.0.0.1\") == NULL");
+      result = 1;
+    }
+  else
+    {
+      printf ("\nNow using gethostbyname(..):\n");
+      printf ("h_name: %s\n", ent->h_name);
+      if (strcmp (ent->h_name, "127.0.0.1") != 0)
+	{
+	  puts ("ent->h_name != \"127.0.0.1\"");
+	  result = 1;
+	}
+
+      if (ent->h_aliases == NULL)
+	{
+	  puts ("ent->h_aliases == NULL");
+	  result = 1;
+	}
+      else
+	{
+	  printf ("h_aliases[0]: %s\n", ent->h_aliases[0]);
+	  result |= ent->h_aliases[0] != NULL;
+	}
+    }
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/tst-getni1.c b/ap/libc/glibc/glibc-2.22/inet/tst-getni1.c
new file mode 100644
index 0000000..3960f71
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/tst-getni1.c
@@ -0,0 +1,36 @@
+#include <netdb.h>
+#include <stdio.h>
+#include <sys/socket.h>
+
+static int
+do_test (void)
+{
+  int retval = 0;
+
+  struct sockaddr_in s;
+  s.sin_family = AF_INET;
+  s.sin_port = 80;
+  s.sin_addr.s_addr = INADDR_LOOPBACK;
+  int r = getnameinfo((struct sockaddr *) &s, sizeof (s), NULL, 0, NULL, 0,
+		      NI_NUMERICHOST | NI_NUMERICSERV);
+  printf("r = %d\n", r);
+  if (r != 0)
+    {
+      puts ("failed without NI_NAMEREQD");
+      retval = 1;
+    }
+
+  r = getnameinfo((struct sockaddr *) &s, sizeof (s), NULL, 0, NULL, 0,
+		  NI_NUMERICHOST | NI_NUMERICSERV | NI_NAMEREQD);
+  printf("r = %d\n", r);
+  if (r != EAI_NONAME)
+    {
+      puts ("did not fail with EAI_NONAME with NI_NAMEREQD set");
+      retval = 1;
+    }
+
+  return retval;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/tst-getni2.c b/ap/libc/glibc/glibc-2.22/inet/tst-getni2.c
new file mode 100644
index 0000000..66e7806
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/tst-getni2.c
@@ -0,0 +1,41 @@
+#include <netdb.h>
+#include <stdio.h>
+#include <sys/socket.h>
+
+static int
+do_test (void)
+{
+  int retval = 0;
+
+  struct sockaddr_in6 s;
+  s.sin6_family = AF_INET6;
+  s.sin6_port = htons (80);
+  s.sin6_flowinfo = 0;
+  s.sin6_addr = (struct in6_addr) IN6ADDR_ANY_INIT;
+  s.sin6_scope_id = 0;
+  char buf[1000];
+  buf[0] = '\0';
+  int r = getnameinfo((struct sockaddr *) &s, sizeof (s), buf, sizeof (buf),
+		      NULL, 0, NI_NUMERICSERV);
+  printf("r = %d, buf = \"%s\"\n", r, buf);
+  if (r != 0)
+    {
+      puts ("failed without NI_NAMEREQD");
+      retval = 1;
+    }
+
+  buf[0] = '\0';
+  r = getnameinfo((struct sockaddr *) &s, sizeof (s), buf, sizeof (buf),
+		  NULL, 0, NI_NUMERICSERV | NI_NAMEREQD);
+  printf("r = %d, buf = \"%s\"\n", r, buf);
+  if (r != EAI_NONAME)
+    {
+      puts ("did not fail with EAI_NONAME with NI_NAMEREQD set");
+      retval = 1;
+    }
+
+  return retval;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/tst-inet6_rth.c b/ap/libc/glibc/glibc-2.22/inet/tst-inet6_rth.c
new file mode 100644
index 0000000..549d717
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/tst-inet6_rth.c
@@ -0,0 +1,192 @@
+#include <stdio.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <netinet/ip6.h>
+
+static int
+do_test (void)
+{
+  int res = 0;
+  char buf[1000];
+  void *p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 0);
+  if (p == NULL)
+    {
+      puts ("first inet6_rth_init failed");
+      res = 1;
+    }
+  else if (inet6_rth_add (p, &in6addr_any) == 0)
+    {
+      puts ("first inet6_rth_add succeeded");
+      res = 1;
+    }
+
+  p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 1);
+  if (p == NULL)
+    {
+      puts ("second inet6_rth_init failed");
+      res = 1;
+    }
+  else if (inet6_rth_add (p, &in6addr_any) != 0)
+    {
+      puts ("second inet6_rth_add failed");
+      res = 1;
+    }
+
+  for (int nseg = 4; nseg < 6; ++nseg)
+    {
+      printf ("nseg = %d\n", nseg);
+
+      p = inet6_rth_init (buf, sizeof (buf), IPV6_RTHDR_TYPE_0, nseg);
+      if (p == NULL)
+	{
+	  puts ("third inet6_rth_init failed");
+	  res = 1;
+	}
+      else
+	{
+	  struct in6_addr tmp;
+	  memset (&tmp, '\0', sizeof (tmp));
+
+	  for (int i = 0; i < nseg; ++i)
+	    {
+	      tmp.s6_addr[0] = i;
+	      if (inet6_rth_add (p, &tmp) != 0)
+		{
+		  printf ("call %d of third inet6_rth_add failed\n", i + 1);
+		  res = 1;
+		  goto out;
+		}
+	    }
+	  ((struct ip6_rthdr0 *) p)->ip6r0_segleft = 0;
+	  if (inet6_rth_segments (p) != nseg)
+	    {
+	      puts ("\
+inet6_rth_segments returned wrong value after loop with third inet6_rth_add");
+	      res = 1;
+	      goto out;
+	    }
+
+          union
+          {
+            char buffer[1000];
+            struct ip6_rthdr0 rthdr0;
+          } buf2;
+	  if (inet6_rth_reverse (p, buf2.buffer) != 0)
+	    {
+	      puts ("first inet6_rth_reverse call failed");
+	      res = 1;
+	      goto out;
+	    }
+	  if (buf2.rthdr0.ip6r0_segleft != nseg)
+	    {
+	      puts ("segleft after first inet6_rth_reverse wrong");
+	      res = 1;
+	    }
+
+	  if (inet6_rth_segments (p) != inet6_rth_segments (buf2.buffer))
+	    {
+	      puts ("number of seconds after first inet6_rth_reverse differs");
+	      res = 1;
+	      goto out;
+	    }
+
+	  for (int i = 0; i < nseg; ++i)
+	    {
+	      struct in6_addr *addr = inet6_rth_getaddr (buf2.buffer, i);
+	      if (addr == NULL)
+		{
+		  printf ("call %d of first inet6_rth_getaddr failed\n",
+			  i + 1);
+		  res = 1;
+		}
+	      else if (addr->s6_addr[0] != nseg - 1 - i
+		       || memcmp (&addr->s6_addr[1], &in6addr_any.s6_addr[1],
+				  sizeof (in6addr_any)
+				  - sizeof (in6addr_any.s6_addr[0])) != 0)
+		{
+		  char addrbuf[100];
+		  inet_ntop (AF_INET6, addr, addrbuf, sizeof (addrbuf));
+		  printf ("\
+address %d after first inet6_rth_reverse wrong (%s)\n",
+			  i + 1, addrbuf);
+		  res = 1;
+		}
+	    }
+	out:
+	  ;
+	}
+
+      p = inet6_rth_init (buf, sizeof (buf), IPV6_RTHDR_TYPE_0, nseg);
+      if (p == NULL)
+	{
+	  puts ("fourth inet6_rth_init failed");
+	  res = 1;
+	}
+      else
+	{
+	  struct in6_addr tmp;
+	  memset (&tmp, '\0', sizeof (tmp));
+
+	  for (int i = 0; i < nseg; ++i)
+	    {
+	      tmp.s6_addr[0] = i;
+	      if (inet6_rth_add (p, &tmp) != 0)
+		{
+		  printf ("call %d of fourth inet6_rth_add failed\n", i + 1);
+		  res = 1;
+		  goto out2;
+		}
+	    }
+	  ((struct ip6_rthdr0 *) p)->ip6r0_segleft = 0;
+	  if (inet6_rth_segments (p) != nseg)
+	    {
+	      puts ("\
+inet6_rth_segments returned wrong value after loop with fourth inet6_rth_add");
+	      res = 1;
+	      goto out2;
+	    }
+
+	  if (inet6_rth_reverse (p, p) != 0)
+	    {
+	      puts ("second inet6_rth_reverse call failed");
+	      res = 1;
+	      goto out2;
+	    }
+	  if (((struct ip6_rthdr0 *) p)->ip6r0_segleft != nseg)
+	    {
+	      puts ("segleft after second inet6_rth_reverse wrong");
+	      res = 1;
+	    }
+
+	  for (int i = 0; i < nseg; ++i)
+	    {
+	      struct in6_addr *addr = inet6_rth_getaddr (p, i);
+	      if (addr == NULL)
+		{
+		  printf ("call %d of second inet6_rth_getaddr failed\n",
+			  i + 1);
+		  res = 1;
+		}
+	      else if (addr->s6_addr[0] != nseg - 1 - i
+		       || memcmp (&addr->s6_addr[1], &in6addr_any.s6_addr[1],
+				  sizeof (in6addr_any)
+				  - sizeof (in6addr_any.s6_addr[0])) != 0)
+		{
+		  char addrbuf[100];
+		  inet_ntop (AF_INET6, addr, addrbuf, sizeof (addrbuf));
+		  printf ("\
+address %d after second inet6_rth_reverse wrong (%s)\n",
+			  i + 1, addrbuf);
+		  res = 1;
+		}
+	    }
+	out2:
+	  ;
+	}
+    }
+
+  return res;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/tst-network.c b/ap/libc/glibc/glibc-2.22/inet/tst-network.c
new file mode 100644
index 0000000..71d49c2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/tst-network.c
@@ -0,0 +1,81 @@
+/* Test for inet_network.
+   Copyright (C) 2000-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Jaeger <aj@suse.de>, 2000.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+struct
+{
+  const char *network;
+  uint32_t number;
+} tests [] =
+{
+  {"1.0.0.0", 0x1000000},
+  {"1.0.0", 0x10000},
+  {"1.0", 0x100},
+  {"1", 0x1},
+  {"192.168.0.0", 0xC0A80000},
+  {"0", 0},
+  {"0x0", 0},
+  /* Now some invalid addresses.  */
+  {"0x", INADDR_NONE},
+  {"1 bar", INADDR_NONE}, /* Bug 15277.  */
+  {"141.30.225.2800", INADDR_NONE},
+  {"141.76.1.1.1", INADDR_NONE},
+  {"141.76.1.11.", INADDR_NONE},
+  {"1410", INADDR_NONE},
+  {"1.1410", INADDR_NONE},
+  {"1.1410.", INADDR_NONE},
+  {"1.1410", INADDR_NONE},
+  {"141.76.1111", INADDR_NONE},
+  {"141.76.1111.", INADDR_NONE}
+};
+
+
+static int
+do_test (void)
+{
+  int errors = 0;
+  size_t i;
+  uint32_t res;
+
+  for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
+    {
+      printf ("Testing: %s\n", tests[i].network);
+      res = inet_network (tests[i].network);
+
+      if (res != tests[i].number)
+	{
+	  ++errors;
+	  printf ("Test failed for inet_network (\"%s\"):\n",
+		  tests[i].network);
+	  printf ("Expected return value %u (0x%x) but got %u (0x%x).\n",
+		  tests[i].number, tests[i].number, res, res);
+	}
+
+    }
+
+  return errors != 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/inet/tst-ntoa.c b/ap/libc/glibc/glibc-2.22/inet/tst-ntoa.c
new file mode 100644
index 0000000..ef82d4d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/inet/tst-ntoa.c
@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+
+static int
+test (unsigned int inaddr, const char *expected)
+{
+  struct in_addr addr;
+  char *res;
+  int fail;
+
+  addr.s_addr = htonl (inaddr);
+  res = inet_ntoa (addr);
+  fail = strcmp (res, expected);
+
+  printf ("%#010x -> \"%s\" -> %s%s\n", inaddr, res,
+	  fail ? "fail, expected" : "ok", fail ? expected : "");
+
+  return fail;
+}
+
+
+static int
+do_test (void)
+{
+  int result = 0;
+
+  result |= test (INADDR_LOOPBACK, "127.0.0.1");
+  result |= test (INADDR_BROADCAST, "255.255.255.255");
+  result |= test (INADDR_ANY, "0.0.0.0");
+  result |= test (0xc0060746, "192.6.7.70");
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
