]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/BsdSocketLib/getpeername.c
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / StdLib / BsdSocketLib / getpeername.c
diff --git a/StdLib/BsdSocketLib/getpeername.c b/StdLib/BsdSocketLib/getpeername.c
deleted file mode 100644 (file)
index 5991099..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/** @file\r
-  Implement the getpeername API.\r
-\r
-  Copyright (c) 2011, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include <SocketInternals.h>\r
-\r
-\r
-/**\r
-  Get the remote address\r
-\r
-  The getpeername routine retrieves the remote system address from the socket.\r
-\r
-  The\r
-  <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/getpeername.html#">POSIX</a>\r
-  documentation is available online.\r
-\r
-  @param [in] s         Socket file descriptor returned from ::socket.\r
-\r
-  @param [out] address  Network address to receive the remote system address\r
-\r
-  @param [in] address_len Length of the remote network address structure\r
-\r
-  @return     This routine returns zero (0) if successful or -1 when an error occurs.\r
-              In the case of an error, ::errno contains more details.\r
-\r
- **/\r
-int\r
-getpeername (\r
-  int s,\r
-  struct sockaddr * address,\r
-  socklen_t * address_len\r
-  )\r
-{\r
-  int RetVal;\r
-  EFI_SOCKET_PROTOCOL * pSocketProtocol;\r
-  EFI_STATUS Status;\r
-\r
-  //\r
-  //  Assume failure\r
-  //\r
-  RetVal = -1;\r
-\r
-  //\r
-  //  Locate the context for this socket\r
-  //\r
-  pSocketProtocol = BslFdToSocketProtocol ( s, NULL, &errno );\r
-  if ( NULL != pSocketProtocol ) {\r
-    //\r
-    //  Get the remote address\r
-    //\r
-    Status = pSocketProtocol->pfnGetPeer ( pSocketProtocol,\r
-                                           address,\r
-                                           address_len,\r
-                                           &errno );\r
-    if ( !EFI_ERROR ( Status )) {\r
-      RetVal = 0;\r
-    }\r
-  }\r
-\r
-  //\r
-  //  Return the operation status\r
-  //\r
-  return RetVal;\r
-}\r