222 lines
7.6 KiB
C
222 lines
7.6 KiB
C
/* ipdiameterc_config.c - IPNet Diameter Components 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
|
|
--------------------
|
|
01i,16jul10,hfc secureKeyDB support for diameter
|
|
01h,12mar09,tlu Add Diameter EAP to application list
|
|
01g,10oct07,tlu Port to Linux
|
|
01f,08aug07,tlu Add TLS configration parameters
|
|
01e,10jul07,tlu Add local node TCP listening port number as a config parameter
|
|
01d,04jul07,tlu Add supported application IDs as a configuration parameter
|
|
01c,28jun07,tlu Add local host IP address as configuration parameters
|
|
01b,06jun07,tlu Update after code inspection
|
|
01a,04apr07,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_IPDIAMETERC_CMD
|
|
#endif
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 EXTERN PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#ifdef INCLUDE_IPDIAMETERC_CMD
|
|
IP_PUBLIC int ipdiameter_cmd_diameterc(int argc, char **argv);
|
|
#endif /* INCLUDE_IPDIAMETERC_CMD */
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 7 LOCAL PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
IP_PUBLIC Ip_err ipdiameterc_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,5", DIAMETER_APPLICATION_LIST ),
|
|
|
|
/* Diameter vendor ID */
|
|
IP_SYSVAR("ipdiameter.vendorid", "0",DIAMETER_VENDOR_ID),
|
|
|
|
/* Diameter ASR comply */
|
|
IP_SYSVAR("ipdiameter.asrcomply","1", DIAMETER_ASR_COMPLY),
|
|
|
|
/* Diameter session timeout in seconds */
|
|
IP_SYSVAR("ipdiameter.timeout.session","30", DIAMETER_SESSION_TIMEOUT),
|
|
|
|
/* Diameter authorization lifetime in seconds */
|
|
IP_SYSVAR("ipdiameter.timeout.authlifetime","360",DIAMETER_AUTH_LIFETIME),
|
|
|
|
/* Diameter auth grace period in seconds */
|
|
IP_SYSVAR("ipdiameter.timeout.authgraceperiod","30",DIAMETER_AUTH_GRACE_PERIOD),
|
|
|
|
/* 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
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipdiameterc_configure
|
|
*===========================================================================
|
|
* Description: Diameter client configuration function
|
|
* Parameters: none
|
|
* Returns: IPCOM_SUCCESS
|
|
*
|
|
*/
|
|
IP_PUBLIC Ip_err
|
|
ipdiameterc_configure(void)
|
|
{
|
|
/* Initialize IPDIAMETER system variables. */
|
|
(void)ipcom_sysvar_setv(ipdiameter_conf_sysvar, 0);
|
|
|
|
#ifdef INCLUDE_IPDIAMETERC_CMD
|
|
/* Add the diameter client command */
|
|
(void)ipcom_shell_add_cmd("diameterc", "diameterc [command] <modifier...>",
|
|
"Diameterc", ipdiameter_cmd_diameterc,
|
|
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
|
|
#endif /* INCLUDE_IPDIAMETERC_CMD */
|
|
|
|
return IPCOM_SUCCESS;
|
|
}
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|
|
|