Skip to content

Commit

Permalink
net: add documentation to socket.c
Browse files Browse the repository at this point in the history
Adds missing sphinx documentation to the
socket.c's functions. Also fixes some whitespaces.

I also changed the style of older documentation as an
effort to have an uniform documentation style.

Signed-off-by: Pedro Tammela <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
tammela authored and davem330 committed Mar 15, 2019
1 parent 228cd2d commit 8a3c245
Show file tree
Hide file tree
Showing 3 changed files with 271 additions and 24 deletions.
6 changes: 6 additions & 0 deletions include/linux/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ enum sock_type {

#endif /* ARCH_HAS_SOCKET_TYPES */

/**
* enum sock_shutdown_cmd - Shutdown types
* @SHUT_RD: shutdown receptions
* @SHUT_WR: shutdown transmissions
* @SHUT_RDWR: shutdown receptions/transmissions
*/
enum sock_shutdown_cmd {
SHUT_RD,
SHUT_WR,
Expand Down
12 changes: 6 additions & 6 deletions include/linux/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ typedef __kernel_sa_family_t sa_family_t;
/*
* 1003.1g requires sa_family_t and that sa_data is char.
*/

struct sockaddr {
sa_family_t sa_family; /* address family, AF_xxx */
char sa_data[14]; /* 14 bytes of protocol address */
Expand All @@ -44,7 +44,7 @@ struct linger {
* system, not 4.3. Thus msg_accrights(len) are now missing. They
* belong in an obscure libc emulation or the bin.
*/

struct msghdr {
void *msg_name; /* ptr to socket address structure */
int msg_namelen; /* size of socket address structure */
Expand All @@ -54,7 +54,7 @@ struct msghdr {
unsigned int msg_flags; /* flags on received message */
struct kiocb *msg_iocb; /* ptr to iocb for async requests */
};

struct user_msghdr {
void __user *msg_name; /* ptr to socket address structure */
int msg_namelen; /* size of socket address structure */
Expand Down Expand Up @@ -122,7 +122,7 @@ struct cmsghdr {
* inside range, given by msg->msg_controllen before using
* ancillary object DATA. --ANK (980731)
*/

static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
struct cmsghdr *__cmsg)
{
Expand Down Expand Up @@ -264,10 +264,10 @@ struct ucred {
/* Maximum queue length specifiable by listen. */
#define SOMAXCONN 128

/* Flags we can use with send/ and recv.
/* Flags we can use with send/ and recv.
Added those for 1003.1g not all are supported yet
*/

#define MSG_OOB 1
#define MSG_PEEK 2
#define MSG_DONTROUTE 4
Expand Down
Loading

0 comments on commit 8a3c245

Please sign in to comment.