示例#1
0
int zts_getpeername(int fd, struct sockaddr *addr, socklen_t *addrlen)
{
	if (!addr) {
		return ZTS_ERR_INVALID_ARG;
	}
	if (*addrlen > (int)sizeof(struct sockaddr_storage) || *addrlen < (int)sizeof(struct sockaddr_in)) {
		return ZTS_ERR_INVALID_ARG;
	}
	return (!_run_service || !_run_lwip_tcpip) ? ZTS_ERR_SERVICE : lwip_getpeername(fd, addr, addrlen);
}
int LWIP_SOCKETS_Driver::GetPeerName( SOCK_SOCKET socket, SOCK_sockaddr* name, int* namelen )
{ 
    NATIVE_PROFILE_PAL_NETWORK();
    int ret;

    sockaddr_in addr;

    SOCK_SOCKADDR_TO_SOCKADDR(name, addr, namelen);

    ret = lwip_getpeername(socket, (sockaddr*)&addr, (u32_t*)namelen);

    SOCKADDR_TO_SOCK_SOCKADDR(name, addr, namelen);

    return ret;
}
示例#3
0
int getpeername(int s, struct sockaddr *name, socklen_t *namelen) {
	BT_HANDLE hSocket = (BT_HANDLE)s;

	return lwip_getpeername(hSocket->socket, name, namelen);
}
示例#4
0
int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
{
  int sock = socket_for_fd(sockfd);
  return lwip_getpeername(sock, addr, addrlen);
}