206 lines
6.5 KiB
C
206 lines
6.5 KiB
C
/*
|
|
******************************************************************************
|
|
* INTERPEAK CONFIGURATION SOURCE FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: iprip_config.c,v $ $Revision: 1.12.12.2 $
|
|
* $Source: /home/interpeak/CVSRoot/iprip/config/iprip_config.c,v $
|
|
* $Author: hxie $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Lennart Bang <lob@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include "iprip_config.h"
|
|
|
|
#include "ipcom_cstyle.h"
|
|
#include "ipcom_err.h"
|
|
#include "ipcom_sysvar.h"
|
|
#include <ipcom_shell.h>
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 EXTERN PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
IP_PUBLIC int iprip_cmd_ripctrl(int argc, char **argv);
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 LOCAL PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
IP_PUBLIC Ip_err iprip_configure(void);
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 7 DATA
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* SYSVAR CONFIGURATION
|
|
*===========================================================================
|
|
*/
|
|
|
|
IP_STATIC IP_CONST Ipcom_sysvar iprip_conf_sysvar[] =
|
|
{
|
|
/* RIP regular update timeout in seconds (minium interval). */
|
|
IP_SYSVAR("iprip.update.seconds", "20", IPRIP_UPDATE_INTERVAL),
|
|
|
|
/* Variation to RIP updates in seconds (20-40 sec) */
|
|
IP_SYSVAR("iprip.update.deltaseconds", "20", IPRIP_UPDATE_DELTA),
|
|
|
|
/* Seconds til a RIP route expires. Default value accordingly to RFC 2453. */
|
|
IP_SYSVAR("iprip.expire.seconds", "180", IPRIP_EXPIRE_INTERVAL),
|
|
|
|
/* Seconds til a garbage RIP route is removed. Default value accordingly to RFC 2453. */
|
|
IP_SYSVAR("iprip.garbage.seconds", "120", IPRIP_GARBAGE_INTERVAL),
|
|
|
|
/* RIP flash delay in seconds. */
|
|
IP_SYSVAR("iprip.flash.seconds", "3", IPRIP_FLASH_DELAY),
|
|
|
|
/* Set to 1 if you require RIP requests to be authenticated as well. */
|
|
IP_SYSVAR("iprip.auth.requests", "0", IPRIP_AUTH_ENABLED),
|
|
|
|
/* Set to 1 if you want to drop host route. */
|
|
IP_SYSVAR("iprip.drop.hostroute", "0", IPRIP_DROP_HOSTROUTE),
|
|
|
|
{ IP_NULL, IP_NULL }
|
|
};
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* INTERFACES
|
|
*===========================================================================
|
|
* Description: Interface configuration.
|
|
* Syntax: "[all | ifname] [options] ...
|
|
* Options:
|
|
* broadcast - Use subnet broadcast output.
|
|
* multicast - Use multicast output (224.0.0.9).
|
|
* input-multicast - Accept multicast input (224.0.0.9).
|
|
* silent - Do not output RIP requests/responses.
|
|
* auth-md5=<pw> - Enable GateD style md5 authentication with <pw>
|
|
* auth-simple=<pw] - Enable simple authentication with <pw>.
|
|
* input=<no|v1|v2> - Change input mode (no,v1 or v2 only).
|
|
* metric=<num> - Change default metric from 1 to <num>.
|
|
* version-1 - Enable RIPv1 (default is RIPv2)
|
|
* nopoison - Use simple Split Horizon instead of poisonous.
|
|
*
|
|
* Note: Only use one of broadcast, multicast or silent options.
|
|
*/
|
|
IP_CONST char *iprip_interface_config[] =
|
|
{
|
|
#ifdef IPTESTENGINE
|
|
#elif defined(IP_PORT_VXWORKS)
|
|
#ifdef INCLUDE_IPRIP_IFCONFIG_1
|
|
IPRIP_IFCONFIG_1,
|
|
#endif /* INCLUDE_IPRIP_IFCONFIG_1 */
|
|
|
|
#ifdef INCLUDE_IPRIP_IFCONFIG_2
|
|
IPRIP_IFCONFIG_2,
|
|
#endif /* INCLUDE_IPRIP_IFCONFIG_2 */
|
|
|
|
#ifdef INCLUDE_IPRIP_IFCONFIG_3
|
|
IPRIP_IFCONFIG_3,
|
|
#endif /* INCLUDE_IPRIP_IFCONFIG_3 */
|
|
|
|
#ifdef INCLUDE_IPRIP_IFCONFIG_4
|
|
IPRIP_IFCONFIG_4,
|
|
#endif /* INCLUDE_IPRIP_IFCONFIG_4 */
|
|
#else /* IP_PORT_VXWORKS */
|
|
"all broadcast input-multicast",
|
|
"eth0 broadcast input-multicast input=v2",
|
|
"ppp0 silent metric=2 input=no",
|
|
#endif
|
|
IP_NULL
|
|
};
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* STATIC RIP ROUTES
|
|
*===========================================================================
|
|
* Description: Static RIP routes.
|
|
* Syntax: "dst=a.b.c.d mask=a.b.c.d gw=a.b.c.d"
|
|
* Options:
|
|
* metric=<num> - Change default metric from 1 to <num>.
|
|
*/
|
|
IP_CONST char *iprip_staticroute_config[] =
|
|
{
|
|
"dst=136.35.0.0 mask=255.255.0.0 gw=10.1.2.100 metric=3",
|
|
IP_NULL
|
|
};
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* AUTHENTICATION
|
|
*===========================================================================
|
|
*/
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* iprip_configure
|
|
*===========================================================================
|
|
* Description:
|
|
* Parameters:
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_PUBLIC Ip_err
|
|
iprip_configure(void)
|
|
{
|
|
/* Initialize IPRIP system variables. */
|
|
(void)ipcom_sysvar_setv(iprip_conf_sysvar, 0);
|
|
|
|
(void)ipcom_shell_add_cmd("ripctrl", "ripctrl <command> [-options] [args]",
|
|
"RIP daemon control", iprip_cmd_ripctrl,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
|
|
return IPCOM_SUCCESS;
|
|
}
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|
|
|