846 lines
30 KiB
C
846 lines
30 KiB
C
/*
|
|
******************************************************************************
|
|
* IPLITE USER CONFIGURATION FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: iplite_config.c,v $ $Revision: 1.55.10.4 $
|
|
* $Source: /home/interpeak/CVSRoot/iplite2/config/iplite_config.c,v $
|
|
* $Author: hxie $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Kenneth Jonsson <kenneth@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
* IPLITE user configuration file.
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include "iplite_config.h"
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include <ipcom_err.h>
|
|
#include <ipcom_shell.h>
|
|
#include <ipcom_sysvar.h>
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
#ifndef TCP_CONN_TIMEOUT
|
|
#define TCP_CONN_TIMEOUT 300
|
|
#endif
|
|
#ifndef TCP_MAX_RETRANSMITS
|
|
#define TCP_MAX_RETRANSMITS 10
|
|
#endif
|
|
#ifndef IPTCP_MAX_RETRAMSMITS_IN_TRANSIENT
|
|
#define IPTCP_MAX_RETRAMSMITS_IN_TRANSIENT 2
|
|
#endif
|
|
#ifndef IPTCP_MAX_TRANSIENT
|
|
#define IPTCP_MAX_TRANSIENT 20
|
|
#endif
|
|
#ifndef IPTCP_TRANSIENT_THRESH
|
|
#define IPTCP_TRANSIENT_THRESH 5
|
|
#endif
|
|
#ifndef TCP_MSL
|
|
#define TCP_MSL 30
|
|
#endif
|
|
#ifndef TCP_MAX_MSS
|
|
#define TCP_MAX_MSS 0
|
|
#endif
|
|
#ifndef TCP_ALLOW_ZERO_WINDOW
|
|
#define TCP_ALLOW_ZERO_WINDOW 0
|
|
#endif
|
|
#ifndef TCP_ALLOW_TINY_WINDOW
|
|
#define TCP_ALLOW_TINY_WINDOW 1
|
|
#endif
|
|
#ifndef TCP_LAND_ATTACK_PROTECTION
|
|
#define TCP_LAND_ATTACK_PROTECTION 1
|
|
#endif
|
|
#ifdef IPLITE_TCP_USE_TIMESTAMP_OPT
|
|
#ifndef TCP_USE_TIMESTAMP
|
|
#define TCP_USE_TIMESTAMP 0
|
|
#endif
|
|
#endif
|
|
#ifndef TCP_USE_RFC1122_URGENT_DATA
|
|
#define TCP_USE_RFC1122_URGENT_DATA 0
|
|
#endif
|
|
#ifndef TCP_KEEP_CNT
|
|
#define TCP_KEEP_CNT 10
|
|
#endif
|
|
#ifndef TCP_KEEP_INTVL
|
|
#define TCP_KEEP_INTVL 75
|
|
#endif
|
|
#ifndef TCP_KEEP_IDLE
|
|
#define TCP_KEEP_IDLE 7200
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 EXTERN PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
*===========================================================================
|
|
* Shell commands
|
|
*===========================================================================
|
|
*/
|
|
|
|
IP_PUBLIC int iplite_cmd_netstat(int argc, char **argv);
|
|
IP_PUBLIC int iplite_cmd_route(int argc, char **argv);
|
|
IP_PUBLIC int iplite_cmd_ifconfig(int argc, char **argv);
|
|
IP_PUBLIC int iplite_cmd_ctrl(int argc, char **argv);
|
|
IP_PUBLIC int iplite_cmd_arp(int argc, char **argv);
|
|
IP_PUBLIC int iplite_cmd_ping(int argc, char **argv);
|
|
IP_PUBLIC int iplite_cmd_ndp(int argc, char **argv);
|
|
IP_PUBLIC int iplite_cmd_ping6(int argc, char **argv);
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 7 LOCAL PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
IP_PUBLIC Ip_err iplite_configure(void);
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 8 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* INTERFACE CONFIGURATION
|
|
*===========================================================================
|
|
* Each interface found that matches an entry below is configured at boot
|
|
* accordingly. An interface entry consists of the following entries:
|
|
*
|
|
* ifname - Interface name, e.g. "eth0"
|
|
* devname - Device name to bind interface too.
|
|
* a.b.c.d/x - IPv4 address/network bits (alt. "dhcp" or "driver")
|
|
* x:y:z::w/p - IPv6 address/prefix length.
|
|
*
|
|
*/
|
|
#ifndef IP_PORT_OSE5
|
|
#ifndef IP_PORT_VXWORKS
|
|
IP_CONST
|
|
#endif
|
|
Iplite_conf_ifdata
|
|
iplite_conf_interfaces[] =
|
|
{
|
|
#ifdef IPCOM_USE_ETHERNET
|
|
{
|
|
#if defined(IP_PORT_UNIX)
|
|
"eth0", /* Name of the interface to configure */
|
|
"10.1.2.110/16", /* IPv4 address and subnet (dhcp or driver) */
|
|
"2001::6e/64" /* IPv6 address and subnet */
|
|
#else
|
|
/* Interface 1 */
|
|
"", /* Name of the interface to configure */
|
|
#if defined(IP_PORT_INTEGRITY) || defined(IP_PORT_OSECK)
|
|
"driver", /* IPv4 address and subnet (dhcp or driver) */
|
|
#elif defined(IP_PORT_VXWORKS)
|
|
"driver", /* MUX device to bind interface to */
|
|
"driver", /* IPv4 address and subnet (dhcp or driver) */
|
|
#else
|
|
"driver", /* IPv4 address and subnet (dhcp or driver) */
|
|
#endif
|
|
"driver", /* IPv6 address and subnet */
|
|
#endif
|
|
},
|
|
|
|
#endif /* IPCOM_USE_ETHERNET */
|
|
|
|
{
|
|
/* Interface Terminator */
|
|
IP_NULL,
|
|
#ifdef IP_PORT_VXWORKS
|
|
IP_NULL,
|
|
#endif
|
|
IP_NULL,
|
|
IP_NULL
|
|
}
|
|
};
|
|
#endif /* ifndef IP_PORT_OSE5 */
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* DEFAULT GATEWAY CONFIGURATION
|
|
*===========================================================================
|
|
* IPv4 and/or IPv6 default gateways.
|
|
*/
|
|
|
|
/* IPv4 default gateway: "a.b.c.d", "driver" or IP_NULL for none. */
|
|
#ifdef IPCOM_USE_INET
|
|
#if defined(IP_PORT_INTEGRITY) || defined(IP_PORT_VXWORKS) || defined(IP_PORT_OSECK) || defined(IP_PORT_UNIX)
|
|
IP_CONST char *iplite_conf_default_gateway = "driver";
|
|
#else
|
|
IP_CONST char *iplite_conf_default_gateway = "10.1.1.1";
|
|
#endif
|
|
#endif
|
|
|
|
/* IPv6 default gateway: "x:y:z::g" or "::" for listening to router adverts. */
|
|
#ifdef IPCOM_USE_INET6
|
|
IP_CONST char *iplite_conf_default_gateway6 = "::";
|
|
#endif
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* PACKET POOL
|
|
*===========================================================================
|
|
* Array of packet pool entries: { number of packets, packet size },
|
|
*
|
|
* Note: The largest MTU in this list should be equal or larger than the MTU
|
|
* of any network interface used on this target
|
|
*
|
|
* NOTE: The maximum number of packet pool entries is limited by the
|
|
* iplite_config.h macro IPLITE_CONF_MAX_PKTPOOL.
|
|
*/
|
|
IP_CONST Iplite_conf_pkt_pool iplite_conf_pkt_pool_buf[] =
|
|
{
|
|
{ 8, 576 },
|
|
#ifdef IPIPSEC2
|
|
{ 100, 1602 },
|
|
#else
|
|
{ 100, 1500 },
|
|
#endif
|
|
#ifdef IPPPP
|
|
{ 16, 3016 },
|
|
#endif
|
|
{ 2, 10000 },
|
|
{ 0, 0 } /* End marker */
|
|
};
|
|
IP_CONST Iplite_conf_pkt_pool *iplite_conf_pkt_pool = iplite_conf_pkt_pool_buf;
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* Maximum link header size
|
|
*===========================================================================
|
|
* Maximum link header size.
|
|
* Typically, this variable does _not_ have to be changed from its default.
|
|
*/
|
|
#ifdef IPPPP
|
|
int ipcom_conf_max_link_hdr_size = 4 + 22; /* 32bit cookie + pppoe=22,ethernet=14,ppp=6 */
|
|
#else
|
|
int ipcom_conf_max_link_hdr_size = 4 + 14; /* 32bit cookie + ethernet=14 */
|
|
#endif
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* TCP VARIABLES
|
|
*===========================================================================
|
|
*/
|
|
IP_STATIC IP_CONST Ipcom_sysvar iptcp_conf_sysvar[] =
|
|
{
|
|
/* Define the number of seconds IPNET will try to create a TCP
|
|
connection before giving up. Must be 300 or larger when running
|
|
the Ixia ANVL suite, several tests will fail otherwise */
|
|
IP_SYSVAR("iptcp.ConnectionTimeout", "300", IPCOM_MAKE_STR(TCP_CONN_TIMEOUT)),
|
|
|
|
/* Maximum number of times a TCP segment will be resent before
|
|
giving up with an IPTCP_ERRNO_ETIMEDOUT error. Exponential back
|
|
off is applied before each resend (max time between two resends
|
|
is 1 minute). */
|
|
IP_SYSVAR("iptcp.MaxRetransmits", "10", IPCOM_MAKE_STR(TCP_MAX_RETRANSMITS)),
|
|
|
|
/* Number of retransmissions that is allowed for sessions in transient
|
|
states when the total number of session in transient states is
|
|
greater than IPTCP_THRESH_TRANSIENT */
|
|
IP_SYSVAR("iptcp.MaxRetransmitsTransientStates", "2", IPCOM_MAKE_STR(IPTCP_MAX_RETRAMSMITS_IN_TRANSIENT)),
|
|
|
|
/* Maximum number of TCP sockets that are allowed to be in a state
|
|
that is very short-lived under normal conditions. Large number of
|
|
sockets in this states is an strong indication that this node is
|
|
under some form of DoS attack. The session that spent the most time
|
|
in a transient state will be dropped if this count is exceeded. */
|
|
IP_SYSVAR("iptcp.MaxTransient", "20", IPCOM_MAKE_STR(IPTCP_MAX_TRANSIENT)),
|
|
|
|
/* This node will decrease the number of resend attempts for session
|
|
in states that are normally very short-lived when the total amount
|
|
of session in transient states exceeds IPTCP_TRANSIENT_THRESH */
|
|
IP_SYSVAR("iptcp.TransientTresh", "5", IPCOM_MAKE_STR(IPTCP_TRANSIENT_THRESH)),
|
|
|
|
/* Maximum segment lifetime. TCP sockets that enter the TIME_WAIT
|
|
state will be in that state for 2 times this value. Should be
|
|
120 sec (2 min) according to RFC 793, but most TCP/IP stacks
|
|
sets this value to 30 sec */
|
|
IP_SYSVAR("iptcp.Msl", "30", IPCOM_MAKE_STR(TCP_MSL)),
|
|
|
|
/* Defines the largest Maximum Segment Size that TCP will ever
|
|
suggest. The actual MSS suggested might be smaller than this
|
|
number if depending on MTU for the interface. Set to 0 if the
|
|
largest MSS allowed by the MTU should be used */
|
|
IP_SYSVAR("iptcp.MaxMss", "0", IPCOM_MAKE_STR(TCP_MAX_MSS)),
|
|
|
|
/* Set to !=0 to allow zero window in ACK of a SYN/ACK. */
|
|
IP_SYSVAR("iptcp.AllowZeroWindow", "0", IPCOM_MAKE_STR(TCP_ALLOW_ZERO_WINDOW)),
|
|
|
|
/* Set to !=0 to allow a window less than one MSS in ACK of a
|
|
SYN/ACK. */
|
|
IP_SYSVAR("iptcp.AllowTinyWindow", "1", IPCOM_MAKE_STR(TCP_ALLOW_TINY_WINDOW)),
|
|
|
|
/* Set to 1 to disable LAND attacks */
|
|
IP_SYSVAR("iptcp.DisableLandAttack", "1", IPCOM_MAKE_STR(TCP_LAND_ATTACK_PROTECTION)),
|
|
|
|
#ifdef IPLITE_TCP_USE_TIMESTAMP_OPT
|
|
/* Set to 0 or not defined to make IPTCP not include the timestamp
|
|
option in TCP segments. */
|
|
IP_SYSVAR("iptcp.opt.Timestamp", "0", IPCOM_MAKE_STR(TCP_USE_TIMESTAMP)),
|
|
#endif
|
|
|
|
/* Set to 1 to use urgent data as described in RFC 1122 chapter 4.2.2.4
|
|
set to 0 to use urgent data as described in RFC 793
|
|
Should be set to 0 since that is how most stacks works, must be set
|
|
to 1 in order successfully pass Ixia ANVL TCP-CORE group 19 tests */
|
|
IP_SYSVAR("iptcp.urg.Rfc1122", "0", IPCOM_MAKE_STR(TCP_USE_RFC1122_URGENT_DATA)),
|
|
|
|
/* The default time a TCP connection must be idle before the first
|
|
keep-alive packet is sent (in seconds). */
|
|
IP_SYSVAR("iptcp.KeepIdle", "7200", IPCOM_MAKE_STR(TCP_KEEP_IDLE)),
|
|
|
|
/* The time between each keep-alive probe. */
|
|
IP_SYSVAR("iptcp.KeepIntvl", "75", IPCOM_MAKE_STR(TCP_KEEP_INTVL)),
|
|
|
|
/* Number of unsuccessful keep-alive probes that will be sent
|
|
before dropping the connection. */
|
|
IP_SYSVAR("iptcp.KeepCnt", "10", IPCOM_MAKE_STR(TCP_KEEP_CNT)),
|
|
|
|
|
|
{ IP_NULL, IP_NULL }
|
|
};
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPv4 VARIABLES
|
|
*===========================================================================
|
|
*/
|
|
#if defined(IP_PORT_VXWORKS) \
|
|
&& defined(IPCOM_USE_INET) \
|
|
&& defined(INCLUDE_IPCOM_USE_INET)
|
|
|
|
#ifdef IPLITE_USE_RFC3927
|
|
|
|
#ifndef INET_AUTO_CONFIG
|
|
#define INET_AUTO_CONFIG "0"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_IFNAME_LIST
|
|
#define INET_IPAIP_IFNAME_LIST ""
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_PROBE_WAIT
|
|
#define INET_IPAIP_PROBE_WAIT "1"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_PROBE_NUM
|
|
#define INET_IPAIP_PROBE_NUM "3"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_PROBE_MIN
|
|
#define INET_IPAIP_PROBE_MIN "1"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_PROBE_MAX
|
|
#define INET_IPAIP_PROBE_MAX "3"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_ANNOUNCE_WAIT
|
|
#define INET_IPAIP_ANNOUNCE_WAIT "2"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_ANNOUNCE_NUM
|
|
#define INET_IPAIP_ANNOUNCE_NUM "2"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_ANNOUNCE_INTERVAL
|
|
#define INET_IPAIP_ANNOUNCE_INTERVAL "2"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_MAX_CONFLICTS
|
|
#define INET_IPAIP_MAX_CONFLICTS "10"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_RATE_LIMIT_INTERVAL
|
|
#define INET_IPAIP_RATE_LIMIT_INTERVAL "60"
|
|
#endif
|
|
|
|
#ifndef INET_IPAIP_DEFEND_INTERVAL
|
|
#define INET_IPAIP_DEFEND_INTERVAL "10"
|
|
#endif
|
|
|
|
#endif /* IPLITE_USE_RFC3927 */
|
|
|
|
|
|
IP_STATIC IP_CONST Ipcom_sysvar ipv4_conf_sysvar[] =
|
|
{
|
|
/*
|
|
* All the inet variables can also be set per interface by
|
|
* replacing "ipnet." with "ifname."
|
|
* ex: eth0.inet.IcmpRedirectSend). The interface specific version
|
|
* overrides the "ipnet.inet." version.
|
|
*/
|
|
|
|
/* The default hop limit for IPv4 packets */
|
|
IP_SYSVAR("ipnet.inet.BaseHopLimit", "64", INET_BASE_HOP_LIMIT),
|
|
|
|
/*
|
|
* Number of packets that can be waiting for IPv4 to link layer
|
|
* resolution to finish
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.MaxPending", "3", INET_MAX_PKTS_PENDING),
|
|
/*
|
|
* Number of unicast ARP request messages shall be sent before
|
|
* starting to use multicast solicits
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.MaxUnicastSolicit", "1", INET_MAX_UNICAST_SOLICIT),
|
|
|
|
/*
|
|
* Number of ARP request messages that shall be sent before
|
|
* starting to use application probes
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.MaxMulticastSolicit", "9", INET_MAX_MULTICAST_SOLICIT),
|
|
|
|
/*
|
|
* Number of resolve message that is sent to routing/netlink
|
|
* sockets if ARP probes failed (or is disabled)
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.MaxApplicationSolicit", "1", INET_MAX_APP_SOLICIT),
|
|
|
|
/*
|
|
* Duration, in seconds, that an entry in the ARP cache is in
|
|
* reachable state RFC 1122 chapter 2.3.2.1 recommends a value in
|
|
* the order of minutes and the equivalent feature in IPv6 (NDP)
|
|
* requires it to be 30 seconds.
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.BaseReachableTime", "30", INET_BASE_REACHABLE_TIME),
|
|
|
|
/* Number of seconds to wait between retransmits */
|
|
IP_SYSVAR("ipnet.inet.BaseRetransmitTime", "1", INET_BASE_RETRANSMIT_TIME),
|
|
|
|
/*
|
|
* Duration, in seconds, to wait for a stale ARP entry to become
|
|
* reachable before forcing a probe, packets will be sent using
|
|
* the stale entry during this time
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.DelayFirstProbeTime", "5", INET_DELAY_FIRST_PROBE_TIME),
|
|
|
|
/*
|
|
* Duration, in seconds, that can pass before a stale entry in the
|
|
* ARP cache is deleted
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.NeighborCacheToLive", "1200", INET_NBR_CACHE_TO_LIVE_TIME),
|
|
|
|
/*
|
|
* Duration, in seconds, that can pass before an entry in the
|
|
* destination cache is deleted, this lifetime is used by on
|
|
* entries created as a response to redirect and packet too big
|
|
* ICMP messages
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.DstCacheToLive", "600", INET_DST_CACHE_TO_LIVE_TIME),
|
|
|
|
/*
|
|
* IcmpRatelimitBucketsize is the number of ICMP messages the
|
|
* stack is allowed to per IcmpRatelimitInterval millisecond
|
|
* interval. Set IcmpRatelimitInterval to 0 to disable the
|
|
* ratelimiter
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.IcmpRatelimitBucketsize", "100", INET_ICMP_RATE_LIMIT_BUCKET_SIZE),
|
|
IP_SYSVAR("ipnet.inet.IcmpRatelimitInterval", "1000", INET_ICMP_RATE_LIMIT_INTERVAL),
|
|
|
|
/*
|
|
* 2 if a redirect shall be sent and the original message shall
|
|
* be forwarded (default)
|
|
* 1 if a redirect shall be sent but the original message shall
|
|
* be discarded
|
|
* 0 if no redirect shall be sent but the original message shall
|
|
* be forwarded
|
|
* -1 if no redirect shall be sent and the original message shall
|
|
* be discarded
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.IcmpRedirectSend", "2", INET_ICMP_REDIRECT_SEND),
|
|
|
|
/* != 0 if redirect messages shall be accepted and processed */
|
|
IP_SYSVAR("ipnet.inet.IcmpRedirectReceive", "yes", INET_ICMP_REDIRECT_RECEIVE),
|
|
|
|
/* == 0 if the stack shall answer to echo requests */
|
|
IP_SYSVAR("ipnet.inet.IcmpIgnoreEchoRequest", "no", INET_ICMP_IGNORE_ECHO_REQ),
|
|
|
|
/* == 0 if the stack shall answer to timestamp requests */
|
|
IP_SYSVAR("ipnet.inet.IcmpIgnoreTimestampRequest", "no", INET_ICMP_IGNORE_TIMESTAMP_REQ),
|
|
|
|
/* != 0 if the stack shall send time exceeded messages */
|
|
IP_SYSVAR("ipnet.inet.IcmpSendTimeExceeded", "yes", INET_ICMP_SEND_TIME_EXCEEDED),
|
|
|
|
/* != 0 if the stack shall send destination unreachable */
|
|
IP_SYSVAR("ipnet.inet.IcmpSendDestinationUnreachable", "yes", INET_ICMP_SEND_DST_UNREACHABLE),
|
|
|
|
/* == 0 if the stack should process ICMPs with src addr =
|
|
* broadcast (SMURF attack disable) */
|
|
IP_SYSVAR("ipnet.inet.IcmpIgnoreBroadcast", "1", INET_ICMP_IGNORE_BROADCAST),
|
|
|
|
/* == 1 if the stack shouldnt forward broadcasts(directed or otherwise) */
|
|
IP_SYSVAR("ipnet.inet.DontForwardBroadcast", "1", INET_DISABLE_BROADCAST_FWD),
|
|
|
|
/* != 0 if the stack shall send */
|
|
IP_SYSVAR("ipnet.inet.SendGratuitousArp", "yes",INET_SEND_GRATUITOUS_ARP),
|
|
|
|
/*
|
|
* != 0 if the stack shall automatically remove a configured
|
|
* address upon duplicate address detection (Gratuitous ARP)
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.DeleteAddressOnDuplicateDetect", "yes", INET_DELETE_ADDR_ON_DUPLICATE_DETECT),
|
|
|
|
#ifdef IPLITE_USE_RFC3927
|
|
/*
|
|
* Autoconfigure a link-local IPv4 address. Currently only
|
|
* implemented for Ethernet interfaces This configuration can also
|
|
* be set per interface by replacing "ipnet." with "ifname." (ex:
|
|
* eth0.inet.AutoConf)
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.AutoConf", "0", INET_AUTO_CONFIG),
|
|
|
|
/*
|
|
* List of interfaces that can configure a link-local IPv4
|
|
* address.
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.linklocal.IFNAME_LIST", "", INET_IPAIP_IFNAME_LIST),
|
|
|
|
/*
|
|
* The host will wait [0..PROBE_WAIT] seconds before creating a
|
|
* link local IPv4 and start checking it for uniqueness
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.linklocal.PROBE_WAIT", "1", INET_IPAIP_PROBE_WAIT),
|
|
|
|
/*
|
|
* Number of times a link local address is checked for uniqueness
|
|
* before being assigned
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.linklocal.PROBE_NUM", "3", INET_IPAIP_PROBE_NUM),
|
|
|
|
/* The next probe is sent after [PROBE_MIN..PROBE_MAX] seconds */
|
|
IP_SYSVAR("ipnet.inet.linklocal.PROBE_MIN", "1", INET_IPAIP_PROBE_MIN),
|
|
IP_SYSVAR("ipnet.inet.linklocal.PROBE_MAX", "3", INET_IPAIP_PROBE_MAX),
|
|
|
|
/*
|
|
* Time to wait (in seconds) before starting to announce the
|
|
* selected address. The address will not be defended if another
|
|
* announcement is heard during this period
|
|
* The address has been assigned to the interface when the annouce
|
|
* period starts
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.linklocal.ANNOUNCE_WAIT", "2", INET_IPAIP_ANNOUNCE_WAIT),
|
|
|
|
/* The number of announcements to send */
|
|
IP_SYSVAR("ipnet.inet.linklocal.ANNOUNCE_NUM", "2", INET_IPAIP_ANNOUNCE_NUM),
|
|
|
|
/* Seconds between announcements */
|
|
IP_SYSVAR("ipnet.inet.linklocal.ANNOUNCE_INTERVAL", "2", INET_IPAIP_ANNOUNCE_INTERVAL),
|
|
|
|
/*
|
|
* Maximum number of address collisions that is allowed before
|
|
* rate limiting is applied to creation of next address
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.linklocal.MAX_CONFLICTS", "10", INET_IPAIP_MAX_CONFLICTS),
|
|
|
|
/*
|
|
* Delay between successive address regeneration attempts when the
|
|
* regeneration is rate limited.
|
|
*/
|
|
IP_SYSVAR("ipnet.inet.linklocal.RATE_LIMIT_INTERVAL", "60", INET_IPAIP_RATE_LIMIT_INTERVAL),
|
|
|
|
/* Minimum interval between defensive ARPs */
|
|
IP_SYSVAR("ipnet.inet.linklocal.DEFEND_INTERVAL", "10", INET_IPAIP_DEFEND_INTERVAL),
|
|
|
|
#endif /* IPLITE_USE_RFC3927 */
|
|
|
|
{ IP_NULL, IP_NULL }
|
|
};
|
|
#endif /* IPCOM_USE_INET */
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPv6 VARIABLES
|
|
*===========================================================================
|
|
*/
|
|
#if defined(IP_PORT_VXWORKS) \
|
|
&& defined(IPCOM_USE_INET6) \
|
|
&& defined(INCLUDE_IPCOM_USE_INET6)
|
|
IP_STATIC IP_CONST Ipcom_sysvar ipv6_conf_sysvar[] =
|
|
{
|
|
/*
|
|
* All the inet6 variables can also be set per interface by
|
|
* replacing "ipnet." with "ifname." (ex:
|
|
* eth0.inet6.BaseHopLimit). The interface specific version
|
|
* overrides the "ipnet.inet6." version.
|
|
*/
|
|
|
|
/* The default hop limit for IPv6 packets */
|
|
IP_SYSVAR("ipnet.inet6.BaseHopLimit", "64", INET6_BASE_HOP_LIMIT),
|
|
|
|
/*
|
|
* Number of packets that can be waiting for IPv6 to link layer
|
|
* resolution to finish
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.MaxPending", "3", INET6_MAX_PKTS_PENDING),
|
|
|
|
/*
|
|
* Number of unicast neighbor discovery messages shall be sent for
|
|
* ND entry update before starting to use multicast solicit
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.MaxUnicastSolicit", "3", INET6_MAX_UNICAST_SOLICIT),
|
|
|
|
/*
|
|
* Number of neighbor discovery messages shall be resent before
|
|
* staring to use application solicit. setting this !=0 will cause
|
|
* IPv6 ready tests to fail, so change it only if you know what
|
|
* you are doing
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.MaxMulticastSolicit", "0", INET6_MAX_MULTICAST_SOLICIT),
|
|
|
|
/*
|
|
* Number of resolve message that is sent to routing/netlink
|
|
* sockets if ND probes failed (or is disabled)
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.MaxApplicationSolicit", "1", INET6_MAX_APP_SOLICIT),
|
|
|
|
/*
|
|
* Number of times the node shall test the address for uniqueness
|
|
* before assigning it to the interface (set to 0 to turn of
|
|
* Duplicate Address Detection)
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.DupAddrDetectTransmits", "1", INET6_DAD_TRANSMITS),
|
|
|
|
/*
|
|
* Duration, in seconds, that an entry in the NDP cache is in
|
|
* reachable state
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.BaseReachableTime", "30", INET6_BASE_REACHABLE_TIME),
|
|
|
|
/* Number of seconds to wait between retransmits */
|
|
IP_SYSVAR("ipnet.inet6.BaseRetransmitTime", "1", INET6_BASE_RETRANSMIT_TIME),
|
|
|
|
/*
|
|
* Duration, in seconds, to wait for a stale ND entry to become
|
|
* reachable before forcing a probe, packets will be sent using
|
|
* the stale entry during this time
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.DelayFirstProbeTime", "5", INET6_DELAY_FIRST_PROBE_TIME),
|
|
|
|
/* Duration, in seconds, that can pass before a stale entry in the neighbor
|
|
cache is deleted */
|
|
IP_SYSVAR("ipnet.inet6.NeighborCacheToLive", "1200", INET6_NBR_CACHE_TO_LIVE_TIME),
|
|
|
|
/*
|
|
* Duration, in seconds, that can pass before an entry in the
|
|
* destination cache is deleted, this lifetime is used by on
|
|
* entries created as a response to redirect and need frag ICMP
|
|
* messages
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.DstCacheToLive", "600", INET6_DST_CACHE_TO_LIVE_TIME),
|
|
|
|
/*
|
|
* The number of seconds this router can be used as gateway after
|
|
* a router advertisement had been sent, only used when configured
|
|
* as a router
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.RouterLifetime", "1800", INET6_ROUTER_LIFETIME),
|
|
|
|
/*
|
|
* Maximum number of router solicitation that will sent when the
|
|
* node is attached to a link. Set to 0 to disable router
|
|
* solicitations.
|
|
*/
|
|
|
|
{ "ipnet.inet6.RtSolicitationCount", "3" },
|
|
|
|
/*
|
|
* Minimum duration, in milliseconds, between two router
|
|
* solicitations messages sent to the same link
|
|
*/
|
|
{ "ipnet.inet6.RtSolicitationMinInterval", "1000" },
|
|
|
|
/*
|
|
* Maximum duration, in milliseconds, between two router
|
|
* solicitations messages sent to the same link
|
|
*/
|
|
{ "ipnet.inet6.RtSolicitationMaxInterval", "3000" },
|
|
|
|
/*
|
|
* IcmpRatelimitBucketsize is the number of ICMPv6 messages the
|
|
* stack is allowed to per IcmpRatelimitInterval millisecond
|
|
* interval. Set IcmpRatelimitInterval to 0 to disable the
|
|
* ratelimiter
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.IcmpRatelimitBucketsize", "100", INET6_ICMP_RATE_LIMIT_BUCKET_SIZE),
|
|
IP_SYSVAR("ipnet.inet6.IcmpRatelimitInterval", "1000", INET6_ICMP_RATE_LIMIT_INTERVAL),
|
|
|
|
/*
|
|
* 2 if a redirect shall be sent and the original message shall
|
|
* be forwarded (default)
|
|
* 1 if a redirect shall be sent but the original message shall
|
|
* be discarded
|
|
* 0 if no redirect shall be sent but the original message shall
|
|
* be forwarded
|
|
* -1 if no redirect shall be sent and the original message shall
|
|
* be discarded
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.IcmpRedirectSend", "2", INET6_ICMP_REDIRECT_SEND),
|
|
|
|
/* != 0 if redirect messages shall be accepted and processed */
|
|
IP_SYSVAR("ipnet.inet6.IcmpRedirectReceive", "yes", INET6_ICMP_REDIRECT_RECEIVE),
|
|
|
|
/* == 0 if the stack shall answer to echo requests */
|
|
IP_SYSVAR("ipnet.inet6.IcmpIgnoreEchoRequest", "no", INET6_ICMP_IGNORE_ECHO_REQ),
|
|
|
|
/* != 0 if the stack shall send time exceeded messages */
|
|
IP_SYSVAR("ipnet.inet6.IcmpSendTimeExceeded", "yes", INET6_ICMP_SEND_TIME_EXCEEDED),
|
|
|
|
/* != 0 if the stack shall send destination unreachable */
|
|
IP_SYSVAR("ipnet.inet6.IcmpSendDestinationUnreachable", "yes", INET6_ICMP_SEND_DST_UNREACHABLE),
|
|
|
|
/* Enable/disable processing of router advertisements message */
|
|
IP_SYSVAR("ipnet.inet6.AcceptRtAdv", "yes", INET6_ACCEPT_RTADV),
|
|
|
|
/* Enable/disable address autoconfiguration */
|
|
IP_SYSVAR("ipnet.inet6.AutoConf", "enabled", INET6_AUTO_CONFIG),
|
|
|
|
/*
|
|
* Enable to allow processing of IPv6 Routing Header type 0, its
|
|
* disabled by default since it is a potential security problem
|
|
*/
|
|
IP_SYSVAR("ipnet.inet6.RtHdr0", "disabled", INET6_RTHDR0),
|
|
|
|
{ IP_NULL, IP_NULL }
|
|
};
|
|
#endif /* IPCOM_USE_INET6 */
|
|
|
|
/*
|
|
*===========================================================================
|
|
* iplite_configure
|
|
*===========================================================================
|
|
* Description: Configure IPLITE
|
|
* Parameters:
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_PUBLIC Ip_err
|
|
iplite_configure(void)
|
|
{
|
|
/* Set ipv4 system variables. */
|
|
#if defined(IP_PORT_VXWORKS) \
|
|
&& defined(IPCOM_USE_INET) \
|
|
&& defined(INCLUDE_IPCOM_USE_INET)
|
|
(void)ipcom_sysvar_setv(ipv4_conf_sysvar, 0);
|
|
#endif
|
|
/* Set ipv6 system variables. */
|
|
#if defined(IP_PORT_VXWORKS) \
|
|
&& defined(IPCOM_USE_INET6) \
|
|
&& defined(INCLUDE_IPCOM_USE_INET6)
|
|
(void)ipcom_sysvar_setv(ipv6_conf_sysvar, 0);
|
|
#endif
|
|
/* Set TCP system variables. */
|
|
(void)ipcom_sysvar_setv(iptcp_conf_sysvar, 0);
|
|
|
|
#if !defined(IP_PORT_VXWORKS) || defined(INCLUDE_IPIFCONFIG_CMD)
|
|
(void)ipcom_shell_add_cmd("ifconfig", "ifconfig [ options ] <modifier...>",
|
|
"IPLITE interface configuration", iplite_cmd_ifconfig,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
#endif
|
|
|
|
#if !defined(IP_PORT_VXWORKS) || defined(INCLUDE_IPNETSTAT_CMD)
|
|
(void)ipcom_shell_add_cmd("netstat", "netstat [ options ]",
|
|
"IPLITE socket and route stats", iplite_cmd_netstat,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
#endif
|
|
|
|
#ifndef IP_PORT_VXWORKS
|
|
(void)ipcom_shell_add_cmd("iplite_ctrl", "iplite_ctrl [ options ]",
|
|
"IPLITE runtime debugger util", iplite_cmd_ctrl,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_LARGE);
|
|
#endif
|
|
|
|
#ifdef IPCOM_USE_INET
|
|
#if !defined(IP_PORT_VXWORKS) || defined(INCLUDE_IPARP_CMD)
|
|
(void)ipcom_shell_add_cmd("arp", "arp [ options ] <modifier...>",
|
|
"IPLITE arp control", iplite_cmd_arp,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
#endif
|
|
#endif
|
|
|
|
#if !defined(IP_PORT_VXWORKS) && defined(IPCOM_USE_INET6)
|
|
(void)ipcom_shell_add_cmd("ndp", "ndp [ options ] <modifier...>",
|
|
"IPLITE ndp control", iplite_cmd_ndp,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
#endif
|
|
|
|
/* Below shell commands use public APIs only */
|
|
#ifndef IP_PORT_OSE5
|
|
#if !defined(IP_PORT_VXWORKS) || defined(INCLUDE_IPROUTE_CMD)
|
|
(void)ipcom_shell_add_cmd("route", "route <cmd> {options]...>",
|
|
"IPLITE route control", iplite_cmd_route,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
#endif
|
|
|
|
#ifdef IPCOM_USE_INET
|
|
#if !defined(IP_PORT_VXWORKS) || defined(INCLUDE_IPPING_CMD)
|
|
(void)ipcom_shell_add_cmd("ping", "ping [ options ] <modifier...>",
|
|
"IPLITE ping utility", iplite_cmd_ping,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef IPCOM_USE_INET6
|
|
#if !defined(IP_PORT_VXWORKS) || defined(INCLUDE_IPPING6_CMD)
|
|
(void)ipcom_shell_add_cmd("ping6", "ping6 [ options ] <modifier...>",
|
|
"IPLITE ping6 utility", iplite_cmd_ping6,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
#endif
|
|
#endif
|
|
#endif /* IP_PORT_OSE5 */
|
|
|
|
return IPCOM_SUCCESS;
|
|
}
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|