EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

StdLib/BsdSocketLib/getpeername.c

Go to the documentation of this file.
00001 
00015 #include <SocketInternals.h>
00016 
00017 
00037 int
00038 getpeername (
00039   int s,
00040   struct sockaddr * address,
00041   socklen_t * address_len
00042   )
00043 {
00044   int RetVal;
00045   EFI_SOCKET_PROTOCOL * pSocketProtocol;
00046   EFI_STATUS Status;
00047 
00048   //
00049   //  Assume failure
00050   //
00051   RetVal = -1;
00052 
00053   //
00054   //  Locate the context for this socket
00055   //
00056   pSocketProtocol = BslFdToSocketProtocol ( s, NULL, &errno );
00057   if ( NULL != pSocketProtocol ) {
00058     //
00059     //  Get the remote address
00060     //
00061     Status = pSocketProtocol->pfnGetPeer ( pSocketProtocol,
00062                                            address,
00063                                            address_len,
00064                                            &errno );
00065     if ( !EFI_ERROR ( Status )) {
00066       RetVal = 0;
00067     }
00068   }
00069 
00070   //
00071   //  Return the operation status
00072   //
00073   return RetVal;
00074 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines