205 lines
6.7 KiB
C
205 lines
6.7 KiB
C
/* ipdiameterp_config.c - Diameter proxy agent configellete 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
|
|
--------------------
|
|
01d,16jul10,hfc secureKeyDB support for diameter
|
|
01c,11dec07,tlu Port to Linux
|
|
01b,13nov07,tlu Add timer config parameters
|
|
01a,08nov07,tlu created.
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
#if 0
|
|
#include "ipdiameter_config.h"
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include "ipcom_cstyle.h"
|
|
#include "ipcom_err.h"
|
|
#include "ipcom_sysvar.h"
|
|
#include "ipcom_shell.h"
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#if !defined(WRS_IPNET) && !defined(PRJ_BUILD)
|
|
#define INCLUDE_IPDIAMETERP_CMD
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 EXTERN PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#ifdef INCLUDE_IPDIAMETERP_CMD
|
|
IP_PUBLIC int ipdiameter_cmd_diameterp(int argc, char **argv);
|
|
#endif /* INCLUDE_IPDIAMETERP_CMD */
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 7 LOCAL PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
IP_PUBLIC Ip_err ipdiameterp_configure(void);
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 8 DATA
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
*===========================================================================
|
|
* SYSVAR CONFIGURATION
|
|
*===========================================================================
|
|
*/
|
|
|
|
IP_STATIC IP_CONST Ipcom_sysvar ipdiameter_conf_sysvar[] =
|
|
{
|
|
/* Diameter Identifier: node's FQDN. e.g. apple.example.com */
|
|
IP_SYSVAR("ipdiameter.identifier","apple.example.com", DIAMETER_IDENTIFIER),
|
|
|
|
/* Diameter realm, e.g. example.com */
|
|
IP_SYSVAR("ipdiameter.realm", "example.com", DIAMETER_HOST_REALM),
|
|
|
|
/* Diameter local node's address family, e.g. IP_AF_INET */
|
|
IP_SYSVAR("ipdiameter.domain","2", DIAMETER_HOST_DOMAIN),
|
|
|
|
/* Diameter local node's IPv4 address, e.g. "10.1.2.1" */
|
|
IP_SYSVAR("ipdiameter.ipv4_address", "10.1.2.1", DIAMETER_HOST_IPV4_ADDRESS),
|
|
|
|
/* Diameter local node's IPv6 address, e.g. "3ffe:300::5" */
|
|
IP_SYSVAR("ipdiameter.ipv6_address","3ffe:300::5", DIAMETER_HOST_IPV6_ADDRESS),
|
|
|
|
/* Diameter local node's TCP port number, default "3868" */
|
|
IP_SYSVAR("ipdiameter.tcp_port","3868", DIAMETER_HOST_TCP_PORT),
|
|
|
|
/* Diameter supported application IDs */
|
|
IP_SYSVAR("ipdiameter.appl_list", "2", DIAMETER_APPLICATION_LIST),
|
|
|
|
/* Diameter vendor ID */
|
|
IP_SYSVAR("ipdiameter.vendorid", "0", DIAMETER_VENDOR_ID),
|
|
|
|
/* Diameter peer reconnect interval in seconds */
|
|
IP_SYSVAR("ipdiameter.timeout.reconninterval","30", DIAMETER_PEER_RECONN_INTERVAL),
|
|
|
|
/* Diameter max peer reconnection attempts */
|
|
IP_SYSVAR("ipdiameter.maxreconnattempt", "30", DIAMETER_PEER_MAX_RECONN_ATTEMPT),
|
|
|
|
/* Diameter watchdog timeout in seconds */
|
|
IP_SYSVAR("ipdiameter.timeout.watchdog","30", DIAMETER_WATCHDOG_TIMEOUT ),
|
|
|
|
/* Diameter request retransmission interval in seconds */
|
|
IP_SYSVAR("ipdiameter.timeout.reqretxinterval","10", DIAMETER_REQ_RETX_INTERVAL ),
|
|
|
|
/* Diameter max request retransmission */
|
|
IP_SYSVAR("ipdiameter.maxreqretx","3", DIAMETER_REQ_MAX_RETX),
|
|
|
|
/* Enable TLS flag on Diameter local node */
|
|
IP_SYSVAR("ipdiameter.tls", "0", DIAMETER_TLS_ENABLED),
|
|
|
|
/* Diameter local node's TLS certificate file */
|
|
IP_SYSVAR("ipdiameter.tls.certfile","certfile.pem", DIAMETER_TLS_CERTIFICATE),
|
|
|
|
#ifdef _WRS_CONFIG_IPDIAMETER_SEC_KEY_DB
|
|
/* Diameter local node's TLS private key ID */
|
|
IP_SYSVAR("ipdiameter.tls.tlsPKeyId", "diameterTlsPKeyId",DIAMETER_TLS_KEY_ID),
|
|
#else
|
|
/* Diameter local node's TLS private key file */
|
|
IP_SYSVAR("ipdiameter.tls.keyfile","keyfile.pem", DIAMETER_TLS_KEY_FILE ),
|
|
|
|
/* Diameter local node's TLS key file's key password */
|
|
IP_SYSVAR("ipdiameter.tls.keypasswd","clientkey", DIAMETER_TLS_KEY_PASSWORD ),
|
|
#endif /* _WRS_CONFIG_IPDIAMETER_SEC_KEY_DB */
|
|
|
|
/* Diameter TLS CA root certificate file */
|
|
IP_SYSVAR("ipdiameter.tls.cacertfile","cacertfile.pem", DIAMETER_TLS_ROOT_CERTIFICATE ),
|
|
|
|
/* Diameter TLS certificate root directory */
|
|
IP_SYSVAR("ipdiameter.tls.rootdir","/romfs", DIAMETER_TLS_ROOT_DIR ),
|
|
|
|
{ IP_NULL, IP_NULL }
|
|
};
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* PUBLIC FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipdiameterp_configure
|
|
*===========================================================================
|
|
* Description: Diameter proxy agent configuration function
|
|
* Parameters: none
|
|
* Returns: IPCOM_SUCCESS
|
|
*
|
|
*/
|
|
IP_PUBLIC Ip_err
|
|
ipdiameterp_configure(void)
|
|
{
|
|
/* Initialize IPDIAMETER system variables. */
|
|
(void)ipcom_sysvar_setv(ipdiameter_conf_sysvar, 0);
|
|
|
|
#ifdef INCLUDE_IPDIAMETERP_CMD
|
|
/* Add the diameter proxy agent command */
|
|
(void)ipcom_shell_add_cmd("diameterp", "diameterp [command] <modifier...>",
|
|
"Diameterp", ipdiameter_cmd_diameterp,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
#endif /* INCLUDE_IPDIAMETERP_CMD */
|
|
|
|
return IPCOM_SUCCESS;
|
|
}
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|
|
|