original files of m241
This commit is contained in:
@@ -0,0 +1,813 @@
|
||||
/* 00comp_ipnet_mobility.cdf - IPNet Mobility 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
|
||||
--------------------
|
||||
01b,14jul08,tlu Fix a module name to fix the component greyed out in WB
|
||||
01i,11may08,jho created.
|
||||
*/
|
||||
|
||||
#ifdef _WRS_CONFIG_COMPONENT_IPMIP6HA
|
||||
|
||||
Component INCLUDE_IPMIP6HA {
|
||||
NAME IPv6 Home Agent
|
||||
SYNOPSIS IPv6 Home Agent
|
||||
REQUIRES INCLUDE_IPCOM INCLUDE_IPCOM_USE_INET6 INCLUDE_IPMIP6 SELECT_IPMIP6HA
|
||||
MODULES ipmip6ha.o
|
||||
CONFIGLETTES ipmip6ha_config.c
|
||||
CFG_PARAMS MIP6HA_LIFETIME_ENUM \
|
||||
MIP6HA_INTERFACES \
|
||||
MIP6HA_INTERFACE_ADDRESS_ENUM \
|
||||
MIP6HA_REFRESH_ENUM \
|
||||
MIP6HA_TUNNEL_IP6IP6_ENUM \
|
||||
MIP6HA_BINDING_REVOCATION_MIN_DELAY_ENUM \
|
||||
MIP6HA_BINDING_REVOCATION_MAX_RETRIES_ENUM
|
||||
}
|
||||
|
||||
Component INCLUDE_IPMIP6HA_DUAL_STACK {
|
||||
NAME IPv6 Home Agent Dual Stack Support
|
||||
SYNOPSIS IPv6 Home Agent Dual Stack Support
|
||||
REQUIRES INCLUDE_IPMIP6HA
|
||||
CFG_PARAMS MIP6HA_INET_INTERFACE_ADDRESS_ENUM \
|
||||
MIP6HA_INET_ACCEPT_FORCED_IPV4_UDP_ENCAPSULATION_REQUEST_ENUM \
|
||||
MIP6HA_INET_FORCE_IPV4_UDP_ENCAPSULATION_ENUM \
|
||||
MIP6HA_INET_IPV4_UDP_ENCAPSULATION_NAT_TIMEOUT \
|
||||
MIP6HA_INET_TUNNEL_IPIP_ENUM \
|
||||
MIP6HA_INET_TOPOLOGY_ADDRESS_RESERVATION \
|
||||
MIP6HA_INET_POOL_ENUM \
|
||||
MIP6HA_INET_ACL_HOMEADDRESS_ENUM \
|
||||
MIP6HA_INET_ACL_POOL_ENUM \
|
||||
MIP6HA_INET_ACL_LIMIT_HOMEADDRESS_ENUM \
|
||||
MIP6HA_INET_ACL_LIMIT_PD_ENUM
|
||||
}
|
||||
|
||||
Component INCLUDE_IPMIP6HA_MOBILE_ROUTER {
|
||||
NAME IPv6 Home Agent Mobile Router Support
|
||||
SYNOPSIS IPv6 Home Agent Mobile Router Support
|
||||
REQUIRES INCLUDE_IPMIP6HA
|
||||
CFG_PARAMS MIP6HA_MOBILE_ROUTER_ACL_PD_ENUM
|
||||
}
|
||||
|
||||
|
||||
Component INCLUDE_IPMIP6HA_MOBILE_ROUTER_DUAL_STACK {
|
||||
NAME IPv6 Home Agent Mobile Router Dual Stack Support
|
||||
SYNOPSIS IPv6 Home Agent Mobile Router Dual Stack Support
|
||||
REQUIRES INCLUDE_IPMIP6HA_DUAL_STACK INCLUDE_IPMIP6HA_MOBILE_ROUTER
|
||||
CFG_PARAMS MIP6HA_MOBILE_ROUTER_INET_ACL_PD_ENUM
|
||||
}
|
||||
|
||||
|
||||
Component INCLUDE_IPMIP6HA_LMA {
|
||||
NAME IPv6 Home Agent LMA Support
|
||||
SYNOPSIS IPv6 Home Agent LMA Support
|
||||
REQUIRES INCLUDE_IPMIP6HA
|
||||
CFG_PARAMS MIP6HA_LMA_TUNNEL_IP6IP6_ENUM \
|
||||
MIP6HA_LMA_TUNNEL_GRE_ENUM \
|
||||
MIP6HA_LMA_POOL_ENUM \
|
||||
MIP6HA_LMA_ACL_PD_ENUM \
|
||||
MIP6HA_LMA_ACL_POOL_ENUM \
|
||||
MIP6HA_LMA_ACL_LIMIT_ENUM \
|
||||
MIP6HA_LMA_MIN_DELAY_BEFORE_BCE_DELETE_ENUM \
|
||||
MIP6HA_LMA_MAX_DELAY_BEFORE_NEW_BCE_ASSIGN_ENUM \
|
||||
MIP6HA_LMA_TIMESTAMP_VALIDITY_WINDOW_ENUM \
|
||||
MIP6HA_LMA_MOBILE_NODE_GENERATED_TIMESTAMP_IN_USE_ENUM \
|
||||
MIP6HA_LMA_HEARTBEAT_ENABLED_ENUM \
|
||||
MIP6HA_LMA_HEARTBEAT_INTERVAL_ENUM \
|
||||
MIP6HA_LMA_MISSING_HEARTBEATS_ALLOWED_ENUM \
|
||||
MIP6HA_LMA_MAG_ENUM \
|
||||
MIP6HA_LMA_FIXED_MAG_LINKLOCAL_ADDRESS_ON_ALL_ACCESS_LINKS_ENUM \
|
||||
MIP6HA_LMA_REVOKE_PREVIOUS_MAG_ENUM
|
||||
}
|
||||
|
||||
Component INCLUDE_IPMIP6HA_LMA_DHCP_SERVER {
|
||||
NAME IPv6 Home Agent LMA DHCP Server Support
|
||||
SYNOPSIS IPv6 Home Agent LMA DHCP Server Support
|
||||
REQUIRES INCLUDE_IPMIP6HA_LMA
|
||||
CFG_PARAMS MIP6HA_LMA_DHCP_SERVER_SERVER_ENUM \
|
||||
MIP6HA_LMA_DHCP_SERVER_SERVER_PREFERRED_ENUM \
|
||||
MIP6HA_LMA_DHCP_SERVER_SERVER_VALID_ENUM
|
||||
}
|
||||
|
||||
|
||||
Component INCLUDE_IPMIP6HA_LMA_DUAL_STACK {
|
||||
NAME IPv6 Home Agent LMA Dual Stack Support
|
||||
SYNOPSIS IPv6 Home Agent LMA Dual Stack Support
|
||||
REQUIRES INCLUDE_IPMIP6HA_DUAL_STACK INCLUDE_IPMIP6HA_LMA
|
||||
CFG_PARAMS MIP6HA_LMA_INET_TUNNEL_IPIP_ENUM \
|
||||
MIP6HA_LMA_INET_TUNNEL_GRE_ENUM \
|
||||
MIP6HA_LMA_INET_TOPOLOGY_DHCP_OPTION_ENUM \
|
||||
MIP6HA_LMA_INET_ACL_HOMEADDRESS_ENUM \
|
||||
MIP6HA_LMA_INET_ACL_POOL_ENUM
|
||||
}
|
||||
|
||||
Component INCLUDE_IPMIP6HA_LMA_DUAL_STACK_DHCP_SERVER {
|
||||
NAME IPv6 Home Agent LMA Dual Stack Internal DHCP Server Support
|
||||
SYNOPSIS IPv6 Home Agent LMA Dual Stack Internal DHCP Server includes \
|
||||
the integrated DHCP server feature.
|
||||
REQUIRES INCLUDE_IPMIP6HA_LMA_DUAL_STACK
|
||||
CFG_PARAMS MIP6HA_LMA_INET_DHCP_SERVER_ENUM
|
||||
}
|
||||
|
||||
|
||||
Component INCLUDE_IPMIP6HA_FEATURE_EXTENSION {
|
||||
NAME IPv6 Home Agent Feature Extension
|
||||
SYNOPSIS This feature should be included if one wants to add \
|
||||
a new feature to the home agent v6, and have the \
|
||||
feature hook being registered during initialization.
|
||||
REQUIRES INCLUDE_IPMIP6HA
|
||||
CFG_PARAMS MIP6HA_FEATURE_INITIALIZATION_HOOK
|
||||
}
|
||||
|
||||
Selection SELECT_IPMIP6HA {
|
||||
NAME Ipv6 Home Agent Components
|
||||
SYNOPSIS Ipv6 Home Agent Components
|
||||
COUNT 0-
|
||||
REQUIRES INCLUDE_IPMIP6HA
|
||||
_CHILDREN FOLDER_MOBILITY_V6
|
||||
CHILDREN INCLUDE_IPMIP6HA \
|
||||
INCLUDE_IPMIP6HA_CMD \
|
||||
INCLUDE_IPMIP6HA_DUAL_STACK \
|
||||
INCLUDE_IPMIP6HA_MOBILE_ROUTER \
|
||||
INCLUDE_IPMIP6HA_MOBILE_ROUTER_DUAL_STACK \
|
||||
INCLUDE_IPMIP6HA_FEATURE_EXTENSION \
|
||||
INCLUDE_IPMIP6HA_LMA \
|
||||
INCLUDE_IPMIP6HA_LMA_DHCP_SERVER \
|
||||
INCLUDE_IPMIP6HA_LMA_DUAL_STACK \
|
||||
INCLUDE_IPMIP6HA_LMA_DUAL_STACK_DHCP_SERVER
|
||||
DEFAULTS INCLUDE_IPMIP6HA \
|
||||
INCLUDE_IPMIP6HA_CMD \
|
||||
INCLUDE_IPMIP6HA_MOBILE_ROUTER \
|
||||
INCLUDE_IPMIP6HA_MOBILE_ROUTER_DUAL_STACK \
|
||||
INCLUDE_IPMIP6HA_DUAL_STACK \
|
||||
INCLUDE_IPMIP6HA_LMA \
|
||||
INCLUDE_IPMIP6HA_LMA_DHCP_SERVER \
|
||||
INCLUDE_IPMIP6HA_LMA_DUAL_STACK \
|
||||
INCLUDE_IPMIP6HA_LMA_DUAL_STACK_DHCP_SERVER
|
||||
}
|
||||
|
||||
Component INCLUDE_IPMIP6HA_CMD {
|
||||
NAME IPv6 Home Agent IPCOM commands
|
||||
SYNOPSIS IPv6 Home Agent IPCOM commands.
|
||||
MODULES ipmip6ha_cmd_ha6.o
|
||||
REQUIRES INCLUDE_IPCOM_SHELL_CMD INCLUDE_IPMIP6HA
|
||||
}
|
||||
|
||||
/* INCLUDE_IPMIP6HA configuration parameters */
|
||||
Parameter MIP6HA_LIFETIME_ENUM {
|
||||
NAME Interface lifetime specification
|
||||
SYNOPSIS The maximum lifetime in seconds allowed on this interface. A \
|
||||
value of "0" means that any lifetime may be accepted. For \
|
||||
ordinary non-proxy registrations, the maximum lifetime value \
|
||||
is still limited by the home address prefix lifetime as \
|
||||
advertised by the routers. Format for this configuration item \
|
||||
is a semi-colon separated list of interfaces and lifetime values \
|
||||
as specified by the following format string \
|
||||
"<ifname1>=<lifetime1>;<ifnameN>=<lifetimeN>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_REFRESH_ENUM {
|
||||
NAME Interface refresh indication
|
||||
SYNOPSIS This configuration item specifies the refresh indicator that \
|
||||
the home agent should provide, if any. The value may range \
|
||||
between 0 and 100, which is per cent of the granted lifetime. \
|
||||
A value of 0 disables the refresh indicator. The refresh \
|
||||
indicator tells the registering node how long it should wait \
|
||||
before refreshing its binding. If no refresh indicator value \
|
||||
has been specified for an interface, it is considered having \
|
||||
a value of 0. Format for this configuration item \
|
||||
is a semi-colon separated list of interfaces and refresh values \
|
||||
as specified by the following format string \
|
||||
"<ifname1>=<refresh1>;<ifnameN>=<refreshN>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INTERFACES {
|
||||
NAME Interface list
|
||||
SYNOPSIS The interface list specifies what interfaces \
|
||||
should be configured for home agent operation. This \
|
||||
parameter is a comma separated list of interfaces such \
|
||||
as "<ifname1>,<ifname2>" etc.
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INTERFACE_ADDRESS_ENUM {
|
||||
NAME Interface address configuration
|
||||
SYNOPSIS Each enabled interface must have an assigned v6 address that \
|
||||
will be used during communication with registering nodes. If \
|
||||
no address has been specified for an enabled interface, the \
|
||||
home agent will attempt to resolve the address and use the \
|
||||
first global IPv6 address it locates on the specified \
|
||||
interface. This configuration parameter is specified by using \
|
||||
a semi-colon separated list of interface names and addresses, as \
|
||||
specified by the format string \
|
||||
"<ifname1>=<address1>;<ifnameN>=<addressN>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_TUNNEL_IP6IP6_ENUM {
|
||||
NAME Home Agent IPv6 tunneling
|
||||
SYNOPSIS This configuration item specifies whether or not IPv6 tunneling \
|
||||
is allowed by the home agent. This configuration item should \
|
||||
not be disabled unless the home agent is only doing Proxy Mobility,\
|
||||
or is only reachable by means of IPv4. This configuration \
|
||||
parameter is specified by using a semi-colon separated list of \
|
||||
interface names and disabled/enabled values, as specified by \
|
||||
the format string \
|
||||
"<ifname1>=<enabled|disabled>;<ifnameN>=<enabled|disabled>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_MOBILE_ROUTER_ACL_PD_ENUM {
|
||||
NAME Mobile Router Prefix Delegation Access Control
|
||||
SYNOPSIS This configuration item determines how prefixes are allocated \
|
||||
to the registrering node when Mobile Router. The specified prefixes \
|
||||
indicates what prefixes are to be used for Mobile Router \
|
||||
registrations. Syntax for this configuration item is: \
|
||||
<nai|hoa=<prefix1>/prefixlen1>[,<prefixN>/<prefixlenN>] \
|
||||
A Mobile Router example for this entry would be: \
|
||||
"mr-user@windriver.com=3ffe:1::/64,3ffe:2::/64" or \
|
||||
"3ffe:10::1=3ffe:1::/64,3ffe:2::/64"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_TUNNEL_IP6IP6_ENUM {
|
||||
NAME LMA IPv6 tunneling
|
||||
SYNOPSIS This configuration item specifies whether or not IPv6 tunneling \
|
||||
is allowed by the LMA for proxy mobility. By default all \
|
||||
interfaces enables IPv6 tunneling. This configuration parameter \
|
||||
is specified by using a semi-colon separated list of interface \
|
||||
names and disabled/enabled values, as specified by the format \
|
||||
string "<ifname1>=<enabled|disabled>;<ifnameN>=<enabled|disabled>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_TUNNEL_GRE_ENUM {
|
||||
NAME LMA IPv6 GRE tunneling
|
||||
SYNOPSIS This configuration item specifies whether IPv6 GRE tunneling \
|
||||
is allowed by the LMA for Proxy Mobility. By default all \
|
||||
interfaces enables GRE. This configuration parameter is \
|
||||
specified by using a semi-colon separated list of interface \
|
||||
names and disabled/enabled values, as specified by the format string \
|
||||
"<ifname1>=<enabled|disabled>;<ifnameN>=<enabled|disabled>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_POOL_ENUM {
|
||||
NAME LMA Prefix Allocation Pool definitions
|
||||
SYNOPSIS This configuration item defines a LMA pool allocation \
|
||||
object, from which MAGs may allocate v6 prefixes for use \
|
||||
by nodes located in their networks. The format of the \
|
||||
configuration parameter is \
|
||||
<pool name1>=<pool definition1>[;<pool nameN>=<pool definitionN>] \
|
||||
<pool definition> has the form <prefix>/<prefix length>/<chunk size> \
|
||||
where <prefix> is the prefix we will be allocating chunks from, \
|
||||
<prefix length> is the size of the entire prefix, while <chunk size> \
|
||||
determines the size of the allocated prefix. For example, \
|
||||
"WR-POOL=3ffe::/48/64" will be allocating 64 bit chunks from \
|
||||
the prefix 3ffe::/48.
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_ACL_PD_ENUM {
|
||||
NAME Proxy Mobility Prefix Delegation Access Control
|
||||
SYNOPSIS This configuration item determines how prefixes are allocated \
|
||||
to the registrering node when Proxy Mobility is used. \
|
||||
The explicitly specified prefixes \
|
||||
indicates what prefixes are to be used for Proxy Mobility \
|
||||
registrations using the specified NAI. Syntax for this \
|
||||
configuration item is: \
|
||||
<nai|domain=<prefix1>/prefixlen1>[,<prefixN>/<prefixlenN> \
|
||||
An example would be: "pm-user@windriver.com=3ffe:3::/64". A \
|
||||
domain example specifying available prefixes for a domain \
|
||||
would be: "@windriver.com=3ffe:4::/64,3ffe:5::/64,3ffe:6::/64"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_ACL_POOL_ENUM {
|
||||
NAME Proxy Mobility Pool Access Control
|
||||
SYNOPSIS This configuration item determines what pool to be used in order\
|
||||
to allocate prefixes to a specified NAI or domain.\
|
||||
Syntax for this configuration item is: <nai|domain=<pool name> \
|
||||
An example would be: "pm-user@windriver.com=WR-POOL". A domain \
|
||||
example specifying a pool for a domain would be: \
|
||||
"@windriver.com=WR-POOL"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_ACL_LIMIT_ENUM {
|
||||
NAME Proxy Mobility Prefix Allocation Limit Access Control
|
||||
SYNOPSIS This configuration item determines the maximum number of \
|
||||
prefix which a specific NAI or domain may allocate from \
|
||||
the Home Agent. If no LIMIT is specified for a given \
|
||||
user or domain, it will resort to "1". \
|
||||
Syntax for this configuration item is: <nai|domain=<limit> \
|
||||
An example would be: "pm-user@windriver.com=3". A domain example \
|
||||
specifying available prefixes for a domain would be: \
|
||||
"@windriver.com=2"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
|
||||
Parameter MIP6HA_LMA_MIN_DELAY_BEFORE_BCE_DELETE_ENUM {
|
||||
NAME Proxy Mobility Minimum Delay before BCE Delete
|
||||
SYNOPSIS This variable specifies the amount of time in milliseconds the \
|
||||
local mobility anchor MUST wait before it deletes a Binding \
|
||||
Cache entry of a mobile node, upon receiving a Proxy Binding \
|
||||
Update message from a mobile access gateway with a lifetime \
|
||||
value of 0. During this wait time, if the local mobility \
|
||||
anchor receives a Proxy Binding Update for the same mobility \
|
||||
binding, with a lifetime value greater than 0, then it must \
|
||||
update the binding cache entry with the accepted binding \
|
||||
values. By the end of this wait-time, if the local \
|
||||
mobility anchor did not receive any valid Proxy Binding \
|
||||
Update message for that mobility binding, it MUST delete the \
|
||||
Binding Cache entry. This delay essentially ensures a \
|
||||
mobile node's Binding Cache entry is not deleted too quickly \
|
||||
and allows some time for the new mobile access gateway to \
|
||||
complete the signaling for the mobile node. \
|
||||
The format for this configuration item is a semi-colon \
|
||||
separated list of "<ifname>=<timeout>". \
|
||||
If no value has been specified for a given interface, \
|
||||
a value of "10000" will be used.
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_MAX_DELAY_BEFORE_NEW_BCE_ASSIGN_ENUM {
|
||||
NAME Proxy Mobility Max Delay Before New BCE Assign
|
||||
SYNOPSIS This variable specifies the amount of time in milliseconds the \
|
||||
local mobility anchor MUST wait for the de-registration message \
|
||||
for an existing mobility session before it decides to create a \
|
||||
new mobility session.The format for this configuration item is \
|
||||
a semi-colon separated list of "<ifname>=<timeout>". \
|
||||
If no value has been specified for a given interface, \
|
||||
a value of "1500" will be used.
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_TIMESTAMP_VALIDITY_WINDOW_ENUM {
|
||||
NAME Proxy Mobility Timestamp Validity Window
|
||||
SYNOPSIS This variable specifies the maximum amount of time difference \
|
||||
in milliseconds between the timestamp in the received Proxy \
|
||||
Binding Update message and the current time of day on the \
|
||||
local mobility anchor, that is allowed by the local mobility \
|
||||
anchor for thereceived message to be considered valid.\
|
||||
The format for this configuration item is \
|
||||
a semi-colon separated list of "<ifname>=<validity timeout>". \
|
||||
If no value has been specified for a given interface, \
|
||||
a value of "300" will be used.
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_MOBILE_NODE_GENERATED_TIMESTAMP_IN_USE_ENUM {
|
||||
NAME Proxy Mobility Mobile Node Generated Timestamp In Use
|
||||
SYNOPSIS This flag indicates whether or not the mobile-node-generated \
|
||||
timestamp approach is in use in that Proxy Mobile IPv6 domain. \
|
||||
When the value for this flag is set to 1, the local mobility \
|
||||
anchors and mobile access gateways in that Proxy Mobile IPv6 \
|
||||
domain MUST apply the mobile node generated timestamp \
|
||||
considerations. Syntax for this parameter is a semi-colon \
|
||||
separated list of "<ifname>=<0|1>". By default this \
|
||||
feature is turned off.
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_HEARTBEAT_ENABLED_ENUM {
|
||||
NAME Proxy Mobility HEARTBEAT
|
||||
SYNOPSIS This configuration option specifies whether or not the Heartbeat \
|
||||
feature is enabled for the specified interface. If no \
|
||||
configuration is provided, the feature is turned off. \
|
||||
The format for this configuration item is \
|
||||
a semi-colon separated list of "<ifname>=<enabled|disabled>".
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_HEARTBEAT_INTERVAL_ENUM {
|
||||
NAME Proxy Mobility HEARTBEAT_INTERVAL
|
||||
SYNOPSIS This variable is used to set the time interval in seconds \
|
||||
between two consecutive Heartbeat Request messages. The \
|
||||
default value is 60 seconds. It SHOULD NOT be set to less \
|
||||
than 30 seconds.The format for this configuration item is \
|
||||
a semi-colon separated list of "<ifname>=<interval>".
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_MISSING_HEARTBEATS_ALLOWED_ENUM {
|
||||
NAME Proxy Mobility MISSING_HEARTBEATS_ALLOWED
|
||||
SYNOPSIS This variable indicates the maximum number of consecutive \
|
||||
Heartbeat Request messages that a PMIPv6 node can miss before \
|
||||
concluding that the peer PMIPv6 node is not reachable. The \
|
||||
default value for this variable is 3.\
|
||||
The format for this configuration item is a semi-colon \
|
||||
separated list of "<ifname>=<misses>".
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_MAG_ENUM {
|
||||
NAME Proxy Mobility Mobility Access Gateway Definitions
|
||||
SYNOPSIS This configuration item specifies what Mobility Access \
|
||||
Gateways should be permanently added to the MAG database, \
|
||||
and whether or not they support HeartBeat. The LMA will \
|
||||
send an unsolicited HeartBeat response to each HeartBeat \
|
||||
enabled MAG during startup and reconfiguration. \
|
||||
The format for this configuration item is a semi-colon \
|
||||
separated list of "<MAG address>=<enabled|disabled>" where \
|
||||
<MAG Address> has the form <MAG INET6 Address>[/<MAG INET Address>]
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_REVOKE_PREVIOUS_MAG_ENUM {
|
||||
NAME Proxy Mobility Automatic Revocation of Previous MAG
|
||||
SYNOPSIS This feature specifies whether or not the LMA will revoke \
|
||||
bindings from previous MAGs when a new registration and \
|
||||
care-of address has been registered. By default this parameter \
|
||||
is enabled. This configuration parameter is specified by using \
|
||||
a semi-colon separated list of interface names and timeout \
|
||||
values, as specified by the format string \
|
||||
"<ifname1>=<enabled|disabled>;<ifnameN>=<enabled|disabled>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
Parameter MIP6HA_LMA_FIXED_MAG_LINKLOCAL_ADDRESS_ON_ALL_ACCESS_LINKS_ENUM {
|
||||
NAME Proxy Mobility Fixed MAG LinkLocal Address On All Access Links
|
||||
SYNOPSIS This variable indicates the link-local address value that all \
|
||||
the mobile access gateways SHOULD use on any of the access \
|
||||
links shared with any of the mobile nodes in that Proxy Mobile \
|
||||
IPv6 domain. If this variable is initialized to ALL_ZERO value,\
|
||||
itimplies the use of fixed link-local address mode is not \
|
||||
enabled for that Proxy Mobile IPv6 domain. ALL_ZERO is \
|
||||
specified by omitting the configuration or specifying the \
|
||||
address as "::". The format for this configuration item is a \
|
||||
semi-colon separated list of "<ifname>=<link local addresss>".
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_DHCP_SERVER_SERVER_ENUM {
|
||||
NAME Proxy Mobility IPDHCPv6 Support
|
||||
SYNOPSIS This configuration item enabled IPDHCPS6 server support \
|
||||
for the specified interfaces. IPDHCPS6 must be included \
|
||||
in the build for this parameter to be available.. \
|
||||
The format for this configuration item is a semi-colon \
|
||||
separated list of "<ifname>=<enabled|disabled>".
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_DHCP_SERVER_SERVER_PREFERRED_ENUM {
|
||||
NAME Proxy Mobility IPDHCPv6 Preferred Lifetime Configuration
|
||||
SYNOPSIS This configuration item specifies the preferred lifetime in \
|
||||
seconds to be used by the IPDHCPS6 server during DHCP \
|
||||
negotiations. If no configuration is provided, this value \
|
||||
will default to "10000". \
|
||||
The format for this configuration item is a semi-colon \
|
||||
separated list of "<ifname>=<preferred lifetime in seconds>".
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_DHCP_SERVER_SERVER_VALID_ENUM {
|
||||
NAME Proxy Mobility IPDHCPv6 Valid Lifetime Configuration
|
||||
SYNOPSIS This configuration item specifies the valid lifetime in \
|
||||
seconds to be used by the IPDHCPS6 server during DHCP \
|
||||
negotiations. If no configuration is provided, this value \
|
||||
will default to "10000". \
|
||||
The format for this configuration item is a semi-colon \
|
||||
separated list of "<ifname>=<valid lifetime in seconds>".
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_INET_TUNNEL_IPIP_ENUM {
|
||||
NAME INET LMA v4 IPIP tunneling
|
||||
SYNOPSIS This configuration item specifies whether or not v4 IPIP tunneling \
|
||||
is allowed by the LMA for proxy mobility. By default all \
|
||||
interfaces enables IPIP tunneling. This configuration parameter \
|
||||
is specified by using a semi-colon separated list of interface \
|
||||
names and disabled/enabled values, as specified by the format \
|
||||
string "<ifname1>=<enabled|disabled>;<ifnameN>=<enabled|disabled>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_INET_TUNNEL_GRE_ENUM {
|
||||
NAME INET LMA v4 GRE tunneling
|
||||
SYNOPSIS This configuration item specifies whether v4 GRE tunneling \
|
||||
is allowed by the LMA for Proxy Mobility. By default all \
|
||||
interfaces enables GRE. This configuration parameter is \
|
||||
specified by using a semi-colon separated list of interface \
|
||||
names and disabled/enabled values, as specified by the format string \
|
||||
"<ifname1>=<enabled|disabled>;<ifnameN>=<enabled|disabled>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_INET_TOPOLOGY_DHCP_OPTION_ENUM {
|
||||
NAME INET LMA Network Topology DHCP Configuration
|
||||
SYNOPSIS Specify the DHCP options that are valid for various network \
|
||||
segments. The syntax is <type>.<code>.<network>=<value>. \
|
||||
<type> is one of "bool","u8","u16","u32","ip","ip_pair" and \
|
||||
"string". The type specifies how the following values should be \
|
||||
parsed. Type "string" will not parse the value in any way, only \
|
||||
add the entire value to the DHCP option. If more than one space \
|
||||
separated value is provided, they will be added in an array \
|
||||
fashion to the DHCP option. <code> is the DHCP option code as \
|
||||
defined by IANA. For example "ip.6.10.0.0.0/8=10.1.2.3 10.2.3.3" \
|
||||
will add a DNS server option with two servers valid for the \
|
||||
network segment 10.0.0.0/8. Some DHCP options do have alias \
|
||||
names, where the most common are "router", "subnet_mask" and \
|
||||
"dns". So, a valid configuration is also \
|
||||
"router.10.0.0.0/8=10.1.2.3" which would add 10.1.2.3 as a \
|
||||
default router for the network segment 10.0.0.0/8. You \
|
||||
MUST add a router and a subnet_mask option for the appropriate \
|
||||
networks, when using v4 address assignments in Proxy Mobility, \
|
||||
since the specification requires that information to be provided. \
|
||||
This configuration parameter is specified by using a semi-colon \
|
||||
separated list of network topology configurations and values,\
|
||||
such as: "<type>.<code>.<network>/<prefix length>=<value>" or \
|
||||
"<alias>.<network>/<prefix length>=<value>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_INET_ACL_HOMEADDRESS_ENUM {
|
||||
NAME INET LMA Home Address Assignment Access Control
|
||||
SYNOPSIS This configuration item determines what INET home address may \
|
||||
be allocated by a specific NAI. Syntax for this \
|
||||
configuration item is: \
|
||||
<nai>=<INET hoa>/prefixlen> \
|
||||
An example for this entry would be: \
|
||||
"mr-user@windriver.com=10.0.1.1/24"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
|
||||
Parameter MIP6HA_LMA_INET_ACL_POOL_ENUM {
|
||||
NAME INET LMA Pool Allocation Access Control
|
||||
SYNOPSIS This configuration item determines what INET pool may be used \
|
||||
by a specific NAI or DOMAIN for INET home address Syntax for \
|
||||
this configuration item is: <nai|domain>=<pool name> \
|
||||
An example for this entry would be: \
|
||||
"mr-user@windriver.com=WR-INET_POOL"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_LMA_INET_DHCP_SERVER_ENUM {
|
||||
NAME INET LMA Integrated DHCP Server Support
|
||||
SYNOPSIS This configuration item determines if the intergrated DHCP \
|
||||
server is enabled or disabled. The integrated DHCP server \
|
||||
provides DHCP functionality for DHCP requests relayed by the \
|
||||
MAG for proxy mobile nodes. The DHCP options provided by \
|
||||
the server is decided by MIP6HA_LMA_INET_TOPOLOGY_DHCP_OPTION_ENUM. \
|
||||
The format of this entry is a semi-colon separated list of \
|
||||
<ifname>=<enabled|disabled>, such as "eth0=disabled". By \
|
||||
default, the integrated DHCP server is not enabled.
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
Parameter MIP6HA_INET_INTERFACE_ADDRESS_ENUM {
|
||||
NAME INET Interface address configuration
|
||||
SYNOPSIS Each enabled interface may have an assigned v4 address that \
|
||||
will be used during communication with registering nodes. If \
|
||||
no address has been specified for an enabled interface, the \
|
||||
home agent will attempt to resolve the address and use the \
|
||||
first IPv4 address it locates on the specified \
|
||||
interface. This configuration parameter is specified by using \
|
||||
a semi-colon separated list of interface names and addresses, \
|
||||
as specified by the format string \
|
||||
"<ifname1>=<address1>;<ifnameN>=<addressN>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INET_ACCEPT_FORCED_IPV4_UDP_ENCAPSULATION_REQUEST_ENUM {
|
||||
NAME INET Accept Forced IPv4 UDP Encapsulation Request
|
||||
SYNOPSIS This flag indicates whether or not the local mobility anchor/ \
|
||||
home agent should accept IPv4 UDP encapsulation request for \
|
||||
the mobile node's data traffic, even if there is no NAT \
|
||||
detected in the path. The default value for this flag is set \
|
||||
to value of 0, indicating that the LMA/HA MUST NOT accept IPv4 \
|
||||
UDP encapsulation request when NAT is not detected in the path.\
|
||||
When the value for this flag is set to value of 1, the LMA/HA \
|
||||
MUST accept IPv4 UDP encapsulation request even when NAT is not \
|
||||
detected in the path. This configuration parameter is specified \
|
||||
by using a semi-colon separated list of interface names and \
|
||||
flags, as specified by the format string \
|
||||
"<ifname1>=<0|1>;<ifnameN>=<0|1>
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INET_FORCE_IPV4_UDP_ENCAPSULATION_ENUM {
|
||||
NAME INET Force IPv4 UDP Encapsulation
|
||||
SYNOPSIS This boolean parameter specifies whether or not the LMA/HA will \
|
||||
force UDP encapsulation for Ipv4 tunneled frames. This \
|
||||
parameter is by default false. This configuration parameter is \
|
||||
specified by using a semi-colon separated list of interface \
|
||||
names and boolean values as specified by the format string \
|
||||
"<ifname1>=<true|false>;<ifnameN>=<true|false>".
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INET_IPV4_UDP_ENCAPSULATION_NAT_TIMEOUT {
|
||||
NAME INET IPv4 UDP Encapsulation NAT Timeout
|
||||
SYNOPSIS This parameter specifies in seconds the estimated time a NAT \
|
||||
binding will remain valid within this domain. If specified as \
|
||||
0xFFFFFFFF a binding never times out, 0 allows the requesting \
|
||||
node to to determine the timeout value. The default value is \
|
||||
110. This configuration parameter is specified by using a \
|
||||
semi-colon separated list of interface names and timeout values \
|
||||
as specified by the format string \
|
||||
"<ifname1>=<timeout1>;<ifnameN>=<timeoutN>".
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
|
||||
Parameter MIP6HA_INET_TUNNEL_IPIP_ENUM {
|
||||
NAME INET Home Agent v4 IPIP tunneling
|
||||
SYNOPSIS This configuration item specifies whether or not v4 IPIP tunneling \
|
||||
is allowed by the home agent. By default, IPIP is always enabled. \
|
||||
This configuration parameter is specified by using a semi-colon \
|
||||
separated list of interface names and disabled/enabled values, \
|
||||
as specified by the format string \
|
||||
"<ifname1>=<enabled|disabled>;<ifnameN>=<enabled|disabled>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INET_TOPOLOGY_ADDRESS_RESERVATION {
|
||||
NAME INET Network Topology Address Reservation
|
||||
SYNOPSIS Specify the v4 address and prefixes that MUST not be allocated \
|
||||
to any MAG or DSMIPv6 node. \
|
||||
This configuration parameter is specified by specifying a \
|
||||
comma separated list of addresses or prefixes such as: \
|
||||
"<address1>[/<prefix length1>][,<addressN>[/<prefix lengthN>]]"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INET_POOL_ENUM {
|
||||
NAME INET Prefix and Home Address Allocation Pool definitions
|
||||
SYNOPSIS This configuration item defines an INET pool allocation \
|
||||
object, from which MAGs or INET enabled mobile nodes may \
|
||||
allocate v4 prefixes and home addresses.The format of the \
|
||||
configuration parameter is \
|
||||
<pool name1>=<pool definition1>[;<pool nameN>=<pool definitionN>] \
|
||||
<pool definition> has the form: \
|
||||
<INET prefix>/<prefix length>/<chunk size> \
|
||||
or an inclusive range such as: \
|
||||
<INET prefix start>-<INET prefix end>/<prefix length>/<chunk size> \
|
||||
where <INET prefix> is the prefix we will be allocating chunks from, \
|
||||
<prefix length> is number of bits in the netmask, while <chunk size> \
|
||||
determines the size of the allocated prefix. For example, \
|
||||
"WR-INET-POOL=10.0.0.0/24/32" will be allocating single \
|
||||
addresses bit from the network 10.0.0.0/24. Another example is: \
|
||||
"WR-INET-POOL=10.0.0.1-10.0.0.3/24/32" which will provide \
|
||||
addresses 10.0.0.1, 10.0.0.2 and 10.0.0.3 for allocation. \
|
||||
For prefix allocations, a pool rule could read: \
|
||||
"WR-INET-POOL=10.0.0.0/8/24" which would allocate 24 bit segments \
|
||||
of the 10.0.0.0/8 network. If you need to reserve addresses \
|
||||
in the pool, see MIP6HA_INET_TOPOLOGY_ADDRESS_RESERVATION.
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_MOBILE_ROUTER_INET_ACL_PD_ENUM {
|
||||
NAME INET Mobile Router Prefix Delegation Access Control
|
||||
SYNOPSIS This configuration item determines how prefixes are allocated \
|
||||
to the registrering node when Mobile Router. The specified prefixes \
|
||||
indicates what prefixes are to be used for Mobile Router \
|
||||
registrations. Syntax for this configuration item is: \
|
||||
<nai|hoa>=<INET prefix1>/prefixlen1>[,<prefixN>/<INET prefixlenN>] \
|
||||
A Mobile Router example for this entry would be: \
|
||||
"mr-user@windriver.com=10.0.1.0/24,10.0.2.0/24" or \
|
||||
"3ffe:10::1=10.0.1.0/24,10.0.2.0/24"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INET_ACL_HOMEADDRESS_ENUM {
|
||||
NAME INET Home Address Assignment Access Control
|
||||
SYNOPSIS This configuration item determines what INET home addresses may \
|
||||
be allocated by a specific Home Address or NAI. Syntax for this \
|
||||
configuration item is: \
|
||||
<nai|hoa>=<INET hoa1>/prefixlen1>[,<INET hoaN>/<prefixlenN>] \
|
||||
An example for this entry would be: \
|
||||
"mr-user@windriver.com=10.0.1.1/24"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INET_ACL_POOL_ENUM {
|
||||
NAME INET Pool Allocation Access Control
|
||||
SYNOPSIS This configuration item determines what INET pool may be used \
|
||||
by a specific Home Address, NAI or DOMAIN for INET home address \
|
||||
or prefix allocations. Syntax for this configuration item is: \
|
||||
<nai|hoa|domain>=<pool name> \
|
||||
An example for this entry would be: \
|
||||
"mr-user@windriver.com=WR-INET_POOL"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INET_ACL_LIMIT_HOMEADDRESS_ENUM {
|
||||
NAME INET Home Address Allocation Limit Access Control
|
||||
SYNOPSIS This configuration item determines the number of INET Home \
|
||||
Addresses may be allocated by a specific NAI, domain or \
|
||||
Home Address. The default value is "1". The format for this \
|
||||
entry is <nai|domain|hoa>=<limit>. \
|
||||
An example for this entry would be: \
|
||||
"mr-user@windriver.com=2"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_INET_ACL_LIMIT_PD_ENUM {
|
||||
NAME INET Prefix Delegation Limit Access Control
|
||||
SYNOPSIS This configuration item determines the number of INET Prefixes \
|
||||
that may be allocated by a specific NAI, domain or \
|
||||
Home Address. The default value is "0". The format for this \
|
||||
entry is <nai|domain|hoa>=<limit>. \
|
||||
An example for this entry would be: \
|
||||
"mr-user@windriver.com=1"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
|
||||
Parameter MIP6HA_FEATURE_INITIALIZATION_HOOK {
|
||||
NAME Home Agent Service Initialization Hook
|
||||
SYNOPSIS This is the function hook that you may define in order to \
|
||||
register extra functional extensions to the Home Agent.
|
||||
TYPE FUNCPTR
|
||||
DEFAULT your_function_here
|
||||
}
|
||||
|
||||
Parameter MIP6HA_BINDING_REVOCATION_MIN_DELAY_ENUM {
|
||||
NAME Home Agent Minimum Delay Between BRI messages (MINDelayBRIs)
|
||||
SYNOPSIS This variable specifies the delay time in milliseconds before \
|
||||
the revoking mobility entity retransmits a BRI message. The \
|
||||
default is 1000 ms but not less than 500 ms.\
|
||||
This configuration parameter is specified by using a semi-colon \
|
||||
separated list of interface names and timeout values, as \
|
||||
specified by the format string \
|
||||
"<ifname1>=<milliseconds>;<ifnameN>=<milliseconds>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
Parameter MIP6HA_BINDING_REVOCATION_MAX_RETRIES_ENUM {
|
||||
NAME Home Agent BRI Maximum Number of Retries (BRIMaxRetriesNumber)
|
||||
SYNOPSIS This variable specifies the maximum Number of times a mobility \
|
||||
entity can retransmit a Binding Revocation Indication message \
|
||||
before receiving a Binding Revocation Acknowledgement message. \
|
||||
The default value for this parameter is 1. \
|
||||
This configuration parameter is specified by using a semi-colon \
|
||||
separated list of interface names and retransmit values, as \
|
||||
specified by the format string \
|
||||
"<ifname1>=<retransmits>;<ifnameN>=<retransmits>"
|
||||
TYPE char *
|
||||
DEFAULT ""
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
# Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: common.vxconfig,v $ $Revision: 1.8 $
|
||||
# $Source: /home/interpeak/CVSRoot/ipmip6ha/config/common.vxconfig,v $
|
||||
# $Author: myakan $
|
||||
# $State: Exp $ $Locker: $
|
||||
#
|
||||
# INTERPEAK_COPYRIGHT_STRING
|
||||
|
||||
#hidden option that enables IPMIP6HA
|
||||
config SUPPORTS_MIP6HA
|
||||
bool
|
||||
default y
|
||||
|
||||
@@ -0,0 +1,314 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* INTERPEAK CONFIGURATION SOURCE FILE
|
||||
*
|
||||
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6ha_config.c,v $ $Revision: 1.11 $
|
||||
* $Source: /home/interpeak/CVSRoot/ipmip6ha/config/ipmip6ha_config.c,v $
|
||||
* $Author: jhorteli $
|
||||
* $State: Exp $ $Locker: $
|
||||
*
|
||||
* INTERPEAK_COPYRIGHT_STRING
|
||||
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 CONFIGURATION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include <ipcom_cstyle.h>
|
||||
#include <ipcom_os.h>
|
||||
#include <ipcom_err.h>
|
||||
#include <ipcom_sysvar.h>
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
typedef void (*Ipmip6ha_config_func_t) (void *);
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 6 EXTERN PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 7 LOCAL PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
IP_GLOBAL int ipmip6ha_cmd_ha6(int argc, char **argv);
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 8 DATA
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* Basic MIP6 Home Agent (ha) sysvar Configuration
|
||||
*===========================================================================
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_IPMIP6HA
|
||||
|
||||
#define INCLUDE_IPMIP6HA_LMA_DUAL_STACK_DHCP_SERVER 1
|
||||
#define INCLUDE_IPMIP6HA_LMA_DHCP_SERVER 1
|
||||
|
||||
#if defined(IPTESTENGINE)
|
||||
#define INCLUDE_IPMIP6HA_FEATURE_EXTENSION 1
|
||||
#define MIP6HA_FEATURE_INITIALIZATION_HOOK ipmip6ha_service_testext_install
|
||||
#endif
|
||||
|
||||
#if !defined(IP_PORT_LAS)
|
||||
#define INCLUDE_IPMIP6HA_CMD 1
|
||||
#endif
|
||||
|
||||
|
||||
IP_STATIC IP_CONST Ipcom_sysvar ipmip6ha_conf_sysvar[] =
|
||||
{
|
||||
/* Configuration delimiter - DO NOT EDIT! */
|
||||
{ IP_NULL, IP_NULL }
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
IP_STATIC IP_CONST Ipcom_sysvar ipmip6ha_conf_sysvar[] =
|
||||
{
|
||||
{ "ipmip6ha.interfaces", MIP6HA_INTERFACES },
|
||||
|
||||
/* DSMIPv6 */
|
||||
#if defined (INCLUDE_IPMIP6HA_DUAL_STACK)
|
||||
{ "ipmip6ha.inet.topology.reserved", MIP6HA_INET_TOPOLOGY_ADDRESS_RESERVATION },
|
||||
#endif
|
||||
|
||||
/* Configuration delimiter - DO NOT EDIT! */
|
||||
{ IP_NULL, IP_NULL }
|
||||
};
|
||||
|
||||
|
||||
/* Interface specific list configurations */
|
||||
IP_CONST Ipcom_sysvar_ext ipmip6ha_conf_sysvar_ext[] =
|
||||
{
|
||||
/* Basic Configuration Parameters */
|
||||
{ "ipmip6ha.interface", "homeagent", MIP6HA_INTERFACE_ADDRESS_ENUM },
|
||||
{ "ipmip6ha.interface", "lifetime", MIP6HA_LIFETIME_ENUM },
|
||||
{ "ipmip6ha.interface", "refresh", MIP6HA_REFRESH_ENUM },
|
||||
{ "ipmip6ha.interface", "tunnel.ip6ip6", MIP6HA_TUNNEL_IP6IP6_ENUM },
|
||||
|
||||
{ "ipmip6ha.interface", "BRIMaxRetriesNumber", MIP6HA_BINDING_REVOCATION_MAX_RETRIES_ENUM },
|
||||
{ "ipmip6ha.interface", "MINDelayBRIs", MIP6HA_BINDING_REVOCATION_MIN_DELAY_ENUM },
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_DUAL_STACK)
|
||||
/* DSMIPv6 */
|
||||
{ "ipmip6ha.interface", "inet.homeagent", MIP6HA_INET_INTERFACE_ADDRESS_ENUM },
|
||||
{ "ipmip6ha.interface", "inet.AcceptForcedIPv4UDPEncapsulationRequest", MIP6HA_INET_ACCEPT_FORCED_IPV4_UDP_ENCAPSULATION_REQUEST_ENUM },
|
||||
{ "ipmip6ha.interface", "inet.ForceIPv4UDPEncapsulation", MIP6HA_INET_FORCE_IPV4_UDP_ENCAPSULATION_ENUM },
|
||||
{ "ipmip6ha.interface", "inet.IPv4UDPEncapsulationNATTimeout", MIP6HA_INET_IPV4_UDP_ENCAPSULATION_NAT_TIMEOUT },
|
||||
{ "ipmip6ha.interface", "inet.tunnel.ipip", MIP6HA_INET_TUNNEL_IPIP_ENUM },
|
||||
{ "ipmip6ha.inet.pool", IP_NULL, MIP6HA_INET_POOL_ENUM },
|
||||
{ "ipmip6ha.inet.acl.homeaddress", IP_NULL, MIP6HA_INET_ACL_HOMEADDRESS_ENUM },
|
||||
{ "ipmip6ha.inet.acl.limit.homeaddress", IP_NULL, MIP6HA_INET_ACL_LIMIT_HOMEADDRESS_ENUM },
|
||||
{ "ipmip6ha.inet.acl.limit.prefix_delegation", IP_NULL, MIP6HA_INET_ACL_LIMIT_PD_ENUM },
|
||||
{ "ipmip6ha.inet.acl.pool", IP_NULL, MIP6HA_INET_ACL_POOL_ENUM },
|
||||
#endif
|
||||
|
||||
/* NEMO */
|
||||
#if defined(INCLUDE_IPMIP6HA_MOBILE_ROUTER)
|
||||
{ "ipmip6ha.mobile_router.acl.prefix_delegation", IP_NULL, MIP6HA_MOBILE_ROUTER_ACL_PD_ENUM },
|
||||
#endif
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_MOBILE_ROUTER_DUAL_STACK)
|
||||
/* DSMIPv6 NEMO */
|
||||
{ "ipmip6ha.mobile_router.inet.acl.prefix_delegation", IP_NULL, MIP6HA_MOBILE_ROUTER_INET_ACL_PD_ENUM },
|
||||
#endif
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_LMA)
|
||||
/* Proxy Mobility*/
|
||||
{ "ipmip6ha.LMA.pool", IP_NULL, MIP6HA_LMA_POOL_ENUM },
|
||||
{ "ipmip6ha.LMA.acl.prefix_delegation", IP_NULL, MIP6HA_LMA_ACL_PD_ENUM },
|
||||
{ "ipmip6ha.LMA.acl.pool", IP_NULL, MIP6HA_LMA_ACL_POOL_ENUM },
|
||||
{ "ipmip6ha.LMA.acl.limit", IP_NULL, MIP6HA_LMA_ACL_LIMIT_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.BindingRevocation", MIP6HA_LMA_REVOKE_PREVIOUS_MAG_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.tunnel.ip6ip6", MIP6HA_LMA_TUNNEL_IP6IP6_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.tunnel.gre", MIP6HA_LMA_TUNNEL_GRE_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.MinDelayBeforeBCEDelete", MIP6HA_LMA_MIN_DELAY_BEFORE_BCE_DELETE_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.MaxDelayBeforeNewBCEAssign", MIP6HA_LMA_MAX_DELAY_BEFORE_NEW_BCE_ASSIGN_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.TimestampValidityWindow", MIP6HA_LMA_TIMESTAMP_VALIDITY_WINDOW_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.MobileNodeGeneratedTimestampInUse", MIP6HA_LMA_MOBILE_NODE_GENERATED_TIMESTAMP_IN_USE_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.FixedMAGLinkLocalAddressOnAllAccessLinks", MIP6HA_LMA_FIXED_MAG_LINKLOCAL_ADDRESS_ON_ALL_ACCESS_LINKS_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.HeartBeatEnabled", MIP6HA_LMA_HEARTBEAT_ENABLED_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.HeartBeatInterval", MIP6HA_LMA_HEARTBEAT_INTERVAL_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.MissingHeartBeatsAllowed", MIP6HA_LMA_MISSING_HEARTBEATS_ALLOWED_ENUM },
|
||||
{ "ipmip6ha.LMA.MAG", IP_NULL, MIP6HA_LMA_MAG_ENUM },
|
||||
#endif
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_LMA_DHCP_SERVER)
|
||||
{ "ipmip6ha.interface", "LMA.dhcp.server", MIP6HA_LMA_DHCP_SERVER_SERVER_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.dhcp.server.preferred", MIP6HA_LMA_DHCP_SERVER_SERVER_PREFERRED_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.dhcp.server.valid", MIP6HA_LMA_DHCP_SERVER_SERVER_VALID_ENUM },
|
||||
#endif
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_LMA_DUAL_STACK)
|
||||
/* DSMIPv6 Proxy Mobility */
|
||||
{ "ipmip6ha.LMA.inet.topology.dhcp.option", IP_NULL, MIP6HA_LMA_INET_TOPOLOGY_DHCP_OPTION_ENUM },
|
||||
{ "ipmip6ha.LMA.inet.acl.homeaddress", IP_NULL, MIP6HA_LMA_INET_ACL_HOMEADDRESS_ENUM },
|
||||
{ "ipmip6ha.LMA.inet.acl.pool", IP_NULL, MIP6HA_LMA_INET_ACL_POOL_ENUM },
|
||||
|
||||
{ "ipmip6ha.interface", "LMA.inet.tunnel.ipip", MIP6HA_LMA_INET_TUNNEL_IPIP_ENUM },
|
||||
{ "ipmip6ha.interface", "LMA.inet.tunnel.gre", MIP6HA_LMA_INET_TUNNEL_GRE_ENUM },
|
||||
#endif
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_LMA_DUAL_STACK_DHCP_SERVER)
|
||||
{ "ipmip6ha.interface", "LMA.inet.dhcp.server", MIP6HA_LMA_INET_DHCP_SERVER_ENUM },
|
||||
#endif
|
||||
|
||||
|
||||
/* Configuration delimiter - DO NOT EDIT! */
|
||||
{ IP_NULL, IP_NULL, IP_NULL }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_LMA_DUAL_STACK_DHCP_SERVER)
|
||||
extern void ipmip6ha_pmipv6_dhcpv4_install(void *);
|
||||
#endif
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_LMA_DHCP_SERVER)
|
||||
extern void ipmip6ha_pmipv6_dhcpv6_install(void *);
|
||||
#endif
|
||||
|
||||
extern void ipmip6ha_pmipv6_linklocal_install(void *);
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_FEATURE_EXTENSION)
|
||||
extern void MIP6HA_FEATURE_INITIALIZATION_HOOK(void *);
|
||||
#endif
|
||||
|
||||
Ipmip6ha_config_func_t ipmip6ha_service_registrations[] =
|
||||
{
|
||||
#if defined(INCLUDE_IPMIP6HA_LMA_DUAL_STACK_DHCP_SERVER)
|
||||
ipmip6ha_pmipv6_dhcpv4_install,
|
||||
#endif
|
||||
#if defined(INCLUDE_IPMIP6HA_LMA_DHCP_SERVER)
|
||||
ipmip6ha_pmipv6_dhcpv6_install,
|
||||
#endif
|
||||
|
||||
ipmip6ha_pmipv6_linklocal_install,
|
||||
|
||||
#if defined(INCLUDE_IPMIP6HA_FEATURE_EXTENSION)
|
||||
MIP6HA_FEATURE_INITIALIZATION_HOOK,
|
||||
#endif
|
||||
IP_NULL
|
||||
};
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 9 PUBLIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* ipmip6ha_configure
|
||||
*===========================================================================
|
||||
* Description:
|
||||
* Parameters:
|
||||
* Returns:
|
||||
*
|
||||
*/
|
||||
IP_PUBLIC Ip_err ipmip6ha_configure(void);
|
||||
IP_PUBLIC Ip_err
|
||||
ipmip6ha_configure(void)
|
||||
{
|
||||
/* Initialize IPMIPMN system variables. */
|
||||
/* Initialize IPMIPMN system variables. */
|
||||
if (ipcom_sysvar_setv(ipmip6ha_conf_sysvar, 0) == IPCOM_SUCCESS)
|
||||
{
|
||||
/* now configure the interface-specific sysvars */
|
||||
#ifdef INCLUDE_IPMIP6HA
|
||||
return ipcom_sysvar_ext_setv (ipmip6ha_conf_sysvar_ext, 0);
|
||||
#else
|
||||
return IPCOM_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
return IPCOM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* ipmip6ha_init
|
||||
*===========================================================================
|
||||
* Description:
|
||||
* Parameters:
|
||||
* Returns:
|
||||
*
|
||||
*/
|
||||
IP_PUBLIC Ip_err ipmip6ha_init(void);
|
||||
IP_PUBLIC Ip_err
|
||||
ipmip6ha_init(void)
|
||||
{
|
||||
#if defined(INCLUDE_IPMIP6HA_CMD) && !defined(IP_PORT_LAS)
|
||||
ipcom_shell_add_cmd("ha6", "ha6 <command> [modifiers]", "Mobile IPv6 Home Agent",
|
||||
ipmip6ha_cmd_ha6,
|
||||
IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_SMALL);
|
||||
#endif
|
||||
return IPCOM_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* ipmip6ha_exit
|
||||
*===========================================================================
|
||||
* Description:
|
||||
* Parameters:
|
||||
* Returns:
|
||||
*
|
||||
*/
|
||||
IP_PUBLIC Ip_err ipmip6ha_exit(void);
|
||||
IP_PUBLIC Ip_err
|
||||
ipmip6ha_exit(void)
|
||||
{
|
||||
#if defined(INCLUDE_IPMIP6HA_CMD) && !defined(IP_PORT_LAS)
|
||||
/* Remove the shell command */
|
||||
ipcom_shell_remove_cmd("ha6", ipmip6ha_cmd_ha6);
|
||||
#endif
|
||||
return IPCOM_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* INTERPEAK CONFIGURATION HEADER FILE
|
||||
*
|
||||
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6ha_config.h,v $ $Revision: 1.7 $
|
||||
* $Source: /home/interpeak/CVSRoot/ipmip6ha/config/ipmip6ha_config.h,v $
|
||||
* $Author: jhorteli $ $Date: 2009-03-02 11:45:07 $
|
||||
* $State: Exp $ $Locker: $
|
||||
*
|
||||
* INTERPEAK_COPYRIGHT_STRING
|
||||
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
||||
******************************************************************************
|
||||
*/
|
||||
#ifndef IPMIP6HA_CONFIG_H
|
||||
#define IPMIP6HA_CONFIG_H
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include "ipmip6_config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#define IPMIP6HA_PENDING_TIMEOUT 10
|
||||
|
||||
#ifdef IP_DEBUG
|
||||
#define IPMIP6HA_EVENT_BACKLOG 300
|
||||
#else
|
||||
#define IPMIP6HA_EVENT_BACKLOG 100
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
struct Ipmip6ha_context;
|
||||
struct Ipmip_proc;
|
||||
|
||||
typedef void (*Ipmip6ha_service_install_t)
|
||||
(
|
||||
struct Ipmip6ha_context *ctx
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/* Callbacks */
|
||||
extern Ipmip6ha_service_install_t ipmip6ha_service_registrations[];
|
||||
|
||||
IP_PUBLIC Ip_err ipmip6ha_configure(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
@@ -0,0 +1,169 @@
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INTERPEAK SOURCE FILE
|
||||
*
|
||||
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6ha_pktbuf.c,v $ $Revision: 1.6 $
|
||||
* $Source: /home/interpeak/CVSRoot/ipmip6ha/config/ipmip6ha_pktbuf.c,v $
|
||||
* $Author: jhorteli $
|
||||
* $State: Exp $ $Locker: $
|
||||
*
|
||||
* INTERPEAK_COPYRIGHT_STRING
|
||||
* Design and implementation by Joel Hortelius <joel.hortelis@interpeak.se>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 CONFIGURATION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include "ipmip6ha_config.h"
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#define IPCOM_USE_CLIB_PROTO
|
||||
#include <ipcom_clib.h>
|
||||
#include <ipcom_err.h>
|
||||
#include <ipcom_hash.h>
|
||||
#include <ipcom_inet.h>
|
||||
#include <ipcom_ipd.h>
|
||||
#include <ipcom_list.h>
|
||||
#include <ipcom_os.h>
|
||||
#include <ipcom_sock.h>
|
||||
#include <ipcom_sock2.h>
|
||||
#include <ipcom_syslog.h>
|
||||
#include <ipcom_sysvar.h>
|
||||
|
||||
#include <ipmip.h>
|
||||
#include <private/ipmip_sysvar.h>
|
||||
|
||||
#include <ipmip6.h>
|
||||
#include <private/ipmip6_pkt.h>
|
||||
#include <private/ipmip6_context.h>
|
||||
#include <private/ipmip6_util.h>
|
||||
|
||||
#include "ipmip6ha_h.h"
|
||||
#include "ipmip6ha_pktbuf.h"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 6 EXTERN PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 7 LOCAL PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 8 DATA
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 9 STATIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 10 GLOBAL FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* ipmip6ha_pktbuf_alloc
|
||||
*===========================================================================
|
||||
* Description: Allocate a packet buffer
|
||||
* Parameters:
|
||||
* Returns: A newly allocated packet buffer
|
||||
*
|
||||
*/
|
||||
IP_GLOBAL Ipmip_pktbuf_t *
|
||||
ipmip6ha_pktbuf_alloc(Ipmip6ha_context_t *ctx,
|
||||
Ipmip_proc_t *proc,
|
||||
Ip_size_t extra)
|
||||
{
|
||||
Ipmip6ha_pktbuf_t *pbuf;
|
||||
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
|
||||
pbuf = ipcom_calloc(1, sizeof(Ipmip6ha_pktbuf_t) + extra);
|
||||
if (pbuf)
|
||||
{
|
||||
ipmip_buffer_init(&pbuf->mo_reply);
|
||||
pbuf->ipmip6.ipmip.pktend = (void *) (pbuf + 1);
|
||||
return &pbuf->ipmip6.ipmip;
|
||||
}
|
||||
|
||||
return IP_NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* ipmip6ha_pktbuf_free
|
||||
*===========================================================================
|
||||
* Description: Free a packet buffer
|
||||
* Parameters: pbuf - The packet buffer
|
||||
* Returns:
|
||||
*
|
||||
*/
|
||||
IP_GLOBAL void
|
||||
ipmip6ha_pktbuf_free(Ipmip6ha_context_t *ctx,
|
||||
Ipmip_proc_t *proc,
|
||||
Ipmip6ha_pktbuf_t *pbuf)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
|
||||
ipmip_buffer_release(&pbuf->mo_reply);
|
||||
|
||||
/* Free the data */
|
||||
ipcom_free(pbuf);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 11 PUBLIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
@@ -0,0 +1,171 @@
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* HEADER FILE
|
||||
*
|
||||
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6ha_pktbuf.h,v $ $Revision: 1.13 $
|
||||
* $Source: /home/interpeak/CVSRoot/ipmip6ha/config/ipmip6ha_pktbuf.h,v $
|
||||
* $Author: jhorteli $ $Date: 2010-03-30 15:00:37 $
|
||||
* $State: Exp $ $Locker: $
|
||||
*
|
||||
* INTERPEAK_COPYRIGHT_STRING
|
||||
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
||||
******************************************************************************
|
||||
*/
|
||||
#ifndef IPMIP6HA_PKTBUF_H
|
||||
#define IPMIP6HA_PKTBUF_H
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 CONFIGURATION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include <private/ipmip6_pkt.h>
|
||||
#include <private/ipmip6_mh_pkt.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
struct Ipmip6ha_if;
|
||||
struct Ipmip6_if;
|
||||
struct Ipmip6ha_context;
|
||||
struct Ipmip6ha_mag;
|
||||
|
||||
typedef struct Ipmip6ha_pktbuf_pktinfo
|
||||
{
|
||||
Ip_u32 mip6BindingCOAType;
|
||||
union Ipmip6_mib_InetAddress mip6BindingCOA;
|
||||
Ip_u16 mip6BindingUDPEncapPort;
|
||||
Ip_bool mip6BindingUDPEncapsulate;
|
||||
|
||||
Ip_bool mip6BindingCOANAT;
|
||||
|
||||
Ip_u32 mip6BindingHomeAddressType;
|
||||
union Ipmip6_mib_InetAddress mip6BindingHomeAddress;
|
||||
|
||||
Ip_u8 iperr;
|
||||
Ip_u8 haMobilityError;
|
||||
Ip_u8 haMobilityBindingTunnelingType;
|
||||
Ip_u8 haMobilityBindingSuccessCode;
|
||||
|
||||
Ip_time_t haBindingLastUpdated;
|
||||
Ip_u16 haMobilityBindingTimeGranted;
|
||||
Ip_u16 haMobilityBindingSequenceNumber;
|
||||
Ip_u16 haMobilityReason;
|
||||
Ip_u16 haMobilityBindingFlags;
|
||||
|
||||
|
||||
Ip_time_t haMobilityPrefixValid;
|
||||
Ip_time_t haMobilityPrefixTimestamp;
|
||||
|
||||
|
||||
Ip_bool haMobilityDeregistration;
|
||||
Ip_bool haMobilitySelectiveDeregistration;
|
||||
Ip_bool haMobilityRefreshRequest;
|
||||
} Ipmip6ha_pktbuf_pktinfo_t;
|
||||
|
||||
typedef struct Ipmip6ha_pktbuf
|
||||
{
|
||||
Ipmip6_pktbuf_t ipmip6;
|
||||
|
||||
Ip_u32 state;
|
||||
Ip_bool update_services;
|
||||
Ip_bool refresh_request;
|
||||
|
||||
Ip_u32 extensions_processed;
|
||||
|
||||
/* The arriving interface */
|
||||
union
|
||||
{
|
||||
struct Ipmip6ha_if *priv;
|
||||
struct Ipmip6_if *pub;
|
||||
} iff_home;
|
||||
|
||||
union
|
||||
{
|
||||
struct Ipmip6ha_if *priv;
|
||||
struct Ipmip6_if *pub;
|
||||
} iff_transport;
|
||||
|
||||
Ipmip_buffer_t mo_reply;
|
||||
Ipmip6ha_pktbuf_pktinfo_t pktinfo;
|
||||
|
||||
void **extensions;
|
||||
} Ipmip6ha_pktbuf_t;
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 6 FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* ipmip6ha_pktbuf_alloc
|
||||
*===========================================================================
|
||||
* Description: Allocate a packet buffer
|
||||
* Parameters: ctx - Context
|
||||
* proc - Process
|
||||
* Returns: A newly allocated packet buffer
|
||||
*
|
||||
*/
|
||||
IP_GLOBAL Ipmip_pktbuf_t *ipmip6ha_pktbuf_alloc(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
Ip_size_t extra);
|
||||
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* ipmip6ha_pktbuf_free
|
||||
*===========================================================================
|
||||
* Description: Free a packet buffer
|
||||
* Parameters: ctx - Context
|
||||
* proc - Process
|
||||
* pbuf - The packet buffer
|
||||
* Returns:
|
||||
*
|
||||
*/
|
||||
IP_GLOBAL void ipmip6ha_pktbuf_free(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
Ipmip6ha_pktbuf_t *pbuf);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
@@ -0,0 +1,504 @@
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INTERPEAK SOURCE FILE
|
||||
*
|
||||
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6ha_pmipv6_dhcpv4.c,v $ $Revision: 1.7 $
|
||||
* $Source: /home/interpeak/CVSRoot/ipmip6ha/config/ipmip6ha_pmipv6_dhcpv4.c,v $
|
||||
* $Author: jhorteli $
|
||||
* $State: Exp $ $Locker: $
|
||||
*
|
||||
* INTERPEAK_COPYRIGHT_STRING
|
||||
* Design and implementation by Joel Hortelius <joel.hortelis@interpeak.se>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 CONFIGURATION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include "ipmip6ha_config.h"
|
||||
|
||||
#if defined(IPMIP_USE_INET)
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#define IPCOM_USE_CLIB_PROTO
|
||||
#include <ipcom_clib.h>
|
||||
#include <ipcom_err.h>
|
||||
#include <ipcom_hash.h>
|
||||
#include <ipcom_inet.h>
|
||||
#include <ipcom_ipd.h>
|
||||
#include <ipcom_list.h>
|
||||
#include <ipcom_os.h>
|
||||
#include <ipcom_sock.h>
|
||||
#include <ipcom_sock2.h>
|
||||
#include <ipcom_syslog.h>
|
||||
#include <ipcom_sysvar.h>
|
||||
#include <ipcom_strlib.h>
|
||||
|
||||
#include <ipmip.h>
|
||||
#include <private/ipmip_sysvar.h>
|
||||
#include <private/ipmip_dhcp.h>
|
||||
|
||||
#include <ipmip6.h>
|
||||
#include <private/ipmip6_context.h>
|
||||
#include <private/ipmip6_netlink.h>
|
||||
#include <private/ipmip6_if.h>
|
||||
#include <private/ipmip6_icmp.h>
|
||||
#include <private/ipmip6_util.h>
|
||||
|
||||
#include "ipmip6ha_h.h"
|
||||
#include "ipmip6ha_attr_h.h"
|
||||
#include "ipmip6ha_if.h"
|
||||
#include "ipmip6ha_node.h"
|
||||
#include "ipmip6ha_pktbuf.h"
|
||||
#include "ipmip6ha_nemo.h"
|
||||
#include "ipmip6ha_nemo_dsmipv6.h"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
#define IPMIP6HA_PMIPV6_DHCPV4_SERVER "DHCPV4-SERVER"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
typedef struct Ipmip6ha_pmipv6_dhcpv4_config
|
||||
{
|
||||
Ip_bool enabled;
|
||||
} Ipmip6ha_pmipv6_dhcpv4_config_t;
|
||||
|
||||
typedef struct Ipmip6ha_pmipv6_dhcpv4_config_global
|
||||
{
|
||||
Ip_bool enabled;
|
||||
} Ipmip6ha_pmipv6_dhcpv4_config_global_t;
|
||||
|
||||
typedef struct Ipmip6ha_pmipv6_dhcpv4_node
|
||||
{
|
||||
Ipmip_dhcp_node_t dhcp;
|
||||
Ip_bool installed;
|
||||
} Ipmip6ha_pmipv6_dhcpv4_node_t;
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 6 EXTERN PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 7 LOCAL PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
/*
|
||||
****************************************************************************
|
||||
* 8 DATA
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 9 STATIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
IP_STATIC int
|
||||
ipmip6ha_pmipv6_dhcpv4_server(int event,
|
||||
Ipmip6ha_context_t *ctx,
|
||||
Ipmip_proc_t *proc,
|
||||
Ipmip6ha_pmipv6_dhcpv4_node_t *dnode,
|
||||
Ipmip6ha_pktbuf_t *pbuf)
|
||||
{
|
||||
if (event == IPMIP_TIMER_EVENT_RUN)
|
||||
{
|
||||
Ipmip6ha_node_t *node = dnode->dhcp.opaque;
|
||||
Ipmip_dhcp_hdr_t *pkt = (Ipmip_dhcp_hdr_t *)IPMIP_BUFFER_PTR(&pbuf->ipmip6.ipmip.packet);
|
||||
|
||||
if (pkt->op == IPMIP_DHCP_OP_BOOTREQUEST)
|
||||
{
|
||||
Ip_u8 *opt;
|
||||
|
||||
/**/
|
||||
if ((opt = ipmip_dhcp_option_buffer_find(&pbuf->ipmip6.ipmip.packet, IPMIP_DHCP_OPTCODE_DHCP_MESSAGE_TYPE)) == IP_NULL)
|
||||
{
|
||||
IPMIP6_EVENT_IF(ERR, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"No MESSAGE TYPE in DHCP Request Received by %s",
|
||||
ipmip6ha_node_describe(proc, node)));
|
||||
goto done_out;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Ipmip6ha_pktbuf_t *rpkt = (Ipmip6ha_pktbuf_t*)ipmip_pktbuf_alloc(&ctx->ipmip6.ipmip, proc, 512);
|
||||
Ipmip_buffer_t *buf = &rpkt->ipmip6.ipmip.packet;
|
||||
Ip_u8 type;
|
||||
Ip_u8 *ra_opt = ipmip_dhcp_option_buffer_find(&pbuf->ipmip6.ipmip.packet, IPMIP_DHCP_OPTCODE_RELAY_AGENT_INFO);
|
||||
Ip_u8 *req_opt = ipmip_dhcp_option_buffer_find(&pbuf->ipmip6.ipmip.packet, IPMIP_DHCP_OPTCODE_DHCP_PARAMETER_REQUEST_LIST);
|
||||
Ip_u32 tmp32;
|
||||
Ip_u32 override = 0;
|
||||
|
||||
|
||||
/* Do we have a override option? */
|
||||
if (ra_opt)
|
||||
{
|
||||
Ip_u8 *oopt = ipmip_dhcp_option_find(&ra_opt[IPMIP_DHCP_OPT_DATA], ra_opt[IPMIP_DHCP_OPT_LEN], IPMIP_DHCP_SUBOPTCODE_RA_SERVER_OVERRIDE);
|
||||
if (oopt)
|
||||
override = IP_GET_32ON8(&oopt[IPMIP_DHCP_OPT_DATA]);
|
||||
}
|
||||
|
||||
/* Add the packet */
|
||||
ipmip_buffer_append(buf, pkt, sizeof(*pkt));
|
||||
|
||||
|
||||
switch(opt[IPMIP_DHCP_OPT_DATA])
|
||||
{
|
||||
case IPMIP_DHCP_MSG_DISCOVER:
|
||||
IPMIP6_EVENT_IF(INFO, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"DHCP Discover Received by %s",
|
||||
ipmip6ha_node_describe(proc, node)));
|
||||
type = IPMIP_DHCP_MSG_OFFER;
|
||||
break;
|
||||
|
||||
case IPMIP_DHCP_MSG_REQUEST:
|
||||
{
|
||||
Ip_u32 sid = 0;
|
||||
Ip_u32 req_addr = 0;
|
||||
|
||||
IPMIP6_EVENT_IF(INFO, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"DHCP Request Received by %s",
|
||||
ipmip6ha_node_describe(proc, node)));
|
||||
|
||||
sid = ipmip_dhcp_option_buffer_find_ip(&pbuf->ipmip6.ipmip.packet,
|
||||
IPMIP_DHCP_OPTCODE_DHCP_SERVER_IDENTIFIER);
|
||||
req_addr = ipmip_dhcp_option_buffer_find_ip(&pbuf->ipmip6.ipmip.packet,
|
||||
IPMIP_DHCP_OPTCODE_DHCP_REQUESTED_ADDRESS);
|
||||
|
||||
if (req_addr == 0)
|
||||
req_addr = IP_GET_32ON8(&pkt->ciaddr);
|
||||
|
||||
if (sid != 0 && sid != node->ifp_home->ifaddr_v4)
|
||||
{
|
||||
if (override == 0 || sid != override)
|
||||
goto done_out;
|
||||
}
|
||||
|
||||
if (req_addr != 0 && req_addr == dnode->dhcp.remote_id)
|
||||
type = IPMIP_DHCP_MSG_ACK;
|
||||
else
|
||||
type = IPMIP_DHCP_MSG_NAK;
|
||||
}
|
||||
break;
|
||||
case IPMIP_DHCP_MSG_DECLINE:
|
||||
/* Do what? */
|
||||
IPMIP6_EVENT_IF(INFO, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"DHCP Decline Received by %s",
|
||||
ipmip6ha_node_describe(proc, node)));
|
||||
goto done_out;
|
||||
|
||||
case IPMIP_DHCP_MSG_RELEASE:
|
||||
/* Do what? */
|
||||
IPMIP6_EVENT_IF(INFO, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"DHCP Release Received by %s",
|
||||
ipmip6ha_node_describe(proc, node)));
|
||||
goto done_out;
|
||||
|
||||
case IPMIP_DHCP_MSG_INFORM:
|
||||
/* Do what? */
|
||||
IPMIP6_EVENT_IF(INFO, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"DHCP Inform Received by %s",
|
||||
ipmip6ha_node_describe(proc, node)));
|
||||
if (IP_GET_32ON8(&pkt->ciaddr) == dnode->dhcp.remote_id)
|
||||
type = IPMIP_DHCP_MSG_INFORM_ACK;
|
||||
else
|
||||
type = IPMIP_DHCP_MSG_NAK;
|
||||
break;
|
||||
default:
|
||||
IPMIP6_EVENT_IF(INFO, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"DHCP unknown Received by %s",
|
||||
ipmip6ha_node_describe(proc, node)));
|
||||
goto done_out;
|
||||
}
|
||||
|
||||
/* Add TYPE */
|
||||
ipmip_dhcp_option_buffer_append_u8(buf, IPMIP_DHCP_OPTCODE_DHCP_MESSAGE_TYPE, type);
|
||||
ipmip_dhcp_option_buffer_append_ip(buf, IPMIP_DHCP_OPTCODE_DHCP_SERVER_IDENTIFIER, override? override : node->ifp_home->ifaddr_v4);
|
||||
|
||||
/**/
|
||||
if (type != IPMIP_DHCP_MSG_NAK)
|
||||
{
|
||||
/* ACK or INFORM_ACK */
|
||||
if (type != IPMIP_DHCP_MSG_INFORM_ACK)
|
||||
{
|
||||
#ifndef IPTESTENGINE
|
||||
ipmip_dhcp_option_buffer_append_u32(buf, IPMIP_DHCP_OPTCODE_DHCP_LEASE_TIME, node->mip6BindingCacheEntry.mip6BindingTimeRemaining);
|
||||
#else
|
||||
ipmip_dhcp_option_buffer_append_u32(buf, IPMIP_DHCP_OPTCODE_DHCP_LEASE_TIME, 5);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Add the basic options */
|
||||
{
|
||||
Ipmip6ha_nemo_dsmipv6_config_t *cfg = ipmip6ha_nemo_dsmipv6_subnet_config_get(ctx, proc, node->ifp_home->nemo->nemo_dsmipv6, dnode->dhcp.remote_id);
|
||||
if (cfg != IP_NULL)
|
||||
{
|
||||
Ipmip6ha_nemo_dsmipv6_config_t *ncfg;
|
||||
Ipmip_dhcp_option_t *dopt;
|
||||
|
||||
if (req_opt != IP_NULL)
|
||||
{
|
||||
for (tmp32 = 0; tmp32 < req_opt[IPMIP_DHCP_OPT_LEN]; tmp32++)
|
||||
{
|
||||
for (ncfg = cfg; ncfg != IP_NULL; ncfg = ncfg->parent)
|
||||
{
|
||||
dopt = ipmip_dhcp_option_entry_find(&ncfg->opts, req_opt[IPMIP_DHCP_OPT_DATA + tmp32]);
|
||||
if (dopt != IP_NULL)
|
||||
{
|
||||
ipmip_dhcp_buffer_append_option_entry(buf, dopt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (ncfg = cfg; ncfg != IP_NULL; ncfg = ncfg->parent)
|
||||
{
|
||||
for (dopt = IPCOM_LIST_FIRST(&ncfg->opts); dopt != IP_NULL; dopt = IPCOM_LIST_NEXT(&dopt->next))
|
||||
ipmip_dhcp_buffer_append_option_entry(buf, dopt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* NAK */
|
||||
}
|
||||
|
||||
/* Restore the RA_OPT */
|
||||
if (ra_opt)
|
||||
ipmip_dhcp_option_buffer_append(buf, IPMIP_DHCP_OPTCODE_RELAY_AGENT_INFO, ra_opt[IPMIP_DHCP_OPT_LEN], &ra_opt[IPMIP_DHCP_OPT_DATA]);
|
||||
|
||||
ipmip_dhcp_option_buffer_close(buf);
|
||||
|
||||
pkt = (Ipmip_dhcp_hdr_t *)IPMIP_BUFFER_PTR(buf);
|
||||
pkt->op = IPMIP_DHCP_OP_BOOTREPLY;
|
||||
pkt->hops = 0;
|
||||
|
||||
if (type != IPMIP_DHCP_MSG_NAK && type != IPMIP_DHCP_MSG_INFORM_ACK)
|
||||
IP_SET_32ON8(&pkt->yiaddr, dnode->dhcp.remote_id);
|
||||
|
||||
/* Send */
|
||||
tmp32 = IP_GET_32ON8(&pkt->giaddr);
|
||||
if (tmp32 == 0)
|
||||
tmp32 = dnode->dhcp.remote_id;
|
||||
|
||||
/* Always assume unicast; unicast renew will be tunneled */
|
||||
ipmip_dhcp_server_reply(&ctx->ipmip6.ipmip, proc, &rpkt->ipmip6.ipmip, node->ifp_home->ifaddr_v4, IP_NULL, IP_FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IPMIP6_EVENT_IF(ERR, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"DHCP Reply Received for %s",
|
||||
ipmip6ha_node_describe(proc, node)));
|
||||
}
|
||||
}
|
||||
|
||||
done_out:
|
||||
/* Free the DHCP packet */
|
||||
ipmip_pktbuf_release(&ctx->ipmip6.ipmip, proc, &pbuf->ipmip6.ipmip);
|
||||
return IPMIP_TIMER_RET_DONE;
|
||||
}
|
||||
|
||||
IP_STATIC void
|
||||
ipmip6ha_pmipv6_dhcpv4_config(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
struct Ipmip6ha_if *ifp,
|
||||
Ipmip6ha_pmipv6_dhcpv4_config_global_t *gcfg,
|
||||
Ipmip6ha_pmipv6_dhcpv4_config_t *cfg,
|
||||
Ipmip_cli_message_t *request)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
IPMIP_UNUSED_PARAMETER(ifp);
|
||||
|
||||
if (action == IPMIP_CALLBACK_CONFIG_READ)
|
||||
{
|
||||
cfg->enabled = ipmip_sysvar_bool(gcfg->enabled, "ipmip6ha.interface.%s.LMA.inet.dhcp.server", ifp->ipmip6.iff.ifname);
|
||||
if (cfg->enabled)
|
||||
ipmip_dhcp_context_create(&ctx->ipmip6.ipmip, proc);
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_FREE)
|
||||
{
|
||||
/**/
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_DUMP)
|
||||
{
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.interface.%s.LMA.inet.dhcp.server=%s",
|
||||
ifp->ipmip6.iff.ifname, cfg->enabled? "enabled" : "disabled");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IP_STATIC void
|
||||
ipmip6ha_pmipv6_dhcpv4_config_global(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
Ipmip6ha_pmipv6_dhcpv4_config_global_t *gcfg,
|
||||
Ipmip_cli_message_t *request)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
|
||||
if (action == IPMIP_CALLBACK_CONFIG_READ)
|
||||
{
|
||||
gcfg->enabled = ipmip_sysvar_bool(IP_FALSE, "ipmip6ha.LMA.inet.dhcp.server");
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_FREE)
|
||||
{
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_DUMP)
|
||||
{
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.LMA.inet.dhcp.server=%s",
|
||||
gcfg->enabled? "enabled" : "disabled");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IP_STATIC int
|
||||
ipmip6ha_pmipv6_dhcpv4_provide(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
void *gcfg,
|
||||
Ipmip6ha_pmipv6_dhcpv4_config_t *cfg,
|
||||
Ipmip6ha_pmipv6_dhcpv4_node_t *handle,
|
||||
struct Ipmip6ha_node_P *node,
|
||||
struct Ipmip_timer *service)
|
||||
{
|
||||
Ipmip6ha_nemo_dsmipv6_t *nemo;
|
||||
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
IPMIP_UNUSED_PARAMETER(service);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (cfg->enabled)
|
||||
{
|
||||
if (action == IPMIP_CALLBACK_ENABLE)
|
||||
{
|
||||
nemo = IPCOM_LIST_FIRST(&node->node.nemo_hoa_v4);
|
||||
if (nemo != IP_NULL)
|
||||
{
|
||||
handle->dhcp.remote_id = nemo->prefix;
|
||||
|
||||
handle->dhcp.lock = node->node.lock;
|
||||
handle->dhcp.opaque = node;
|
||||
|
||||
handle->dhcp.process_func = (Ipmip_timer_func_t)ipmip6ha_pmipv6_dhcpv4_server;
|
||||
ipmip_dhcp_register(&ctx->ipmip6.ipmip, proc, &handle->dhcp);
|
||||
|
||||
handle->installed = IP_TRUE;
|
||||
}
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_DISABLE || action == IPMIP_CALLBACK_UPDATE)
|
||||
{
|
||||
if (handle->installed)
|
||||
{
|
||||
ipmip_dhcp_unregister(&ctx->ipmip6.ipmip, proc, &handle->dhcp);
|
||||
handle->installed = IP_FALSE;
|
||||
}
|
||||
|
||||
if (action == IPMIP_CALLBACK_UPDATE)
|
||||
return IPMIP_CALLBACK_RET_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Don't delay */
|
||||
return IPMIP_CALLBACK_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 10 GLOBAL FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
IP_GLOBAL void ipmip6ha_pmipv6_dhcpv4_install(struct Ipmip6ha_context *ctx);
|
||||
IP_GLOBAL void
|
||||
ipmip6ha_pmipv6_dhcpv4_install(struct Ipmip6ha_context *ctx)
|
||||
{
|
||||
static Ipmip6ha_extension_t srv;
|
||||
|
||||
ipcom_memset(&srv, 0, sizeof(srv));
|
||||
|
||||
srv.name = IPMIP6HA_PMIPV6_DHCPV4_SERVER;
|
||||
srv.ifp_data_size = sizeof(Ipmip6ha_pmipv6_dhcpv4_config_t);
|
||||
srv.global_data_size= sizeof(Ipmip6ha_pmipv6_dhcpv4_config_global_t);
|
||||
srv.node_data_size = sizeof(Ipmip6ha_pmipv6_dhcpv4_node_t);
|
||||
|
||||
srv.config_global = (Ipmip6ha_extension_config_global_t)ipmip6ha_pmipv6_dhcpv4_config_global;
|
||||
srv.config_ifp = (Ipmip6ha_extension_config_ifp_t)ipmip6ha_pmipv6_dhcpv4_config;
|
||||
srv.provide = (Ipmip6ha_extension_provide_t)ipmip6ha_pmipv6_dhcpv4_provide;
|
||||
|
||||
/* This is a PMIP only feature */
|
||||
ipmip6ha_context_register_extension(ctx, &srv, IP_FALSE, IP_TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 11 PUBLIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
#else
|
||||
IP_GLOBAL void ipmip6ha_pmipv6_dhcpv4_install(struct Ipmip6ha_context *ctx);
|
||||
IP_GLOBAL void
|
||||
ipmip6ha_pmipv6_dhcpv4_install(struct Ipmip6ha_context *ctx)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,353 @@
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INTERPEAK SOURCE FILE
|
||||
*
|
||||
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6ha_pmipv6_dhcpv6.c,v $ $Revision: 1.12.16.1 $
|
||||
* $Source: /home/interpeak/CVSRoot/ipmip6ha/config/ipmip6ha_pmipv6_dhcpv6.c,v $
|
||||
* $Author: jhorteli $
|
||||
* $State: Exp $ $Locker: $
|
||||
*
|
||||
* INTERPEAK_COPYRIGHT_STRING
|
||||
* Design and implementation by Joel Hortelius <joel.hortelis@interpeak.se>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 CONFIGURATION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include "ipmip6ha_config.h"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#define IPCOM_USE_CLIB_PROTO
|
||||
#include <ipcom_clib.h>
|
||||
#include <ipcom_err.h>
|
||||
#include <ipcom_hash.h>
|
||||
#include <ipcom_inet.h>
|
||||
#include <ipcom_ipd.h>
|
||||
#include <ipcom_list.h>
|
||||
#include <ipcom_os.h>
|
||||
#include <ipcom_sock.h>
|
||||
#include <ipcom_sock2.h>
|
||||
#include <ipcom_syslog.h>
|
||||
#include <ipcom_sysvar.h>
|
||||
#include <ipcom_strlib.h>
|
||||
|
||||
|
||||
#include <ipmip.h>
|
||||
#include <private/ipmip_sysvar.h>
|
||||
#include <private/ipmip_dhcp6.h>
|
||||
|
||||
#include <ipmip6.h>
|
||||
#include <private/ipmip6_context.h>
|
||||
#include <private/ipmip6_netlink.h>
|
||||
#include <private/ipmip6_if.h>
|
||||
#include <private/ipmip6_icmp.h>
|
||||
#include <private/ipmip6_util.h>
|
||||
|
||||
#include "ipmip6ha_h.h"
|
||||
#include "ipmip6ha_attr_h.h"
|
||||
#include "ipmip6ha_if.h"
|
||||
#include "ipmip6ha_node.h"
|
||||
#include "ipmip6ha_pktbuf.h"
|
||||
#include "ipmip6ha_nemo.h"
|
||||
|
||||
#ifdef IPDHCPS6
|
||||
|
||||
#include <ipdhcps6.h>
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
#define IPMIP6HA_PMIPV6_DHCPV6_SERVER "DHCPV6-SERVER"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
typedef struct Ipmip6ha_pmipv6_dhcpv6_config_global
|
||||
{
|
||||
Ip_bool enabled;
|
||||
Ip_u32 preferred;
|
||||
Ip_u32 valid;
|
||||
} Ipmip6ha_pmipv6_dhcpv6_config_global_t;
|
||||
|
||||
|
||||
typedef struct Ipmip6ha_pmipv6_dhcpv6_config
|
||||
{
|
||||
Ip_bool enabled;
|
||||
Ip_u32 preferred;
|
||||
Ip_u32 valid;
|
||||
} Ipmip6ha_pmipv6_dhcpv6_config_t;
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 6 EXTERN PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 7 LOCAL PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 8 DATA
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 9 STATIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
IP_STATIC void
|
||||
ipmip6ha_pmipv6_dhcpv6_config_global(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
Ipmip6ha_pmipv6_dhcpv6_config_global_t *gcfg,
|
||||
Ipmip_cli_message_t *request)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (action == IPMIP_CALLBACK_CONFIG_READ)
|
||||
{
|
||||
gcfg->enabled = ipmip_sysvar_bool(IP_FALSE, "ipmip6ha.LMA.dhcp.server");
|
||||
gcfg->preferred = ipmip_sysvar_u32(10000, "ipmip6ha.LMA.dhcp.server.preferred");
|
||||
gcfg->valid = ipmip_sysvar_u32(10000, "ipmip6ha.LMA.dhcp.server.valid");
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_FREE)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_DUMP)
|
||||
{
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.LMA.dhcp.server=%s",
|
||||
gcfg->enabled? "enabled" : "disabled");
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.LMA.dhcp.server.valid=%u",
|
||||
gcfg->valid);
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.LMA.dhcp.server.preferred=%u",
|
||||
gcfg->preferred);
|
||||
}
|
||||
}
|
||||
|
||||
IP_STATIC void
|
||||
ipmip6ha_pmipv6_dhcpv6_config(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
struct Ipmip6ha_if *ifp,
|
||||
Ipmip6ha_pmipv6_dhcpv6_config_global_t *gcfg,
|
||||
Ipmip6ha_pmipv6_dhcpv6_config_t *cfg,
|
||||
Ipmip_cli_message_t *request)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
IPMIP_UNUSED_PARAMETER(ifp);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (action == IPMIP_CALLBACK_CONFIG_READ)
|
||||
{
|
||||
cfg->enabled = ipmip_sysvar_bool(gcfg->enabled, "ipmip6ha.interface.%s.LMA.dhcp.server", ifp->ipmip6.iff.ifname);
|
||||
cfg->preferred = ipmip_sysvar_u32(gcfg->preferred, "ipmip6ha.interface.%s.LMA.dhcp.server.preferred", ifp->ipmip6.iff.ifname);
|
||||
cfg->valid = ipmip_sysvar_u32(gcfg->valid, "ipmip6ha.interface.%s.LMA.dhcp.server.valid", ifp->ipmip6.iff.ifname);
|
||||
|
||||
if (cfg->enabled)
|
||||
ipmip_dhcp6_embedded_server_start(&ctx->ipmip6.ipmip, proc, ifp->ipmip6.iff.ifname);
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_FREE)
|
||||
{
|
||||
/* Do nothing */
|
||||
if (cfg->enabled)
|
||||
ipmip_dhcp6_embedded_server_stop(&ctx->ipmip6.ipmip, proc);
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_DUMP)
|
||||
{
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.interface.%s.LMA.dhcp.server=%s",
|
||||
ifp->ipmip6.iff.ifname, cfg->enabled? "enabled" : "disabled");
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.interface.%s.LMA.dhcp.server.valid=%u",
|
||||
ifp->ipmip6.iff.ifname, cfg->valid);
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.interface.%s.LMA.dhcp.server.preferred=%u",
|
||||
ifp->ipmip6.iff.ifname, cfg->preferred);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IP_STATIC int
|
||||
ipmip6ha_pmipv6_dhcpv6_provide(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
Ipmip6ha_pmipv6_dhcpv6_config_global_t *gcfg,
|
||||
Ipmip6ha_pmipv6_dhcpv6_config_t *cfg,
|
||||
void *handle,
|
||||
struct Ipmip6ha_node_P *node,
|
||||
struct Ipmip_timer *service)
|
||||
{
|
||||
Ipmip6ha_nemo_t *nemo, *nnemo;
|
||||
Ipmip6ha_nemo_t *nemo_p, *nnemo_p;
|
||||
Ipdhcps6_subnet subnet;
|
||||
|
||||
|
||||
IPMIP_UNUSED_PARAMETER(service);
|
||||
IPMIP_UNUSED_PARAMETER(cfg);
|
||||
IPMIP_UNUSED_PARAMETER(handle);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (cfg->enabled)
|
||||
{
|
||||
if (action == IPMIP_CALLBACK_ENABLE)
|
||||
{
|
||||
for (nemo = IPCOM_LIST_FIRST(&node->node.nemo_v6); nemo != IP_NULL; nemo = nnemo)
|
||||
{
|
||||
nnemo = IPCOM_LIST_NEXT(&nemo->next);
|
||||
|
||||
ipcom_memset(&subnet, 0, sizeof(subnet));
|
||||
ipcom_memcpy(&subnet.prefix, &nemo->prefix, sizeof(struct Ip_in6_addr));
|
||||
subnet.prefix_len = nemo->len;
|
||||
|
||||
if (ipdhcps6_subnet_add(&subnet) != IPCOM_SUCCESS)
|
||||
{
|
||||
IPMIP6_EVENT_IF(ERR, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"%s failed to add subnet '%s/%d'",
|
||||
ipmip6ha_node_describe(proc, &node->node),
|
||||
ipmip_ntop_inet6(proc, &nemo->prefix, IP_NULL),
|
||||
nemo->len));
|
||||
}
|
||||
|
||||
for (nemo_p = IPCOM_LIST_FIRST(&node->node.nemo_v6); nemo_p != IP_NULL; nemo_p = nnemo_p)
|
||||
{
|
||||
Ipdhcps6_poolinfo pool;
|
||||
|
||||
nnemo_p = IPCOM_LIST_NEXT(&nemo_p->next);
|
||||
|
||||
ipcom_memcpy(&pool.first, &nemo_p->prefix, sizeof(struct Ip_in6_addr));
|
||||
pool.first.in6.addr32[3] = 0x1;
|
||||
ipcom_memcpy(&pool.last, &pool.first, sizeof(struct Ip_in6_addr));
|
||||
pool.preferred_lifetime = cfg->preferred;
|
||||
pool.valid_lifetime = cfg->valid;
|
||||
pool.prefix_len = 0;
|
||||
|
||||
if (ipdhcps6_pool_add(&subnet, &pool) != IPCOM_SUCCESS)
|
||||
{
|
||||
IPMIP6_EVENT_IF(ERR, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"%s failed to add pool to subnet '%s/%d'",
|
||||
ipmip6ha_node_describe(proc, &node->node),
|
||||
ipmip_ntop_inet6(proc, &nemo->prefix, IP_NULL),
|
||||
nemo->len));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_DISABLE || action == IPMIP_CALLBACK_UPDATE)
|
||||
{
|
||||
for (nemo = IPCOM_LIST_FIRST(&node->node.nemo_v6); nemo != IP_NULL; nemo = nnemo)
|
||||
{
|
||||
nnemo = IPCOM_LIST_NEXT(&nemo->next);
|
||||
|
||||
/* Subnet delete will delete any associated pools as well */
|
||||
ipcom_memset(&subnet, 0, sizeof(subnet));
|
||||
ipcom_memcpy(&subnet.prefix, &nemo->prefix, sizeof(struct Ip_in6_addr));
|
||||
subnet.prefix_len = nemo->len;
|
||||
|
||||
if (ipdhcps6_subnet_delete(&subnet) != IPCOM_SUCCESS)
|
||||
{
|
||||
IPMIP6_EVENT_IF(ERR, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"%s failed to delete subnet '%s/%d'",
|
||||
ipmip6ha_node_describe(proc, &node->node),
|
||||
ipmip_ntop_inet6(proc, &nemo->prefix, IP_NULL),
|
||||
nemo->len));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (action == IPMIP_CALLBACK_UPDATE)
|
||||
return IPMIP_CALLBACK_RET_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Don't delay */
|
||||
return IPMIP_CALLBACK_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 10 GLOBAL FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
IP_GLOBAL void ipmip6ha_pmipv6_dhcpv6_install(struct Ipmip6ha_context *ctx);
|
||||
IP_GLOBAL void
|
||||
ipmip6ha_pmipv6_dhcpv6_install(struct Ipmip6ha_context *ctx)
|
||||
{
|
||||
static Ipmip6ha_extension_t srv;
|
||||
|
||||
ipcom_memset(&srv, 0, sizeof(srv));
|
||||
|
||||
srv.name = IPMIP6HA_PMIPV6_DHCPV6_SERVER;
|
||||
srv.ifp_data_size = sizeof(Ipmip6ha_pmipv6_dhcpv6_config_t);
|
||||
srv.global_data_size= sizeof(Ipmip6ha_pmipv6_dhcpv6_config_global_t);
|
||||
|
||||
srv.config_global = (Ipmip6ha_extension_config_global_t)ipmip6ha_pmipv6_dhcpv6_config_global;
|
||||
srv.config_ifp = (Ipmip6ha_extension_config_ifp_t)ipmip6ha_pmipv6_dhcpv6_config;
|
||||
srv.provide = (Ipmip6ha_extension_provide_t)ipmip6ha_pmipv6_dhcpv6_provide;
|
||||
|
||||
/* This is a PMIP only feature */
|
||||
ipmip6ha_context_register_extension(ctx, &srv, IP_FALSE, IP_TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 11 PUBLIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
#else
|
||||
IP_GLOBAL void ipmip6ha_pmipv6_dhcpv6_install(struct Ipmip6ha_context *ctx);
|
||||
IP_GLOBAL void
|
||||
ipmip6ha_pmipv6_dhcpv6_install(struct Ipmip6ha_context *ctx)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
}
|
||||
#endif /* IPDHCPS6 */
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INTERPEAK SOURCE FILE
|
||||
*
|
||||
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6ha_pmipv6_linklocal.c,v $ $Revision: 1.6 $
|
||||
* $Source: /home/interpeak/CVSRoot/ipmip6ha/config/ipmip6ha_pmipv6_linklocal.c,v $
|
||||
* $Author: jhorteli $
|
||||
* $State: Exp $ $Locker: $
|
||||
*
|
||||
* INTERPEAK_COPYRIGHT_STRING
|
||||
* Design and implementation by Joel Hortelius <joel.hortelis@interpeak.se>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 CONFIGURATION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include "ipmip6ha_config.h"
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#define IPCOM_USE_CLIB_PROTO
|
||||
#include <ipcom_clib.h>
|
||||
#include <ipcom_err.h>
|
||||
#include <ipcom_hash.h>
|
||||
#include <ipcom_inet.h>
|
||||
#include <ipcom_ipd.h>
|
||||
#include <ipcom_list.h>
|
||||
#include <ipcom_os.h>
|
||||
#include <ipcom_sock.h>
|
||||
#include <ipcom_sock2.h>
|
||||
#include <ipcom_syslog.h>
|
||||
#include <ipcom_sysvar.h>
|
||||
#include <ipcom_atomic.h>
|
||||
|
||||
#include <ipmip.h>
|
||||
#include <private/ipmip_sysvar.h>
|
||||
|
||||
#include <ipmip6.h>
|
||||
#include <private/ipmip6_context.h>
|
||||
#include <private/ipmip6_netlink.h>
|
||||
#include <private/ipmip6_if.h>
|
||||
#include <private/ipmip6_icmp.h>
|
||||
#include <private/ipmip6_util.h>
|
||||
|
||||
#include "ipmip6ha_h.h"
|
||||
#include "ipmip6ha_attr_h.h"
|
||||
#include "ipmip6ha_if.h"
|
||||
#include "ipmip6ha_node.h"
|
||||
#include "ipmip6ha_pktbuf.h"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
#define IPMIP6HA_PMIPV6_LINKLOCAL "LINKLOCAL"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
typedef struct Ipmip6ha_pmipv6_linklocal_config
|
||||
{
|
||||
Ipcom_atomic_t counter;
|
||||
} Ipmip6ha_pmipv6_linklocal_config_t;
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 6 EXTERN PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 7 LOCAL PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 8 DATA
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 9 STATIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
IP_STATIC void
|
||||
ipmip6ha_pmipv6_linklocal_config(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
struct Ipmip6ha_if *ifp,
|
||||
void *gcfg,
|
||||
Ipmip6ha_pmipv6_linklocal_config_t *cfg,
|
||||
Ipmip_cli_message_t *request)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
IPMIP_UNUSED_PARAMETER(ifp);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (action == IPMIP_CALLBACK_CONFIG_READ)
|
||||
{
|
||||
ipcom_atomic_set(&cfg->counter, 0);
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_FREE)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_DUMP)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(request);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IP_STATIC int
|
||||
ipmip6ha_pmipv6_linklocal_provide(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
void *gcfg,
|
||||
Ipmip6ha_pmipv6_linklocal_config_t *cfg,
|
||||
void *handle,
|
||||
struct Ipmip6ha_node_P *node,
|
||||
struct Ipmip_timer *service)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(service);
|
||||
IPMIP_UNUSED_PARAMETER(cfg);
|
||||
IPMIP_UNUSED_PARAMETER(handle);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (action == IPMIP_CALLBACK_ENABLE)
|
||||
{
|
||||
if (IP_IN6_IS_ADDR_UNSPECIFIED(&node->pmipv6_link_local_address.prefix))
|
||||
{
|
||||
Ip_u32 low;
|
||||
|
||||
while ((low = (Ip_u32)ipcom_atomic_add_and_return(&cfg->counter, 1)) == 0)
|
||||
;
|
||||
|
||||
ipcom_memset(&node->pmipv6_link_local_address.prefix, 0, sizeof(node->pmipv6_link_local_address.prefix));
|
||||
|
||||
/**/
|
||||
IP_SET_HTONS(&node->pmipv6_link_local_address.prefix.in6.addr16[0], 0xfe80);
|
||||
IP_SET_HTONL(&node->pmipv6_link_local_address.prefix.in6.addr32[3], low);
|
||||
|
||||
IPMIP6_EVENT_IF(DEBUG2, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"Generated Link-Local address %s for node %s",
|
||||
ipmip_ntop_inet6(proc, &node->pmipv6_link_local_address.prefix, IP_NULL),
|
||||
ipmip6ha_node_describe(proc, &node->node)));
|
||||
}
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_DISABLE)
|
||||
{
|
||||
/* DO NOTHING */
|
||||
}
|
||||
|
||||
/* Don't delay */
|
||||
return IPMIP_CALLBACK_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 10 GLOBAL FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
IP_GLOBAL void ipmip6ha_pmipv6_linklocal_install(struct Ipmip6ha_context *ctx);
|
||||
IP_GLOBAL void
|
||||
ipmip6ha_pmipv6_linklocal_install(struct Ipmip6ha_context *ctx)
|
||||
{
|
||||
static Ipmip6ha_extension_t srv;
|
||||
|
||||
ipcom_memset(&srv, 0, sizeof(srv));
|
||||
|
||||
srv.name = IPMIP6HA_PMIPV6_LINKLOCAL;
|
||||
srv.ifp_data_size = sizeof(Ipmip6ha_pmipv6_linklocal_config_t);
|
||||
|
||||
srv.config_ifp = (Ipmip6ha_extension_config_ifp_t)ipmip6ha_pmipv6_linklocal_config;
|
||||
srv.provide = (Ipmip6ha_extension_provide_t)ipmip6ha_pmipv6_linklocal_provide;
|
||||
|
||||
/* This is a PMIP only feature */
|
||||
ipmip6ha_context_register_extension(ctx, &srv, IP_FALSE, IP_TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 11 PUBLIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,469 @@
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INTERPEAK SOURCE FILE
|
||||
*
|
||||
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6ha_service_testext.c,v $ $Revision: 1.6 $
|
||||
* $Source: /home/interpeak/CVSRoot/ipmip6ha/config/ipmip6ha_service_testext.c,v $
|
||||
* $Author: jhorteli $
|
||||
* $State: Exp $ $Locker: $
|
||||
*
|
||||
* INTERPEAK_COPYRIGHT_STRING
|
||||
* Design and implementation by Joel Hortelius <joel.hortelis@interpeak.se>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 CONFIGURATION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include "ipmip6ha_config.h"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#define IPCOM_USE_CLIB_PROTO
|
||||
#include <ipcom_clib.h>
|
||||
#include <ipcom_err.h>
|
||||
#include <ipcom_hash.h>
|
||||
#include <ipcom_inet.h>
|
||||
#include <ipcom_ipd.h>
|
||||
#include <ipcom_list.h>
|
||||
#include <ipcom_os.h>
|
||||
#include <ipcom_sock.h>
|
||||
#include <ipcom_sock2.h>
|
||||
#include <ipcom_syslog.h>
|
||||
#include <ipcom_sysvar.h>
|
||||
#include <ipcom_strlib.h>
|
||||
|
||||
#include <ipmip.h>
|
||||
#include <private/ipmip_sysvar.h>
|
||||
|
||||
#include <ipmip6.h>
|
||||
#include <private/ipmip6_context.h>
|
||||
#include <private/ipmip6_netlink.h>
|
||||
#include <private/ipmip6_if.h>
|
||||
#include <private/ipmip6_icmp.h>
|
||||
#include <private/ipmip6_util.h>
|
||||
#include <private/ipmip6_mh.h>
|
||||
#include <private/ipmip6_mh_pkt.h>
|
||||
|
||||
#include "ipmip6ha_h.h"
|
||||
#include "ipmip6ha_attr_h.h"
|
||||
#include "ipmip6ha_if.h"
|
||||
#include "ipmip6ha_node.h"
|
||||
#include "ipmip6ha_pktbuf.h"
|
||||
#include "ipmip6ha_nemo.h"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
#define IPMIP6HA_SERVICE_SERVICE_SELECTION "SERVICE-SELECTION"
|
||||
#define IPMIP6HA_SERVICE_VENDOR_EXTENSION "VENDOR-EXTENSION"
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
typedef struct Ipmip6ha_service_selection_config
|
||||
{
|
||||
Ip_bool enabled;
|
||||
Ip_bool change_allowed;
|
||||
} Ipmip6ha_service_selection_config_t;
|
||||
|
||||
|
||||
typedef struct Ipmip6ha_service_selection_node_handle
|
||||
{
|
||||
Ip_bool enabled;
|
||||
Ipmip6_mh_mo_service_selection_mobility_option_t *selection;
|
||||
} Ipmip6ha_service_selection_node_handle_t;
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 6 EXTERN PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 7 LOCAL PROTOTYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 8 DATA
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 9 STATIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
IP_STATIC void
|
||||
ipmip6ha_service_selection_config_global(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
Ipmip6ha_service_selection_config_t *gcfg,
|
||||
Ipmip_cli_message_t *request)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (action == IPMIP_CALLBACK_CONFIG_READ)
|
||||
{
|
||||
gcfg->enabled = ipmip_sysvar_bool(IP_FALSE, "ipmip6ha.service_selection.enabled");
|
||||
gcfg->change_allowed = ipmip_sysvar_bool(IP_FALSE, "ipmip6ha.service_selection.changeable");
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_FREE)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_DUMP)
|
||||
{
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.service_selection.enabled=%s",
|
||||
gcfg->enabled? "enabled" : "disabled");
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.service_selection.changeable=%s",
|
||||
gcfg->change_allowed? "enabled" : "disabled");
|
||||
}
|
||||
}
|
||||
|
||||
IP_STATIC void
|
||||
ipmip6ha_service_selection_config(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
struct Ipmip6ha_if *ifp,
|
||||
Ipmip6ha_service_selection_config_t *gcfg,
|
||||
Ipmip6ha_service_selection_config_t *cfg,
|
||||
Ipmip_cli_message_t *request)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(ctx);
|
||||
IPMIP_UNUSED_PARAMETER(proc);
|
||||
IPMIP_UNUSED_PARAMETER(ifp);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (action == IPMIP_CALLBACK_CONFIG_READ)
|
||||
{
|
||||
cfg->enabled = ipmip_sysvar_bool(gcfg->enabled, "ipmip6ha.interface.%s.service_selection.enabled", ifp->ipmip6.iff.ifname);
|
||||
cfg->change_allowed = ipmip_sysvar_bool(gcfg->enabled, "ipmip6ha.interface.%s.service_selection.changeable", ifp->ipmip6.iff.ifname);
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_FREE)
|
||||
{
|
||||
/* Do nothing */
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_CONFIG_DUMP)
|
||||
{
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.interface.%s.service_selection.enabled=%s",
|
||||
ifp->ipmip6.iff.ifname, cfg->enabled? "enabled" : "disabled");
|
||||
ipmip_cli_config_printf(&request->message,
|
||||
"ipmip6ha.interface.%s.service_selection.changeable=%s",
|
||||
ifp->ipmip6.iff.ifname, cfg->change_allowed? "enabled" : "disabled");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IP_STATIC Ip_bool
|
||||
ipmip6ha_service_selection_pkt_request_validate(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
Ipmip6ha_service_selection_config_t *gcfg,
|
||||
Ipmip6ha_service_selection_config_t *cfg,
|
||||
Ipmip6ha_service_selection_node_handle_t *handle,
|
||||
struct Ipmip6ha_node *node,
|
||||
struct Ipmip6ha_pktbuf *pbuf,
|
||||
struct Ipmip_timer *service)
|
||||
{
|
||||
|
||||
IPMIP_UNUSED_PARAMETER(service);
|
||||
IPMIP_UNUSED_PARAMETER(handle);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (pbuf->ipmip6.mo.service_selection != IP_NULL)
|
||||
{
|
||||
if (cfg->enabled)
|
||||
{
|
||||
/* Here's the time to verify if the selection's valid */
|
||||
if (handle->enabled != IP_FALSE)
|
||||
{
|
||||
/* Already have a service setup?*/
|
||||
if (!ipmip6_mh_mo_cmp(&pbuf->ipmip6.mo.service_selection->hdr, &handle->selection->hdr))
|
||||
{
|
||||
if (cfg->change_allowed)
|
||||
{
|
||||
/* Mismatch; redo selection */
|
||||
IPMIP6_EVENT_IF(DEBUG, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"%s changing service selection to '%s'",
|
||||
ipmip6ha_node_describe(proc, node),
|
||||
ipmip_ntop_strn(proc, (char *)&pbuf->ipmip6.mo.service_selection->identifier[0], pbuf->ipmip6.mo.service_selection->hdr.len)));
|
||||
|
||||
pbuf->update_services = IP_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ipmip_pktbuf_error(&pbuf->ipmip6.ipmip,
|
||||
IPMIP6_MH_BA_STATUS_ERROR_SERVICE_AUTHORIZATION_FAILED,
|
||||
"service selection '%s' specified, but not provided by home agent",
|
||||
ipmip_ntop_strn(proc, (char *)&pbuf->ipmip6.mo.service_selection->identifier[0], pbuf->ipmip6.mo.service_selection->hdr.len));
|
||||
ipmip6ha_node_delete(ctx, proc, node, "service selection disallowed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ipmip_pktbuf_error(&pbuf->ipmip6.ipmip,
|
||||
IPMIP6_MH_BA_STATUS_ERROR_SERVICE_AUTHORIZATION_FAILED,
|
||||
"service selection '%s' specified, but not provided by home agent",
|
||||
ipmip_ntop_strn(proc, (char *)&pbuf->ipmip6.mo.service_selection->identifier[0], pbuf->ipmip6.mo.service_selection->hdr.len));
|
||||
}
|
||||
}
|
||||
|
||||
/* Don't delay */
|
||||
return IP_FALSE;
|
||||
}
|
||||
|
||||
|
||||
IP_STATIC Ip_bool
|
||||
ipmip6ha_service_selection_pkt_request_accept(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
Ipmip6ha_service_selection_config_t *gcfg,
|
||||
Ipmip6ha_service_selection_config_t *cfg,
|
||||
Ipmip6ha_service_selection_node_handle_t *handle,
|
||||
struct Ipmip6ha_node *node,
|
||||
struct Ipmip6ha_pktbuf *pbuf,
|
||||
struct Ipmip_timer *service)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(service);
|
||||
IPMIP_UNUSED_PARAMETER(handle);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
IPMIP_UNUSED_PARAMETER(cfg);
|
||||
|
||||
if (pbuf->ipmip6.mo.service_selection != IP_NULL)
|
||||
{
|
||||
/* Only store the service first time around */
|
||||
if (handle->enabled == IP_FALSE)
|
||||
{
|
||||
/* Store the selected service; we'll use it later in provde */
|
||||
handle->selection = (void *)ipmip6_mh_mo_dup(&pbuf->ipmip6.mo.service_selection->hdr);
|
||||
handle->enabled = IP_TRUE;
|
||||
|
||||
/* Mismatch; redo selection */
|
||||
IPMIP6_EVENT_IF(DEBUG, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"%s accepting service selection '%s'",
|
||||
ipmip6ha_node_describe(proc, node),
|
||||
ipmip_ntop_strn(proc, (char *)&pbuf->ipmip6.mo.service_selection->identifier[0], pbuf->ipmip6.mo.service_selection->hdr.len)));
|
||||
}
|
||||
}
|
||||
|
||||
/* Don't delay */
|
||||
return IP_FALSE;
|
||||
}
|
||||
|
||||
|
||||
IP_STATIC int
|
||||
ipmip6ha_service_selection_provide(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
int action,
|
||||
Ipmip6ha_service_selection_config_t *gcfg,
|
||||
Ipmip6ha_service_selection_config_t *cfg,
|
||||
Ipmip6ha_service_selection_node_handle_t *handle,
|
||||
struct Ipmip6ha_node *node,
|
||||
struct Ipmip_timer *service)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(service);
|
||||
IPMIP_UNUSED_PARAMETER(cfg);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
|
||||
if (action == IPMIP_CALLBACK_ENABLE)
|
||||
{
|
||||
if (handle->enabled)
|
||||
{
|
||||
/* Do what? */
|
||||
IPMIP6_EVENT_IF(INFO, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"%s enabling service selection '%s'",
|
||||
ipmip6ha_node_describe(proc, node),
|
||||
ipmip_ntop_strn(proc, (char *)&handle->selection->identifier[0], handle->selection->hdr.len)));
|
||||
}
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_DISABLE)
|
||||
{
|
||||
if (handle->enabled)
|
||||
{
|
||||
/* Disable whatever service setup we've got */
|
||||
|
||||
/* Free & Reset */
|
||||
ipcom_free(handle->selection);
|
||||
handle->enabled = IP_FALSE;
|
||||
}
|
||||
}
|
||||
else if (action == IPMIP_CALLBACK_UPDATE)
|
||||
{
|
||||
/* We're redoing the service setups */
|
||||
if (handle->enabled)
|
||||
{
|
||||
/* Disable whatever service setup we've got */
|
||||
|
||||
/* Free & Reset */
|
||||
ipcom_free(handle->selection);
|
||||
handle->enabled = IP_FALSE;
|
||||
}
|
||||
|
||||
/* Indicate that this service needs to be re-setup; if you ignore UPDATE dont return failure */
|
||||
return IPMIP_CALLBACK_RET_FAILED;
|
||||
}
|
||||
|
||||
/* Don't delay */
|
||||
return IPMIP_CALLBACK_RET_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
IP_STATIC Ip_bool
|
||||
ipmip6ha_service_vendor_extension_pkt_request_accept(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
void *gcfg,
|
||||
void *cfg,
|
||||
void *handle,
|
||||
struct Ipmip6ha_node *node,
|
||||
struct Ipmip6ha_pktbuf *pbuf,
|
||||
struct Ipmip_timer *service)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(service);
|
||||
IPMIP_UNUSED_PARAMETER(handle);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
IPMIP_UNUSED_PARAMETER(cfg);
|
||||
|
||||
if (pbuf->ipmip6.mo.vendor_options.numelem > 0)
|
||||
{
|
||||
Ipmip6_mh_mo_vendor_specific_mobility_option_t *mo;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < pbuf->ipmip6.mo.vendor_options.numelem; i++)
|
||||
{
|
||||
mo = (Ipmip6_mh_mo_vendor_specific_mobility_option_t*)pbuf->ipmip6.mo.vendor_options.hdrs[i];
|
||||
|
||||
/* Mismatch; redo selection */
|
||||
IPMIP6_EVENT_IF(INFO, proc,
|
||||
ipmip_log_event_add(&ctx->ipmip6.ipmip,
|
||||
proc,
|
||||
"%s received Vendor Extension %u.%u",
|
||||
ipmip6ha_node_describe(proc, node),
|
||||
IP_GET_NTOHL(&mo->vendor_id), mo->sub_type));
|
||||
}
|
||||
}
|
||||
|
||||
/* Don't delay */
|
||||
return IP_FALSE;
|
||||
}
|
||||
|
||||
/* Echo the Vendor Extension */
|
||||
IP_STATIC void
|
||||
ipmip6ha_service_selection_pkt_reply_apply(struct Ipmip6ha_context *ctx,
|
||||
struct Ipmip_proc *proc,
|
||||
void *gcfg,
|
||||
void *cfg,
|
||||
void *handle,
|
||||
struct Ipmip6ha_node *node,
|
||||
struct Ipmip6ha_pktbuf *pbuf_reply,
|
||||
struct Ipmip6ha_pktbuf *pbuf_req)
|
||||
{
|
||||
IPMIP_UNUSED_PARAMETER(handle);
|
||||
IPMIP_UNUSED_PARAMETER(gcfg);
|
||||
IPMIP_UNUSED_PARAMETER(cfg);
|
||||
IPMIP_UNUSED_PARAMETER(node);
|
||||
|
||||
if (pbuf_req->ipmip6.mo.vendor_options.numelem > 0)
|
||||
{
|
||||
Ipmip6_mh_mo_vendor_specific_mobility_option_t *mo;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < pbuf_req->ipmip6.mo.vendor_options.numelem; i++)
|
||||
{
|
||||
mo = (Ipmip6_mh_mo_vendor_specific_mobility_option_t*)pbuf_req->ipmip6.mo.vendor_options.hdrs[i];
|
||||
ipmip6_mh_pkt_opt_add_mo(&ctx->ipmip6,
|
||||
proc,
|
||||
&pbuf_reply->ipmip6,
|
||||
&mo->hdr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 10 GLOBAL FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
IP_GLOBAL void ipmip6ha_service_testext_install(struct Ipmip6ha_context *ctx);
|
||||
IP_GLOBAL void
|
||||
ipmip6ha_service_testext_install(struct Ipmip6ha_context *ctx)
|
||||
{
|
||||
static Ipmip6ha_extension_t srv_sel;
|
||||
static Ipmip6ha_extension_t srv_ven;
|
||||
|
||||
ipcom_memset(&srv_sel, 0, sizeof(srv_sel));
|
||||
|
||||
srv_sel.name = IPMIP6HA_SERVICE_SERVICE_SELECTION;
|
||||
srv_sel.ifp_data_size = sizeof(Ipmip6ha_service_selection_config_t);
|
||||
srv_sel.global_data_size= sizeof(Ipmip6ha_service_selection_config_t);
|
||||
srv_sel.node_data_size = sizeof(Ipmip6ha_service_selection_node_handle_t);
|
||||
|
||||
srv_sel.config_global = (Ipmip6ha_extension_config_global_t)ipmip6ha_service_selection_config_global;
|
||||
srv_sel.config_ifp = (Ipmip6ha_extension_config_ifp_t)ipmip6ha_service_selection_config;
|
||||
srv_sel.provide = (Ipmip6ha_extension_provide_t)ipmip6ha_service_selection_provide;
|
||||
srv_sel.pkt_req_accept = (Ipmip6ha_extension_pkt_req_accept_t)ipmip6ha_service_selection_pkt_request_accept;
|
||||
srv_sel.pkt_req_validate= (Ipmip6ha_extension_pkt_req_validate_t)ipmip6ha_service_selection_pkt_request_validate;
|
||||
|
||||
/* This is a PMIP only feature */
|
||||
ipmip6ha_context_register_extension(ctx, &srv_sel, IP_TRUE, IP_TRUE);
|
||||
|
||||
ipcom_memset(&srv_ven, 0, sizeof(srv_ven));
|
||||
|
||||
srv_ven.name = IPMIP6HA_SERVICE_VENDOR_EXTENSION;
|
||||
srv_ven.pkt_req_accept = (Ipmip6ha_extension_pkt_req_accept_t)ipmip6ha_service_vendor_extension_pkt_request_accept;
|
||||
srv_ven.pkt_rep_apply = (Ipmip6ha_extension_pkt_rep_apply_t)ipmip6ha_service_selection_pkt_reply_apply;
|
||||
|
||||
/* This is a PMIP only feature */
|
||||
ipmip6ha_context_register_extension(ctx, &srv_ven, IP_TRUE, IP_TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 11 PUBLIC FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user