diff --git a/share/man/man4/ng_pppoe.4 b/share/man/man4/ng_pppoe.4 index 331b993abc17..8af801733409 100644 --- a/share/man/man4/ng_pppoe.4 +++ b/share/man/man4/ng_pppoe.4 @@ -1,404 +1,404 @@ .\" Copyright (c) 1996-1999 Whistle Communications, Inc. .\" All rights reserved. .\" .\" Subject to the following obligations and disclaimer of warranty, use and .\" redistribution of this software, in source or object code forms, with or .\" without modifications are expressly permitted by Whistle Communications; .\" provided, however, that: .\" 1. Any and all reproductions of the source or object code must include the .\" copyright notice above and the following disclaimer of warranties; and .\" 2. No rights are granted, in any manner or form, to use Whistle .\" Communications, Inc. trademarks, including the mark "WHISTLE .\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as .\" such appears in the above copyright notice or in the software. .\" .\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND .\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO .\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, .\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. .\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY .\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS .\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. .\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES .\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING .\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, .\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR .\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY .\" OF SUCH DAMAGE. .\" .\" Author: Archie Cobbs .\" .\" $FreeBSD$ .\" $Whistle: ng_pppoe.8,v 1.1 1999/01/25 23:46:27 archie Exp $ .\" .Dd October 28, 1999 .Dt NG_PPPOE 4 .Os FreeBSD .Sh NAME .Nm ng_pppoe .Nd RFC 2516 PPPOE protocol netgraph node type .Sh SYNOPSIS .Fd #include .Fd #include .Sh DESCRIPTION The .Nm pppoe node type performs the PPPoE protocol. It is used in conjunction with the .Xr netgraph 4 extensions to the Ethernet framework to divert and inject Ethernet packets to and from a PPP agent (which is not specified). .Pp The .Dv NGM_PPPOE_GET_STATUS control message can be used at any time to query the current status of the PPPOE module. The only statistics presently available are the total packet counts for input and output. This node does not yet support the .Dv NGM_TEXT_STATUS control message. .Sh HOOKS This node type supports the following hooks: .Pp .Bl -tag -width foobarbaz .It Dv ethernet The hook that should normally be connected to an Ethernet node. .It Dv debug Presently no use. .It Dv [unspecified] Any other name is assumed to be a session hook that will be connected to a PPP client agent, or a ppp server agent. .El .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_PPPOE_GET_STATUS This command returns status information in a .Dv "struct ngpppoestat" : .Bd -literal -offset 4n struct ngpppoestat { u_int packets_in; /* packets in from ethernet */ u_int packets_out; /* packets out towards ethernet */ }; .Ed .It Dv NGM_TEXT_STATUS This generic message returns is a human-readable version of the node status. (not yet) .It Dv NGM_PPPOE_CONNECT Tell a nominated newly created hook that it's session should enter the state machine in a manner to become a client. It must be newly created and a service name can be given as an argument. It is legal to specify a zero length service name. This is common on some DSL setups. A session request packet will be broadcast on the Ethernet. This command uses the .Dv ngpppoe_init_data structure shown below. .It Dv NGM_PPPOE_LISTEN Tell a nominated newly created hook that it's session should enter the state machine in a manner to become a server listener. The argument given is the name of the service to listen on behalf of. A zero length service length will match all requests for service. A matching service request packet will be passed unmodified back to the process responsible for starting the service. It can then examine it and pass it on to the session that is started to answer the request. This command uses the .Dv ngpppoe_init_data structure shown below. .It Dv NGM_PPPOE_OFFER Tell a nominated newly created hook that it's session should enter the state machine in a manner to become a server. The argument given is the name of the service to offer. A zero length service is legal. The State machine will progress to a state where it will await a request packet to be forwarded to it from the startup server, which in turn probably received it from a LISTEN mode hook ( see above). This is so that information that is required for the session that is embedded in the original session request packet, is made available to the state machine that eventually answers the request. When the Session request packet is received, the session negotiation will proceed. This command uses the .Dv ngpppoe_init_data structure shown below. .Pp The three commands above use a common data structure: .Bd -literal -offset 4n struct ngpppoe_init_data { char hook[NG_HOOKLEN + 1]; /* hook to monitor on */ u_int16_t data_len; /* service name length */ char data[0]; /* init data goes here */ }; .Ed .It Dv NGM_PPPOE_SUCCESS This command is sent to the node that started this session with one of the above messages, and reports a state change. This message reports successful Session negotiation. It uses the structure shown below, and reports back the hook name corresponding to the successful session. .It Dv NGM_NGM_PPPOE_FAIL This command is sent to the node that started this session with one of the above messages, and reports a state change. This message reports failed Session negotiation. It uses the structure shown below, and reports back the hook name corresponding to the failed session. The hook will probably have been removed immediately after sending this message .It Dv NGM_NGM_PPPOE_CLOSE This command is sent to the node that started this session with one of the above messages, and reports a state change. This message reports a request to close a session. It uses the structure shown below, and reports back the hook name corresponding to the closed session. The hook will probably have been removed immediately after sending this message. At present this message is not yet used and a 'failed' message will be received at closure instead. .Pp The three commands above use a common data structure: .Bd -literal -offset 4n struct ngpppoe_sts { char hook[NG_HOOKLEN + 1]; /* hook associated with event session */ }; - +.Ed .El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, when all session have been disconnected or when the .Dv ethernet hook is disconnected. .Sh EXAMPLES The following code uses .Dv libnetgraph to set up a .Nm node and connect it to both a socket node and an Ethernet node. It can handle the case of when a .Nm node is already attached to the Ethernet. It then starts a client session. .Bd -literal #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static int setup(char *ethername, char *service, char *sessname, int *dfd, int *cfd); int main() { int fd1, fd2; setup("xl0", NULL, "fred", &fd1, &fd2); sleep (30); } static int setup(char *ethername, char *service, char *sessname, int *dfd, int *cfd) { struct ngm_connect ngc; /* connect */ struct ngm_mkpeer mkp; /* mkpeer */ /******** nodeinfo stuff **********/ u_char rbuf[2 * 1024]; struct ng_mesg *const resp = (struct ng_mesg *) rbuf; struct hooklist *const hlist = (struct hooklist *) resp->data; struct nodeinfo *const ninfo = &hlist->nodeinfo; int ch, no_hooks = 0; struct linkinfo *link; struct nodeinfo *peer; /****message to connect pppoe session*****/ struct { struct ngpppoe_init_data idata; char service[100]; } message; /********tracking our little graph ********/ char path[100]; char source_ID[NG_NODELEN + 1]; char pppoe_node_name[100]; int k; /* * Create the data and control sockets */ if (NgMkSockNode(NULL, cfd, dfd) < 0) { return (errno); } /* * find the ether node of the name requested by asking it for * it's inquiry information. */ if (strlen(ethername) > 16) return (EINVAL); sprintf(path, "%s:", ethername); if (NgSendMsg(*cfd, path, NGM_GENERIC_COOKIE, NGM_LISTHOOKS, NULL, 0) < 0) { return (errno); } /* * the command was accepted so it exists. Await the reply (It's * almost certainly already waiting). */ if (NgRecvMsg(*cfd, resp, sizeof(rbuf), NULL) < 0) { return (errno); } /** * The following is available about the node: * ninfo->name (string) * ninfo->type (string) * ninfo->id (u_int32_t) * ninfo->hooks (u_int32_t) (count of hooks) * check it is the correct type. and get it's ID for use * with mkpeer later. */ if (strncmp(ninfo->type, NG_ETHER_NODE_TYPE, strlen(NG_ETHER_NODE_TYPE)) != 0) { return (EPROTOTYPE); } sprintf(source_ID, "[%08x]:", ninfo->id); /* * look for a hook already attached. */ for (k = 0; k < ninfo->hooks; k++) { /** * The following are available about each hook. * link->ourhook (string) * link->peerhook (string) * peer->name (string) * peer->type (string) * peer->id (u_int32_t) * peer->hooks (u_int32_t) */ link = &hlist->link[k]; peer = &hlist->link[k].nodeinfo; /* Ignore debug hooks */ if (strcmp("debug", link->ourhook) == 0) continue; /* If the orphans hook is attached, use that */ if (strcmp(NG_ETHER_HOOK_ORPHAN, link->ourhook) == 0) { break; } /* the other option is the 'divert' hook */ if (strcmp("NG_ETHER_HOOK_DIVERT", link->ourhook) == 0) { break; } } /* * See if we found a hook there. */ if (k < ninfo->hooks) { if (strcmp(peer->type, NG_PPPOE_NODE_TYPE) == 0) { /* * If it's a type pppoe, we skip making one * ourself, but we continue, using * the existing one. */ sprintf(pppoe_node_name, "[%08x]:", peer->id); } else { /* * There is already someone hogging the data, * return an error. Some day we'll try * daisy-chaining.. */ return (EBUSY); } } else { /* * Try make a node of type pppoe against node "ID" * On hook NG_ETHER_HOOK_ORPHAN. */ snprintf(mkp.type, sizeof(mkp.type), "%s", NG_PPPOE_NODE_TYPE); snprintf(mkp.ourhook, sizeof(mkp.ourhook), "%s", NG_ETHER_HOOK_ORPHAN); snprintf(mkp.peerhook, sizeof(mkp.peerhook), "%s", NG_PPPOE_HOOK_ETHERNET); /* Send message */ if (NgSendMsg(*cfd, source_ID, NGM_GENERIC_COOKIE, NGM_MKPEER, &mkp, sizeof(mkp)) < 0) { return (errno); } /* * Work out a name for the new node. */ sprintf(pppoe_node_name, "%s:%s", source_ID, NG_ETHER_HOOK_ORPHAN); } /* * We now have a pppoe node attached to the ethernet * card. The Ethernet is addressed as ethername: The pppoe * node is addressed as pppoe_node_name: attach to it. * Connect socket node to specified node Use the same hook * name on both ends of the link. */ snprintf(ngc.path, sizeof(ngc.path), "%s", pppoe_node_name); snprintf(ngc.ourhook, sizeof(ngc.ourhook), "%s", sessname); snprintf(ngc.peerhook, sizeof(ngc.peerhook), "%s", sessname); if (NgSendMsg(*cfd, ".:", NGM_GENERIC_COOKIE, NGM_CONNECT, &ngc, sizeof(ngc)) < 0) { return (errno); } /* * Send it a message telling it to start up. */ bzero(&message, sizeof(message)); snprintf(message.idata.hook, sizeof(message.idata.hook), "%s", sessname); if (service == NULL) { message.idata.data_len = 0; } else { snprintf(message.idata.data, sizeof(message.idata.data), "%s", service); message.idata.data_len = strlen(service); } /* Tell session/hook to start up as a client */ if (NgSendMsg(*cfd, ngc.path, NGM_PPPOE_COOKIE, NGM_PPPOE_CONNECT, &message.idata, sizeof(message.idata) + message.idata.data_len) < 0) { return (errno); } return (0); } .Ed .Sh SEE ALSO .Xr netgraph 3 , .Xr netgraph 4 , .Xr ng_socket 4 , .Xr ng_ppp 4 , .Xr ngctl 8 .Rs .%A L. Mamakos .%A K. Lidl .%A J. Evarts .%A D. Carrel .%A D. Simone .%A R. Wheeler .%T "A Method for transmitting PPP over Ethernet (PPPoE)" .%O RFC 2516 .Re .Sh HISTORY The .Nm node type was implemented in .Fx 4.0 . .Sh AUTHORS .An Julian Elischer Aq julian@FreeBSD.org diff --git a/share/man/man9/posix4.9 b/share/man/man9/posix4.9 index 4c8ebe3c8b2a..7d2378a6063c 100644 --- a/share/man/man9/posix4.9 +++ b/share/man/man9/posix4.9 @@ -1,130 +1,131 @@ .\" Copyright (c) 1998 HD Associates, Inc. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .Dd March 1, 1998 .Dt POSIX.1B 9 .Os FreeBSD .Sh NAME .Nm posix1b .Nd "Posix P1003-1B extensions" .Sh DESCRIPTION POSIX.1B adds real time extensions and some commonly used Berkeley extensions to POSIX.1. This section contains preliminary information about avoiding conflicts and adding support for the required ability to specify the interface version. .Sh STATUS March 28, 1998: _POSIX_PRIORITY_SCHEDULING works with these kernel options in your configuration: .Bd -literal -offset 0i options "P1003_1B" options "_KPOSIX_PRIORITY_SCHEDULING" .Ed .Sh SPECIFYING THE VERSION There are three manifest constants that set the version and programming interface for POSIX.1B. .Bd -literal -offset 0i _POSIX_VERSION .Ed specifies the system for which the system is built. The default is POSIX.1 and is 199009L. POSIX.1B is 199309L. This defines the base features of the operating system. .Bd -literal -offset 0i _POSIX_SOURCE .Ed is a macro from POSIX.1 that can be defined to specify that only POSIX and ANSI functionality should occur in the name space. .Bd -literal -offset 0i _POSIX_C_SOURCE .Ed is a macro from POSIX.1B that can be defined to specify that only POSIX and ANSI functionality from a specific POSIX version should occur in the name space, i.e., if _POSIX_VERSION is 199309L (POSIX.1B) but _POSIX_C_SOURCE is 199009L (POSIX.1) then only POSIX.1 features should appear. .Sh PROPERLY HIDING EXTENSIONS The following test macros are set up in . They should used by system header files to avoid the kind of tests you see in . Source programs should not use these .Fx specific implementation details and should test _POSIX_VERSION, _POSIX_SOURCE and _POSIX_C_SOURCE. These should not be used in the kernel though - the kernel should be immune to the user land setting of _POSIX_VERSION. The P1003_1B option can be used in the kernel to limit inclusion of new code, but make sure things work properly when a POSIX.1B program is run on a kernel without the P1003_1B option. .Bd -literal -offset 0i _P1003_1B_VISIBLE .Ed is a test macro that sorts out when extensions should be visible. It is defined in . .Pp In normal C program development only _POSIX_VERSION is set, permitting BSD extensions to appear to the programs. However, when adding new functionality mandated by POSIX.1B, it is important to satisfy the requirements added by the new _POSIX_C_SOURCE macro. _P1003_1B_VISIBLE (not a standard feature test macro) is defined in sys/unistd.h when the combination of _POSIX_VERSION, _POSIX_SOURCE, and _POSIX_C_SOURCE indicate that the extensions are in scope. .Bd -literal -offset 0i _P1003_1B_VISIBLE_HISTORICALLY +.Ed is present to conditionalize POSIX.1B extensions that were historically in the system. These are visible when _POSIX_SOURCE and _POSIX_C_SOURCE are not set at all or when _POSIX_C_SOURCE enables POSIX.1B features. The intent of this feature test is to permit hiding the new extensions while still letting BSD extensions show up to avoid breaking existing programs without trying to use the "big hammer" of _POSIX_C_SOURCE. .Pp Some recent additions to header files are new enough that they should be changed to be dependent on _P1003_1B_VISIBLE instead of _HISTORICALLY. .Pp Traditional BSD headers (e.g., mmap.h) now specified in POSIX.1B can include and conditionalize BSD extensions on _P1003_1B_VISIBLE_HISTORICALLY. .Sh NON STANDARD TEST MACROS .Bd -literal -offset 0i _P1003_1B_INCLUDE_MAYBES .Ed when set before the inclusion of any other header file requests that all header files that the POSIX.1B spec says a standard header may include should be included. Normally no non-required headers are included. Setting this pre-processor definition should make any compliant program compile without issues of header file inclusion. .Bd -literal -offset 0i P1003_1B .Ed is a config option to build in POSIX.1B support in the kernel. .\" .Sh SEE ALSO .Sh HISTORY The .Nm section manual page appeared in .Fx 3.0 . diff --git a/usr.sbin/apmd/apmd.8 b/usr.sbin/apmd/apmd.8 index 9cc38ee8d7d8..f85688fd1010 100644 --- a/usr.sbin/apmd/apmd.8 +++ b/usr.sbin/apmd/apmd.8 @@ -1,297 +1,298 @@ .\" Copyright (c) 1999 Mitsuru IWASAKI .\" Copyright (c) 1999 KOIE Hidetaka .\" Copyright (c) 1999 Yoshihiko SARUMARU Aq .\" Copyright (c) 1999 Norihiro Kumagai .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)apmd.8 1.1 (FreeBSD) 6/28/99 .\" $FreeBSD$ .\" .Dd June 28, 1999 .Dt APMD 8 .Os .Sh NAME .Nm apmd .Nd Advanced Power Management monitor daemon .Sh SYNOPSIS .Nm .Op Fl d .Op Fl f file .Op Fl v .Sh DESCRIPTION .Nm Apmd monitors the occurrence of the specified Advanced Power Management .Pq APM events and, if one of the events occurs, it executes the sequence of commands corresponding to the event. Only the events specified in the configuration file are notified to .Nm ; all other events are ignored. For each event posted by the APM BIOS, .Nm invokes the sequence of commands specified in the configuration file. When .Nm is running with monitoring suspend/standby requests, the kernel will not process those requests. Therefore, if you wish action to be taken when these events occur, you need to explicitly configure the appropriate commands or built-in functions in the configuration file. .Pp .Nm Apmd recognizes the following runtime options: .Bl -tag -width -f_file .It Fl d Starts in debug mode. This causes .Nm to execute in the foreground instead of in daemon mode. .It Fl f Ar file Specifies a different configuration file .Ar file to be used in place of the default .Pa /etc/apmd.conf . .It Fl v Verbose mode. .El .Pp When .Nm starts, it reads the configuration file .Po .Pa /etc/apmd.conf as default .Pc and notifies the set of events to be monitored to the APM device driver. When it terminates, the APM device driver automatically cancels monitored events. .Pp If the .Nm process receives a SIGHUP, it will reread its configuration file and notify the APM device driver of any changes to its configuration. .Pp .Nm Apmd uses the device .Pa /dev/apmctl to issue .Xr ioctl 2 requests for monitoring events and for controlling the APM system. This device file is opened exclusively, so only a single .Nm process can be running at any time. .Pp When .Nm receives an APM event, it forks a child process to execute the commands specified in the configuration file and then continues listening for more events. The child process executes the commands specified, one at a time and in the order that they are listed. .Pp While .Nm is processing the command list for SUSPEND/STANDBY requests, the APM kernel device driver issues notifications to APM BIOS once per second so that the BIOS knows that there are still some commands pending, and that it should not complete the request just yet. .Pp The .Nm daemon creates the file .Pa /var/run/apmd.pid , and stores its process id there. This can be used to kill or reconfigure .Nm . .Sh CONFIGURATION FILE The structure of the .Nm configuration file is quite simple. For example: .Pp .Bd -literal apm_event SUSPENDREQ { exec "sync && sync && sync"; exec "sleep 1"; exec "zzz"; } .Ed .Pp will cause .Nm to receive the APM event .Ql SUSPENDREQ (which may be posted by an LCD close), run the .Ql sync command 3 times and wait for a while, then execute .Nm zzz ( Ns Nm apm Fl z ) to put the system in the suspend state. .Pp .Bl -bullet .It The apm_event keyword .Bd -ragged -offset indent .Ql apm_event is the keyword which indicates the start of configuration for each events. .Ed .It APM events .Bd -ragged -offset indent If you wish to execute the same commands for different events, the event names should be delimited by a comma. The following are valid event names: .Bl -item .It - Events ignored by the kernel if .Nm is running: .Pp .Bl -tag -width USERSUSPENDREQ -compact -offset indent .It STANDBYREQ .It USERSTANDBYREQ .It SUSPENDREQ should include sync in the command list, .It USERSUSPENDREQ should include sync in the command list, .It BATTERYLOW only zzz should be specified in the command list. .El .It - Events passed to .Nm after kernel handling: .Pp .Bl -tag -width USERSUSPENDREQ -compact -offset indent .It NORMRESUME .It CRITRESUME .It STANDBYRESUME .It POWERSTATECHANGE .It UPDATETIME .It CAPABILITIESCHANGE .El .Pp Other events will not be sent to .Nm . .El .Ed .It command line syntax .Bd -ragged -offset indent In the example above, the three lines begining with .Ql exec are commands for the event. Each line should be terminated with a semicolon. The command list for the event should be enclosed by .Ql { and .Ql } . .Nm uses .Pa /bin/sh for double-quotation enclosed command execution, just as with .Xr system 3 . Each command is executed in order until the end of the list is reached or a command finishes with a non-zero status code. .Nm will report any failed command's status code via .Xr syslog 3 and will then reject the request event posted by the APM BIOS. .Ed .It Built-in functions .Bd -ragged -offset indent You can also specify .Nm built-in functions instead of command lines. A built-in function name should be terminated with a semicolon, just as with a command line. The following built-in functions are currently supported: .Bl -item .It - reject: .Bd -ragged -offset indent Reject last request posted by APM BIOS. This can be used to reject a SUSPEND request when the LCD is closed and put the system in a STANDBY state instead. .Ed .El +.Ed .El .Sh EXAMPLES Sample configuration commands include: .Bd -literal apm_event SUSPENDREQ { exec "/etc/rc.suspend"; } apm_event USERSUSPENDREQ { exec "sync && sync && sync"; exec "sleep 1"; exec "apm -z"; } apm_event NORMRESUME, STANDBYRESUME { exec "/etc/rc.resume"; } # resume event configuration for serial mouse users by # reinitializing a moused(8) connected to a serial port. # #apm_event NORMRESUME { # exec "kill -HUP `cat /var/run/moused.pid`"; #} # # suspend request event configuration for ATA HDD users: # execute standby instead of suspend. # #apm_event SUSPENDREQ { # reject; # exec "sync && sync && sync"; # exec "sleep 1"; # exec "apm -Z"; #} .Ed .Sh FILES .Bl -tag -width /etc/apmd.conf -compact .It Pa /etc/apmd.conf .It Pa /dev/apmctl .It Pa /var/run/apmd.pid .El .Sh SEE ALSO .Xr apm 4 , .Xr apm 8 .Sh AUTHORS .An Mitsuru IWASAKI Aq iwasaki@FreeBSD.org .An KOIE Hidetaka Aq koie@suri.co.jp .Pp Some contributions made by .An Warner Losh Aq imp@FreeBSD.org , .An Hiroshi Yamashita Aq bluemoon@msj.biglobe.ne.jp , .An Yoshihiko SARUMARU Aq mistral@imasy.or.jp , .An Norihiro Kumagai Aq kuma@nk.rim.or.jp , .An NAKAGAWA Yoshihisa Aq nakagawa@jp.FreeBSD.org , and .An Nick Hilliard Aq nick@foobar.org . .Sh HISTORY The .Nm command appeared in .Fx 3.3 . diff --git a/usr.sbin/wlconfig/wlconfig.8 b/usr.sbin/wlconfig/wlconfig.8 index 02d7b41939c6..42c0547398e4 100644 --- a/usr.sbin/wlconfig/wlconfig.8 +++ b/usr.sbin/wlconfig/wlconfig.8 @@ -1,137 +1,138 @@ .\" $FreeBSD$ .\" .Dd December 26, 1996 .Os .Dt WLCONFIG 8 .Sh NAME .Nm wlconfig .Nd read/write wavelan config parameters .Sh SYNOPSIS .Nm .Ar ifname .Op Ar param value ... .Sh DESCRIPTION The .Nm command can be used to read and set parameters for the NCR/AT&T Wavelan radio LAN card. Various parameters stored in the nonvolatile Parameter Storage Area (PSA) on the card can be modified with this program, which obviates the need for the DOS-based .Nm instconf.exe program. It can also be used to interrogate the optional signal strength cache which may have been compiled into the driver. .Pp The .Ar ifname parameter specifies the wavelan interface name (eg. .Pa wl0 ). If no other arguments are supplied, the current contents of the PSA are interpreted and displayed. .Pp The .Ar param and .Ar value arguments can be used to change the value of several parameters. Any number of .Ar param value pairs may be supplied. .Bl -tag -width 15n -offset indent .It Va param .Va value .It irq IRQ value (used at next reset), may be one of 3,4,5,6,10,11,12,15. .It mac Local MAC value (ethernet address). .It macsel .Sq soft (as set by the .Sq mac parameter) or .Sq default (as set at the factory). .It nwid The NWID is a 2-byte parameter passed to the card's radio modem. NWIDs allow multiple logically discrete networks to operate independantly whilse occupying the same airspace. Packets with a different NWID are simply ignored by the modem. In the hardware, NWIDs are stored long-term in non-volative memory (called the PSA or programmable storage area), and are loaded by software into the radio modem when the driver is initialized. This sets the default NWID loaded at startup. .It currnwid This sets the current operating NWID (but does not save it to the PSA). .It cache The driver may maintain a per interface fixed size cache of signal strength, silence, and quality levels, which are indexed by sender MAC addresses. Input packets are stored in the cache, and when received, the values stored in the radio modem are interrogated and stored. There are also two sysctl values (iponly and multicast only) which can be used for filtering out some input packets. By default, the cache mechanism stores only non-unicast IP packets, but this can be changed with .Xr sysctl 8 . Each non-filtered input packet causes a cache update, hence one can monitor the antennae signal strength to a remote system. There are three commands that can be given as values: .Sq raw , which prints out the raw signal strength data as found in the radio modem hardware value, .Sq scale , which scales the raw hardware values to 0..100%, and .Sq zero which clears out the cache in case you want to store new samples. .El .Pp Note that if the IRQ on the Wavelan card is incorrect, the interface will be configured, but will not function. The .Nm program should then be used to reconfigure the card to a sensible value. .Sh EXAMPLES Set the NWID to 0x1234 : .Bd -literal -offset # wlconfig wl0 nwid 0x1234 .Ed .Pp Show the current settings : .Bd -literal -offset # wlconfig wl0 Board type : ISA Base address options : 0x300, 0x390, 0x3c0, 0x3e0 Waitstates : 0 Bus mode : ISA IRQ : 10 Default MAC address : 08:00:0e:20:3d:4b Soft MAC address : 00:00:00:00:00:00 Current MAC address : Default Adapter compatibility : PC-AT 2.4GHz Threshold preset : 1 Call code required : NO Subband : 2425MHz Quality threshold : 3 Hardware version : 0 (Rel1/Rel2) Network ID enable : YES NWID : 0xdead Datalink security : NO Databus width : 16 (variable) Configuration state : unconfigured CRC-16 : 0x3c26 CRC status : OK +.Ed .Pp Print a scaled version of the signal strength cache : .Bd -literal -offset # wlconfig wl0 cache scale .Ed .Sh SEE ALSO .Xr wl 4 , .Xr sysctl 8 .Sh HISTORY This implementation of the .Nm command is completely new, written for Hilink Internet by .An Michael Smith , and updated by .An Jim Binkley &c .