net/socket: Fix nxstyle issue
This commit is contained in:
parent
5ee0432d6f
commit
76c87d2f85
@ -60,10 +60,10 @@
|
|||||||
* Name: psock_getpeername
|
* Name: psock_getpeername
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The psock_getpeername() function retrieves the remote-connected name of the
|
* The psock_getpeername() function retrieves the remote-connected name of
|
||||||
* specified socket, stores this address in the sockaddr structure pointed
|
* the specified socket, stores this address in the sockaddr structure
|
||||||
* to by the 'addr' argument, and stores the length of this address in the
|
* pointed to by the 'addr' argument, and stores the length of this address
|
||||||
* object pointed to by the 'addrlen' argument.
|
* in the object pointed to by the 'addrlen' argument.
|
||||||
*
|
*
|
||||||
* If the actual length of the address is greater than the length of the
|
* If the actual length of the address is greater than the length of the
|
||||||
* supplied sockaddr structure, the stored address will be truncated.
|
* supplied sockaddr structure, the stored address will be truncated.
|
||||||
@ -79,8 +79,8 @@
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* On success, 0 is returned, the 'addr' argument points to the address
|
* On success, 0 is returned, the 'addr' argument points to the address
|
||||||
* of the socket, and the 'addrlen' argument points to the length of the
|
* of the socket, and the 'addrlen' argument points to the length of the
|
||||||
* address. Otherwise, -1 is returned and errno is set to indicate the error.
|
* address. Otherwise, -1 is returned and errno is set to indicate the
|
||||||
* Possible errno values that may be returned include:
|
* error. Possible errno values that may be returned include:
|
||||||
*
|
*
|
||||||
* EBADF - The socket argument is not a valid file descriptor.
|
* EBADF - The socket argument is not a valid file descriptor.
|
||||||
* ENOTSOCK - The socket argument does not refer to a socket.
|
* ENOTSOCK - The socket argument does not refer to a socket.
|
||||||
@ -145,8 +145,8 @@ int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* On success, 0 is returned, the 'addr' argument points to the address
|
* On success, 0 is returned, the 'addr' argument points to the address
|
||||||
* of the socket, and the 'addrlen' argument points to the length of the
|
* of the socket, and the 'addrlen' argument points to the length of the
|
||||||
* address. Otherwise, -1 is returned and errno is set to indicate the error.
|
* address. Otherwise, -1 is returned and errno is set to indicate the
|
||||||
* Possible errno values that may be returned include:
|
* error. Possible errno values that may be returned include:
|
||||||
*
|
*
|
||||||
* EBADF - The socket argument is not a valid file descriptor.
|
* EBADF - The socket argument is not a valid file descriptor.
|
||||||
* ENOTSOCK - The socket argument does not refer to a socket.
|
* ENOTSOCK - The socket argument does not refer to a socket.
|
||||||
@ -157,7 +157,8 @@ int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int getpeername(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen)
|
int getpeername(int sockfd, FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen)
|
||||||
{
|
{
|
||||||
FAR struct socket *psock = sockfd_socket(sockfd);
|
FAR struct socket *psock = sockfd_socket(sockfd);
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -79,8 +79,8 @@
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* On success, 0 is returned, the 'addr' argument points to the address
|
* On success, 0 is returned, the 'addr' argument points to the address
|
||||||
* of the socket, and the 'addrlen' argument points to the length of the
|
* of the socket, and the 'addrlen' argument points to the length of the
|
||||||
* address. Otherwise, -1 is returned and errno is set to indicate the error.
|
* address. Otherwise, -1 is returned and errno is set to indicate the
|
||||||
* Possible errno values that may be returned include:
|
* error. Possible errno values that may be returned include:
|
||||||
*
|
*
|
||||||
* EBADF - The socket argument is not a valid file descriptor.
|
* EBADF - The socket argument is not a valid file descriptor.
|
||||||
* ENOTSOCK - The socket argument does not refer to a socket.
|
* ENOTSOCK - The socket argument does not refer to a socket.
|
||||||
@ -139,8 +139,8 @@ int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* On success, 0 is returned, the 'addr' argument points to the address
|
* On success, 0 is returned, the 'addr' argument points to the address
|
||||||
* of the socket, and the 'addrlen' argument points to the length of the
|
* of the socket, and the 'addrlen' argument points to the length of the
|
||||||
* address. Otherwise, -1 is returned and errno is set to indicate the error.
|
* address. Otherwise, -1 is returned and errno is set to indicate the
|
||||||
* Possible errno values that may be returned include:
|
* error. Possible errno values that may be returned include:
|
||||||
*
|
*
|
||||||
* EBADF - The socket argument is not a valid file descriptor.
|
* EBADF - The socket argument is not a valid file descriptor.
|
||||||
* ENOTSOCK - The socket argument does not refer to a socket.
|
* ENOTSOCK - The socket argument does not refer to a socket.
|
||||||
@ -151,7 +151,8 @@ int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int getsockname(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen)
|
int getsockname(int sockfd, FAR struct sockaddr *addr,
|
||||||
|
FAR socklen_t *addrlen)
|
||||||
{
|
{
|
||||||
FAR struct socket *psock = sockfd_socket(sockfd);
|
FAR struct socket *psock = sockfd_socket(sockfd);
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/socket/recvfrom.c
|
* net/socket/recvfrom.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights
|
||||||
|
* reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -185,19 +186,20 @@ ssize_t nx_recvfrom(int sockfd, FAR void *buf, size_t len, int flags,
|
|||||||
* -1 is returned, and errno is set appropriately:
|
* -1 is returned, and errno is set appropriately:
|
||||||
*
|
*
|
||||||
* EAGAIN
|
* EAGAIN
|
||||||
* The socket is marked non-blocking and the receive operation would block,
|
* The socket is marked non-blocking and the receive operation would
|
||||||
* or a receive timeout had been set and the timeout expired before data
|
* block, or a receive timeout had been set and the timeout expired
|
||||||
* was received.
|
* before data was received.
|
||||||
* EBADF
|
* EBADF
|
||||||
* The argument sockfd is an invalid descriptor.
|
* The argument sockfd is an invalid descriptor.
|
||||||
* ECONNREFUSED
|
* ECONNREFUSED
|
||||||
* A remote host refused to allow the network connection (typically because
|
* A remote host refused to allow the network connection (typically
|
||||||
* it is not running the requested service).
|
* because it is not running the requested service).
|
||||||
* EFAULT
|
* EFAULT
|
||||||
* The receive buffer pointer(s) point outside the process's address space.
|
* The receive buffer pointer(s) point outside the process's address
|
||||||
|
* space.
|
||||||
* EINTR
|
* EINTR
|
||||||
* The receive was interrupted by delivery of a signal before any data were
|
* The receive was interrupted by delivery of a signal before any data
|
||||||
* available.
|
* were available.
|
||||||
* EINVAL
|
* EINVAL
|
||||||
* Invalid argument passed.
|
* Invalid argument passed.
|
||||||
* ENOMEM
|
* ENOMEM
|
||||||
|
@ -110,7 +110,8 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len,
|
|||||||
ret = psock->s_sockif->si_send(psock, buf, len, flags);
|
ret = psock->s_sockif->si_send(psock, buf, len, flags);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
nerr("ERROR: socket si_send() (or usrsock_sendto()) failed: %d\n", ret);
|
nerr("ERROR: socket si_send() (or usrsock_sendto()) failed: %d\n",
|
||||||
|
ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/socket/sendto.c
|
* net/socket/sendto.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011-2015, 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011-2015, 2017 Gregory Nutt. All rights
|
||||||
|
* reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
Loading…
Reference in New Issue
Block a user