This command returns status information in a "struct ngpppoestat":
struct ngpppoestat {
u_int packets_in;/* packets in from Ethernet */
u_int packets_out; /* packets out towards Ethernet */
};
NGM_TEXT_STATUS
This generic message returns is a human-readable version of the node status. (not yet)
NGM_PPPOE_CONNECT
Tell a nominated newly created hook that its 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 ngpppoe_init_data structure shown below.
NGM_PPPOE_LISTEN
Tell a nominated newly created hook that its 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 ngpppoe_init_data structure shown below.
NGM_PPPOE_OFFER
Tell a nominated newly created hook that its 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 ngpppoe_init_data structure shown below.
The three commands above use a common data structure:
struct ngpppoe_init_data {
char hook[NG_HOOKSIZ]; /* hook to monitor on */
u_int16_t data_len;/* service name length */
char data[0]; /* init data goes here */
};
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.
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
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.
NGM_PPPOE_ACNAME
This command is sent to the node that started this session with one of the above messages, and reports the Access Concentrator Name.
The four commands above use a common data structure:
struct ngpppoe_sts {
char hook[NG_HOOKSIZ]; /* hook associated with event session */
};
NGM_PPPOE_GETMODE
The ng_pppoe node can operate in two different modes: standard mode described in RFC 2516, and in a non-standard mode compatible with equipment from 3Com. When ng_pppoe is a client node, it initiates a session using the configured mode. In server mode ng_pppoe supports both modes simultaneously. This message returns the currently configured mode as a string. ASCII form of this message is "pppoe_getmode".
NGM_PPPOE_SETMODE
Configure node to the specified mode. The string argument is required. ASCII form of this message is "pppoe_setmode". For example, the following command will configure the node to initiate the next session in the proprietary 3Com mode: