ng_ksocket.4 (236596) | ng_ksocket.4 (242997) |
---|---|
1.\" Copyright (c) 1999 Whistle Communications, Inc. 2.\" All rights reserved. 3.\" 4.\" Subject to the following obligations and disclaimer of warranty, use and 5.\" redistribution of this software, in source or object code forms, with or 6.\" without modifications are expressly permitted by Whistle Communications; 7.\" provided, however, that: 8.\" 1. Any and all reproductions of the source or object code must include the --- 18 unchanged lines hidden (view full) --- 27.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 31.\" OF SUCH DAMAGE. 32.\" 33.\" Author: Archie Cobbs <archie@FreeBSD.org> 34.\" | 1.\" Copyright (c) 1999 Whistle Communications, Inc. 2.\" All rights reserved. 3.\" 4.\" Subject to the following obligations and disclaimer of warranty, use and 5.\" redistribution of this software, in source or object code forms, with or 6.\" without modifications are expressly permitted by Whistle Communications; 7.\" provided, however, that: 8.\" 1. Any and all reproductions of the source or object code must include the --- 18 unchanged lines hidden (view full) --- 27.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 31.\" OF SUCH DAMAGE. 32.\" 33.\" Author: Archie Cobbs <archie@FreeBSD.org> 34.\" |
35.\" $FreeBSD: head/share/man/man4/ng_ksocket.4 236596 2012-06-05 03:14:39Z eadler $ | 35.\" $FreeBSD: head/share/man/man4/ng_ksocket.4 242997 2012-11-13 20:41:36Z joel $ |
36.\" 37.Dd January 9, 2012 38.Dt NG_KSOCKET 4 39.Os 40.Sh NAME 41.Nm ng_ksocket 42.Nd kernel socket netgraph node type 43.Sh SYNOPSIS --- 62 unchanged lines hidden (view full) --- 106Otherwise 107.Nm 108will return 109.Er ENOTCONN 110to sender. 111.Sh CONTROL MESSAGES 112This node type supports the generic control messages, plus the following: 113.Bl -tag -width foo | 36.\" 37.Dd January 9, 2012 38.Dt NG_KSOCKET 4 39.Os 40.Sh NAME 41.Nm ng_ksocket 42.Nd kernel socket netgraph node type 43.Sh SYNOPSIS --- 62 unchanged lines hidden (view full) --- 106Otherwise 107.Nm 108will return 109.Er ENOTCONN 110to sender. 111.Sh CONTROL MESSAGES 112This node type supports the generic control messages, plus the following: 113.Bl -tag -width foo |
114.It Dv NGM_KSOCKET_BIND | 114.It Dv NGM_KSOCKET_BIND Pq Ic bind |
115This functions exactly like the 116.Xr bind 2 117system call. 118The 119.Vt "struct sockaddr" 120socket address parameter should be supplied as an argument. | 115This functions exactly like the 116.Xr bind 2 117system call. 118The 119.Vt "struct sockaddr" 120socket address parameter should be supplied as an argument. |
121.It Dv NGM_KSOCKET_LISTEN | 121.It Dv NGM_KSOCKET_LISTEN Pq Ic listen |
122This functions exactly like the 123.Xr listen 2 124system call. 125The backlog parameter (a single 32 bit 126.Dv int ) 127should be supplied as an argument. | 122This functions exactly like the 123.Xr listen 2 124system call. 125The backlog parameter (a single 32 bit 126.Dv int ) 127should be supplied as an argument. |
128.It Dv NGM_KSOCKET_CONNECT | 128.It Dv NGM_KSOCKET_CONNECT Pq Ic connect |
129This functions exactly like the 130.Xr connect 2 131system call. 132The 133.Vt "struct sockaddr" 134destination address parameter should be supplied as an argument. | 129This functions exactly like the 130.Xr connect 2 131system call. 132The 133.Vt "struct sockaddr" 134destination address parameter should be supplied as an argument. |
135.It Dv NGM_KSOCKET_ACCEPT | 135.It Dv NGM_KSOCKET_ACCEPT Pq Ic accept |
136Equivalent to the 137.Xr accept 2 138system call on a non-blocking socket. 139If there is a pending connection on the queue, 140a new socket and a corresponding cloned node are created. 141Returned are the cloned node's ID and a peer name (as 142.Vt "struct sockaddr" ) . 143If there are no pending connections, 144this control message returns nothing, 145and a connected node will receive the above message asynchronously, 146when a connection is established. 147.Pp 148A cloned node supports a single hook with an arbitrary name. 149If not connected, a node disappears when its parent node is destroyed. 150Once connected, it becomes an independent node. | 136Equivalent to the 137.Xr accept 2 138system call on a non-blocking socket. 139If there is a pending connection on the queue, 140a new socket and a corresponding cloned node are created. 141Returned are the cloned node's ID and a peer name (as 142.Vt "struct sockaddr" ) . 143If there are no pending connections, 144this control message returns nothing, 145and a connected node will receive the above message asynchronously, 146when a connection is established. 147.Pp 148A cloned node supports a single hook with an arbitrary name. 149If not connected, a node disappears when its parent node is destroyed. 150Once connected, it becomes an independent node. |
151.It Dv NGM_KSOCKET_GETNAME | 151.It Dv NGM_KSOCKET_GETNAME Pq Ic getname |
152Equivalent to the 153.Xr getsockname 2 154system call. 155The name is returned as a 156.Vt "struct sockaddr" 157in the arguments field of the reply. | 152Equivalent to the 153.Xr getsockname 2 154system call. 155The name is returned as a 156.Vt "struct sockaddr" 157in the arguments field of the reply. |
158.It Dv NGM_KSOCKET_GETPEERNAME | 158.It Dv NGM_KSOCKET_GETPEERNAME Pq Ic getpeername |
159Equivalent to the 160.Xr getpeername 2 161system call. 162The name is returned as a 163.Vt "struct sockaddr" 164in the arguments field of the reply. | 159Equivalent to the 160.Xr getpeername 2 161system call. 162The name is returned as a 163.Vt "struct sockaddr" 164in the arguments field of the reply. |
165.It Dv NGM_KSOCKET_SETOPT | 165.It Dv NGM_KSOCKET_SETOPT Pq Ic setopt |
166Equivalent to the 167.Xr setsockopt 2 168system call, except that the option name, level, and value are passed in a 169.Vt "struct ng_ksocket_sockopt" . | 166Equivalent to the 167.Xr setsockopt 2 168system call, except that the option name, level, and value are passed in a 169.Vt "struct ng_ksocket_sockopt" . |
170.It Dv NGM_KSOCKET_GETOPT | 170.It Dv NGM_KSOCKET_GETOPT Pq Ic getopt |
171Equivalent to the 172.Xr getsockopt 2 173system call, except that the option is passed in a 174.Vt "struct ng_ksocket_sockopt" . 175When sending this command, the 176.Dv value 177field should be empty; upon return, it will contain the 178retrieved value. --- 64 unchanged lines hidden --- | 171Equivalent to the 172.Xr getsockopt 2 173system call, except that the option is passed in a 174.Vt "struct ng_ksocket_sockopt" . 175When sending this command, the 176.Dv value 177field should be empty; upon return, it will contain the 178retrieved value. --- 64 unchanged lines hidden --- |