]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/BsdSocketLib/map_v4v6.c
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / StdLib / BsdSocketLib / map_v4v6.c
diff --git a/StdLib/BsdSocketLib/map_v4v6.c b/StdLib/BsdSocketLib/map_v4v6.c
deleted file mode 100644 (file)
index 5ad73c8..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*\r
- * ++Copyright++ 1985, 1988, 1993\r
- * -\r
- * Copyright (c) 1985, 1988, 1993\r
- *    The Regents of the University of California.  All rights reserved.\r
- *\r
- * Portions copyright (c) 1999, 2000\r
- * Intel Corporation.\r
- * All rights reserved.\r
- * \r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * \r
- * 1. Redistributions of source code must retain the above copyright\r
- *    notice, this list of conditions and the following disclaimer.\r
- * \r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- *    notice, this list of conditions and the following disclaimer in the\r
- *    documentation and/or other materials provided with the distribution.\r
- * \r
- * 3. All advertising materials mentioning features or use of this software\r
- *    must display the following acknowledgement:\r
- * \r
- *    This product includes software developed by the University of\r
- *    California, Berkeley, Intel Corporation, and its contributors.\r
- * \r
- * 4. Neither the name of University, Intel Corporation, or their respective\r
- *    contributors may be used to endorse or promote products derived from\r
- *    this software without specific prior written permission.\r
- * \r
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS, INTEL CORPORATION AND\r
- * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\r
- * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\r
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS,\r
- * INTEL CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\r
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- * -\r
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.\r
- * \r
- * Permission to use, copy, modify, and distribute this software for any\r
- * purpose with or without fee is hereby granted, provided that the above\r
- * copyright notice and this permission notice appear in all copies, and that\r
- * the name of Digital Equipment Corporation not be used in advertising or\r
- * publicity pertaining to distribution of the document or software without\r
- * specific, written prior permission.\r
- * \r
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL\r
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES\r
- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT\r
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\r
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\r
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\r
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\r
- * SOFTWARE.\r
- * -\r
- * --Copyright--\r
- */\r
-\r
-#if defined(LIBC_SCCS) && !defined(lint)\r
-static char sccsid[] = "@(#)gethostnamadr.c    8.1 (Berkeley) 6/4/93";\r
-static char rcsid[] = "$Id: map_v4v6.c,v 1.1.1.1 2003/11/19 01:51:31 kyu3 Exp $";\r
-#endif /* LIBC_SCCS and not lint */\r
-\r
-#include <sys/types.h>\r
-#include <sys/param.h>\r
-#include <sys/socket.h>\r
-#include <netinet/in.h>\r
-#include <arpa/inet.h>\r
-#include <arpa/nameser.h>\r
-\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include <netdb.h>\r
-#include <resolv.h>\r
-#include <ctype.h>\r
-#include <errno.h>\r
-#ifdef _ORG_FREEBSD_\r
-#include <syslog.h>\r
-#endif\r
-#include "Socklib_internals.h"\r
-\r
-typedef union {\r
-       int32_t al;\r
-       char ac;\r
-} align;\r
-\r
-void\r
-_map_v4v6_address(const char *src, char *dst)\r
-{\r
-       u_char *p = (u_char *)dst;\r
-       char tmp[INADDRSZ];\r
-       int i;\r
-\r
-       /* Stash a temporary copy so our caller can update in place. */\r
-       bcopy(src, tmp, INADDRSZ);\r
-       /* Mark this ipv6 addr as a mapped ipv4. */\r
-       for (i = 0; i < 10; i++)\r
-               *p++ = 0x00;\r
-       *p++ = 0xff;\r
-       *p++ = 0xff;\r
-       /* Retrieve the saved copy and we're done. */\r
-       bcopy(tmp, (void*)p, INADDRSZ);\r
-}\r
-\r
-void\r
-_map_v4v6_hostent(struct hostent *hp, char **bpp, int *lenp)\r
-{\r
-       char **ap;\r
-\r
-       if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)\r
-               return;\r
-       hp->h_addrtype = AF_INET6;\r
-       hp->h_length = IN6ADDRSZ;\r
-       for (ap = hp->h_addr_list; *ap; ap++) {\r
-               int i = (int)(sizeof(align) - ((size_t)*bpp % sizeof(align)));\r
-\r
-               if (*lenp < (i + IN6ADDRSZ)) {\r
-                       /* Out of memory.  Truncate address list here.  XXX */\r
-                       *ap = NULL;\r
-                       return;\r
-               }\r
-               *bpp += i;\r
-               *lenp -= i;\r
-               _map_v4v6_address(*ap, *bpp);\r
-               *ap = *bpp;\r
-               *bpp += IN6ADDRSZ;\r
-               *lenp -= IN6ADDRSZ;\r
-       }\r
-}\r