original files of m241

This commit is contained in:
neelimap
2026-07-30 11:19:44 +05:30
parent 170c2b3f3a
commit afc7070c1f
12254 changed files with 7655111 additions and 0 deletions
@@ -0,0 +1,62 @@
/* 01older_ipnet_diameter.cdf - IPNet Diameter configuration file */
/*
* Copyright (c) 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
--------------------
01f,16jul10,hfc secureKeyDB support for diameter
01e,08dec08,tlu Add component for Diameter EAP
01d,08nov07,tlu Add component for proxy agent and change the folder
as SELECTION to select either client or proxy agent
01c,19jul07,cwu Add shell command for proxy agent
01b,06jun07,tlu Update after code inspection
01a,04apr07,tlu Created.
*/
#if defined(_WRS_CONFIG_COMPONENT_IPDIAMETERC) || defined(_WRS_CONFIG_COMPONENT_IPDIAMETERP)
Folder FOLDER_DIAMETER {
NAME Diameter Components
SYNOPSIS Folder for Diameter Components
CHILDREN FOLDER_DIAMETER_NODE \
SELECT_NODE_CMD \
INCLUDE_IPDIAMETER_EAP
_CHILDREN FOLDER_NET_L5_APPLICATIONS
}
Folder FOLDER_DIAMETER_NODE {
NAME Diameter Nodes
SYNOPSIS Folder for Diameter Node Components
CHILDREN SELECT_NODE \
INCLUDE_IPDIAMETER_TLS_CFG
_CHILDREN FOLDER_DIAMETER
}
Selection SELECT_NODE {
NAME Diametr Node Selection
SYNOPSIS Select Diameter Node
COUNT 1-1
CHILDREN INCLUDE_IPDIAMETERC \
INCLUDE_IPDIAMETERP
_CHILDREN FOLDER_DIAMETER_NODE
}
Selection SELECT_NODE_CMD {
NAME Diametr Shell Commands Selection
SYNOPSIS Select Diameter Shell Commands Corresponding to Node Selection
COUNT 1-1
CHILDREN INCLUDE_IPDIAMETERC_CMD \
INCLUDE_IPDIAMETERP_CMD
_CHILDREN FOLDER_DIAMETER
}
#endif
@@ -0,0 +1,338 @@
/* 02comp_ipnet_diameter.cdf - IPNet Diameter Components configuration file */
/*
* Copyright (c) 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
--------------------
01p,16noc10,tlu Set the default value of DIAMETER_TLS_ROOT_DIR to ""
01o,16jul10,hfc secureKeyDB support for diameter
01n,08dec08,tlu Add component for Diameter EAP
01m,28nov07,tlu Fix typos
01l,12nov07,tlu Rename proxy agent shell command file name
01k,08nov07,tlu Add component for Diameter proxy agent
01j,19jul07,cwu Add component for Diameter proxy agent shell command
01i,24sep07,tlu Modify component names
01h,07sep07,tlu Modify configuration parameter names for visual improvement
01g,17aug07,tlu Update after code inspection
01f,09jul07,tlu Add TLS configuration parameters
01e,10jul07,tlu Add local node TCP listening port as a configuration 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.
*/
#if defined(_WRS_CONFIG_COMPONENT_IPDIAMETERC) || defined(_WRS_CONFIG_COMPONENT_IPDIAMETERP)
Component INCLUDE_IPDIAMETERC {
NAME Diameter Client
SYNOPSIS Diameter client component
MODULES ipdiameter_client.o
CONFIGLETTES ipdiameterc_config.c
CFG_PARAMS DIAMETER_IDENTIFIER \
DIAMETER_HOST_REALM \
DIAMETER_HOST_DOMAIN \
DIAMETER_HOST_IPV4_ADDRESS \
DIAMETER_HOST_IPV6_ADDRESS \
DIAMETER_HOST_TCP_PORT \
DIAMETER_APPLICATION_LIST \
DIAMETER_VENDOR_ID \
DIAMETER_ASR_COMPLY \
DIAMETER_SESSION_TIMEOUT \
DIAMETER_AUTH_LIFETIME \
DIAMETER_AUTH_GRACE_PERIOD \
DIAMETER_PEER_RECONN_INTERVAL \
DIAMETER_PEER_MAX_RECONN_ATTEMPT \
DIAMETER_WATCHDOG_TIMEOUT \
DIAMETER_REQ_RETX_INTERVAL \
DIAMETER_REQ_MAX_RETX
REQUIRES INCLUDE_IPDIAMETER_TLS_CFG
}
Component INCLUDE_IPDIAMETERP {
NAME Diameter Proxy Agent
SYNOPSIS Diameter proxy agent component
MODULES ipdiameter_pagent.o
CONFIGLETTES ipdiameterp_config.c
CFG_PARAMS DIAMETER_IDENTIFIER \
DIAMETER_HOST_REALM \
DIAMETER_HOST_DOMAIN \
DIAMETER_HOST_IPV4_ADDRESS \
DIAMETER_HOST_IPV6_ADDRESS \
DIAMETER_HOST_TCP_PORT \
DIAMETER_APPLICATION_LIST \
DIAMETER_VENDOR_ID \
DIAMETER_PEER_RECONN_INTERVAL \
DIAMETER_PEER_MAX_RECONN_ATTEMPT \
DIAMETER_WATCHDOG_TIMEOUT \
DIAMETER_REQ_RETX_INTERVAL \
DIAMETER_REQ_MAX_RETX
REQUIRES INCLUDE_IPDIAMETER_TLS_CFG
}
Component INCLUDE_IPDIAMETERC_CMD {
NAME Diameter Client Commands
SYNOPSIS IPCOM shell commands for diameter client
MODULES ipdiameter_cmd_diameterc.o
REQUIRES INCLUDE_IPCOM_SHELL_CMD
}
Component INCLUDE_IPDIAMETERP_CMD {
NAME Diameter Proxy Agent Commands
SYNOPSIS IPCOM shell commands for diameter proxy agent
MODULES ipdiameter_cmd_diameterp.o
REQUIRES INCLUDE_IPCOM_SHELL_CMD
}
Component INCLUDE_IPDIAMETER_TLS_CFG {
NAME Diameter TLS Configuration
SYNOPSIS Diameter TLS configuration parameters
REQUIRES INCLUDE_IPSSL
CFG_PARAMS DIAMETER_TLS_ENABLED \
DIAMETER_TLS_CERTIFICATE \
DIAMETER_TLS_ROOT_CERTIFICATE \
DIAMETER_TLS_ROOT_DIR
}
#ifdef _WRS_CONFIG_IPDIAMETER_SEC_KEY_DB
Component INCLUDE_IPDIAMETER_TLS_CFG {
REQUIRES+= INCLUDE_IPCOM_USE_KEY_DB
}
#endif
Component INCLUDE_IPDIAMETER_EAP {
NAME Diameter EAP
SYNOPSIS Diameter EAP application component
MODULES ipdiameter_eap.o
REQUIRES INCLUDE_IPDIAMETERC
}
/******************** Configuration Parameters *****************************/
Parameter DIAMETER_IDENTIFIER {
NAME Entity Identifier
SYNOPSIS DIAMETER entity identity, which is the node's FQDN. \
This identity string is used to get the node's address \
via getaddrinfo function. Hence, users MUST enter a \
valid resolvable entry for this string.
TYPE char *
DEFAULT "apple.example.com"
}
Parameter DIAMETER_HOST_REALM {
NAME Realm
SYNOPSIS DIAMETER realm to which the Diameter node belongs.
TYPE char *
DEFAULT "example.com"
}
Parameter DIAMETER_HOST_DOMAIN {
NAME Domain
SYNOPSIS DIAMETER local node address family, IP_AF_INET=2 \
or IP_AF_INET6=28.
TYPE char *
DEFAULT "2"
}
Parameter DIAMETER_HOST_IPV4_ADDRESS {
NAME IPv4 Address
SYNOPSIS DIAMETER local node's IPv4 address.
TYPE char *
DEFAULT "10.1.2.1"
}
Parameter DIAMETER_HOST_IPV6_ADDRESS {
NAME IPv6 Address
SYNOPSIS DIAMETER local node's IPv6 address.
TYPE char *
DEFAULT "3ffe:300::5"
}
Parameter DIAMETER_HOST_TCP_PORT {
NAME TCP Port
SYNOPSIS DIAMETER local node's TCP listening port number.
TYPE char *
DEFAULT "3868"
}
Parameter DIAMETER_APPLICATION_LIST {
NAME Application List
SYNOPSIS List of application IDs that Diameter local node supports. \
Refer to RFC 3588, section 2.4. The Format is a \
comma-separated list of application IDs, e.g. "1,2", where \
1 represents Diameter NASREQ, and 2 represents Diameter \
Mobile-IP.
TYPE char *
DEFAULT "2"
}
Parameter DIAMETER_VENDOR_ID {
NAME Vendor ID
SYNOPSIS Specifies the IANA "SMI Network Management Private Enterprise \
Codes" [ASSIGNNO] value assigned to the vendor of the \
Diameter application. Refer to RFC 3588, section 5.3.3.
TYPE char *
DEFAULT "0"
}
Parameter DIAMETER_ASR_COMPLY {
NAME ASR Compliance
SYNOPSIS Specifies whether to terminate a session when receiving an ASR. \
Specify 1 to terminate the sesion upcon receiving an ASR, \
and 0 to ignore the ASR. Refer to RFC 3588, section 8.5.2.
TYPE char *
DEFAULT "1"
}
Parameter DIAMETER_SESSION_TIMEOUT {
NAME Session Timeout Interval
SYNOPSIS Specifies the timeout in seconds before a session requires \
re-authentication. Refer to RFC 3588, section 8.13.
TYPE char *
DEFAULT "30"
}
Parameter DIAMETER_AUTH_LIFETIME {
NAME Authorization Lifetime
SYNOPSIS Specifies the maximum number of seconds of service to \
be provided to the user before the user is to be \
re-authenticated and/or re-authorized. Refer to RFC 3588, \
section 8.9.
TYPE char *
DEFAULT "360"
}
Parameter DIAMETER_AUTH_GRACE_PERIOD {
NAME Authorization Grace Period
SYNOPSIS Specifies the number of seconds the Diameter server will \
wait following the expiration of the Authorization-Lifetime \
AVP before cleaning up resources for the session. Refer to \
RFC 3588, section 8.10.
TYPE char *
DEFAULT "30"
}
Parameter DIAMETER_PEER_RECONN_INTERVAL {
NAME Peer Reconnection Interval
SYNOPSIS Specifies the interval between reconnection attemps. \
The recommended value is 30 seconds. Refer to \
RFC 3588, section 12.
TYPE char *
DEFAULT "30"
}
Parameter DIAMETER_PEER_MAX_RECONN_ATTEMPT {
NAME Max Peer Reconnect Attempts
SYNOPSIS Specifies the max number of peer reconnection attempts.
TYPE char *
DEFAULT "30"
}
Parameter DIAMETER_WATCHDOG_TIMEOUT {
NAME Watchdog Timeout Interval
SYNOPSIS Specifies the Diameter transport watchdog timeout interval \
in seconds. Refer to RFC 3588, section 5.5.
TYPE char *
DEFAULT "30"
}
Parameter DIAMETER_REQ_RETX_INTERVAL {
NAME Request Retransmission Interval
SYNOPSIS Specifies the number of seconds Diameter node will \
retransmit a request before receiving the answer to the \
request.
TYPE char *
DEFAULT "10"
}
Parameter DIAMETER_REQ_MAX_RETX {
NAME Max Request Retransmissions
SYNOPSIS Specifies the maximum number of a request to issue \
before declaring a request failure.
TYPE char *
DEFAULT "3"
}
Parameter DIAMETER_TLS_ENABLED {
NAME Enable TLS
SYNOPSIS Control whether TLS is enabled or not on the local node. \
If set to "1", TLS is enabled on the local node; if set \
to "0", it is disabled. If TLS is enabled, IPSSL and its \
requirements must be built, the other Diameter TLS \
configuration parameters must be configured properly, \
and certiface files and private key file must be loaded.
TYPE char *
DEFAULT "0"
}
Parameter DIAMETER_TLS_CERTIFICATE {
NAME TLS Certificate File
SYNOPSIS Local node's certificate file.
TYPE char *
DEFAULT "certfile.pem"
}
#ifdef _WRS_CONFIG_IPDIAMETER_SEC_KEY_DB
Parameter DIAMETER_TLS_KEY_ID {
NAME TLS Private Key ID
SYNOPSIS This KeyId will be used to retrieve private key file \
from secure key database.If IPDIAMETER_SEC_KEY_DB is selected \
at VSB then user has to import the private \
key file into secure key database using this keyid inorder to \
retrieve it at run time otherwise diameter with TLS security \
will not work.
TYPE char *
DEFAULT "diameterTlsPKeyId"
_CFG_PARAMS INCLUDE_IPDIAMETER_TLS_CFG
}
#else
Parameter DIAMETER_TLS_KEY_FILE {
NAME TLS Private Key File
SYNOPSIS Local node's private key file.
TYPE char *
DEFAULT "keyfile.pem"
_CFG_PARAMS INCLUDE_IPDIAMETER_TLS_CFG
}
Parameter DIAMETER_TLS_KEY_PASSWORD {
NAME TLS Key File Key Password
SYNOPSIS Local node's private key file key password
TYPE char *
DEFAULT "clientkey"
_CFG_PARAMS INCLUDE_IPDIAMETER_TLS_CFG
}
#endif /* _WRS_CONFIG_IPDIAMETER_SEC_KEY_DB */
Parameter DIAMETER_TLS_ROOT_CERTIFICATE {
NAME TLS CA Root Certificate File
SYNOPSIS CA root certificate file.
TYPE char *
DEFAULT "cacertfile.pem"
}
Parameter DIAMETER_TLS_ROOT_DIR {
NAME TLS Certificate Root Directory
SYNOPSIS The root location of the CA root certificate.
TYPE char *
DEFAULT ""
}
#endif /* _WRS_CONFIG_COMPONENT_IPDIAMETER */
@@ -0,0 +1,11 @@
# Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: common.vxconfig,v $ $Revision: 1.11 $
# $Source: /home/interpeak/CVSRoot/ipdiameter/config/common.vxconfig,v $
# $Author: myakan $
# $State: Exp $ $Locker: $
#
# INTERPEAK_COPYRIGHT_STRING
#hidden option that enables IPDIAMETERC/IPDIAMETERP
config SUPPORTS_DIAMETER
bool
default y
@@ -0,0 +1,80 @@
/*
* Copyright 2007 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01c,14sep10,hfc change syslog priority as per netConfig enhancement
01b,15apr09,tlu Add macro for dynamic peer discovery feature
01a,03apr07,tlu Initial creation
*/
#ifndef IPDIAMETER_CONFIG_H
#define IPDIAMETER_CONFIG_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 3 DEFINES
****************************************************************************
*/
/* Syslog priority */
#if defined(_WRS_CONFIG_IPDIAMETER_SYSLOG_PRIORITY)
#define IPDIAMETER_SYSTEM_PRIORITY _WRS_CONFIG_IPDIAMETER_SYSLOG_PRIORITY
#else
#define IPDIAMETER_SYSTEM_PRIORITY IPCOM_LOG_WARNING
#endif
/* Macro for dynamic peer discovery feature */
#undef IPDIAMETER_DYNAMIC_PEER_DISCOVERY
/*
****************************************************************************
* 4 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 5 PROTOTYPES
****************************************************************************
*/
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,221 @@
/* 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
****************************************************************************
*/
@@ -0,0 +1,204 @@
/* 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
****************************************************************************
*/