ng_pppoe.4 (213573) | ng_pppoe.4 (231564) |
---|---|
1.\" Copyright (c) 1996-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) 1996-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_pppoe.4 213573 2010-10-08 12:40:16Z uqs $ | 35.\" $FreeBSD: head/share/man/man4/ng_pppoe.4 231564 2012-02-12 18:29:56Z ed $ |
36.\" $Whistle: ng_pppoe.8,v 1.1 1999/01/25 23:46:27 archie Exp $ 37.\" 38.Dd December 27, 2007 39.Dt NG_PPPOE 4 40.Os 41.Sh NAME 42.Nm ng_pppoe 43.Nd RFC 2516 PPPoE protocol netgraph node type --- 99 unchanged lines hidden (view full) --- 143.Dv ngpppoe_init_data 144structure shown below. 145.El 146.Pp 147The three commands above use a common data structure: 148.Bd -literal -offset 4n 149struct ngpppoe_init_data { 150 char hook[NG_HOOKSIZ]; /* hook to monitor on */ | 36.\" $Whistle: ng_pppoe.8,v 1.1 1999/01/25 23:46:27 archie Exp $ 37.\" 38.Dd December 27, 2007 39.Dt NG_PPPOE 4 40.Os 41.Sh NAME 42.Nm ng_pppoe 43.Nd RFC 2516 PPPoE protocol netgraph node type --- 99 unchanged lines hidden (view full) --- 143.Dv ngpppoe_init_data 144structure shown below. 145.El 146.Pp 147The three commands above use a common data structure: 148.Bd -literal -offset 4n 149struct ngpppoe_init_data { 150 char hook[NG_HOOKSIZ]; /* hook to monitor on */ |
151 u_int16_t data_len; /* service name length */ | 151 uint16_t data_len; /* service name length */ |
152 char data[0]; /* init data goes here */ 153}; 154.Ed 155.Bl -tag -width 3n 156.It Dv NGM_PPPOE_SUCCESS 157This command is sent to the node that started this session with one of the 158above messages, and reports a state change. 159This message reports successful Session negotiation. --- 180 unchanged lines hidden (view full) --- 340 */ 341 if (NgRecvMsg(*cfd, resp, sizeof(rbuf), NULL) < 0) { 342 return (errno); 343 } 344 /** 345 * The following is available about the node: 346 * ninfo->name (string) 347 * ninfo->type (string) | 152 char data[0]; /* init data goes here */ 153}; 154.Ed 155.Bl -tag -width 3n 156.It Dv NGM_PPPOE_SUCCESS 157This command is sent to the node that started this session with one of the 158above messages, and reports a state change. 159This message reports successful Session negotiation. --- 180 unchanged lines hidden (view full) --- 340 */ 341 if (NgRecvMsg(*cfd, resp, sizeof(rbuf), NULL) < 0) { 342 return (errno); 343 } 344 /** 345 * The following is available about the node: 346 * ninfo->name (string) 347 * ninfo->type (string) |
348 * ninfo->id (u_int32_t) 349 * ninfo->hooks (u_int32_t) (count of hooks) | 348 * ninfo->id (uint32_t) 349 * ninfo->hooks (uint32_t) (count of hooks) |
350 * check it is the correct type. and get it's ID for use 351 * with mkpeer later. 352 */ 353 if (strncmp(ninfo->type, NG_ETHER_NODE_TYPE, 354 strlen(NG_ETHER_NODE_TYPE)) != 0) { 355 return (EPROTOTYPE); 356 } 357 sprintf(source_ID, "[%08x]:", ninfo->id); 358 359 /* 360 * look for a hook already attached. 361 */ 362 for (k = 0; k < ninfo->hooks; k++) { 363 /** 364 * The following are available about each hook. 365 * link->ourhook (string) 366 * link->peerhook (string) 367 * peer->name (string) 368 * peer->type (string) | 350 * check it is the correct type. and get it's ID for use 351 * with mkpeer later. 352 */ 353 if (strncmp(ninfo->type, NG_ETHER_NODE_TYPE, 354 strlen(NG_ETHER_NODE_TYPE)) != 0) { 355 return (EPROTOTYPE); 356 } 357 sprintf(source_ID, "[%08x]:", ninfo->id); 358 359 /* 360 * look for a hook already attached. 361 */ 362 for (k = 0; k < ninfo->hooks; k++) { 363 /** 364 * The following are available about each hook. 365 * link->ourhook (string) 366 * link->peerhook (string) 367 * peer->name (string) 368 * peer->type (string) |
369 * peer->id (u_int32_t) 370 * peer->hooks (u_int32_t) | 369 * peer->id (uint32_t) 370 * peer->hooks (uint32_t) |
371 */ 372 link = &hlist->link[k]; 373 peer = &hlist->link[k].nodeinfo; 374 375 /* Ignore debug hooks */ 376 if (strcmp("debug", link->ourhook) == 0) 377 continue; 378 --- 129 unchanged lines hidden --- | 371 */ 372 link = &hlist->link[k]; 373 peer = &hlist->link[k].nodeinfo; 374 375 /* Ignore debug hooks */ 376 if (strcmp("debug", link->ourhook) == 0) 377 continue; 378 --- 129 unchanged lines hidden --- |