diff options
| author | Julian Elischer <julian@FreeBSD.org> | 1999-11-06 21:07:32 +0000 |
|---|---|---|
| committer | Julian Elischer <julian@FreeBSD.org> | 1999-11-06 21:07:32 +0000 |
| commit | 41d4aa314c022968eaa1df19f3dc9fa54dddca0d (patch) | |
| tree | 54a8e6e05e0a5f64a7d96aee876707513951f742 /sys/modules/netgraph/socket | |
| parent | 3ba3ae906a6058c1054e107cb82905e55497110a (diff) | |
Notes
Diffstat (limited to 'sys/modules/netgraph/socket')
| -rw-r--r-- | sys/modules/netgraph/socket/ng_socket.4 | 39 | ||||
| -rw-r--r-- | sys/modules/netgraph/socket/ng_socket.8 | 39 |
2 files changed, 72 insertions, 6 deletions
diff --git a/sys/modules/netgraph/socket/ng_socket.4 b/sys/modules/netgraph/socket/ng_socket.4 index d39c4089557f..49ecb1ad95c4 100644 --- a/sys/modules/netgraph/socket/ng_socket.4 +++ b/sys/modules/netgraph/socket/ng_socket.4 @@ -37,7 +37,7 @@ .\" .Dd January 19, 1999 .Dt NG_SOCKET 8 -.Os FreeBSD 3 +.Os FreeBSD 4.0 .Sh NAME .Nm ng_socket .Nd netgraph socket node type @@ -62,7 +62,10 @@ in the protocol family using the .Xr socket 2 system call. -Any control messages received by the node are received using +Any control messages received by the node +and not having a cookie value of +.Dv NGM_SOCKET_COOKIE +are received by the process, using .Xr recvfrom 2 ; the socket address argument is a .Dv "struct sockaddr_ng" @@ -104,7 +107,28 @@ There is a user library that simplifies using netgraph sockets; see This node type supports hooks with arbitrary names (as long as they are unique) and always accepts hook connection requests. .Sh CONTROL MESSAGES -This node type supports only the generic control messages. +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_SOCK_CMD_NOLINGER +When the last hook is removed from this node, it will shut down as +if it had received a +.Dv NGM_SHUTDOWN +message. Attempts to access the sockets associated will return +.Er ENOTCONN . +.It Dv NGM_SOCK_CMD_LINGER +This is the default mode. When the last hook is removed, the node will +continue to exist, ready to accept new hooks until it +is explicitly shut down. +.El +.Pp +All other messages +with neither the +.Dv NGM_SOCKET_COOKIE +or +.Dv NGM_GENERIC_COOKIE +will be passed unaltered up the +.Dv NG_CONTROL +socket. .Sh SHUTDOWN This node type shuts down and disappears when both the associated .Dv NG_CONTROL @@ -115,9 +139,18 @@ sockets have been closed, or a control message is received. In the latter case, attempts to write to the still-open sockets will return .Er ENOTCONN . +If the +.Dv NGM_SOCK_CMD_NOLINGER +message has been received, closure of the last hook will also initiate +a shutdown of the node. .Sh BUGS It is not possible to reject the connection of a hook, though any data received on that hook can certainly be ignored. +.Pp +The controlling process is not notified of all events that an in-kernel node +would be notified of, e.g. a new hook, or hook removal. We should define +some node-initiated messages for this purpose (to be sent up the control +socket). .Sh SEE ALSO .Xr socket 2 , .Xr netgraph 3 , diff --git a/sys/modules/netgraph/socket/ng_socket.8 b/sys/modules/netgraph/socket/ng_socket.8 index d39c4089557f..49ecb1ad95c4 100644 --- a/sys/modules/netgraph/socket/ng_socket.8 +++ b/sys/modules/netgraph/socket/ng_socket.8 @@ -37,7 +37,7 @@ .\" .Dd January 19, 1999 .Dt NG_SOCKET 8 -.Os FreeBSD 3 +.Os FreeBSD 4.0 .Sh NAME .Nm ng_socket .Nd netgraph socket node type @@ -62,7 +62,10 @@ in the protocol family using the .Xr socket 2 system call. -Any control messages received by the node are received using +Any control messages received by the node +and not having a cookie value of +.Dv NGM_SOCKET_COOKIE +are received by the process, using .Xr recvfrom 2 ; the socket address argument is a .Dv "struct sockaddr_ng" @@ -104,7 +107,28 @@ There is a user library that simplifies using netgraph sockets; see This node type supports hooks with arbitrary names (as long as they are unique) and always accepts hook connection requests. .Sh CONTROL MESSAGES -This node type supports only the generic control messages. +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_SOCK_CMD_NOLINGER +When the last hook is removed from this node, it will shut down as +if it had received a +.Dv NGM_SHUTDOWN +message. Attempts to access the sockets associated will return +.Er ENOTCONN . +.It Dv NGM_SOCK_CMD_LINGER +This is the default mode. When the last hook is removed, the node will +continue to exist, ready to accept new hooks until it +is explicitly shut down. +.El +.Pp +All other messages +with neither the +.Dv NGM_SOCKET_COOKIE +or +.Dv NGM_GENERIC_COOKIE +will be passed unaltered up the +.Dv NG_CONTROL +socket. .Sh SHUTDOWN This node type shuts down and disappears when both the associated .Dv NG_CONTROL @@ -115,9 +139,18 @@ sockets have been closed, or a control message is received. In the latter case, attempts to write to the still-open sockets will return .Er ENOTCONN . +If the +.Dv NGM_SOCK_CMD_NOLINGER +message has been received, closure of the last hook will also initiate +a shutdown of the node. .Sh BUGS It is not possible to reject the connection of a hook, though any data received on that hook can certainly be ignored. +.Pp +The controlling process is not notified of all events that an in-kernel node +would be notified of, e.g. a new hook, or hook removal. We should define +some node-initiated messages for this purpose (to be sent up the control +socket). .Sh SEE ALSO .Xr socket 2 , .Xr netgraph 3 , |
