original files of m241

This commit is contained in:
neelimap
2026-07-30 11:19:44 +05:30
parent 170c2b3f3a
commit afc7070c1f
12254 changed files with 7655111 additions and 0 deletions
@@ -0,0 +1,715 @@
/* 00comp_ipnet_ppp.cdf - IPNet PPP configuration file */
/*
* Copyright (c) 2006-2007 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01j,23apr08,rme General misspelled words
01i,19sep07,rme Added missing backslash (line: 194)
01h,22jan07,kch Added configuration parameters for PPP username and password
(WIND00085576).
01g,10jan07,kch Updated default value for PPP_IPCP_PEER_IPV4_ADDRESS and
PPP_IPCP_PEER_IPV4_ADDRESS_POOL.
01f,04jan07,kch Updated default value for PPP_DEFAULT_BAUDRATE,
PPP_AUTH_MODES, PPPOE_SERVER and PPPOE_SERVICE_NAME. Removed
PPPOE_IF_MAX_SESSIONS_LIST configuration parameter.
01e,12dec06,kch Added PPP_INSTALL_CALLBACK_HOOK configuration parameter
to INCLUDE_IPPPP.
01d,01dec06,kch Added PPP_ACTION_CALLBACK_HOOK parameter and ipppp_example.c
configlette to INCLUDE_IPPPP.
01c,27nov06,kch Only define ipppp configlette once in INCLUDE_IPPPP.
01b,23sep06,kch Fixed IPCOM shell commands description.
01a,17sep06,kch created.
*/
Component INCLUDE_IPPPP {
NAME PPP
SYNOPSIS PPP
MODULES ipppp.o
REQUIRES INCLUDE_IPNET_USE_PPP
CONFIGLETTES ipppp_config.c ipppp_example.c
CFG_PARAMS PPP_DEFAULT_BAUDRATE PPP_RUNMODE PPP_FLAGS PPP_AUTH_MODES \
PPP_LCP_MRU PPP_LCP_MTU PPP_LCP_ECHO_REQ_INTERVAL \
PPP_LCP_ECHO_REQ_FAILURE PPP_IPCP_IPV4_ADDRESS \
PPP_IPCP_PEER_IPV4_ADDRESS PPP_IPCP_PEER_IPV4_POOL_NAME \
PPP_IPCP_PEER_IPV4_ADDRESS_POOL \
PPP_USERNAME PPP_PASSWD \
PPP_IPCP_PRIMARY_DNS_ADDRESS \
PPP_IPCP_SECONDARY_DNS_ADDRESS \
PPP_IPCP_PRIMARY_NBNS_ADDRESS \
PPP_IPCP_SECONDARY_NBNS_ADDRESS \
PPP_L2TP_LNS_ADDRESS_DEFAULT \
PPP_INSTALL_CALLBACK_HOOK PPP_ACTION_CALLBACK_HOOK \
PPP_LCP_CLOSE_IF_NO_NCP_OPENED
}
Selection SELECT_IPPPP_OPTIONAL_CONFIG {
NAME Optional IPPP configurations
SYNOPSIS Optional IPPP configurations
COUNT 0-
CHILDREN INCLUDE_IPPPP_INTERFACE_CONFIG \
INCLUDE_IPPPP_USERS_CONFIG
}
Component INCLUDE_IPPPP_INTERFACE_CONFIG {
NAME Per-interface configurations
SYNOPSIS Per-interface configurations
REQUIRES INCLUDE_IPPPP
CFG_PARAMS PPP_IF_DEFAULT_BAUDRATE_LIST PPP_IF_RUNMODE_LIST \
PPP_IF_FLAGS_LIST PPP_IF_AUTH_MODES_LIST \
PPP_IF_USERNAME PPP_IF_PASSWD \
PPP_IF_LCP_MRU_LIST PPP_IF_LCP_MTU_LIST \
PPP_IF_LCP_ECHO_REQ_INTERVAL_LIST \
PPP_IF_LCP_ECHO_REQ_FAILURE_LIST \
PPP_IF_IPCP_IPV4_ADDRESS_LIST \
PPP_IF_IPCP_PEER_IPV4_ADDRESS_LIST \
PPP_IF_IPCP_PEER_IPV4_ADDRESS_POOL_LIST \
PPP_IF_IPCP_PRIMARY_DNS_ADDRESS_LIST \
PPP_IF_IPCP_SECONDARY_DNS_ADDRESS_LIST
}
Component INCLUDE_IPPPP_USERS_CONFIG {
NAME Per-user configurations
SYNOPSIS Per-user configurations
REQUIRES INCLUDE_IPPPP
CFG_PARAMS PPP_USERS_LCP_ECHO_REQ_INTERVAL_LIST \
PPP_USERS_IPCP_IPV4_ADDRESS_LIST \
PPP_USERS_IPCP_PEER_IPV4_ADDRESS_LIST \
PPP_USERS_IPCP_PEER_IPV4_ADDRESS_POOL_LIST \
PPP_USERS_IPCP_PRIMARY_DNS_ADDRESS_LIST \
PPP_USERS_IPCP_SECONDARY_DNS_ADDRESS_LIST
}
Component INCLUDE_IPPPPOE {
NAME PPPoE
SYNOPSIS PPPoE
REQUIRES INCLUDE_IPNET_USE_PPP INCLUDE_IPCOM_USE_ETHERNET \
INCLUDE_IPPPP
MODULES ipppp_pppoe.o
LINK_SYMS ipppp_pppoe_input
CFG_PARAMS PPPOE_SERVER PPPOE_SECRET_NAME PPPOE_MAX_SESSIONS \
PPPOE_MAX_ETH_SESSIONS PPPOE_AC_NAME PPPOE_SERVICE_NAME \
PPPOE_IF_MAX_ETH_SESSIONS_LIST \
PPPOE_IF_SERVICE_NAME_LIST
}
Component INCLUDE_IPPPP_CMD {
NAME PPP IPCOM commands
SYNOPSIS pppconfig IPCOM commands
MODULES ipppp_cmd_pppconfig.o
REQUIRES INCLUDE_IPCOM_SHELL_CMD INCLUDE_IPPPP
}
Component INCLUDE_IPPPPMP {
NAME PPP Multilink
SYNOPSIS PPP Multilink
REQUIRES INCLUDE_IPPPP
MODULES ipppp_pppmp.o
LINK_SYMS ipppp_pppmp_input
CFG_PARAMS PPPMP_ENABLE PPPMP_MRRU PPPMP_SSN PPPMP_FRAG_DISABLE PPPMP_PPPOE_LINKS
}
Component INCLUDE_IPPPP_VJCOMP {
NAME PPP Van Jacobson Compression
SYNOPSIS PPP TCP/IP header compression from RFC 1144
REQUIRES INCLUDE_IPPPP
MODULES ipppp_vjcomp.o
LINK_SYMS ipppp_vjcomp_init
CFG_PARAMS PPPVJC_ENABLE
}
/******************** Configuration Parameters *****************************/
/* INCLUDE_IPPPP configuration parameters */
Parameter PPP_DEFAULT_BAUDRATE {
NAME Initial baudrate
SYNOPSIS PPP RS232 serial driver baudrate.
TYPE char *
DEFAULT "9600"
}
Parameter PPP_RUNMODE {
NAME Runmode
SYNOPSIS Specifies one or more runmode options on an interface. \
Possible runmode options are "start", "passive" , "exit" \
"wincompat".
TYPE char *
DEFAULT "start,passive,wincompat"
}
Parameter PPP_FLAGS {
NAME PPP flags
SYNOPSIS Specifies one or more flag behavioral options on an \
interface. Possible flags options are "defaultroute" \
and "proxyarp".
TYPE char *
DEFAULT "proxyarp"
}
Parameter PPP_AUTH_MODES {
NAME Authentication mode
SYNOPSIS Configures the required authentication modes. Currently, \
there are six authentication modes defined - "auth", \
"noauth", "pap", "refuse-pap", "chap", and "refuse-chap"
TYPE char *
DEFAULT "noauth"
}
Parameter PPP_LCP_MRU {
NAME LCP maximum receive unit
SYNOPSIS Specifies LCP Maximum receive unit.
TYPE char *
DEFAULT "1500"
}
Parameter PPP_LCP_MTU {
NAME LCP maximum transmit unit
SYNOPSIS Specifies LCP maximum transmit unit.
TYPE char *
DEFAULT "1500"
}
Parameter PPP_LCP_ECHO_REQ_INTERVAL {
NAME LCP echo requests interval
SYNOPSIS LCP EchoReq output interval in seconds. 0 to disable.
TYPE char *
DEFAULT "60"
}
Parameter PPP_LCP_ECHO_REQ_FAILURE {
NAME Echo failure
SYNOPSIS Max echo request failures before link termination.
TYPE char *
DEFAULT "5"
}
Parameter PPP_IPCP_IPV4_ADDRESS {
NAME Local IPv4 address
SYNOPSIS Specifies the desired local IPv4 address. Setting local IPv4 \
address to 0.0.0.0 means asking the peer to suggest our IPv4 \
address.
TYPE char *
DEFAULT "0.0.0.0"
}
Parameter PPP_IPCP_PEER_IPV4_ADDRESS {
NAME Peer IPv4 address
SYNOPSIS Suggest peer IPv4 address if asked for. Note that the peer \
IPv4 address will only get suggested to the peer if it ask \
for it by requesting IP address 0.0.0.0.
TYPE char *
DEFAULT "10.1.4.1"
}
Parameter PPP_IPCP_PEER_IPV4_POOL_NAME {
NAME Peer IPv4 address pool name
SYNOPSIS Defines the name of the address pool used to supply peers \
with IPv4 addresses when running as a PPP or PPPoE server. \
The configuration consists of two steps. First a pool must be \
defined with a name with PPP_IPCP_PEER_IPV4_POOL_NAME. The \
start and end IPv4 addresses pool are then defined with \
PPP_IPCP_PEER_IPV4_ADDRESS_POOL. E.g. "default".
TYPE char *
DEFAULT "default"
}
Parameter PPP_IPCP_PEER_IPV4_ADDRESS_POOL {
NAME Peer IPv4 address pool
SYNOPSIS Configures a IPv4 address pool associated with the pool name \
defined by PPP_IPCP_PEER_IPV4_POOL_NAME. This address pool \
is used to supply peers with IPv4 addresses when running as \
a PPP or PPPoE server. E.g., "10.1.3.1-10.1.3.255".
TYPE char *
DEFAULT "10.1.3.1-10.1.3.255"
}
Parameter PPP_USERNAME {
NAME PPP username
SYNOPSIS PPP username.
TYPE char *
DEFAULT "ppp"
}
Parameter PPP_PASSWD {
NAME PPP password
SYNOPSIS PPP password
TYPE char *
DEFAULT "kallekula"
}
Parameter PPP_IPCP_PRIMARY_DNS_ADDRESS {
NAME Primary DNS Address
SYNOPSIS Configures the PPP client IPv4 primary DNS address. The \
configured IPv4 address will be given to the peer (i.e. the \
client) if the peer requests a primary DNS address. \
E.g. "10.1.2.3".
TYPE char *
DEFAULT ""
}
Parameter PPP_IPCP_SECONDARY_DNS_ADDRESS {
NAME Secondary DNS Address
SYNOPSIS Configures the PPP client IPv4 secondary DNS address. The \
configured IPv4 address will be given to the peer (the \
client) if the peer requests a secondary DNS address. \
E.g. "195.42.198.5".
TYPE char *
DEFAULT ""
}
/* INCLUDE_IPPPP_INTERFACE_CONFIG configuration parameters */
Parameter PPP_IPCP_PRIMARY_NBNS_ADDRESS {
NAME Primary NBNS Address
SYNOPSIS Configures PPP client IPv4 primary NBNS address. The \
configured IPv4 address will be given to the peer (i.e. the \
client) if the peer requests a primary NBNS (WINS) address. \
E.g., "10.1.2.2".
TYPE char *
DEFAULT ""
}
Parameter PPP_IPCP_SECONDARY_NBNS_ADDRESS {
NAME Secondary NBNS Address
SYNOPSIS Configures the PPP client IPv4 secondary DNS address. The \
configured IPv4 address will be given to the peer (the \
client) if the peer requests a secondary DNS address. \
E.g. "195.42.198.4".
TYPE char *
DEFAULT ""
}
Parameter PPP_L2TP_LNS_ADDRESS_DEFAULT {
NAME Default Address for L2TP Network Server
SYNOPSIS Configures a default address for PPP over L2TPv2 for a \
Network Server. This address will be used by PPP when \
establishing a PPP over L2TPv2 connection, when no another \
address has been assigned. \
E.g. "195.42.198.4".
TYPE char *
DEFAULT ""
}
Parameter PPP_LCP_CLOSE_IF_NO_NCP_OPENED {
NAME Close LCP link if no ncp is opened
SYNOPSIS Close LCP link if there is no more ncp is in opened state.
TYPE char *
DEFAULT "yes"
}
Parameter PPP_INSTALL_CALLBACK_HOOK {
NAME Install ppp callback routine
SYNOPSIS Determines if the user-defined PPP action callback routine \
as specified by the macro PPP_ACTION_CALLBACK_HOOK should \
be installed. If FALSE, the PP_ACTION_CALLBACK_HOOK \
configuration is not applicable.
TYPE BOOL
DEFAULT FALSE
}
Parameter PPP_ACTION_CALLBACK_HOOK {
NAME PPP action callback routine
SYNOPSIS User-defined PPP action callback routine. In order for \
PPP to function, this callback function used by PPP must \
be implemented to handle various PPP actions like initialization, \
startup, peer IPv4 address requests, Peer authentication \
login etc. If not specified, the internal PPP action \
callback routine will be used. The \
PPP_INSTALL_CALLBACK_HOOK must also be set to TRUE in \
order to install this callback hook.
TYPE FUNCPTR
DEFAULT NULL
}
Parameter PPP_IF_DEFAULT_BAUDRATE_LIST {
NAME Initial baudrate
SYNOPSIS PPP RS232 serial driver baudrate. This parameter is \
configurable on a per-interface basis in the form of \
"<ifparam>=<value>", each separated from the other by a \
semicolon. E.g, "ppp0=38400;ppp1=38400".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_RUNMODE_LIST {
NAME Interface runmode
SYNOPSIS Specifies one or more runmode options on an interface. \
Possible runmode options are "start", "passive" and "exit". \
This parameter is configurable on a per-interface basis in \
the form of "<ifparam>=<value>", each separated from the \
other by a semicolon. E.g, "ppp0=start,passive".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_FLAGS_LIST {
NAME PPP flags
SYNOPSIS Specifies one or more flag behavioural options on an \
interface. Possible flags options are "defaultroute" \
and "proxyarp". This parameter is configurable on a \
per-interface basis in the form of "<ifparam>=<value>", \
each separated from the other by a semicolon. E.g, \
"ppp0=proxyarp;ppp1=proxyarp".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_AUTH_MODES_LIST {
NAME Authentication mode
SYNOPSIS Configures the required authentication modes. There are \
six authentication modes - "auth", \
"noauth", "pap", "refuse-pap", "chap", and "refuse-chap". \
This parameter is configurable on a per-interface basis in \
the form of "<ifparam>=<value>", each separated from the \
other by a semicolon. E.g. "ppp0=chap;ppp1=pap".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_USERNAME {
NAME PPP username per interface
SYNOPSIS Configures the username for this interface. This parameter \
is configurable on a per-interface basis in the form of \
"<ifparam>=<value>", each separated from the other by a \
semicolon. E.g. "ppp0=PPP1;ppp1=PPP2".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_PASSWD {
NAME PPP password per interface
SYNOPSIS Configures the password for this interface. This parameter \
is configurable on a per-interface basis in the form of \
"<ifparam>=<value>", each separated from the other by a \
semicolon. E.g. "ppp0=PAS1;ppp1=PAS2".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_LCP_MRU_LIST {
NAME LCP maximum receive unit
SYNOPSIS Specifies interface LCP maximum receive unit. This parameter \
is configurable on a per-interface basis in the form of \
"<ifparam>=<value>", each separated from the other by a \
semicolon. E.g, "ppp0=1500;ppp1=1500".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_LCP_MTU_LIST {
NAME LCP maximum transmit unit
SYNOPSIS Specifies interface LCP maximum transmit unit. This parameter \
is configurable on a per-interface basis in the form of \
"<ifparam>=<value>", each separated from the other by a \
semicolon.. E.g, "ppp0=1500;ppp1=1500".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_LCP_ECHO_REQ_INTERVAL_LIST {
NAME Interface LCP echo requests interval
SYNOPSIS LCP echo request output interval in seconds. 0 to disable. \
This parameter is configurable on a per-interface basis in \
the form of "<ifparam>=<value>", each separated from the \
other by a semicolon.. E.g, "ppp0=60;ppp1=60".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_LCP_ECHO_REQ_FAILURE_LIST {
NAME Echo failure
SYNOPSIS Max echo request failures before link termination. This \
parameter is configurable on a per-interface basis in the \
form of "<ifparam>=<value>", each separated from the other \
by a semicolon. E.g, "ppp0=5;ppp1=5".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_IPCP_IPV4_ADDRESS_LIST {
NAME local IPv4 address list
SYNOPSIS Specifies the desired local IPv4 address. Setting local IPv4 \
address to 0 means asking the peer to suggest our IPv4 \
address. This parameter is configurable on a per-interface \
basis in the form of "<ifparam>=<value>", each separated \
from the other by a semicolon. \
E.g, "ppp0=12.0.0.100;ppp1=12.1.0.100".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_IPCP_PEER_IPV4_ADDRESS_LIST {
NAME Peer IPv4 address list
SYNOPSIS Suggest peer IPv4 address if asked for. Note that the peer \
IPv4 address will only get suggested to the peer if it ask \
for it by requesting IP address 0. This parameter is \
configurable on a per-interface basis in the form of \
"<ifparam>=<value>", each separated from the other by a \
semicolon. E.g, "ppp0=10.1.4.1;ppp1=10.2.4.1".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_IPCP_PEER_IPV4_ADDRESS_POOL_LIST {
NAME IPv4 peer address pool list
SYNOPSIS Configure a IPv4 address pool used for the interface to \
supply peers with IPv4 addresses when running as a PPP or \
PPPoE server. This parameter is configurable on a per-\
interface basis in the form of "<ifparam>=<value>". Each \
pair of "<ifparam>=<value>" is semicolon separated. \
E.g., "ppp0=10.1.3.1-10.1.3.255".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_IPCP_PRIMARY_DNS_ADDRESS_LIST {
NAME Primary DNS Address list
SYNOPSIS Configures the PPP client IPv4 primary DNS address. The \
configured IPv4 address will be given to the peer (the \
client) if the peer requests a primary DNS address. This \
parameter is configurable on a per-interface basis in the \
form of "<ifparam>=<value>", each separated from the other \
by a semicolon. E.g. "ppp0=10.1.2.3;ppp1=10.2.2.3".
TYPE char *
DEFAULT ""
}
Parameter PPP_IF_IPCP_SECONDARY_DNS_ADDRESS_LIST {
NAME Secondary DNS Address list
SYNOPSIS Configures the PPP client IPv4 secondary DNS address. The \
configured IPv4 address will be given to the peer (the \
client) if the peer requests a secondary DNS address. This \
parameter is configurable on a per-interface basis in the \
form of "<ifparam>=<value>", each separated from the other \
by a semicolon. E.g. "ppp0=195.42.198.5;ppp1=195.43.198.5".
TYPE char *
DEFAULT ""
}
/* INCLUDE_IPPPP_USERS_CONFIG configuration parameters */
Parameter PPP_USERS_LCP_ECHO_REQ_INTERVAL_LIST {
NAME Users LCP echo requests interval
SYNOPSIS LCP echo request output interval in seconds. 0 to disable. \
This parameter is configurable on a per-user basis in \
the form of "<username>=<value>", each separated from the \
other by a semicolon. E.g, "user1=60;user2=60".
TYPE char *
DEFAULT ""
}
Parameter PPP_USERS_IPCP_IPV4_ADDRESS_LIST {
NAME Users local IPv4 address list
SYNOPSIS Specifies the desired local IPv4 address. Setting local IPv4 \
address to 0 means asking the peer to suggest our IPv4 \
address. This parameter is configurable on a per-user \
basis in the form of "<username>=<value>", each separated \
from the other by a semicolon. \
E.g, "user1=12.0.0.100;user2=12.1.0.100".
TYPE char *
DEFAULT ""
}
Parameter PPP_USERS_IPCP_PEER_IPV4_ADDRESS_LIST {
NAME Users Peer IPv4 address list
SYNOPSIS Suggest peer IPv4 address if asked for. Note that the peer \
IPv4 address will only get suggested to the peer if it ask \
for it by requesting IP address 0. This parameter is \
configurable on a per-user basis in the form of \
"<username>=<value>" each separated from the other by a \
semicolon. E.g, "user1=10.1.4.1;user2=10.2.4.1".
TYPE char *
DEFAULT ""
}
Parameter PPP_USERS_IPCP_PEER_IPV4_ADDRESS_POOL_LIST {
NAME Users IPv4 peer address pool list
SYNOPSIS Configure a IPv4 address pool used for a user to supply \
peers with IPv4 addresses when running as a PPP or PPPoE \
server. This parameter is configurable on a per-user \
basis in the form of "<username>=<value>", each separated \
from the other by a semicolon. E.g., \
"user1=10.1.3.1-10.1.3.255;user2=10.2.3.1-10.2.3.255"
TYPE char *
DEFAULT ""
}
Parameter PPP_USERS_IPCP_PRIMARY_DNS_ADDRESS_LIST {
NAME Users primary DNS Address list
SYNOPSIS Configures the PPP client IPv4 primary DNS address. The \
configured IPv4 address will be given to the peer (the \
client) if the peer requests a primary DNS address. This \
parameter is configurable on a per-user basis in the \
form of "<username>=<value>", each separated from the other \
by a semicolon. E.g. "user1=10.1.2.3;user2=10.2.2.3".
TYPE char *
DEFAULT ""
}
Parameter PPP_USERS_IPCP_SECONDARY_DNS_ADDRESS_LIST {
NAME Users secondary DNS Address list
SYNOPSIS Configures the PPP client IPv4 secondary DNS address. The \
configured IPv4 address will be given to the peer (the \
client) if the peer requests a secondary DNS address. This \
parameter is configurable on a per-user basis in the \
form of "<username>=<value>", each separated from the other \
by a semicolon. E.g. "user1=195.42.198.5;user2=195.43.198.5".
TYPE char *
DEFAULT ""
}
/* INCLUDE_IPPPPOE configuration parameters */
Parameter PPPOE_SERVER {
NAME Enable(1) /disable(0) PPPoE server
SYNOPSIS Enable(1) /disable(0) PPPoE server. If the option is set \
to "1", PPPoE server is enabled, a value of "0" disabled \
it for the whole device or for a specific interface.
TYPE char *
DEFAULT "0"
}
Parameter PPPOE_SECRET_NAME {
NAME PPPoE Secret
SYNOPSIS Secret name for PPPoE cookie. It is used in a MD5 checksum \
calculation to thwart DOS (denial-of-service) attacks. The \
definition of the string need not match any remote \
configuration! The value should be changed from its factory \
default.
TYPE char *
DEFAULT "puttoanythinghere"
}
Parameter PPPOE_MAX_SESSIONS {
NAME PPPoE Sessions
SYNOPSIS Maximum total number of PPPoE sessions allowed before \
incoming PPPoE PADI packets are ignored, i.e. the PPPoE \
server will not accept any additional connections.
TYPE char *
DEFAULT "16"
}
Parameter PPPOE_MAX_ETH_SESSIONS {
NAME PPPoE Sessions per Interface
SYNOPSIS Maximum number of PPPoE sessions per Ethernet interface. \
Note that the interface name used is the Ethernet interface \
name and not the pppoe interface name.
TYPE char *
DEFAULT "8"
}
Parameter PPPOE_AC_NAME {
NAME Access Concentrator
SYNOPSIS PPPoE Access Concentrator Name (AC-Name).
TYPE char *
DEFAULT "Windriver PPPoE Server"
}
Parameter PPPOE_SERVICE_NAME {
NAME Service name
SYNOPSIS Service name to accept. Do not set the service name to \
accept any service name.
TYPE char *
DEFAULT "myservice"
}
Parameter PPPOE_IF_MAX_ETH_SESSIONS_LIST {
NAME PPPoE Sessions list per Interface
SYNOPSIS Maximum number of PPPoE sessions per Ethernet interface. \
Note that the interface name used is the Ethernet interface \
name and not the pppoe interface name. This parameter is \
configurable on a per-interface basis in the form of \
"<ifparam>=<value>", each separated from the other by a \
semicolon. E.g. "eth0=8;eth1=8".
TYPE char *
DEFAULT ""
}
Parameter PPPOE_IF_SERVICE_NAME_LIST {
NAME Service name list
SYNOPSIS Service name to accept. Do not set the service name to \
accept any service name. This parameter is configurable on \
a per-interface basis in the form of "<ifparam>=<value>", \
each separated from the other by a semicolon. \
E.g. "eth0=myservicename1;eth1=myservicename2".
TYPE char *
DEFAULT IP_NULL
}
/* INCLUDE_IPPPPMP configuration parameters */
Parameter PPPMP_ENABLE {
NAME Enable(1) /disable(0) PPP multilink
SYNOPSIS Enable(1) /disable(0) PPP multilink. If the option is set \
to "1", PPP multilink protocol is enabled, a value of "0" disables \
it for the whole device or for a specific interface.
TYPE char *
DEFAULT "0"
}
Parameter PPPMP_MRRU {
NAME Maximum Reconstructed Receive Unit
SYNOPSIS Maximum size for packets received using the multilink protocol \
after being reconstructed, if necessary, from fragments received \
over multiple links.
TYPE char *
DEFAULT "1500"
}
Parameter PPPMP_SSN {
NAME PPP MP Short Sequence Number header Enable(1) / Disable(0)
SYNOPSIS Enable(1) / Disable(0) proposition of the PPP MP Short \
Sequence Number header option to be negotiated. \
If this option is set to "1", PPP MP Short Sequence \
Number headers option will be negotiated and in the case \
the peer accepts it - the PPP MP Short Sequence Number \
headers will be used. \
If this option is set to "0", the PPP MP Short Sequence \
Number headers option will not be proposed as an option \
for the negotiation, but if the peer will offer it then \
it will be accepted.\
Note, that RFC1990 specifies that default value has to \
be "0" and in the case device doesn't succeed to negotiate \
with peer Short Sequence Number option then \
Long Sequence Number will be used.
TYPE char *
DEFAULT "0"
}
Parameter PPPMP_FRAG_DISABLE {
NAME PPP MP PDU Fragmentation Disable (1) or Enable (0)
SYNOPSIS PPP MP PDU Fragmentation Disable (1) or Enable (0). \
If this option is set to "1", PPP MP stack will try \
to prevent PDU fragmentation. \
In the case the PDU is smaller then link's MTU - \
it will be sent unfragmented. \
In the case the PDU is bigger then link's MTU - \
it will be fragmented.\
Note, that default value is 0 - it means that all MTUs \
will be fragmented.
TYPE char *
DEFAULT "0"
}
Parameter PPPMP_PPPOE_LINKS {
NAME PPPoE links
SYNOPSIS Number of links which will be started for multilink use when a PPPoE \
interface is started.
TYPE char *
DEFAULT "1"
}
Parameter PPPVJC_ENABLE {
NAME Enable(1) /disable(0) Van Jacobson TCP/IP header compression
SYNOPSIS Enable(1) /disable(0) Van Jacobson TCP/IP header compression If the
option is set to "1", VJC is enabled, a value of "0" disables \
it for the whole device or for a specific interface.
TYPE char *
DEFAULT "0"
}
@@ -0,0 +1,13 @@
# Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: common.vxconfig,v $ $Revision: 1.5 $
# $Source: /home/interpeak/CVSRoot/ipppp/config/common.vxconfig,v $
# $Author: myakan $
# $State: Exp $ $Locker: $
#
# INTERPEAK_COPYRIGHT_STRING
#hidden option that enables IPPPP
config SUPPORTS_PPP
bool
default y
@@ -0,0 +1,520 @@
/*
******************************************************************************
* INTERPEAK CONFIGURATION SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipppp_config.c,v $ $Revision: 1.36.10.5 $
* $Source: /home/interpeak/CVSRoot/ipppp/config/ipppp_config.c,v $
* $Author: jren $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Lennart Bang <lob@interpeak.se>
******************************************************************************
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#ifdef IP_PORT_VXWORKS
#include "ipppp_config.h"
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include <ipcom_sysvar.h>
#include <ipcom_err.h>
#include <ipcom_shell.h>
#else
#include <ipcom_type.h>
#include <ipcom_sysvar.h>
#include <ipcom_err.h>
#include <ipcom_shell.h>
#include "ipppp_config.h"
#endif
/*
****************************************************************************
* 3 DEFINES
****************************************************************************
*/
/*
****************************************************************************
* 4 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 5 EXTERN PROTOTYPES
****************************************************************************
*/
IP_PUBLIC int ipppp_cmd_pppconfig(int argc, char **argv);
/*
****************************************************************************
* 6 LOCAL PROTOTYPES
****************************************************************************
*/
IP_PUBLIC Ip_err ipppp_configure(void);
/*
****************************************************************************
* 7 DATA
****************************************************************************
*/
/*
*===========================================================================
* SYSTEM VARIABLES
*===========================================================================
*/
/*
*===========================================================================
* ipppp_conf_sysvar
*===========================================================================
*/
IP_STATIC IP_CONST Ipcom_sysvar ipppp_conf_sysvar[] =
{
/* Device driver name. */
#ifdef IP_PORT_VXWORKS
#if defined(NUM_TTY) && (NUM_TTY>1)
{ "ipcom.if.ppp0.devname", "/tyCo/1" }, /* COM2 */
#endif
#else
{ "ipcom.if.ppp0.devname", "/dev/ttyS0" }, /* UNIX default */
#endif
/* Default baudrate. */
IP_SYSVAR("ipppp.baudrate", "9600", PPP_DEFAULT_BAUDRATE),
/* PPP runmode
* Supported modes: start, passive, exit, wincompat
*/
IP_SYSVAR("ipppp.runmode", "passive,wincompat", PPP_RUNMODE),
/* PPP flags
* Supported flags: defaultroute, proxyarp
*/
IP_SYSVAR("ipppp.flags", "proxyarp", PPP_FLAGS),
/* Authentication mode.
* Supported modes: auth, noauth, pap, refuse-pap, chap, refuse-chap
*/
IP_SYSVAR("ipppp.auth", "chap", PPP_AUTH_MODES),
/* LCP maximum receive unit */
IP_SYSVAR("ipppp.lcp.mru", "1500", PPP_LCP_MRU),
/* LCP maximum transmit unit */
IP_SYSVAR("ipppp.lcp.mtu", "1500", PPP_LCP_MTU),
/* Close LCP link when no ncp is opened */
IP_SYSVAR("ipppp.lcp.autoclose", "yes", PPP_LCP_CLOSE_IF_NO_NCP_OPENED),
/* Default LCP echo requests interval in seconds (0 to disable) */
IP_SYSVAR("ipppp.lcp.echo_interval", "60", PPP_LCP_ECHO_REQ_INTERVAL),
/* Max LCP EchoReq failures before link termination. */
IP_SYSVAR("ipppp.lcp.echo_failure", "5", PPP_LCP_ECHO_REQ_FAILURE),
/* Local IPv4 address. */
IP_SYSVAR("ipppp.ipcp.addr", "12.0.0.100", PPP_IPCP_IPV4_ADDRESS),
/* Peer IPv4 address */
IP_SYSVAR("ipppp.ipcp.dstaddr", "10.1.4.1", PPP_IPCP_PEER_IPV4_ADDRESS),
/* IPv4 local address. 0.0.0.0 = let peer suggest one. */
IP_SYSVAR("ipppp.ipcp.pool", "default", PPP_IPCP_PEER_IPV4_POOL_NAME),
/* IPv4 peer address pool (examples only!). */
#ifdef IP_PORT_VXWORKS
{ "ipppp.ipcp.pool." PPP_IPCP_PEER_IPV4_POOL_NAME, PPP_IPCP_PEER_IPV4_ADDRESS_POOL },
#else
{ "ipppp.ipcp.pool.default", "10.1.3.1-10.1.3.255" },
#endif
{ "ipcom.if.ppp0.ipppp.ipcp.dstaddr", "10.1.4.1" },
#ifndef IP_PORT_VXWORKS
{ "ipcom.users.olli.ipppp.ipcp.dstaddr", "10.1.5.1" },
#endif
/* PPP 'client' username and password. */
IP_SYSVAR("ipppp.username", "ppp", PPP_USERNAME),
IP_SYSVAR("ipppp.password", "kallekula", PPP_PASSWD),
#ifdef IPPPP_USE_RFC1877_SERVER
/* Primary and secondary DNS and NBNS(WINS) addresses */
IP_SYSVAR("ipppp.ipcp.primary_dns_address", "10.1.2.3", PPP_IPCP_PRIMARY_DNS_ADDRESS),
IP_SYSVAR("ipppp.ipcp.secondary_dns_address", "195.42.198.5", PPP_IPCP_SECONDARY_DNS_ADDRESS),
IP_SYSVAR("ipppp.ipcp.primary_nbns_address", "10.1.2.2", PPP_IPCP_PRIMARY_NBNS_ADDRESS),
IP_SYSVAR("ipppp.ipcp.secondary_nbns_address", "195.42.198.4", PPP_IPCP_SECONDARY_NBNS_ADDRESS),
#endif
#ifdef IPPPP_USE_PPPOE
/* Enable(1) /disable(0) PPPoE server */
IP_SYSVAR("ipppp.pppoe.server", "0", PPPOE_SERVER),
/* Access Concentrator Name (AC-Name) */
IP_SYSVAR("ipppp.pppoe.ac_name", "Interpeak PPPoE Server", PPPOE_AC_NAME),
/* Secret name (for PPPoE cookie). This macro is used in a MD5 checksum
* calculation to thwart DOS (denial-of-service) attacks. The definition of
* the string need not match any remote configuration! The value should be
* changed from its factory default.
*/
IP_SYSVAR("ipppp.pppoe.secret_name", "puttoanythinghere", PPPOE_SECRET_NAME),
/* Maximum total number of PPPoE sessions. */
IP_SYSVAR("ipppp.pppoe.max_sessions", "16", PPPOE_MAX_SESSIONS),
/* Maximum number of PPPoE sessions per Ethernet interface. */
IP_SYSVAR("ipppp.pppoe.max_eth_sessions", "8", PPPOE_MAX_ETH_SESSIONS),
#ifndef IP_PORT_VXWORKS
{ "ipcom.if.eth1.ipppp.pppoe.max_eth_sessions", "4" },
#endif
/* Service name we request/accept. Undefine to accept any service name. */
IP_SYSVAR("ipppp.pppoe.service_name", "myservice", PPPOE_SERVICE_NAME),
/* Example of how to lower the MRU/MTU for PPPoE using eth0:
{ "ipcom.if.eth0.ipppp.lcp.mru", "1024" },
{ "ipcom.if.eth0.ipppp.lcp.mtu", "512" },
*/
#endif /* IPPPP_USE_PPPOE */
#ifdef IPPPP_USE_PPPMP
/* Sysvars for PPP MULTILINK */
/* Enable(1) / disable(0) PPP multilink protocol */
IP_SYSVAR("ipppp.mp.enable", "0", PPPMP_ENABLE),
/* Set the maximum reconstructed received unit */
IP_SYSVAR("ipppp.mp.mrru", "1500", PPPMP_MRRU),
/* Enable(1) / Disable(0) PPP MP Short Sequence Number usage*/
IP_SYSVAR("ipppp.mp.ssn", "0", PPPMP_SSN),
/* Disable(1) / Enable (0) PPP MP PDU Fragmentation */
IP_SYSVAR("ipppp.mp.frag_disable", "0", PPPMP_FRAG_DISABLE),
#ifdef IPPPP_USE_PPPOE
IP_SYSVAR("ipppp.pppoe.mp_links", "1", PPPMP_PPPOE_LINKS),
#endif /* IPPPP_USE_PPPOE */
#endif /* IPPPP_USE_PPPMP */
#ifdef IPPPP_USE_VJCOMP
IP_SYSVAR("ipppp.vjc.enable", "0", PPPVJC_ENABLE),
#endif /* IPPPP_USE_VJCOMP */
#ifdef IPPPP_USE_PPPL2TP
IP_SYSVAR("ipppp.l2tp.lnsAddrDefault", "0.0.0.0", PPP_L2TP_LNS_ADDRESS_DEFAULT),
#ifdef IPPPP_USE_PPPL2TP_LNS
{ "ipppp.l2tp.server", "0"},
#endif
#endif
{ IP_NULL, IP_NULL }
};
#ifdef IP_PORT_VXWORKS
/* Interface specific list configurations */
IP_CONST Ipcom_sysvar_ext ipppp_conf_sysvar_ext[] =
{
#ifdef INCLUDE_IPPPP_INTERFACE_CONFIG
/*
* Interface initial baudrate. This parameter is configurable on a
* per-interface basis in the form of "<ifparam>=<value>", each separated
* from the other by a semicolon. E.g, "ppp0=38400".
*/
{"ipcom.if", "ipppp.baudrate", PPP_IF_DEFAULT_BAUDRATE_LIST},
/*
* Interface runmode. Specifies one or more runmode options on an
* interface. Possible runmode options are "start", "passive" and "exit".
* This parameter is configurable on a per-interface basis in the form
* of "<ifparam>=<value>", each separated from the other by a semicolon.
* E.g, "ppp0=start,passive".
*/
{"ipcom.if", "ipppp.runmode", PPP_IF_RUNMODE_LIST},
/*
* Interface PPP flags. Specifies one or more flag behavioural options
* on an interface. Possible flags options are "defaultroute" and
* "proxyarp". This parameter is configurable on a per-interface basis
* in the form of "<ifparam>=<value>", each separated from the other by
* a semicolon. E.g, "ppp0=proxyarp".
*/
{"ipcom.if", "ipppp.flags", PPP_IF_FLAGS_LIST},
/*
* Configures the required authentication modes. There are currently
* six authentication options defined - "auth", "noauth", "pap",
* "refuse-pap", "chap", and "refuse-chap". This parameter is configurable
* on a per-interface basis in the form of "<ifparam>=<value>", each
* separated from the other by a semicolon. E.g. "ppp0=chap;ppp1=pap".
*/
{ "ipcom.if", "ipppp.auth", PPP_IF_AUTH_MODES_LIST},
/*
* Configures the username for this interface. This parameter is configurable
* on a per-interface basis in the form of "<ifparam>=<value>", each
* separated from the other by a semicolon. E.g. "ppp0=PPP1;ppp1=PPP2".
*/
{ "ipcom.if", "ipppp.username", PPP_IF_USERNAME},
/*
* Configures the password for this interface. This parameter is configurable
* on a per-interface basis in the form of "<ifparam>=<value>", each
* separated from the other by a semicolon. E.g. "ppp0=PAS1;ppp1=PAS2".
*/
{ "ipcom.if", "ipppp.password", PPP_IF_PASSWD},
/*
* Interface LCP maximum receive unit. This parameter is configurable
* on a per-interface basis in the form of "<ifparam>=<value>", each
* separated from the other by a semicolon. E.g, "ppp0=1500".
*/
{"ipcom.if", "ipppp.lcp.mru", PPP_IF_LCP_MRU_LIST},
/*
* Interface LCP maximum transmit unit. This parameter is configurable
* on a per-interface basis in the form of "<ifparam>=<value>", each
* separated from the other by a semicolon. E.g, "ppp0=1500".
*/
{"ipcom.if", "ipppp.lcp.mtu", PPP_IF_LCP_MTU_LIST},
/*
* LCP echo request output interval in seconds. 0 to disable. This
* parameter is configurable on a per-interface basis in the form of
* "<ifparam>=<value>", each separated from the other by a semicolon.
* E.g, "ppp0=60".
*/
{"ipcom.if", "ipppp.lcp.echo_interval", PPP_IF_LCP_ECHO_REQ_INTERVAL_LIST},
/*
* Max echo request failures before link termination. This parameter can
* be configured on a per-interface basis in the form of
* "<ifparam>=<value>", each separated from the other by a semicolon.
* E.g, "ppp0=5"
*/
{"ipcom.if", "ipppp.lcp.echo_failure", PPP_IF_LCP_ECHO_REQ_FAILURE_LIST},
/*
* Local IPv4 address list
* Specifies the desired local IPv4 address. Setting local IPv4 address
* to 0 means asking the peer to suggest our IPv4 address. This parameter
* is configurable on a per-interface basis in the form of
* "<ifparam>=<value>", each separated from the other by a semicolon.
* E.g, "ppp0=12.0.0.100".
*/
{"ipcom.if", "ipppp.ipcp.addr", PPP_IF_IPCP_IPV4_ADDRESS_LIST},
/*
* Peer IPv4 address list
* Suggest peer IPv4 address if asked for. Note that the peer IPv4
* address will only get suggested to the peer if it ask for it by
* requesting IP address 0. This parameter is configurable on a
* per-interface basis in the form of "<ifparam>=<value>", each separated
* from the other by a semicolon. E.g, "ppp0=10.1.4.1".
*/
{ "ipcom.if", "ipppp.ipcp.dstaddr", PPP_IF_IPCP_PEER_IPV4_ADDRESS_LIST},
/*
* Interface IPv4 peer address pool list
* Configure a IPv4 address pool used for the interface to supply peers
* with IPv4 addresses when running as a PPP or PPPoE server. This
* parameter is configurable on a per-interface basis in the form of
* "<ifparam>=<value>", each separated from the other by a semicolon.
* E.g., "ppp0=10.1.3.1-10.1.3.255".
*/
{ "ipcom.if", "ipppp.ipcp.pool",
PPP_IF_IPCP_PEER_IPV4_ADDRESS_POOL_LIST},
/*
* Configures the PPP client IPv4 primary DNS address. The configured
* IPv4 address will be given to the peer (the client) if the peer
* requests a primary DNS address. This parameter is configurable on
* a per-interface basis in the form of "<ifparam>=<value>", each
* separated from the other by a semicolon.
* E.g. "ppp0=10.1.2.3;ppp1=10.2.2.3".
*/
{ "ipcom.if", "ipppp.ipcp.primary_dns_address",
PPP_IF_IPCP_PRIMARY_DNS_ADDRESS_LIST },
/*
* Configures the PPP client IPv4 secondary DNS address. The configured
* IPv4 address will be given to the peer (the client) if the peer
* requests a secondary DNS address. This parameter is configurable on
* a per-interface basis in the form of "<ifparam>=<value>", each
* separated from the other by a semicolon.
* E.g. "ppp0=195.42.198.5;ppp1=195.43.198.5".
*/
{ "ipcom.if", "ipppp.ipcp.secondary_dns_address",
PPP_IF_IPCP_SECONDARY_DNS_ADDRESS_LIST },
#endif /* INCLUDE_IPPPP_INTERFACE_CONFIG */
#ifdef INCLUDE_IPPPP_USERS_CONFIG
/*
* LCP echo request output interval in seconds. 0 to disable. This
* parameter is configurable on a per-user basis in the form of
* "<username>=<value>", each separated from the other by a semicolon.
* E.g, "user1=60;user2=60".
*/
{"ipcom.users", "ipppp.lcp.echo_interval",
PPP_USERS_LCP_ECHO_REQ_INTERVAL_LIST},
/*
* user local IPv4 address list
* Specifies the desired local IPv4 address. Setting local IPv4 address
* to 0 means asking the peer to suggest our IPv4 address. This parameter
* is configurable on a per-user basis in the form of
* "<username>=<value>". Each pair of "<username>=<value>" is semicolon
* separated. E.g, "user1=12.0.0.100;user2=12.1.0.100".
*/
{"ipcom.users", "ipppp.ipcp.addr", PPP_USERS_IPCP_IPV4_ADDRESS_LIST},
/*
* Users Peer IPv4 address list
* Suggest peer IPv4 address if asked for. Note that the peer IPv4
* address will only get suggested to the peer if it ask for it by
* requesting IP address 0. This parameter is configurable on a
* per-user basis in the form of "<username>=<value>". Each pair
* of "<username>=<value>" is semicolon separated.
* E.g, "user1=10.1.4.1;user2=10.2.4.1"
*/
{ "ipcom.users", "ipppp.ipcp.dstaddr",
PPP_USERS_IPCP_PEER_IPV4_ADDRESS_LIST},
/*
* Users IPv4 peer address pool list
* Configure a IPv4 address pool used for a user to supply peers with
* IPv4 addresses when running as a PPP or PPPoE server. This parameter
* is configurable on a per-user basis in the form of
* "<username>=<value>". Each pair of "<username>=<value>" is semicolon
* separated. E.g., "user1=10.1.3.1-10.1.3.255;user2=10.2.3.1-10.2.3.255".
*/
{ "ipcom.users", "ipppp.ipcp.pool",
PPP_USERS_IPCP_PEER_IPV4_ADDRESS_POOL_LIST},
/*
* Configures the PPP client IPv4 primary DNS address. The configured
* IPv4 address will be given to the peer (the client) if the peer
* requests a primary DNS address. This parameter is configurable on
* a per-user basis in the form of "<ifparam>=<value>", each separated
* from the other by a semicolon.
* E.g. "user1=10.1.2.3;user2=10.2.2.3"
*/
{ "ipcom.users", "ipppp.ipcp.primary_dns_address",
PPP_USERS_IPCP_PRIMARY_DNS_ADDRESS_LIST },
/*
* Configures the PPP client IPv4 secondary DNS address. The configured
* IPv4 address will be given to the peer (the client) if the peer
* requests a secondary DNS address. This parameter is configurable on
* a per-user basis in the form of "<ifparam>=<value>", each separated
* from the other by a semicolon.
* E.g. "user1=195.42.198.5;user2=195.43.198.5".
*/
{ "ipcom.users", "ipppp.ipcp.secondary_dns_address",
PPP_USERS_IPCP_SECONDARY_DNS_ADDRESS_LIST },
#endif /* INCLUDE_IPPPP_USERS_CONFIG */
#ifdef INCLUDE_IPPPPOE
/*
* Maximum number of PPPoE sessions per Ethernet interface. Note that the
* interface name used is the Ethernet interface name and not the pppoe
* interface name. This parameter is configurable on a per-interface basis
* in the form of "<ifparam>=<value>", each separated from the other by
* a semicolon. E.g. "eth0=8;eth1=8".
*/
{ "ipcom.if", "ipppp.pppoe.max_eth_sessions",
PPPOE_IF_MAX_ETH_SESSIONS_LIST},
/*
* Service name to accept. Do not set the service name to accept any
* service name. This parameter is configurable on a per-interface basis
* in the form of "<ifparam>=<value>", each separated from the other by
* a semicolon. E.g. "ppp0=myservicename1;ppp1=myservicename2".
*/
{ "ipcom.if", "ipppp.pppoe.service_name", PPPOE_IF_SERVICE_NAME_LIST},
#endif /* INCLUDE_IPPPPOE */
{ IP_NULL, IP_NULL, IP_NULL }
};
#endif /* IP_PORT_VXWORKS */
/*
****************************************************************************
* 8 STATIC FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 9 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* ipppp_configure
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_PUBLIC Ip_err
ipppp_configure(void)
{
/* Set IPPPP system variables. */
(void)ipcom_sysvar_setv(ipppp_conf_sysvar, 0);
#ifndef IP_PORT_OSE5
#ifdef IP_PORT_VXWORKS
/* now configure the interface-specific sysvars */
(void)ipcom_sysvar_ext_setv(ipppp_conf_sysvar_ext, 0);
#endif
(void)ipcom_shell_add_cmd("pppconfig", "pppconfig <ifname> [options]", "ppp config",
ipppp_cmd_pppconfig,
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_SMALL);
#endif
return IPCOM_SUCCESS;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,225 @@
/*
******************************************************************************
* INTERPEAK CONFIGURATION HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipppp_config.h,v $ $Revision: 1.28.10.3 $
* $Source: /home/interpeak/CVSRoot/ipppp/config/ipppp_config.h,v $
* $Author: hxu0 $ $Date: 2012-08-30 09:43:51 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Lennart Bang <lob@interpeak.se>
******************************************************************************
*/
#ifndef IPPPP_CONFIG_H
#define IPPPP_CONFIG_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_config.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 3 GENERAL
****************************************************************************
*/
/*
*===========================================================================
* IPPPP_SYSLOG_PRIORITY
*===========================================================================
* Initial PPP syslog system priority.
*/
#ifdef IP_DEBUG
#define IPPPP_SYSLOG_PRIORITY IPCOM_LOG_DEBUG
#else
#define IPPPP_SYSLOG_PRIORITY IPCOM_LOG_WARNING
#endif
/*
*===========================================================================
* IPPPP_USE_AUTH_XXX
*===========================================================================
* Define for PPP Authentication PAP and/or CHAP support.
*/
#ifdef IPCOM_USE_AUTH
#define IPPPP_USE_AUTH_PAP
#ifdef IPCOM_USE_MD5
#define IPPPP_USE_AUTH_CHAP
#endif
#endif
/*
*===========================================================================
* IPPPP_USE_RFC1877_XXX
*===========================================================================
* Define for PPP RFC1877 client/server support (Primary & secondary DNS/NBNS)
*/
#ifndef IPLITE
/*#define IPPPP_USE_RFC1877_SERVER*/
#define IPPPP_USE_RFC1877_CLIENT
#endif
/*
****************************************************************************
* 4 PPPOE
****************************************************************************
*/
/*
*===========================================================================
* IPPPP_USE_PPPOE
*===========================================================================
* Define to support PPPoE (in 'server' mode only)
*/
#define IPPPP_USE_PPPOE
/*
*===========================================================================
* IPPPP_USE_PPPMP
*===========================================================================
* Define to support PPPMP
*/
#if defined(IP_PORT_VXWORKS) && (_WRS_CONFIG_IPPPP_MP)
#define IPPPP_USE_PPPMP
#else
/*
#define IPPPP_USE_PPPMP
*/
#endif
/*
*===========================================================================
* IPPPP_MAX_LINKS
*===========================================================================
* If PPPMP is not being used, this macro must always be set to 1.
*/
#if defined(IPPPP_USE_PPPMP)
/*
* Maximum bundle size
*/
#define IPPPP_MAX_LINKS 3
/*
* Maximum receive reconstructed unit
*/
#define IPPPP_PPPMP_MRRU_MAX 3000
/*
* Enable multilink fragment timer
* default timeout 20 seconds.
*/
/*
#define IPPPP_PPPMP_FRAGMENT_TIMER
#define IPPPP_PPPMP_TIMEOUT_LENGTH 20000
*/
#else /* not IPPPP_USE_PPPMP */
#define IPPPP_MAX_LINKS 1
#endif
/*
*===========================================================================
* IPPPP_USE_VJCOMP
*===========================================================================
* Define to support Van Jacobson compression of TCP/IP headers
* (for TCP/IP only)
*/
/*
#ifdef IPCOM_USE_INET
#define IPPPP_USE_VJCOMP
#endif
*/
#ifdef IPPPP_USE_VJCOMP
/*
* Maximum number of simultaneous connections
* (see dicussion of MAX_STATES in rfc1144.c)
*/
#define IPPPP_VJCOMP_MAX_SLOTS 16
/*
* Allow slot ID to be compressed in VJC compressed
* packet? (0 means NO, 1 means OK)
*/
#define IPPPP_VJCOMP_COMP_SLOT_ID 0
#endif
/*
*===========================================================================
* IPPPP_PPPOE_USE_MD5
*===========================================================================
* Define if you want to use the PPPoE AC_Cookie to better protect vs DOS attacks.
*/
#if defined(IPPPP_USE_PPPOE) && !defined(IPLITE)
#define IPPPP_PPPOE_USE_MD5
#endif
/*
*===========================================================================
* IPPPP_USE_PPPL2TP
*===========================================================================
* Define to support PPP over L2TPv2
*/
/*
#ifdef IPL2TP
#define IPPPP_USE_PPPL2TP
#endif
*/
/*
#ifdef IPPPP_USE_PPPL2TP
#define IPPPP_USE_PPPL2TP_LNS
#endif
*/
/*
****************************************************************************
* 5 DO NOT EDIT
****************************************************************************
*/
/*
*===========================================================================
* IPPPP_USE_AUTH
*===========================================================================
* NO NOT EDIT!
*/
#if defined(IPPPP_USE_AUTH_PAP) || defined(IPPPP_USE_AUTH_CHAP)
#define IPPPP_USE_AUTH
#endif
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,646 @@
/*
******************************************************************************
* INTERPEAK EXAMPLE SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipppp_example.c,v $ $Revision: 1.25.10.2 $
* $Source: /home/interpeak/CVSRoot/ipppp/config/ipppp_example.c,v $
* $Author: svc-cmnet $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Lennart Bang <lob@interpeak.se>
******************************************************************************
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
* Example file of PPP action callback.
*
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#ifdef IP_PORT_VXWORKS
#ifdef IPCOM_USE_CLIB_PROTO
#undef IPCOM_USE_CLIB_PROTO
#endif
#endif
#ifndef IPCOM_KERNEL
#define IPCOM_KERNEL
#endif
#include "ipppp_config.h"
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#ifdef IP_PORT_VXWORKS
#ifdef INCLUDE_IPCOM_USE_SYSLOGD
#define IPCOM_USE_SYSLOG
#endif
#include <ipcom_err.h>
/*
* some internal macro mappings - ugly but necessary for Ipcom_netif
* structure alignment!
*/
#ifdef INCLUDE_IPPPP
#define IPPPP
#endif
#ifdef INCLUDE_IP_SECURITY
#define IPIPSEC2
#endif
#ifdef INCLUDE_IPNET_USE_WLAN
#define IPWLAN
#endif
#include <ipcom_netif.h>
#include <ipcom_syslog.h>
#include <ipcom_clib.h>
#include <ipcom_err.h>
#include "ipppp.h"
#else
#define IPCOM_USE_CLIB_PROTO
#include <ipcom_clib.h>
#include <ipcom_cstyle.h>
#include <ipcom_list.h>
#include <ipcom_netif.h>
#include <ipcom_syslog.h>
#include <ipcom_type.h>
#include "ipppp_h.h"
#endif /* IP_PORT_VXWORKS */
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
#if (defined(IP_PORT_VXWORKS) && (defined(INCLUDE_IPPPP) || defined(INCLUDE_IPPPPOE))) || !defined(IP_PORT_VXWORKS)
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
#ifdef IP_PORT_VXWORKS
/* typedef to make compiler happy... */
typedef int (*ipppp_action_cb)(struct Ipppp_action_work *w);
/* prototype user-defined action callback routine */
#if PPP_INSTALL_CALLBACK_HOOK == TRUE
IP_EXTERN int PPP_ACTION_CALLBACK_HOOK (struct Ipppp_action_work *w);
#endif
#else
struct Ipppp_action_work
{
Ipcom_list list;
char ifname[IP_IFNAMSIZ];
Ip_u32 ifindex;
Ip_u32 link_index;
int action;
void *data;
};
#endif
/*
****************************************************************************
* 6 EXTERN PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 7 LOCAL PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 8 DATA
****************************************************************************
*/
#ifdef IP_PORT_VXWORKS
Ipcom_once_t ipppp_work_once = {IPCOM_ONCE_STATE_UNINITIALIZED, 0, IP_NULL};
IP_EXTERN Ipcom_mutex ipppp_work_lock;
IP_EXTERN Ipcom_sem ipppp_work_sem;
IP_EXTERN Ipcom_list ipppp_work_queue;
/*
*===========================================================================
* ipppp_example_action_work
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_STATIC int
ipppp_example_action_work(struct Ipppp_action_work *w)
{
ipppp_action_cb ppp_cb;
#if PPP_INSTALL_CALLBACK_HOOK == TRUE
ppp_cb = (PPP_ACTION_CALLBACK_HOOK == NULL) ?
ipppp_example_action_work_default : PPP_ACTION_CALLBACK_HOOK;
#else
ppp_cb = ipppp_example_action_work_default;
#endif
return ppp_cb(w);
}
#else /* (not vxWorks) */
Ipcom_once_t ipppp_work_once = IPCOM_ONCE_INIT;
Ipcom_mutex ipppp_work_lock = IPCOM_MUTEX_INVALID;
Ipcom_sem ipppp_work_sem = IPCOM_SEM_INVALID;
Ipcom_list ipppp_work_queue;
/*
*===========================================================================
* ipppp_auth_login_hook
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
#ifdef IPPPP_USE_AUTH
IP_STATIC void
ipppp_auth_login_hook(Ip_err retval, Ipcom_auth_userinfo *userinfo, void *auth_login_cookie)
{
struct Ip_pppreq pppreq;
Ipppp_auth_cookie *auth_cookie = auth_login_cookie;
int ret;
Ip_fd fd;
if (auth_login_cookie == IP_NULL)
return;
if (ipcom_if_indextoname(auth_cookie->ifindex, pppreq.pppr_name) == IP_NULL)
{
IPCOM_LOG1(WARNING, "<if=%d> :: ipppp_auth_login_hook() :: missing interface",
auth_cookie->ifindex);
goto leave;
}
#ifdef IPCOM_USE_INET
fd = ipcom_socket(IP_AF_INET, IP_SOCK_DGRAM, 0);
#else
fd = ipcom_socket(IP_AF_INET6, IP_SOCK_DGRAM, 0);
#endif
if (fd == IP_INVALID_SOCKET)
{
IP_PANIC();
goto leave;
}
pppreq.pppru.auth.ifindex = auth_cookie->ifindex;
pppreq.pppru.auth.link_index = auth_cookie->link_index;
pppreq.pppru.auth.success = retval == IPCOM_SUCCESS;
ipcom_memcpy(&pppreq.pppru.auth.userinfo, userinfo, sizeof(Ipcom_auth_userinfo));
ret = ipcom_socketioctl(fd, IP_SIOCXPPPAUTH, &pppreq);
if (ret != 0)
{
IPCOM_LOG3(WARNING, "<%s> :: ipppp_auth_login_hook() :: ioctl(AUTH) failed : %s(%d)",
pppreq.pppr_name, ipcom_strerror(ipcom_errno), ipcom_errno);
}
(void)ipcom_socketclose(fd);
leave:
ipcom_free(auth_cookie);
}
#endif /* IPPPP_USE_AUTH */
/*
*===========================================================================
* ipppp_example_action_work
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_STATIC void
ipppp_example_action_work(struct Ipppp_action_work *w)
{
struct Ip_pppreq pppreq;
struct Ip_ifreq ifreq;
Ip_fd fd;
int ret;
int action = w->action;
void *data = w->data;
ipcom_strcpy(ifreq.ifr_name, w->ifname);
ipcom_strcpy(pppreq.pppr_name, w->ifname);
#ifdef IPCOM_USE_INET
fd = ipcom_socket(IP_AF_INET, IP_SOCK_DGRAM, 0);
#else
fd = ipcom_socket(IP_AF_INET6, IP_SOCK_DGRAM, 0);
#endif
if (fd == IP_INVALID_SOCKET)
{
IP_PANIC();
return;
}
switch(action)
{
/********************* ACTION INIT ********************/
case IPPPP_ACTION_INIT:
IPCOM_LOG1(INFO, "<%s> :: ACTION init", w->ifname);
/* Get PPP flags. */
if (ipcom_socketioctl(fd, IP_SIOCXPPPGFLAGS, &pppreq) == IP_SOCKERR)
{
IP_PANIC();
break;
}
/****** PPP Example configuration *****/
/* Set PPP flags. */
ipcom_strcpy(pppreq.pppr_name, w->ifname);
if (ipcom_socketioctl(fd, IP_SIOCXPPPSFLAGS, &pppreq) == IP_SOCKERR)
{
IP_PANIC();
break;
}
break;
/********************* LCP STARTING ********************/
case IPPPP_ACTION_LCP_STARTING:
IPCOM_LOG1(INFO, "<%s> :: ACTION LCP starting", w->ifname);
break;
#ifdef IPCOM_USE_INET
/********************* IPCP STARTING ********************/
case IPPPP_ACTION_IPCP_STARTING:
IPCOM_LOG1(INFO, "<%s> :: ACTION IPCP starting", w->ifname);
/* Example of how to set local address if "ipppp.addr" sysvar is not used:
{
struct Ip_sockaddr_in *sinaddr;
sinaddr = (struct Ip_sockaddr_in *)&ifreq.ip_ifr_addr;
(void)ipcom_inet_pton(IP_AF_INET, "12.0.0.0", &sinaddr->sin_addr);
sinaddr->sin_family = IP_AF_INET;
sinaddr->sin_len = sizeof(struct Ip_sockaddr_in);
sinaddr->sin_addr.s_addr = ip_htonl((ip_ntohl(sinaddr->sin_addr.s_addr) + netif->ifindex));
(void)ipcom_socketioctl(fd, IP_SIOCSIFADDR, &ifreq);
}
*/
break;
/********************* IP UP ********************/
case IPPPP_ACTION_IP_UP:
IPCOM_LOG1(DEBUG, "<%s> :: ACTION IP up", w->ifname);
break;
/********************* IP DOWN ********************/
case IPPPP_ACTION_IP_DOWN:
IPCOM_LOG1(DEBUG, "<%s> :: ACTION IP down", w->ifname);
break;
#endif /* IPCOM_USE_INET */
#ifdef IPCOM_USE_INET6
/********************* IPV6 STARTING ********************/
case IPPPP_ACTION_IPV6CP_STARTING:
IPCOM_LOG1(INFO, "<%s> :: ACTION IPV6CP starting", w->ifname);
break;
/********************* IPV6 UP ********************/
case IPPPP_ACTION_IPV6_UP:
IPCOM_LOG1(DEBUG, "<%s> :: ACTION IPV6 up", w->ifname);
break;
/********************* IPV6 DOWN ********************/
case IPPPP_ACTION_IPV6_DOWN:
IPCOM_LOG1(DEBUG, "<%s> :: ACTION IPV6 down", w->ifname);
break;
/********************* IPV6 PEER ID ********************/
case IPPPP_ACTION_PEER_IDENTIFIER:
IPCOM_LOG1(DEBUG, "<%s> :: ACTION PEER ID", w->ifname);
break;
#endif /* IPCOM_USE_INET6 */
/********************* ACTION LOGIN ********************/
/* Called when we need to authenticate ourselves (i.e. login) to the peer.
* User code must call ioctl(IP_SIOCXPPPLOGIN) with the same 'data',
* username and password when ready to login.
*/
#ifdef IPPPP_USE_AUTH
case IPPPP_ACTION_LOGIN:
{
Ip_size_t password_size = IPCOM_AUTH_PASSWORD_MAX;
Ip_size_t username_size = IPCOM_AUTH_USERNAME_MAX;
IPCOM_LOG1(INFO, "<%s> :: ACTION login", w->ifname);
if (ipcom_sysvar_get("ipppp.username", pppreq.pppru.login.username, &username_size)
&& username_size > 0
&& ipcom_sysvar_get("ipppp.password", pppreq.pppru.login.password, &password_size)
&& password_size > 0)
{
pppreq.pppru.login.ifindex = w->ifindex;
pppreq.pppru.login.link_index = w->link_index;
pppreq.pppru.login.login_cookie = data;
ret = ipcom_socketioctl(fd, IP_SIOCXPPPLOGIN, &pppreq);
if (ret != 0)
{
IPCOM_LOG3(WARNING, "<%s> :: ACTION LOGIN :: ioctl(LOGIN) failed : %s(%d)",
w->ifname, ipcom_strerror(ipcom_errno), ipcom_errno);
}
}
else
{
IPCOM_LOG1(NOTICE, "<%s> :: ACTION LOGIN :: missing ppp 'client' username or password", w->ifname);
}
}
break;
/********************* ACTION AUTH ********************/
/* Called when peer needs to be authenticated
*/
case IPPPP_ACTION_AUTH:
{
Ipcom_auth_userinfo userinfo;
Ipppp_auth_cookie *auth_cookie = data;
IPCOM_LOG1(INFO, "<%s> :: ACTION authenticate", w->ifname);
switch(auth_cookie->protocol)
{
case IPPPP_PROTOCOL_PAP:
ret = ipcom_auth_login(auth_cookie->username,
auth_cookie->password,
&userinfo,
ipppp_auth_login_hook,
auth_cookie);
break;
#ifdef IPPPP_USE_AUTH_CHAP
case IPPPP_PROTOCOL_CHAP:
{
Ipcom_auth_chap chap;
/* Validate user using the name and CHAP response, id and challenge. */
chap.response = auth_cookie->chap_response;
chap.ident = auth_cookie->chap_ident;
chap.challenge = auth_cookie->chap_challenge;
chap.challenge_size = auth_cookie->chap_challenge_size;
ret = ipcom_auth_chap_login(auth_cookie->username, &chap,
&userinfo, ipppp_auth_login_hook, auth_cookie);
}
break;
#endif /* IPPPP_USE_AUTH_CHAP */
default:
IP_PANIC2();
ret = IPCOM_ERR_FAILED;
ipcom_memset(&userinfo, 0, sizeof(userinfo));
break;
}
switch(ret)
{
case IPCOM_ERR_PENDING:
/* The ipppp_auth_login_hook() will be called later. */
break;
default:
/* login ok/fail. */
pppreq.pppru.auth.ifindex = w->ifindex;
pppreq.pppru.auth.link_index = w->link_index;
pppreq.pppru.auth.success = ret == IPCOM_SUCCESS;
ipcom_memcpy(&pppreq.pppru.auth.userinfo, &userinfo, sizeof(Ipcom_auth_userinfo));
ret = ipcom_socketioctl(fd, IP_SIOCXPPPAUTH, &pppreq);
if (ret != 0)
{
IPCOM_LOG3(WARNING, "<%s> :: ACTION AUTH :: ioctl(AUTH) failed : %s(%d)",
w->ifname, ipcom_strerror(ipcom_errno), ipcom_errno);
}
ipcom_free(auth_cookie);
break;
}
break;
}
#endif /* IPPPP_USE_AUTH */
default:
IP_PANIC();
break;
}
(void)ipcom_socketclose(fd);
}
#endif /* IP_PORT_VXWORKS */
/*
*===========================================================================
* ipppp_work
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_STATIC
IPCOM_PROCESS(ipppp_work)
{
ipcom_proc_init();
for (;;)
{
struct Ipppp_action_work *work;
ipcom_sem_wait(ipppp_work_sem);
ipcom_mutex_lock(ipppp_work_lock);
if ((work = IPCOM_LIST_FIRST(&ipppp_work_queue)) == IP_NULL)
{
ipcom_mutex_unlock(ipppp_work_lock);
continue;
}
ipcom_list_remove(&work->list);
ipcom_mutex_unlock(ipppp_work_lock);
ipppp_example_action_work(work);
ipcom_free(work);
}
/* ipcom_proc_exit(); */
}
/*
*===========================================================================
* ipppp_work_init
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_STATIC Ip_err
ipppp_work_init(void *unused)
{
IPCOM_UNUSED_ARG(unused);
ipcom_list_init(&ipppp_work_queue);
ipcom_mutex_create(&ipppp_work_lock);
ipcom_sem_create(&ipppp_work_sem, 0);
return ipcom_proc_create("ipppp_work",
(Ipcom_proc_func)ipppp_work,
IPCOM_PROC_STACK_DEFAULT,
IP_NULL);
}
/*
*===========================================================================
* ipppp_work_alloc
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_STATIC struct Ipppp_action_work *
ipppp_work_alloc(Ipcom_netif *netif, int action, void *data)
{
struct Ipppp_action_work *work;
work = ipcom_malloc(sizeof(*work));
if (work)
{
ipcom_strcpy(work->ifname, netif->name);
work->ifindex = netif->ifindex;
work->link_index = netif->link_index;
work->action = action;
work->data = data;
}
return work;
}
/*
*===========================================================================
* ipppp_work_schedule
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_STATIC int
ipppp_work_schedule(struct Ipppp_action_work *work)
{
if (ipcom_once(&ipppp_work_once,
ipppp_work_init,
IP_NULL)
!= IPCOM_SUCCESS)
{
IP_PANIC();
return -1;
}
ipcom_mutex_lock(ipppp_work_lock);
ipcom_list_insert_last(&ipppp_work_queue, &work->list);
ipcom_mutex_unlock(ipppp_work_lock);
ipcom_sem_post(ipppp_work_sem);
return 0;
}
#endif /* (defined(IP_PORT_VXWORKS) && (defined(INCLUDE_IPPPP) || defined(INCLUDE_IPPPPOE))) || !defined(IP_PORT_VXWORKS) */
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
* ipppp_example_action_cb - PPP action callback routine
*
* In order for PPP to function, this callback function is called by PPP to
* handle various PPP actions like initialization, startup, peer IPv4 address
* requests, peer authentication login etc.
*
* .IP <netif>
* Ipcom_netif pointer to the PPP interface.
* .IP <action>
* The action type - IPPPP_ACTION_xxx.
* .IP <data>
* Action type specific additional data.
*
* RETURNS: Depends on the action type.
*
* NOMANUAL
*/
IP_PUBLIC int
ipppp_example_action_cb(Ipcom_netif *netif, int action, void *data)
{
#if (defined(IP_PORT_VXWORKS) && (defined(INCLUDE_IPPPP) || defined(INCLUDE_IPPPPOE))) || !defined(IP_PORT_VXWORKS)
struct Ipppp_action_work *work;
work = ipppp_work_alloc(netif, action, data);
return ipppp_work_schedule(work);
#else
return 0;
#endif
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/