include/nuttx/net/net.h: Fix some long lines.

This commit is contained in:
Gregory Nutt 2019-07-01 09:18:38 -06:00
parent b0f751897c
commit ded1900927
2 changed files with 31 additions and 21 deletions

View File

@ -56,8 +56,8 @@
/* Most internal network OS interfaces are not available in the user space in /* Most internal network OS interfaces are not available in the user space in
* PROTECTED and KERNEL builds. In that context, the corresponding * PROTECTED and KERNEL builds. In that context, the corresponding
* application network interfaces must be used. The differences between the two * application network interfaces must be used. The differences between the
* sets of interfaces are: The internal OS interfaces (1) do not cause * two sets of interfaces are: The internal OS interfaces (1) do not cause
* cancellation points and (2) they do not modify the errno variable. * cancellation points and (2) they do not modify the errno variable.
* *
* This is only important when compiling libraries (libc or libnx) that are * This is only important when compiling libraries (libc or libnx) that are
@ -162,8 +162,9 @@ struct sock_intf_s
CODE int (*si_listen)(FAR struct socket *psock, int backlog); CODE int (*si_listen)(FAR struct socket *psock, int backlog);
CODE int (*si_connect)(FAR struct socket *psock, CODE int (*si_connect)(FAR struct socket *psock,
FAR const struct sockaddr *addr, socklen_t addrlen); FAR const struct sockaddr *addr, socklen_t addrlen);
CODE int (*si_accept)(FAR struct socket *psock, FAR struct sockaddr *addr, CODE int (*si_accept)(FAR struct socket *psock,
FAR socklen_t *addrlen, FAR struct socket *newsock); FAR struct sockaddr *addr, FAR socklen_t *addrlen,
FAR struct socket *newsock);
CODE int (*si_poll)(FAR struct socket *psock, CODE int (*si_poll)(FAR struct socket *psock,
FAR struct pollfd *fds, bool setup); FAR struct pollfd *fds, bool setup);
CODE ssize_t (*si_send)(FAR struct socket *psock, FAR const void *buf, CODE ssize_t (*si_send)(FAR struct socket *psock, FAR const void *buf,
@ -196,7 +197,8 @@ struct socket
{ {
int16_t s_crefs; /* Reference count on the socket */ int16_t s_crefs; /* Reference count on the socket */
uint8_t s_domain; /* IP domain: PF_INET, PF_INET6, or PF_PACKET */ uint8_t s_domain; /* IP domain: PF_INET, PF_INET6, or PF_PACKET */
uint8_t s_type; /* Protocol type: Only SOCK_STREAM or SOCK_DGRAM */ uint8_t s_type; /* Protocol type: Only SOCK_STREAM or
* SOCK_DGRAM */
uint8_t s_flags; /* See _SF_* definitions */ uint8_t s_flags; /* See _SF_* definitions */
/* Socket options */ /* Socket options */
@ -216,7 +218,8 @@ struct socket
FAR const struct sock_intf_s *s_sockif; FAR const struct sock_intf_s *s_sockif;
#if defined(CONFIG_NET_TCP_WRITE_BUFFERS) || defined(CONFIG_NET_UDP_WRITE_BUFFERS) #if defined(CONFIG_NET_TCP_WRITE_BUFFERS) || \
defined(CONFIG_NET_UDP_WRITE_BUFFERS)
/* Callback instance for TCP send() or UDP sendto() */ /* Callback instance for TCP send() or UDP sendto() */
FAR struct devif_callback_s *s_sndcb; FAR struct devif_callback_s *s_sndcb;
@ -444,7 +447,8 @@ void net_initlist(FAR struct socketlist *list);
* Release resources held by the socket list * Release resources held by the socket list
* *
* Input Parameters: * Input Parameters:
* list -- A reference to the pre-allocated socket list to be un-initialized. * list -- A reference to the pre-allocated socket list to be un-
* initialized.
* *
* Returned Value: * Returned Value:
* None * None
@ -481,7 +485,8 @@ FAR struct socket *sockfd_socket(int sockfd);
* domain (see sys/socket.h) * domain (see sys/socket.h)
* type (see sys/socket.h) * type (see sys/socket.h)
* protocol (see sys/socket.h) * protocol (see sys/socket.h)
* psock A pointer to a user allocated socket structure to be initialized. * psock A pointer to a user allocated socket structure to be
* initialized.
* *
* Returned Value: * Returned Value:
* Returns zero (OK) on success. On failure, it returns a negated errno * Returns zero (OK) on success. On failure, it returns a negated errno
@ -509,7 +514,8 @@ FAR struct socket *sockfd_socket(int sockfd);
* *
****************************************************************************/ ****************************************************************************/
int psock_socket(int domain, int type, int protocol, FAR struct socket *psock); int psock_socket(int domain, int type, int protocol,
FAR struct socket *psock);
/**************************************************************************** /****************************************************************************
* Name: net_close * Name: net_close
@ -578,7 +584,7 @@ int psock_close(FAR struct socket *psock);
* *
****************************************************************************/ ****************************************************************************/
struct sockaddr; /* Forward reference. Defined in nuttx/include/sys/socket.h */ struct sockaddr; /* Forward reference. See nuttx/include/sys/socket.h */
int psock_bind(FAR struct socket *psock, FAR const struct sockaddr *addr, int psock_bind(FAR struct socket *psock, FAR const struct sockaddr *addr,
socklen_t addrlen); socklen_t addrlen);
@ -1012,7 +1018,8 @@ int psock_getsockopt(FAR struct socket *psock, int level, int option,
* Description: * Description:
* psock_setsockopt() sets the option specified by the 'option' argument, * psock_setsockopt() sets the option specified by the 'option' argument,
* at the protocol level specified by the 'level' argument, to the value * at the protocol level specified by the 'level' argument, to the value
* pointed to by the 'value' argument for the socket on the 'psock' argument. * pointed to by the 'value' argument for the socket on the 'psock'
* argument.
* *
* The 'level' argument specifies the protocol level of the option. To set * The 'level' argument specifies the protocol level of the option. To set
* options at the socket level, specify the level argument as SOL_SOCKET. * options at the socket level, specify the level argument as SOL_SOCKET.
@ -1061,9 +1068,9 @@ int psock_setsockopt(FAR struct socket *psock, int level, int option,
* *
* Description: * Description:
* The psock_getsockname() function retrieves the locally-bound name of the * The psock_getsockname() function retrieves the locally-bound name of the
* the 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
* object pointed to by the 'addrlen' argument. * address 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.
@ -1079,8 +1086,8 @@ int psock_setsockopt(FAR struct socket *psock, int level, int option,
* 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.
@ -1119,8 +1126,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.
@ -1391,7 +1398,8 @@ int net_clone(FAR struct socket *psock1, FAR struct socket *psock2);
#ifdef CONFIG_NET_SENDFILE #ifdef CONFIG_NET_SENDFILE
struct file; struct file;
ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset, size_t count); ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset,
size_t count);
#endif #endif
/**************************************************************************** /****************************************************************************
@ -1507,3 +1515,4 @@ int netdev_unregister(FAR struct net_driver_s *dev);
#endif /* CONFIG_NET */ #endif /* CONFIG_NET */
#endif /* __INCLUDE_NUTTX_NET_NET_H */ #endif /* __INCLUDE_NUTTX_NET_NET_H */

View File

@ -418,8 +418,9 @@ static inline int tcp_close_disconnect(FAR struct socket *psock)
* structure, as defined in the <sys/socket.h> header, * structure, as defined in the <sys/socket.h> header,
* to specify the state of the option and linger interval. * to specify the state of the option and linger interval.
* *
* Here is merely adds a pointless timeout on top of the normal * Here it merely adds a pointless timeout on top of the normal
* close operation. * close operation. It should first wait for all data in the
* protocol-specific write buffers to drain.
*/ */
linger = _SO_GETOPT(psock->s_options, SO_LINGER); linger = _SO_GETOPT(psock->s_options, SO_LINGER);