diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-03-26 17:05:09 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-03-26 17:05:09 +0000 |
commit | b6cc16f9a0d30b54f6be4b2f7b7b6b38686a2f3c (patch) | |
tree | bf2139fec6569333e181a798c3a3a0391bc84fbc /sys | |
parent | 359932b59233a3579a9815d7a1bca842ba8fdf5c (diff) | |
download | FreeBSD-src-b6cc16f9a0d30b54f6be4b2f7b7b6b38686a2f3c.zip FreeBSD-src-b6cc16f9a0d30b54f6be4b2f7b7b6b38686a2f3c.tar.gz |
Following movement of functions from uipc_socket2.c to uipc_socket.c and
uipc_sockbuf.c, clean up and update comments.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_sockbuf.c | 13 | ||||
-rw-r--r-- | sys/kern/uipc_socket.c | 66 |
2 files changed, 39 insertions, 40 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 2293eef..381632c 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -980,8 +980,8 @@ sbdroprecord(struct sockbuf *sb) } /* - * Create a "control" mbuf containing the specified data - * with the specified type for presentation on a socket buffer. + * Create a "control" mbuf containing the specified data with the specified + * type for presentation on a socket buffer. */ struct mbuf * sbcreatecontrol(p, size, type, level) @@ -1014,10 +1014,11 @@ sbcreatecontrol(p, size, type, level) } /* - * This does the same for sockbufs. Note that the xsockbuf structure, - * since it is always embedded in a socket, does not include a self - * pointer nor a length. We make this entry point public in case - * some other mechanism needs it. + * This does the same for socket buffers that sotoxsocket does for sockets: + * generate an user-format data structure describing the socket buffer. Note + * that the xsockbuf structure, since it is always embedded in a socket, does + * not include a self pointer nor a length. We make this entry point public + * in case some other mechanism needs it. */ void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7d5a95a..de83932 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2673,8 +2673,8 @@ pru_send_notsupp(struct socket *so, int flags, struct mbuf *m, } /* - * This isn't really a ``null'' operation, but it's the default one - * and doesn't do anything destructive. + * This isn't really a ``null'' operation, but it's the default one and + * doesn't do anything destructive. */ int pru_sense_null(struct socket *so, struct stat *sb) @@ -2827,39 +2827,37 @@ sysctl_somaxconn(SYSCTL_HANDLER_ARGS) } /* - * Primitive routines for operating on sockets. + * These functions are used by protocols to notify the socket layer (and its + * consumers) of state changes in the sockets driven by protocol-side events. */ /* - * Procedures to manipulate state flags of socket - * and do appropriate wakeups. Normal sequence from the - * active (originating) side is that soisconnecting() is - * called during processing of connect() call, - * resulting in an eventual call to soisconnected() if/when the - * connection is established. When the connection is torn down - * soisdisconnecting() is called during processing of disconnect() call, - * and soisdisconnected() is called when the connection to the peer - * is totally severed. The semantics of these routines are such that - * connectionless protocols can call soisconnected() and soisdisconnected() - * only, bypassing the in-progress calls when setting up a ``connection'' - * takes no time. + * Procedures to manipulate state flags of socket and do appropriate wakeups. * - * From the passive side, a socket is created with - * two queues of sockets: so_incomp for connections in progress - * and so_comp for connections already made and awaiting user acceptance. - * As a protocol is preparing incoming connections, it creates a socket - * structure queued on so_incomp by calling sonewconn(). When the connection - * is established, soisconnected() is called, and transfers the - * socket structure to so_comp, making it available to accept(). + * Normal sequence from the active (originating) side is that + * soisconnecting() is called during processing of connect() call, resulting + * in an eventual call to soisconnected() if/when the connection is + * established. When the connection is torn down soisdisconnecting() is + * called during processing of disconnect() call, and soisdisconnected() is + * called when the connection to the peer is totally severed. The semantics + * of these routines are such that connectionless protocols can call + * soisconnected() and soisdisconnected() only, bypassing the in-progress + * calls when setting up a ``connection'' takes no time. * - * If a socket is closed with sockets on either - * so_incomp or so_comp, these sockets are dropped. + * From the passive side, a socket is created with two queues of sockets: + * so_incomp for connections in progress and so_comp for connections already + * made and awaiting user acceptance. As a protocol is preparing incoming + * connections, it creates a socket structure queued on so_incomp by calling + * sonewconn(). When the connection is established, soisconnected() is + * called, and transfers the socket structure to so_comp, making it available + * to accept(). * - * If higher level protocols are implemented in - * the kernel, the wakeups done here will sometimes - * cause software-interrupt process scheduling. + * If a socket is closed with sockets on either so_incomp or so_comp, these + * sockets are dropped. + * + * If higher-level protocols are implemented in the kernel, the wakeups done + * here will sometimes cause software-interrupt process scheduling. */ - void soisconnecting(so) register struct socket *so; @@ -2969,12 +2967,12 @@ sodupsockaddr(const struct sockaddr *sa, int mflags) } /* - * Create an external-format (``xsocket'') structure using the information - * in the kernel-format socket structure pointed to by so. This is done - * to reduce the spew of irrelevant information over this interface, - * to isolate user code from changes in the kernel structure, and - * potentially to provide information-hiding if we decide that - * some of this information should be hidden from users. + * Create an external-format (``xsocket'') structure using the information in + * the kernel-format socket structure pointed to by so. This is done to + * reduce the spew of irrelevant information over this interface, to isolate + * user code from changes in the kernel structure, and potentially to provide + * information-hiding if we decide that some of this information should be + * hidden from users. */ void sotoxsocket(struct socket *so, struct xsocket *xso) |