Upgrade freeDiameter version to 1.3.2

This commit is contained in:
Sukchan Lee 2019-11-02 15:52:48 +09:00
parent f2831ff1fd
commit e55c7f9174
462 changed files with 2257 additions and 129031 deletions

View File

@ -19,7 +19,6 @@ mme:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: hss.localdomain
addr: 127.0.0.4
@ -94,7 +93,6 @@ hss:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: mme.localdomain
addr: 127.0.0.2

View File

@ -229,7 +229,6 @@ LoadExtension = "@libdir@/freeDiameter/dict_nasreq.fdx";
LoadExtension = "@libdir@/freeDiameter/dict_nas_mipv6.fdx";
LoadExtension = "@libdir@/freeDiameter/dict_dcca.fdx";
LoadExtension = "@libdir@/freeDiameter/dict_dcca_3gpp.fdx";
LoadExtension = "@libdir@/freeDiameter/dict_s6a.fdx";
##############################################################

View File

@ -229,7 +229,6 @@ LoadExtension = "@libdir@/freeDiameter/dict_nasreq.fdx";
LoadExtension = "@libdir@/freeDiameter/dict_nas_mipv6.fdx";
LoadExtension = "@libdir@/freeDiameter/dict_dcca.fdx";
LoadExtension = "@libdir@/freeDiameter/dict_dcca_3gpp.fdx";
LoadExtension = "@libdir@/freeDiameter/dict_s6a.fdx";
##############################################################

View File

@ -23,7 +23,7 @@ conf_data.set('libdir', libdir)
conf_data.set('localstatedir', localstatedir)
freediameter_extensions_builddir = join_paths(
meson.build_root(), 'subprojects', freediameter_subdir, 'extensions')
meson.build_root(), 'subprojects', 'freeDiameter', 'extensions')
conf_data.set('freediameter_extensions_builddir',
freediameter_extensions_builddir)

View File

@ -19,7 +19,6 @@ mme:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: hss.localdomain
addr: 127.0.0.4
@ -60,7 +59,6 @@ hss:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: mme.localdomain
addr: 127.0.0.2

View File

@ -19,7 +19,6 @@ mme:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: hss.localdomain
addr: 127.0.0.4
@ -60,7 +59,6 @@ hss:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: mme.localdomain
addr: 127.0.0.2

View File

@ -19,7 +19,6 @@ mme:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: hss.localdomain
addr: 127.0.0.4
@ -60,7 +59,6 @@ hss:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: mme.localdomain
addr: 127.0.0.2

View File

@ -20,7 +20,6 @@ mme:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: hss.open-ims.test
addr: 127.0.0.4
@ -61,7 +60,6 @@ hss:
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
- module: @freediameter_extensions_builddir@/dict_s6a.fdx
connect:
- identity: mme.open-ims.test
addr: 127.0.0.2

147
lib/diameter/common/dict.c Normal file
View File

@ -0,0 +1,147 @@
/*********************************************************************************************************
* Software License Agreement (BSD License) *
* Author: Thomas Klausner <tk@giga.or.at> *
* *
* Copyright (c) 2013, Thomas Klausner *
* All rights reserved. *
* *
* Written under contract by nfotex IT GmbH, http://nfotex.com/ *
* *
* Redistribution and use of this software in source and binary forms, with or without modification, are *
* permitted provided that the following conditions are met: *
* *
* * Redistributions of source code must retain the above *
* copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above *
* copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other *
* materials provided with the distribution. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF *
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*********************************************************************************************************/
#include <freeDiameter/extension.h>
/* The content of this file follows the same structure as dict_base_proto.c */
#define CHECK_dict_new( _type, _data, _parent, _ref ) \
CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct local_rules_definition {
struct dict_avp_request avp_vendor_plus_name;
enum rule_position position;
int min;
int max;
};
#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 )
/* Attention! This version of the macro uses AVP_BY_NAME_AND_VENDOR, in contrast to most other copies! */
#define PARSE_loc_rules( _rulearray, _parent) { \
int __ar; \
for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \
struct dict_rule_data __data = { NULL, \
(_rulearray)[__ar].position, \
0, \
(_rulearray)[__ar].min, \
(_rulearray)[__ar].max}; \
__data.rule_order = RULE_ORDER(__data.rule_position); \
CHECK_FCT( fd_dict_search( \
fd_g_config->cnf_dict, \
DICT_AVP, \
AVP_BY_NAME_AND_VENDOR, \
&(_rulearray)[__ar].avp_vendor_plus_name, \
&__data.rule_avp, 0 ) ); \
if ( !__data.rule_avp ) { \
TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return ENOENT; \
} \
CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \
{ \
TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \
(_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return EINVAL; \
} ); \
} \
}
#define enumval_def_u32( _val_, _str_ ) \
{ _str_, { .u32 = _val_ }}
#define enumval_def_os( _len_, _val_, _str_ ) \
{ _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}}
int ogs_dict_common_entry(char *conffile)
{
/* Applications section */
{
{
struct dict_vendor_data vendor_data = { 13019, "ETSI" };
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_VENDOR, &vendor_data, NULL, NULL));
}
}
struct dict_object * UTF8String_type;
CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type);
/* Logical-Access-ID */
{
struct dict_avp_data data = {
302, /* Code */
13019, /* Vendor */
"Logical-Access-ID", /* Name */
AVP_FLAG_VENDOR, /* Fixed flags */
AVP_FLAG_VENDOR, /* Fixed flag values */
AVP_TYPE_OCTETSTRING /* base type of data */
};
CHECK_dict_new(DICT_AVP, &data, NULL, NULL);
};
/* Physical-Access-ID */
{
struct dict_avp_data data = {
313, /* Code */
13019, /* Vendor */
"Physical-Access-ID", /* Name */
AVP_FLAG_VENDOR, /* Fixed flags */
AVP_FLAG_VENDOR, /* Fixed flag values */
AVP_TYPE_OCTETSTRING /* base type of data */
};
CHECK_dict_new(DICT_AVP, &data, UTF8String_type, NULL);
};
/* Reservation-Priority */
{
struct dict_avp_data data = {
458, /* Code */
13019, /* Vendor */
"Reservation-Priority", /* Name */
AVP_FLAG_VENDOR |AVP_FLAG_MANDATORY, /* Fixed flags */
AVP_FLAG_VENDOR, /* Fixed flag values */
AVP_TYPE_UNSIGNED32 /* base type of data */
};
CHECK_dict_new(DICT_AVP, &data, NULL, NULL);
};
LOG_D( "Extension 'Dictionary definitions for DCCA 3GPP' initialized");
return 0;
}
#if 0 /* modified by acetcom */
EXTENSION_ENTRY("dict_ogs_common", ogs_dict_common_entry, "dict_dcca_3gpp");
#endif

View File

@ -23,6 +23,7 @@ libdiameter_common_sources = files('''
base.h
libapp_sip.c
dict.c
message.c
logger.c
config.c
@ -31,12 +32,23 @@ libdiameter_common_sources = files('''
libdiameter_common_inc = include_directories('.')
libfdcore_dep = freediameter_proj.get_variable('libfdcore_dep')
# At this point, Open5GS always use the subproject of freeDiameter
freeDiameter_proj = subproject('freeDiameter')
libfdcore_dep = freeDiameter_proj.get_variable('libfdcore_dep')
libdiameter_common_cc_flags = ['-DOGS_DIAM_COMPILATION']
libdiameter_common_cc_flags += cc.get_supported_arguments([
'-Wno-missing-prototypes',
'-Wno-missing-declarations',
'-Wno-discarded-qualifiers',
'-Wno-incompatible-pointer-types',
'-Wno-strict-prototypes',
])
libdiameter_common = library('ogsdiameter-common',
sources : libdiameter_common_sources,
version : libogslib_version,
c_args : '-DOGS_DIAM_COMPILATION',
c_args : libdiameter_common_cc_flags,
include_directories : [libdiameter_common_inc, libinc],
dependencies : [libcore_dep, libfdcore_dep],
install : true)

View File

@ -44,10 +44,14 @@ struct dict_object *ogs_diam_mip_home_agent_address = NULL;
struct dict_object *ogs_diam_vendor = NULL;
struct dict_object *ogs_diam_vendor_id = NULL;
extern int ogs_dict_common_entry(char *conffile);
int ogs_diam_message_init()
{
vendor_id_t id = OGS_3GPP_VENDOR_ID;
ogs_assert(ogs_dict_common_entry(NULL) == 0);
CHECK_dict_search( DICT_VENDOR, VENDOR_BY_ID, (void *)&id, &ogs_diam_vendor);
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Vendor-Id", &ogs_diam_vendor_id);

View File

@ -1,156 +1,286 @@
/*********************************************************************************************************
* Software License Agreement (BSD License) *
* Author: Thomas Klausner <tk@giga.or.at> *
* *
* Copyright (c) 2013, Thomas Klausner *
* All rights reserved. *
* *
* Written under contract by nfotex IT GmbH, http://nfotex.com/ *
* *
* Redistribution and use of this software in source and binary forms, with or without modification, are *
* permitted provided that the following conditions are met: *
* *
* * Redistributions of source code must retain the above *
* copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above *
* copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other *
* materials provided with the distribution. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF *
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*********************************************************************************************************/
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
/*
* Dictionary definitions for objects specified for DCCA by 3GPP.
*
* This file is part of Open5GS.
* This extensions contains a lot of AVPs from various 3GPP standards
* documents, and some rules for the grouped AVPs described therein.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This extension does not contain ALL AVPs described by 3GPP, but
* quite a big number of them.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* When extending the AVPs, please edit dict_rx.org instead and
* create pastable code with contrib/tools/org_to_fd.pl.
*
* Some points of consideration:
* 1. This dictionary could be split up per document.
*
* + pro: you can only load the AVPs/Rules you're interested in ->
* smaller memory size
*
* - con: the documents use AVPs from each other A LOT, so setting the
* dependencies correctly will be annoying
*
* - con: you need to load all of them as extensions
*
* 2. This dictionary contains ONE AVP in the "3GPP2" vendor space,
* since I found it wasteful to write a separate dictionary just for
* one AVP. Also, it is defined in a 3GPP document.
*
* 3. While there are quite a number of rules here already, many more
* are missing. I've only added rules for those grouped AVPs or
* commands in which I was concretely interested so far; many more
* will need to be added to make this complete.
*
* That being said, I hope this will be useful for you.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-diameter-gx.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
/*
* Some comments on the 3GPP Standards documents themselves:
*
* 1. It would be good if 29.061 was reviewed to check for each AVP if
* it is Mandatory or not. The data currently in the document does not
* match what was in the previous version of the freeDiameter
* extension (the one that existedbefore I rewrote it) or what I saw
* so far. IIRC, even the table and the document contradict each
* other. The AVP table is also missing an entry for
* "External-Identifier", 28.
*
* 2. 29.140 has conflicting AVP names with other documents:
* - Sequence-Number is also in 32.329
* - Recipient-Address is also in 32.299
* - Status is also in 32.299
*
* 3. 29.229 has name conflict with 29.329 about User-Data (different
* AVP code 702, instead of 606) -- the weird thing is, the latter
* uses some AVPs from the former, but not this one.
*/
#include <freeDiameter/extension.h>
struct dict_object *ogs_diam_gx_application = NULL;
struct dict_object *ogs_diam_gx_cmd_ccr = NULL;
struct dict_object *ogs_diam_gx_cmd_cca = NULL;
struct dict_object *ogs_diam_gx_cmd_rar = NULL;
struct dict_object *ogs_diam_gx_cmd_raa = NULL;
/* The content of this file follows the same structure as dict_base_proto.c */
struct dict_object *ogs_diam_gx_cc_request_type = NULL;
struct dict_object *ogs_diam_gx_cc_request_number = NULL;
struct dict_object *ogs_diam_gx_network_request_support = NULL;
struct dict_object *ogs_diam_gx_subscription_id = NULL;
struct dict_object *ogs_diam_gx_subscription_id_type = NULL;
struct dict_object *ogs_diam_gx_subscription_id_data = NULL;
struct dict_object *ogs_diam_gx_supported_features = NULL;
struct dict_object *ogs_diam_gx_feature_list_id = NULL;
struct dict_object *ogs_diam_gx_feature_list = NULL;
struct dict_object *ogs_diam_gx_framed_ip_address = NULL;
struct dict_object *ogs_diam_gx_framed_ipv6_prefix = NULL;
struct dict_object *ogs_diam_gx_ip_can_type = NULL;
struct dict_object *ogs_diam_gx_rat_type = NULL;
struct dict_object *ogs_diam_gx_qos_information = NULL;
struct dict_object *ogs_diam_gx_qos_class_identifier = NULL;
struct dict_object *ogs_diam_gx_max_requested_bandwidth_ul = NULL;
struct dict_object *ogs_diam_gx_max_requested_bandwidth_dl = NULL;
struct dict_object *ogs_diam_gx_min_requested_bandwidth_ul = NULL;
struct dict_object *ogs_diam_gx_min_requested_bandwidth_dl = NULL;
struct dict_object *ogs_diam_gx_guaranteed_bitrate_ul = NULL;
struct dict_object *ogs_diam_gx_guaranteed_bitrate_dl = NULL;
struct dict_object *ogs_diam_gx_allocation_retention_priority = NULL;
struct dict_object *ogs_diam_gx_priority_level = NULL;
struct dict_object *ogs_diam_gx_pre_emption_capability = NULL;
struct dict_object *ogs_diam_gx_pre_emption_vulnerability = NULL;
struct dict_object *ogs_diam_gx_apn_aggregate_max_bitrate_ul = NULL;
struct dict_object *ogs_diam_gx_apn_aggregate_max_bitrate_dl = NULL;
struct dict_object *ogs_diam_gx_3gpp_user_location_info = NULL;
struct dict_object *ogs_diam_gx_called_station_id = NULL;
struct dict_object *ogs_diam_gx_default_eps_bearer_qos = NULL;
struct dict_object *ogs_diam_gx_3gpp_ms_timezone = NULL;
struct dict_object *ogs_diam_gx_event_trigger = NULL;
struct dict_object *ogs_diam_gx_bearer_control_mode = NULL;
struct dict_object *ogs_diam_gx_charging_rule_install = NULL;
struct dict_object *ogs_diam_gx_charging_rule_remove = NULL;
struct dict_object *ogs_diam_gx_charging_rule_definition = NULL;
struct dict_object *ogs_diam_gx_charging_rule_base_name = NULL;
struct dict_object *ogs_diam_gx_charging_rule_name = NULL;
struct dict_object *ogs_diam_gx_flow_information = NULL;
struct dict_object *ogs_diam_gx_flow_direction = NULL;
struct dict_object *ogs_diam_gx_flow_description = NULL;
struct dict_object *ogs_diam_gx_flow_status = NULL;
struct dict_object *ogs_diam_gx_precedence = NULL;
struct dict_object *ogs_diam_gx_flows = NULL;
struct dict_object *ogs_diam_gx_media_component_description = NULL;
struct dict_object *ogs_diam_gx_media_component_number = NULL;
struct dict_object *ogs_diam_gx_media_type = NULL;
struct dict_object *ogs_diam_gx_rr_bandwidth = NULL;
struct dict_object *ogs_diam_gx_rs_bandwidth = NULL;
struct dict_object *ogs_diam_gx_codec_data = NULL;
struct dict_object *ogs_diam_gx_media_sub_component = NULL;
struct dict_object *ogs_diam_gx_flow_number = NULL;
struct dict_object *ogs_diam_gx_flow_usage = NULL;
#define CHECK_dict_new( _type, _data, _parent, _ref ) \
CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) );
int ogs_diam_gx_dict_init(void)
{
application_id_t id = OGS_DIAM_GX_APPLICATION_ID;
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID, (void *)&id, &ogs_diam_gx_application);
struct local_rules_definition {
struct dict_avp_request avp_vendor_plus_name;
enum rule_position position;
int min;
int max;
};
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Request", &ogs_diam_gx_cmd_ccr);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Answer", &ogs_diam_gx_cmd_cca);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Request", &ogs_diam_gx_cmd_rar);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Answer", &ogs_diam_gx_cmd_raa);
#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 )
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Type", &ogs_diam_gx_cc_request_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Number", &ogs_diam_gx_cc_request_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Network-Request-Support", &ogs_diam_gx_network_request_support);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id", &ogs_diam_gx_subscription_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Type", &ogs_diam_gx_subscription_id_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Data", &ogs_diam_gx_subscription_id_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Supported-Features", &ogs_diam_gx_supported_features);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List-ID", &ogs_diam_gx_feature_list_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List", &ogs_diam_gx_feature_list);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IP-Address", &ogs_diam_gx_framed_ip_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IPv6-Prefix", &ogs_diam_gx_framed_ipv6_prefix);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "IP-CAN-Type", &ogs_diam_gx_ip_can_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_gx_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Information", &ogs_diam_gx_qos_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier" , &ogs_diam_gx_qos_class_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_gx_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_gx_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-UL" , &ogs_diam_gx_min_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-DL" , &ogs_diam_gx_min_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-UL" , &ogs_diam_gx_guaranteed_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-DL" , &ogs_diam_gx_guaranteed_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Allocation-Retention-Priority" , &ogs_diam_gx_allocation_retention_priority);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Priority-Level", &ogs_diam_gx_priority_level);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Capability", &ogs_diam_gx_pre_emption_capability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Vulnerability", &ogs_diam_gx_pre_emption_vulnerability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-UL" , &ogs_diam_gx_apn_aggregate_max_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-DL" , &ogs_diam_gx_apn_aggregate_max_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-User-Location-Info", &ogs_diam_gx_3gpp_user_location_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Called-Station-Id", &ogs_diam_gx_called_station_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Default-EPS-Bearer-QoS", &ogs_diam_gx_default_eps_bearer_qos);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-MS-TimeZone", &ogs_diam_gx_3gpp_ms_timezone);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Event-Trigger", &ogs_diam_gx_event_trigger);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Bearer-Control-Mode", &ogs_diam_gx_bearer_control_mode);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Install", &ogs_diam_gx_charging_rule_install);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Remove", &ogs_diam_gx_charging_rule_remove);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Definition", &ogs_diam_gx_charging_rule_definition);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Base-Name", &ogs_diam_gx_charging_rule_base_name);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Name", &ogs_diam_gx_charging_rule_name);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Information", &ogs_diam_gx_flow_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Direction", &ogs_diam_gx_flow_direction);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Description", &ogs_diam_gx_flow_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Status", &ogs_diam_gx_flow_status);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Precedence", &ogs_diam_gx_precedence);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flows", &ogs_diam_gx_flows);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Description", &ogs_diam_gx_media_component_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Number", &ogs_diam_gx_media_component_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Type", &ogs_diam_gx_media_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RR-Bandwidth" , &ogs_diam_gx_rr_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RS-Bandwidth" , &ogs_diam_gx_rs_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Codec-Data", &ogs_diam_gx_codec_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Sub-Component", &ogs_diam_gx_media_sub_component);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Number", &ogs_diam_gx_flow_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Usage", &ogs_diam_gx_flow_usage);
return 0;
/* Attention! This version of the macro uses AVP_BY_NAME_AND_VENDOR, in contrast to most other copies! */
#define PARSE_loc_rules( _rulearray, _parent) { \
int __ar; \
for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \
struct dict_rule_data __data = { NULL, \
(_rulearray)[__ar].position, \
0, \
(_rulearray)[__ar].min, \
(_rulearray)[__ar].max}; \
__data.rule_order = RULE_ORDER(__data.rule_position); \
CHECK_FCT( fd_dict_search( \
fd_g_config->cnf_dict, \
DICT_AVP, \
AVP_BY_NAME_AND_VENDOR, \
&(_rulearray)[__ar].avp_vendor_plus_name, \
&__data.rule_avp, 0 ) ); \
if ( !__data.rule_avp ) { \
TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return ENOENT; \
} \
CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \
{ \
TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \
(_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return EINVAL; \
} ); \
} \
}
#define enumval_def_u32( _val_, _str_ ) \
{ _str_, { .u32 = _val_ }}
#define enumval_def_os( _len_, _val_, _str_ ) \
{ _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}}
int ogs_dict_gx_entry(char *conffile)
{
/* Applications section */
{
{
struct dict_object * vendor;
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor, ENOENT));
struct dict_application_data app_data = { 16777238, "Gx" };
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &app_data, vendor, NULL));
}
}
/* Re-Auth-Request (RAR) Command - Extension for Gx */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Session-Release-Cause" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Event-Trigger" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Event-Report-Indication" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Charging-Rule-Remove" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Charging-Rule-Install" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Default-EPS-Bearer-QoS" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "QoS-Information" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Revalidation-Time" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Request", &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Re-Auth-Answer (RAA) Command - Extension for Gx */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "IP-CAN-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAT-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AN-GW-Address" }, RULE_OPTIONAL, -1, 2 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-MCC-MNC" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-Address" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-IPv6-Address" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAI" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-User-Location-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-MS-TimeZone" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Charging-Rule-Report" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Answer", &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Credit-Control-Request (CCR) Command - Extension for Gx */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Network-Request-Support" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Packet-Filter-Information" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Packet-Filter-Operation" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Bearer-Identifier" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Bearer-Operation" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Framed-IP-Address" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Framed-IPv6-Prefix" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "IP-CAN-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-RAT-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAT-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "QoS-Information" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "QoS-Negotiation" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "QoS-Upgrade" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Default-EPS-Bearer-QoS" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AN-GW-Address" }, RULE_OPTIONAL, -1, 2 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-MCC-MNC" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-Address" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-IPv6-Address" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAI" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-User-Location-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-MS-TimeZone" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Called-Station-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "PDN-Connection-ID" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Bearer-Usage" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Online" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Offline" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "TFT-Packet-Filter-Information" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Charging-Rule-Report" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Event-Trigger" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Event-Report-Indication" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Address" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Identifier-Gx" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "CoA-Information" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Routing-Rule-Install" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Routing-Rule-Remove" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 13019, .avp_name = "Logical-Access-ID" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 13019, .avp_name = "Physical-Access-ID" }, RULE_OPTIONAL, -1, 1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Request", &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Credit-Control-Answer (CCA) Command - Extension for Gx */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Bearer-Control-Mode" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Event-Trigger" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Event-Report-Indication" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Charging-Rule-Remove" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Charging-Rule-Install" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Charging-Information" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Online" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Offline" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "QoS-Information" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Revalidation-Time" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Default-EPS-Bearer-QoS" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Bearer-Usage" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "CSG-Information-Reporting" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "User-CSG-Information" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Error-Message" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Error-Reporting-Host" }, RULE_OPTIONAL, -1, 1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Answer", &cmd);
PARSE_loc_rules( rules, cmd );
}
LOG_D( "Extension 'Dictionary definitions for DCCA 3GPP' initialized");
return 0;
}
#if 0 /* modified by acetcom */
EXTENSION_ENTRY("dict_gx", ogs_dict_gx_entry, "dict_dcca_3gpp");
#endif

View File

@ -1,136 +0,0 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(OGS_DIAMETER_INSIDE) && !defined(OGS_DIAMETER_COMPILATION)
#error "This header cannot be included directly."
#endif
#ifndef OGS_DIAM_GX_DICT_H
#define OGS_DIAM_GX_DICT_H
#ifdef __cplusplus
extern "C" {
#endif
#define OGS_DIAM_GX_APPLICATION_ID 16777238
#define OGS_DIAM_GX_AVP_CODE_RE_AUTH_REQUEST_TYPE (285)
#define OGS_DIAM_GX_AVP_CODE_CC_REQUEST_NUMBER (415)
#define OGS_DIAM_GX_AVP_CODE_CC_REQUEST_TYPE (416)
#define OGS_DIAM_GX_AVP_CODE_DEFAULT_EPS_BEARER_QOS (1049)
#define OGS_DIAM_GX_AVP_CODE_SUPPORTED_FEATURES (628)
#define OGS_DIAM_GX_AVP_CODE_CHARGING_RULE_INSTALL (1001)
#define OGS_DIAM_GX_AVP_CODE_CHARGING_RULE_REMOVE (1002)
#define OGS_DIAM_GX_AVP_CODE_CHARGING_RULE_DEFINITION (1003)
#define OGS_DIAM_GX_AVP_CODE_CHARGING_RULE_NAME (1005)
#define OGS_DIAM_GX_AVP_CODE_FLOW_INFORMATION (1058)
#define OGS_DIAM_GX_AVP_CODE_FLOW_STATUS (511)
#define OGS_DIAM_GX_AVP_CODE_QOS_INFORMATION (1016)
#define OGS_DIAM_GX_AVP_CODE_PRECEDENCE (1010)
extern struct dict_object *ogs_diam_gx_application;
extern struct dict_object *ogs_diam_gx_cmd_ccr;
extern struct dict_object *ogs_diam_gx_cmd_cca;
extern struct dict_object *ogs_diam_gx_cmd_rar;
extern struct dict_object *ogs_diam_gx_cmd_raa;
extern struct dict_object *ogs_diam_gx_cc_request_type;
extern struct dict_object *ogs_diam_gx_cc_request_number;
extern struct dict_object *ogs_diam_gx_network_request_support;
extern struct dict_object *ogs_diam_gx_subscription_id;
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_E164 0
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI 1
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI 2
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_NAI 3
extern struct dict_object *ogs_diam_gx_subscription_id_type;
extern struct dict_object *ogs_diam_gx_subscription_id_data;
extern struct dict_object *ogs_diam_gx_supported_features;
extern struct dict_object *ogs_diam_gx_feature_list_id;
extern struct dict_object *ogs_diam_gx_feature_list;
extern struct dict_object *ogs_diam_gx_framed_ip_address;
extern struct dict_object *ogs_diam_gx_framed_ipv6_prefix;
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP_GPRS 0
#define OGS_DIAM_GX_IP_CAN_TYPE_DOCSIS 1
#define OGS_DIAM_GX_IP_CAN_TYPE_xDSL 2
#define OGS_DIAM_GX_IP_CAN_TYPE_WiMAX 3
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP2 4
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP_EPS 5
#define OGS_DIAM_GX_IP_CAN_TYPE_Non_3GPP_EPS 6
extern struct dict_object *ogs_diam_gx_ip_can_type;
#define OGS_DIAM_GX_RAT_TYPE_WLAN 0
#define OGS_DIAM_GX_RAT_TYPE_VIRTUAL 1
#define OGS_DIAM_GX_RAT_TYPE_UTRAN 1000
#define OGS_DIAM_GX_RAT_TYPE_GERAN 1001
#define OGS_DIAM_GX_RAT_TYPE_GAN 1002
#define OGS_DIAM_GX_RAT_TYPE_HSPA_EVOLUTION 1003
#define OGS_DIAM_GX_RAT_TYPE_EUTRAN 1004
#define OGS_DIAM_GX_RAT_TYPE_EUTRAN_NB_IoT 1005
#define OGS_DIAM_GX_RAT_TYPE_CDMA2000_1X 2000
#define OGS_DIAM_GX_RAT_TYPE_HRPD 2001
#define OGS_DIAM_GX_RAT_TYPE_UMB 2002
#define OGS_DIAM_GX_RAT_TYPE_EHRPD 2003
extern struct dict_object *ogs_diam_gx_rat_type;
extern struct dict_object *ogs_diam_gx_qos_information;
extern struct dict_object *ogs_diam_gx_qos_class_identifier;
extern struct dict_object *ogs_diam_gx_max_requested_bandwidth_ul;
extern struct dict_object *ogs_diam_gx_max_requested_bandwidth_dl;
extern struct dict_object *ogs_diam_gx_guaranteed_bitrate_ul;
extern struct dict_object *ogs_diam_gx_guaranteed_bitrate_dl;
extern struct dict_object *ogs_diam_gx_allocation_retention_priority;
extern struct dict_object *ogs_diam_gx_priority_level;
extern struct dict_object *ogs_diam_gx_pre_emption_capability;
extern struct dict_object *ogs_diam_gx_pre_emption_vulnerability;
extern struct dict_object *ogs_diam_gx_apn_aggregate_max_bitrate_ul;
extern struct dict_object *ogs_diam_gx_apn_aggregate_max_bitrate_dl;
#define OGS_DIAM_GX_3GPP_USER_LOCATION_INFO_TYPE_TAI_AND_ECGI 130
extern struct dict_object *ogs_diam_gx_3gpp_user_location_info;
extern struct dict_object *ogs_diam_gx_called_station_id;
extern struct dict_object *ogs_diam_gx_default_eps_bearer_qos;
extern struct dict_object *ogs_diam_gx_3gpp_ms_timezone;
extern struct dict_object *ogs_diam_gx_event_trigger;
extern struct dict_object *ogs_diam_gx_bearer_control_mode;
extern struct dict_object *ogs_diam_gx_charging_rule_install;
extern struct dict_object *ogs_diam_gx_charging_rule_remove;
extern struct dict_object *ogs_diam_gx_charging_rule_definition;
extern struct dict_object *ogs_diam_gx_charging_rule_base_name;
extern struct dict_object *ogs_diam_gx_charging_rule_name;
extern struct dict_object *ogs_diam_gx_flow_information;
extern struct dict_object *ogs_diam_gx_flow_direction;
extern struct dict_object *ogs_diam_gx_flow_description;
extern struct dict_object *ogs_diam_gx_flow_status;
extern struct dict_object *ogs_diam_gx_precedence;
extern struct dict_object *ogs_diam_gx_flows;
extern struct dict_object *ogs_diam_gx_media_component_description;
extern struct dict_object *ogs_diam_gx_media_component_number;
extern struct dict_object *ogs_diam_gx_media_type;
extern struct dict_object *ogs_diam_gx_rr_bandwidth;
extern struct dict_object *ogs_diam_gx_rs_bandwidth;
extern struct dict_object *ogs_diam_gx_codec_data;
extern struct dict_object *ogs_diam_gx_media_sub_component;
extern struct dict_object *ogs_diam_gx_flow_number;
extern struct dict_object *ogs_diam_gx_flow_usage;
int ogs_diam_gx_dict_init(void);
#ifdef __cplusplus
}
#endif
#endif /* OGS_DIAM_GX_DICT_H */

View File

@ -18,7 +18,6 @@
libdiameter_gx_sources = files('''
ogs-diameter-gx.h
dict.h
message.h
dict.c
@ -30,7 +29,7 @@ libdiameter_gx_inc = include_directories('.')
libdiameter_gx = library('ogsdiameter-gx',
sources : libdiameter_gx_sources,
version : libogslib_version,
c_args : '-DOGS_DIAM_COMPILATION',
c_args : libdiameter_common_cc_flags,
include_directories : libdiameter_gx_inc,
dependencies : libdiameter_common_dep,
install : true)

View File

@ -19,6 +19,145 @@
#include "ogs-diameter-gx.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_gx_application = NULL;
struct dict_object *ogs_diam_gx_cmd_ccr = NULL;
struct dict_object *ogs_diam_gx_cmd_cca = NULL;
struct dict_object *ogs_diam_gx_cmd_rar = NULL;
struct dict_object *ogs_diam_gx_cmd_raa = NULL;
struct dict_object *ogs_diam_gx_cc_request_type = NULL;
struct dict_object *ogs_diam_gx_cc_request_number = NULL;
struct dict_object *ogs_diam_gx_network_request_support = NULL;
struct dict_object *ogs_diam_gx_subscription_id = NULL;
struct dict_object *ogs_diam_gx_subscription_id_type = NULL;
struct dict_object *ogs_diam_gx_subscription_id_data = NULL;
struct dict_object *ogs_diam_gx_supported_features = NULL;
struct dict_object *ogs_diam_gx_feature_list_id = NULL;
struct dict_object *ogs_diam_gx_feature_list = NULL;
struct dict_object *ogs_diam_gx_framed_ip_address = NULL;
struct dict_object *ogs_diam_gx_framed_ipv6_prefix = NULL;
struct dict_object *ogs_diam_gx_ip_can_type = NULL;
struct dict_object *ogs_diam_gx_rat_type = NULL;
struct dict_object *ogs_diam_gx_qos_information = NULL;
struct dict_object *ogs_diam_gx_qos_class_identifier = NULL;
struct dict_object *ogs_diam_gx_max_requested_bandwidth_ul = NULL;
struct dict_object *ogs_diam_gx_max_requested_bandwidth_dl = NULL;
struct dict_object *ogs_diam_gx_min_requested_bandwidth_ul = NULL;
struct dict_object *ogs_diam_gx_min_requested_bandwidth_dl = NULL;
struct dict_object *ogs_diam_gx_guaranteed_bitrate_ul = NULL;
struct dict_object *ogs_diam_gx_guaranteed_bitrate_dl = NULL;
struct dict_object *ogs_diam_gx_allocation_retention_priority = NULL;
struct dict_object *ogs_diam_gx_priority_level = NULL;
struct dict_object *ogs_diam_gx_pre_emption_capability = NULL;
struct dict_object *ogs_diam_gx_pre_emption_vulnerability = NULL;
struct dict_object *ogs_diam_gx_apn_aggregate_max_bitrate_ul = NULL;
struct dict_object *ogs_diam_gx_apn_aggregate_max_bitrate_dl = NULL;
struct dict_object *ogs_diam_gx_3gpp_user_location_info = NULL;
struct dict_object *ogs_diam_gx_called_station_id = NULL;
struct dict_object *ogs_diam_gx_default_eps_bearer_qos = NULL;
struct dict_object *ogs_diam_gx_3gpp_ms_timezone = NULL;
struct dict_object *ogs_diam_gx_event_trigger = NULL;
struct dict_object *ogs_diam_gx_bearer_control_mode = NULL;
struct dict_object *ogs_diam_gx_charging_rule_install = NULL;
struct dict_object *ogs_diam_gx_charging_rule_remove = NULL;
struct dict_object *ogs_diam_gx_charging_rule_definition = NULL;
struct dict_object *ogs_diam_gx_charging_rule_base_name = NULL;
struct dict_object *ogs_diam_gx_charging_rule_name = NULL;
struct dict_object *ogs_diam_gx_flow_information = NULL;
struct dict_object *ogs_diam_gx_flow_direction = NULL;
struct dict_object *ogs_diam_gx_flow_description = NULL;
struct dict_object *ogs_diam_gx_flow_status = NULL;
struct dict_object *ogs_diam_gx_precedence = NULL;
struct dict_object *ogs_diam_gx_flows = NULL;
struct dict_object *ogs_diam_gx_media_component_description = NULL;
struct dict_object *ogs_diam_gx_media_component_number = NULL;
struct dict_object *ogs_diam_gx_media_type = NULL;
struct dict_object *ogs_diam_gx_rr_bandwidth = NULL;
struct dict_object *ogs_diam_gx_rs_bandwidth = NULL;
struct dict_object *ogs_diam_gx_codec_data = NULL;
struct dict_object *ogs_diam_gx_media_sub_component = NULL;
struct dict_object *ogs_diam_gx_flow_number = NULL;
struct dict_object *ogs_diam_gx_flow_usage = NULL;
extern int ogs_dict_gx_entry(char *conffile);
int ogs_diam_gx_init(void)
{
application_id_t id = OGS_DIAM_GX_APPLICATION_ID;
ogs_assert(ogs_dict_gx_entry(NULL) == 0);
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID, (void *)&id, &ogs_diam_gx_application);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Request", &ogs_diam_gx_cmd_ccr);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Answer", &ogs_diam_gx_cmd_cca);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Request", &ogs_diam_gx_cmd_rar);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Answer", &ogs_diam_gx_cmd_raa);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Type", &ogs_diam_gx_cc_request_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Number", &ogs_diam_gx_cc_request_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Network-Request-Support", &ogs_diam_gx_network_request_support);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id", &ogs_diam_gx_subscription_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Type", &ogs_diam_gx_subscription_id_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Data", &ogs_diam_gx_subscription_id_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Supported-Features", &ogs_diam_gx_supported_features);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List-ID", &ogs_diam_gx_feature_list_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List", &ogs_diam_gx_feature_list);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IP-Address", &ogs_diam_gx_framed_ip_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IPv6-Prefix", &ogs_diam_gx_framed_ipv6_prefix);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "IP-CAN-Type", &ogs_diam_gx_ip_can_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_gx_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Information", &ogs_diam_gx_qos_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier" , &ogs_diam_gx_qos_class_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_gx_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_gx_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-UL" , &ogs_diam_gx_min_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-DL" , &ogs_diam_gx_min_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-UL" , &ogs_diam_gx_guaranteed_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Guaranteed-Bitrate-DL" , &ogs_diam_gx_guaranteed_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Allocation-Retention-Priority" , &ogs_diam_gx_allocation_retention_priority);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Priority-Level", &ogs_diam_gx_priority_level);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Capability", &ogs_diam_gx_pre_emption_capability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Vulnerability", &ogs_diam_gx_pre_emption_vulnerability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-UL" , &ogs_diam_gx_apn_aggregate_max_bitrate_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-DL" , &ogs_diam_gx_apn_aggregate_max_bitrate_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-User-Location-Info", &ogs_diam_gx_3gpp_user_location_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Called-Station-Id", &ogs_diam_gx_called_station_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Default-EPS-Bearer-QoS", &ogs_diam_gx_default_eps_bearer_qos);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-MS-TimeZone", &ogs_diam_gx_3gpp_ms_timezone);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Event-Trigger", &ogs_diam_gx_event_trigger);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Bearer-Control-Mode", &ogs_diam_gx_bearer_control_mode);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Install", &ogs_diam_gx_charging_rule_install);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Remove", &ogs_diam_gx_charging_rule_remove);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Definition", &ogs_diam_gx_charging_rule_definition);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Base-Name", &ogs_diam_gx_charging_rule_base_name);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Charging-Rule-Name", &ogs_diam_gx_charging_rule_name);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Information", &ogs_diam_gx_flow_information);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Direction", &ogs_diam_gx_flow_direction);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Description", &ogs_diam_gx_flow_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Status", &ogs_diam_gx_flow_status);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Precedence", &ogs_diam_gx_precedence);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flows", &ogs_diam_gx_flows);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Description", &ogs_diam_gx_media_component_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Number", &ogs_diam_gx_media_component_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Type", &ogs_diam_gx_media_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RR-Bandwidth" , &ogs_diam_gx_rr_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RS-Bandwidth" , &ogs_diam_gx_rs_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Codec-Data", &ogs_diam_gx_codec_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Sub-Component", &ogs_diam_gx_media_sub_component);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Number", &ogs_diam_gx_flow_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Usage", &ogs_diam_gx_flow_usage);
return 0;
}
void ogs_diam_gx_message_free(ogs_diam_gx_message_t *gx_message)
{
int i;

View File

@ -28,6 +28,105 @@
extern "C" {
#endif
#define OGS_DIAM_GX_APPLICATION_ID 16777238
#define OGS_DIAM_GX_AVP_CODE_RE_AUTH_REQUEST_TYPE (285)
#define OGS_DIAM_GX_AVP_CODE_CC_REQUEST_NUMBER (415)
#define OGS_DIAM_GX_AVP_CODE_CC_REQUEST_TYPE (416)
#define OGS_DIAM_GX_AVP_CODE_DEFAULT_EPS_BEARER_QOS (1049)
#define OGS_DIAM_GX_AVP_CODE_SUPPORTED_FEATURES (628)
#define OGS_DIAM_GX_AVP_CODE_CHARGING_RULE_INSTALL (1001)
#define OGS_DIAM_GX_AVP_CODE_CHARGING_RULE_REMOVE (1002)
#define OGS_DIAM_GX_AVP_CODE_CHARGING_RULE_DEFINITION (1003)
#define OGS_DIAM_GX_AVP_CODE_CHARGING_RULE_NAME (1005)
#define OGS_DIAM_GX_AVP_CODE_FLOW_INFORMATION (1058)
#define OGS_DIAM_GX_AVP_CODE_FLOW_STATUS (511)
#define OGS_DIAM_GX_AVP_CODE_QOS_INFORMATION (1016)
#define OGS_DIAM_GX_AVP_CODE_PRECEDENCE (1010)
extern struct dict_object *ogs_diam_gx_application;
extern struct dict_object *ogs_diam_gx_cmd_ccr;
extern struct dict_object *ogs_diam_gx_cmd_cca;
extern struct dict_object *ogs_diam_gx_cmd_rar;
extern struct dict_object *ogs_diam_gx_cmd_raa;
extern struct dict_object *ogs_diam_gx_cc_request_type;
extern struct dict_object *ogs_diam_gx_cc_request_number;
extern struct dict_object *ogs_diam_gx_network_request_support;
extern struct dict_object *ogs_diam_gx_subscription_id;
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_E164 0
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI 1
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI 2
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_NAI 3
extern struct dict_object *ogs_diam_gx_subscription_id_type;
extern struct dict_object *ogs_diam_gx_subscription_id_data;
extern struct dict_object *ogs_diam_gx_supported_features;
extern struct dict_object *ogs_diam_gx_feature_list_id;
extern struct dict_object *ogs_diam_gx_feature_list;
extern struct dict_object *ogs_diam_gx_framed_ip_address;
extern struct dict_object *ogs_diam_gx_framed_ipv6_prefix;
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP_GPRS 0
#define OGS_DIAM_GX_IP_CAN_TYPE_DOCSIS 1
#define OGS_DIAM_GX_IP_CAN_TYPE_xDSL 2
#define OGS_DIAM_GX_IP_CAN_TYPE_WiMAX 3
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP2 4
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP_EPS 5
#define OGS_DIAM_GX_IP_CAN_TYPE_Non_3GPP_EPS 6
extern struct dict_object *ogs_diam_gx_ip_can_type;
#define OGS_DIAM_GX_RAT_TYPE_WLAN 0
#define OGS_DIAM_GX_RAT_TYPE_VIRTUAL 1
#define OGS_DIAM_GX_RAT_TYPE_UTRAN 1000
#define OGS_DIAM_GX_RAT_TYPE_GERAN 1001
#define OGS_DIAM_GX_RAT_TYPE_GAN 1002
#define OGS_DIAM_GX_RAT_TYPE_HSPA_EVOLUTION 1003
#define OGS_DIAM_GX_RAT_TYPE_EUTRAN 1004
#define OGS_DIAM_GX_RAT_TYPE_EUTRAN_NB_IoT 1005
#define OGS_DIAM_GX_RAT_TYPE_CDMA2000_1X 2000
#define OGS_DIAM_GX_RAT_TYPE_HRPD 2001
#define OGS_DIAM_GX_RAT_TYPE_UMB 2002
#define OGS_DIAM_GX_RAT_TYPE_EHRPD 2003
extern struct dict_object *ogs_diam_gx_rat_type;
extern struct dict_object *ogs_diam_gx_qos_information;
extern struct dict_object *ogs_diam_gx_qos_class_identifier;
extern struct dict_object *ogs_diam_gx_max_requested_bandwidth_ul;
extern struct dict_object *ogs_diam_gx_max_requested_bandwidth_dl;
extern struct dict_object *ogs_diam_gx_guaranteed_bitrate_ul;
extern struct dict_object *ogs_diam_gx_guaranteed_bitrate_dl;
extern struct dict_object *ogs_diam_gx_allocation_retention_priority;
extern struct dict_object *ogs_diam_gx_priority_level;
extern struct dict_object *ogs_diam_gx_pre_emption_capability;
extern struct dict_object *ogs_diam_gx_pre_emption_vulnerability;
extern struct dict_object *ogs_diam_gx_apn_aggregate_max_bitrate_ul;
extern struct dict_object *ogs_diam_gx_apn_aggregate_max_bitrate_dl;
#define OGS_DIAM_GX_3GPP_USER_LOCATION_INFO_TYPE_TAI_AND_ECGI 130
extern struct dict_object *ogs_diam_gx_3gpp_user_location_info;
extern struct dict_object *ogs_diam_gx_called_station_id;
extern struct dict_object *ogs_diam_gx_default_eps_bearer_qos;
extern struct dict_object *ogs_diam_gx_3gpp_ms_timezone;
extern struct dict_object *ogs_diam_gx_event_trigger;
extern struct dict_object *ogs_diam_gx_bearer_control_mode;
extern struct dict_object *ogs_diam_gx_charging_rule_install;
extern struct dict_object *ogs_diam_gx_charging_rule_remove;
extern struct dict_object *ogs_diam_gx_charging_rule_definition;
extern struct dict_object *ogs_diam_gx_charging_rule_base_name;
extern struct dict_object *ogs_diam_gx_charging_rule_name;
extern struct dict_object *ogs_diam_gx_flow_information;
extern struct dict_object *ogs_diam_gx_flow_direction;
extern struct dict_object *ogs_diam_gx_flow_description;
extern struct dict_object *ogs_diam_gx_flow_status;
extern struct dict_object *ogs_diam_gx_precedence;
extern struct dict_object *ogs_diam_gx_flows;
extern struct dict_object *ogs_diam_gx_media_component_description;
extern struct dict_object *ogs_diam_gx_media_component_number;
extern struct dict_object *ogs_diam_gx_media_type;
extern struct dict_object *ogs_diam_gx_rr_bandwidth;
extern struct dict_object *ogs_diam_gx_rs_bandwidth;
extern struct dict_object *ogs_diam_gx_codec_data;
extern struct dict_object *ogs_diam_gx_media_sub_component;
extern struct dict_object *ogs_diam_gx_flow_number;
extern struct dict_object *ogs_diam_gx_flow_usage;
typedef struct ogs_diam_gx_message_s {
#define OGS_DIAM_GX_CMD_CODE_CREDIT_CONTROL 272
#define OGS_DIAM_GX_CMD_RE_AUTH 258
@ -57,6 +156,7 @@ typedef struct ogs_diam_gx_message_s {
int num_of_pcc_rule;
} ogs_diam_gx_message_t;
int ogs_diam_gx_init(void);
void ogs_diam_gx_message_free(ogs_diam_gx_message_t *gx_message);
#ifdef __cplusplus

View File

@ -24,7 +24,6 @@
#define OGS_DIAMETER_INSIDE
#include "diameter/gx/dict.h"
#include "diameter/gx/message.h"
#undef OGS_DIAMETER_INSIDE

View File

@ -1,100 +1,683 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
/*********************************************************************************************************
* Software License Agreement (BSD License) *
* Author: Thomas Klausner <tk@giga.or.at> *
* *
* Copyright (c) 2013, Thomas Klausner *
* All rights reserved. *
* *
* Written under contract by nfotex IT GmbH, http://nfotex.com/ *
* *
* Redistribution and use of this software in source and binary forms, with or without modification, are *
* permitted provided that the following conditions are met: *
* *
* * Redistributions of source code must retain the above *
* copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above *
* copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other *
* materials provided with the distribution. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF *
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*********************************************************************************************************/
/*
* Dictionary definitions for objects specified for DCCA by 3GPP.
*
* This file is part of Open5GS.
* This extensions contains a lot of AVPs from various 3GPP standards
* documents, and some rules for the grouped AVPs described therein.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This extension does not contain ALL AVPs described by 3GPP, but
* quite a big number of them.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* When extending the AVPs, please edit dict_rx.org instead and
* create pastable code with contrib/tools/org_to_fd.pl.
*
* Some points of consideration:
* 1. This dictionary could be split up per document.
*
* + pro: you can only load the AVPs/Rules you're interested in ->
* smaller memory size
*
* - con: the documents use AVPs from each other A LOT, so setting the
* dependencies correctly will be annoying
*
* - con: you need to load all of them as extensions
*
* 2. This dictionary contains ONE AVP in the "3GPP2" vendor space,
* since I found it wasteful to write a separate dictionary just for
* one AVP. Also, it is defined in a 3GPP document.
*
* 3. While there are quite a number of rules here already, many more
* are missing. I've only added rules for those grouped AVPs or
* commands in which I was concretely interested so far; many more
* will need to be added to make this complete.
*
* That being said, I hope this will be useful for you.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-diameter-rx.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
/*
* Some comments on the 3GPP Standards documents themselves:
*
* 1. It would be good if 29.061 was reviewed to check for each AVP if
* it is Mandatory or not. The data currently in the document does not
* match what was in the previous version of the freeDiameter
* extension (the one that existedbefore I rewrote it) or what I saw
* so far. IIRC, even the table and the document contradict each
* other. The AVP table is also missing an entry for
* "External-Identifier", 28.
*
* 2. 29.140 has conflicting AVP names with other documents:
* - Sequence-Number is also in 32.329
* - Recipient-Address is also in 32.299
* - Status is also in 32.299
*
* 3. 29.229 has name conflict with 29.329 about User-Data (different
* AVP code 702, instead of 606) -- the weird thing is, the latter
* uses some AVPs from the former, but not this one.
*/
#include <freeDiameter/extension.h>
struct dict_object *ogs_diam_rx_application = NULL;
struct dict_object *ogs_diam_rx_cmd_aar = NULL;
struct dict_object *ogs_diam_rx_cmd_aaa = NULL;
struct dict_object *ogs_diam_rx_cmd_asr = NULL;
struct dict_object *ogs_diam_rx_cmd_asa = NULL;
struct dict_object *ogs_diam_rx_cmd_str = NULL;
struct dict_object *ogs_diam_rx_cmd_sta = NULL;
/* The content of this file follows the same structure as dict_base_proto.c */
struct dict_object *ogs_diam_rx_media_component_description = NULL;
struct dict_object *ogs_diam_rx_media_component_number = NULL;
struct dict_object *ogs_diam_rx_media_type = NULL;
struct dict_object *ogs_diam_rx_max_requested_bandwidth_ul = NULL;
struct dict_object *ogs_diam_rx_max_requested_bandwidth_dl = NULL;
struct dict_object *ogs_diam_rx_min_requested_bandwidth_ul = NULL;
struct dict_object *ogs_diam_rx_min_requested_bandwidth_dl = NULL;
struct dict_object *ogs_diam_rx_rr_bandwidth = NULL;
struct dict_object *ogs_diam_rx_rs_bandwidth = NULL;
struct dict_object *ogs_diam_rx_flow_status = NULL;
struct dict_object *ogs_diam_rx_codec_data = NULL;
struct dict_object *ogs_diam_rx_media_sub_component = NULL;
struct dict_object *ogs_diam_rx_flow_number = NULL;
struct dict_object *ogs_diam_rx_flow_usage = NULL;
struct dict_object *ogs_diam_rx_flow_description = NULL;
struct dict_object *ogs_diam_rx_subscription_id = NULL;
struct dict_object *ogs_diam_rx_subscription_id_type = NULL;
struct dict_object *ogs_diam_rx_subscription_id_data = NULL;
struct dict_object *ogs_diam_rx_specific_action = NULL;
struct dict_object *ogs_diam_rx_framed_ip_address = NULL;
struct dict_object *ogs_diam_rx_framed_ipv6_prefix = NULL;
struct dict_object *ogs_diam_rx_ip_can_type = NULL;
struct dict_object *ogs_diam_rx_rat_type = NULL;
struct dict_object *ogs_diam_rx_abort_cause = NULL;
struct dict_object *ogs_diam_rx_termination_cause = NULL;
#define CHECK_dict_new( _type, _data, _parent, _ref ) \
CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) );
int ogs_diam_rx_dict_init(void)
{
application_id_t id = OGS_DIAM_RX_APPLICATION_ID;
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID, (void *)&id, &ogs_diam_rx_application);
struct local_rules_definition {
struct dict_avp_request avp_vendor_plus_name;
enum rule_position position;
int min;
int max;
};
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "AA-Request", &ogs_diam_rx_cmd_aar);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "AA-Answer", &ogs_diam_rx_cmd_aaa);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Abort-Session-Request", &ogs_diam_rx_cmd_asr);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Abort-Session-Answer", &ogs_diam_rx_cmd_asa);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Session-Termination-Request", &ogs_diam_rx_cmd_str);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Session-Termination-Answer", &ogs_diam_rx_cmd_sta);
#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 )
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Description", &ogs_diam_rx_media_component_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Number", &ogs_diam_rx_media_component_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Type", &ogs_diam_rx_media_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_rx_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_rx_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-UL" , &ogs_diam_rx_min_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-DL" , &ogs_diam_rx_min_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RR-Bandwidth" , &ogs_diam_rx_rr_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RS-Bandwidth" , &ogs_diam_rx_rs_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Status", &ogs_diam_rx_flow_status);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Codec-Data", &ogs_diam_rx_codec_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Sub-Component", &ogs_diam_rx_media_sub_component);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Number", &ogs_diam_rx_flow_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Usage", &ogs_diam_rx_flow_usage);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Description", &ogs_diam_rx_flow_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id", &ogs_diam_rx_subscription_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Type", &ogs_diam_rx_subscription_id_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Data", &ogs_diam_rx_subscription_id_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Specific-Action", &ogs_diam_rx_specific_action);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IP-Address", &ogs_diam_rx_framed_ip_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IPv6-Prefix", &ogs_diam_rx_framed_ipv6_prefix);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "IP-CAN-Type", &ogs_diam_rx_ip_can_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_rx_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Abort-Cause", &ogs_diam_rx_abort_cause);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Termination-Cause", &ogs_diam_rx_termination_cause);
return 0;
/* Attention! This version of the macro uses AVP_BY_NAME_AND_VENDOR, in contrast to most other copies! */
#define PARSE_loc_rules( _rulearray, _parent) { \
int __ar; \
for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \
struct dict_rule_data __data = { NULL, \
(_rulearray)[__ar].position, \
0, \
(_rulearray)[__ar].min, \
(_rulearray)[__ar].max}; \
__data.rule_order = RULE_ORDER(__data.rule_position); \
CHECK_FCT( fd_dict_search( \
fd_g_config->cnf_dict, \
DICT_AVP, \
AVP_BY_NAME_AND_VENDOR, \
&(_rulearray)[__ar].avp_vendor_plus_name, \
&__data.rule_avp, 0 ) ); \
if ( !__data.rule_avp ) { \
TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return ENOENT; \
} \
CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \
{ \
TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \
(_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return EINVAL; \
} ); \
} \
}
#define enumval_def_u32( _val_, _str_ ) \
{ _str_, { .u32 = _val_ }}
#define enumval_def_os( _len_, _val_, _str_ ) \
{ _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}}
int ogs_dict_rx_entry(char *conffile)
{
/* Applications section */
{
/* Create the vendors */
{
struct dict_object * vendor;
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor, ENOENT));
struct dict_application_data app_data = { 16777216, "Cx" };
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &app_data, vendor, NULL));
}
{
struct dict_object * vendor;
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor, ENOENT));
struct dict_application_data app_data = { 16777236, "Rx" };
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &app_data, vendor, NULL));
}
}
/* Command section */
{
struct dict_object* app;
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_APPLICATION, APPLICATION_BY_NAME, "Cx", &app, ENOENT));
/* User-Authorization-Request (UAR) Command */
{
struct dict_object* cmd_uar;
struct dict_cmd_data data = {
300, /* Code */
"3GPP/User-Authorization-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Host" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Destination-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Visited-Network-Identifier" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "User-Authorization-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "UAR-Flags" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_uar);
PARSE_loc_rules(rules, cmd_uar);
}
/* User-Authorization-Answer (UAA) Command */
{
struct dict_object* cmd_uaa;
struct dict_cmd_data data = {
300, /* Code */
"3GPP/User-Authorization-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Server-Capabilities" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_uaa);
PARSE_loc_rules(rules, cmd_uaa);
}
/* Location-Info-Request (LIR) Command */
{
struct dict_object* cmd_lir;
struct dict_cmd_data data = {
302, /* Code */
"3GPP/Location-Info-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Host" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Destination-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Originating-Request" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "User-Authorization-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Session-Priority" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_lir);
PARSE_loc_rules(rules, cmd_lir);
}
/* Location-Info-Answer (LIA) Command */
{
struct dict_object* cmd_lia;
struct dict_cmd_data data = {
302, /* Code */
"3GPP/Location-Info-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Server-Capabilities" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "LIA-Flags" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_lia);
PARSE_loc_rules(rules, cmd_lia);
}
/* Multimedia-Auth-Request (MAR) Command */
{
struct dict_object* cmd_mar;
struct dict_cmd_data data = {
303, /* Code */
"3GPP/Multimedia-Auth-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Host" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SIP-Auth-Data-Item" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SIP-Number-Auth-Items" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_mar);
PARSE_loc_rules(rules, cmd_mar);
}
/* Multimedia-Auth-Answer (MAA) Command */
{
struct dict_object* cmd_maa;
struct dict_cmd_data data = {
303, /* Code */
"3GPP/Multimedia-Auth-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SIP-Number-Auth-Items" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SIP-Auth-Data-Item" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_maa);
PARSE_loc_rules(rules, cmd_maa);
}
/* Server-Assignment-Request (SAR) Command */
{
struct dict_object* cmd_sar;
struct dict_cmd_data data = {
301, /* Code */
"3GPP/Server-Assignment-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Host" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Destination-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Server-Assignment-Type" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "User-Data-Already-Available" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SCSCF-Restoration-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Multiple-Registration-Indication" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Session-Priority" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_sar);
PARSE_loc_rules(rules, cmd_sar);
}
/* Server-Assignment-Answer (SAA) Command */
{
struct dict_object* cmd_saa;
struct dict_cmd_data data = {
301, /* Code */
"3GPP/Server-Assignment-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "User-Data" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Charging-Information" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Associated-Identities" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Loose-Route-Indication" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SCSCF-Restoration-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Associated-Registered-Identities" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Priviledged-Sender-Indication" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_saa);
PARSE_loc_rules(rules, cmd_saa);
}
/* Registration-Termination-Request (RTR) Command */
{
struct dict_object* cmd_rtr;
struct dict_cmd_data data = {
304, /* Code */
"3GPP/Registration-Termination-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Associated-Identities" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Deregistration-Reason" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_rtr);
PARSE_loc_rules(rules, cmd_rtr);
}
/* Registration-Termination-Answer (RTA) Command */
{
struct dict_object* cmd_rta;
struct dict_cmd_data data = {
304, /* Code */
"3GPP/Registration-Termination-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Associated-Identities" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Identity-with-Emergency-Registration" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_rta);
PARSE_loc_rules(rules, cmd_rta);
}
/* Push-Profile-Request (PPR) Command */
{
struct dict_object* cmd_ppr;
struct dict_cmd_data data = {
305, /* Code */
"3GPP/Push-Profile-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "User-Data" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Charging-Information" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SIP-Auth-Data-Item" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_ppr);
PARSE_loc_rules(rules, cmd_ppr);
}
/* Push-Profile-Answer (PPA) Command */
{
struct dict_object* cmd_ppa;
struct dict_cmd_data data = {
305, /* Code */
"3GPP/Push-Profile-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_new(DICT_COMMAND, &data, app, &cmd_ppa);
PARSE_loc_rules(rules, cmd_ppa);
}
}
struct dict_object* rx;
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_APPLICATION, APPLICATION_BY_NAME, "Rx", &rx, ENOENT));
/* AA-Request (AAR) Command */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "AF-Application-Identifier" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Media-Component-Description" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Service-Info-Status" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AF-Charging-Identifier" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SIP-Forking-Indication" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Specific-Action" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Subscription-Id" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 13019, .avp_name = "Reservation-Priority" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Called-Station-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Service-URN" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Sponsored-Connectivity-Data" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "MPS-Identifier" }, RULE_OPTIONAL, -1, 1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "AA-Request", &cmd);
PARSE_loc_rules( rules, cmd );
}
/* AA-Answer (AAA) Command */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Identifier" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Address" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Acceptable-Service-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "IP-CAN-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAT-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Flows" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "AA-Answer", &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Re-Auth-Request (RAR) Command - Extension for Rx */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
#if 0 /* modified by acetcom */
{ { .avp_vendor = 10415, .avp_name = "Specific-Action" }, RULE_REQUIRED, -1, 1 },
#endif
{ { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Identifier" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Address" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Flows" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Subscription-Id" }, RULE_OPTIONAL, -1, -1 },
#if 0 /* modified by acetcom */
{ { .avp_vendor = 10415, .avp_name = "Abort-Cause" }, RULE_REQUIRED, -1, 1 },
#endif
{ { .avp_vendor = 10415, .avp_name = "IP-CAN-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAT-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Sponsored-Connectivity-Data" }, RULE_OPTIONAL, -1, 1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Request", &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Re-Auth-Answer (RAA) Command - Extension for Rx */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Media-Component-Description" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Service-URN" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Redirect-Max-Cache-Time" }, RULE_OPTIONAL, -1, 1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Answer", &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Session-Termination-Answer (STA) Command - Extension for Rx */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Sponsored-Connectivity-Data" }, RULE_OPTIONAL, -1, 1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Session-Termination-Answer", &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Abort-Session-Request (ASR) Command - Extension for Rx */
{
struct dict_object * cmd;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Abort-Cause" }, RULE_REQUIRED, -1, 1 }
};
CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Abort-Session-Request", &cmd);
PARSE_loc_rules( rules, cmd );
}
LOG_D( "Extension 'Dictionary definitions for DCCA 3GPP' initialized");
return 0;
}
#if 0 /* modified by acetcom */
EXTENSION_ENTRY("dict_rx", ogs_dict_rx_entry, "dict_dcca_3gpp");
#endif

View File

@ -1,132 +0,0 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(OGS_DIAMETER_INSIDE) && !defined(OGS_DIAMETER_COMPILATION)
#error "This header cannot be included directly."
#endif
#ifndef OGS_DIAM_RX_DICT_H
#define OGS_DIAM_RX_DICT_H
#ifdef __cplusplus
extern "C" {
#endif
#define OGS_DIAM_RX_APPLICATION_ID 16777236
#define OGS_DIAM_RX_AVP_CODE_SUBSCRIPTION_ID (443)
#define OGS_DIAM_RX_AVP_CODE_SPECIFIC_ACTION (513)
#define OGS_DIAM_RX_AVP_CODE_MEDIA_COMPONENT_DESCRIPTION (517)
#define OGS_DIAM_RX_AVP_CODE_MEDIA_TYPE (520)
#define OGS_DIAM_RX_AVP_CODE_MAX_REQUESTED_BANDWIDTH_DL (515)
#define OGS_DIAM_RX_AVP_CODE_MAX_REQUESTED_BANDWIDTH_UL (516)
#define OGS_DIAM_RX_AVP_CODE_RR_BANDWIDTH (521)
#define OGS_DIAM_RX_AVP_CODE_RS_BANDWIDTH (522)
#define OGS_DIAM_RX_AVP_CODE_MIN_REQUESTED_BANDWIDTH_DL (534)
#define OGS_DIAM_RX_AVP_CODE_MIN_REQUESTED_BANDWIDTH_UL (535)
#define OGS_DIAM_RX_AVP_CODE_MEDIA_COMPONENT_NUMBER (518)
#define OGS_DIAM_RX_AVP_CODE_MEDIA_SUB_COMPONENT (519)
#define OGS_DIAM_RX_AVP_CODE_FLOW_DESCRIPTION (507)
#define OGS_DIAM_RX_AVP_CODE_FLOW_NUMBER (509)
#define OGS_DIAM_RX_AVP_CODE_FLOW_USAGE (512)
extern struct dict_object *ogs_diam_rx_application;
extern struct dict_object *ogs_diam_rx_cmd_aar;
extern struct dict_object *ogs_diam_rx_cmd_aaa;
extern struct dict_object *ogs_diam_rx_cmd_asr;
extern struct dict_object *ogs_diam_rx_cmd_asa;
extern struct dict_object *ogs_diam_rx_cmd_str;
extern struct dict_object *ogs_diam_rx_cmd_sta;
extern struct dict_object *ogs_diam_rx_media_component_description;
extern struct dict_object *ogs_diam_rx_media_component_number;
extern struct dict_object *ogs_diam_rx_media_type;
extern struct dict_object *ogs_diam_rx_max_requested_bandwidth_ul;
extern struct dict_object *ogs_diam_rx_max_requested_bandwidth_dl;
extern struct dict_object *ogs_diam_rx_min_requested_bandwidth_ul;
extern struct dict_object *ogs_diam_rx_min_requested_bandwidth_dl;
extern struct dict_object *ogs_diam_rx_rr_bandwidth;
extern struct dict_object *ogs_diam_rx_rs_bandwidth;
#define OGS_DIAM_RX_FLOW_STATUS_ENABLED_UPLINK 0
#define OGS_DIAM_RX_FLOW_STATUS_ENABLED_DOWNLINK 1
#define OGS_DIAM_RX_FLOW_STATUS_ENABLED 2
#define OGS_DIAM_RX_FLOW_STATUS_DISABLED 3
extern struct dict_object *ogs_diam_rx_flow_status;
extern struct dict_object *ogs_diam_rx_codec_data;
extern struct dict_object *ogs_diam_rx_media_sub_component;
extern struct dict_object *ogs_diam_rx_flow_number;
extern struct dict_object *ogs_diam_rx_flow_usage;
extern struct dict_object *ogs_diam_rx_flow_description;
extern struct dict_object *ogs_diam_rx_subscription_id;
#define OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_E164 0
#define OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI 1
#define OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI 2
#define OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_NAI 3
extern struct dict_object *ogs_diam_rx_subscription_id_type;
extern struct dict_object *ogs_diam_rx_subscription_id_data;
extern struct dict_object *ogs_diam_rx_specific_action;
extern struct dict_object *ogs_diam_rx_framed_ip_address;
extern struct dict_object *ogs_diam_rx_framed_ipv6_prefix;
#define OGS_DIAM_RX_IP_CAN_TYPE_3GPP_GPRS 0
#define OGS_DIAM_RX_IP_CAN_TYPE_DOCSIS 1
#define OGS_DIAM_RX_IP_CAN_TYPE_xDSL 2
#define OGS_DIAM_RX_IP_CAN_TYPE_WiMAX 3
#define OGS_DIAM_RX_IP_CAN_TYPE_3GPP2 4
#define OGS_DIAM_RX_IP_CAN_TYPE_3GPP_EPS 5
#define OGS_DIAM_RX_IP_CAN_TYPE_Non_3GPP_EPS 6
extern struct dict_object *ogs_diam_rx_ip_can_type;
#define OGS_DIAM_RX_RAT_TYPE_WLAN 0
#define OGS_DIAM_RX_RAT_TYPE_VIRTUAL 1
#define OGS_DIAM_RX_RAT_TYPE_UTRAN 1000
#define OGS_DIAM_RX_RAT_TYPE_GERAN 1001
#define OGS_DIAM_RX_RAT_TYPE_GAN 1002
#define OGS_DIAM_RX_RAT_TYPE_HSPA_EVOLUTION 1003
#define OGS_DIAM_RX_RAT_TYPE_EUTRAN 1004
#define OGS_DIAM_RX_RAT_TYPE_EUTRAN_NB_IoT 1005
#define OGS_DIAM_RX_RAT_TYPE_CDMA2000_1X 2000
#define OGS_DIAM_RX_RAT_TYPE_HRPD 2001
#define OGS_DIAM_RX_RAT_TYPE_UMB 2002
#define OGS_DIAM_RX_RAT_TYPE_EHRPD 2003
extern struct dict_object *ogs_diam_rx_rat_type;
#define OGS_DIAM_RX_ABORT_CAUSE_BEARER_RELEASED 0
#define OGS_DIAM_RX_ABORT_CAUSE_INSUFFICIENT_SERVER_RESOURCES 1
#define OGS_DIAM_RX_ABORT_CAUSE_INSUFFICIENT_BEARER_RESOURCES 2
#define OGS_DIAM_RX_ABORT_CAUSE_PS_TO_CS_HANDOVER 3
#define OGS_DIAM_RX_ABORT_CAUSE_SPONSORED_DATA_CONNECTIVITY_DISALLOWED 4
extern struct dict_object *ogs_diam_rx_abort_cause;
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_LOGOUT 1
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_SERVICE_NOT_PROVIDED 2
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_BAD_ANSWER 3
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_DIAMETER_ADMINISTRATIVE 4
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_LINK_BROKEN 5
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_AUTH_EXPIRED 6
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_USER_MOVED 7
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_SESSION_TIMEOUT 8
extern struct dict_object *ogs_diam_rx_termination_cause;
int ogs_diam_rx_dict_init(void);
#ifdef __cplusplus
}
#endif
#endif /* OGS_DIAM_RX_DICT_H */

View File

@ -18,7 +18,6 @@
libdiameter_rx_sources = files('''
ogs-diameter-rx.h
dict.h
message.h
dict.c
@ -30,7 +29,7 @@ libdiameter_rx_inc = include_directories('.')
libdiameter_rx = library('ogsdiameter-rx',
sources : libdiameter_rx_sources,
version : libogslib_version,
c_args : '-DOGS_DIAM_COMPILATION',
c_args : libdiameter_common_cc_flags,
include_directories : libdiameter_rx_inc,
dependencies : libdiameter_common_dep,
install : true)

View File

@ -19,6 +19,90 @@
#include "ogs-diameter-rx.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_rx_application = NULL;
struct dict_object *ogs_diam_rx_cmd_aar = NULL;
struct dict_object *ogs_diam_rx_cmd_aaa = NULL;
struct dict_object *ogs_diam_rx_cmd_asr = NULL;
struct dict_object *ogs_diam_rx_cmd_asa = NULL;
struct dict_object *ogs_diam_rx_cmd_str = NULL;
struct dict_object *ogs_diam_rx_cmd_sta = NULL;
struct dict_object *ogs_diam_rx_media_component_description = NULL;
struct dict_object *ogs_diam_rx_media_component_number = NULL;
struct dict_object *ogs_diam_rx_media_type = NULL;
struct dict_object *ogs_diam_rx_max_requested_bandwidth_ul = NULL;
struct dict_object *ogs_diam_rx_max_requested_bandwidth_dl = NULL;
struct dict_object *ogs_diam_rx_min_requested_bandwidth_ul = NULL;
struct dict_object *ogs_diam_rx_min_requested_bandwidth_dl = NULL;
struct dict_object *ogs_diam_rx_rr_bandwidth = NULL;
struct dict_object *ogs_diam_rx_rs_bandwidth = NULL;
struct dict_object *ogs_diam_rx_flow_status = NULL;
struct dict_object *ogs_diam_rx_codec_data = NULL;
struct dict_object *ogs_diam_rx_media_sub_component = NULL;
struct dict_object *ogs_diam_rx_flow_number = NULL;
struct dict_object *ogs_diam_rx_flow_usage = NULL;
struct dict_object *ogs_diam_rx_flow_description = NULL;
struct dict_object *ogs_diam_rx_subscription_id = NULL;
struct dict_object *ogs_diam_rx_subscription_id_type = NULL;
struct dict_object *ogs_diam_rx_subscription_id_data = NULL;
struct dict_object *ogs_diam_rx_specific_action = NULL;
struct dict_object *ogs_diam_rx_framed_ip_address = NULL;
struct dict_object *ogs_diam_rx_framed_ipv6_prefix = NULL;
struct dict_object *ogs_diam_rx_ip_can_type = NULL;
struct dict_object *ogs_diam_rx_rat_type = NULL;
struct dict_object *ogs_diam_rx_abort_cause = NULL;
struct dict_object *ogs_diam_rx_termination_cause = NULL;
extern int ogs_dict_rx_entry(char *conffile);
int ogs_diam_rx_init(void)
{
application_id_t id = OGS_DIAM_RX_APPLICATION_ID;
ogs_assert(ogs_dict_rx_entry(NULL) == 0);
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID, (void *)&id, &ogs_diam_rx_application);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "AA-Request", &ogs_diam_rx_cmd_aar);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "AA-Answer", &ogs_diam_rx_cmd_aaa);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Abort-Session-Request", &ogs_diam_rx_cmd_asr);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Abort-Session-Answer", &ogs_diam_rx_cmd_asa);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Session-Termination-Request", &ogs_diam_rx_cmd_str);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Session-Termination-Answer", &ogs_diam_rx_cmd_sta);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Description", &ogs_diam_rx_media_component_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Component-Number", &ogs_diam_rx_media_component_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Type", &ogs_diam_rx_media_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_rx_max_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL" , &ogs_diam_rx_max_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-UL" , &ogs_diam_rx_min_requested_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Min-Requested-Bandwidth-DL" , &ogs_diam_rx_min_requested_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RR-Bandwidth" , &ogs_diam_rx_rr_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RS-Bandwidth" , &ogs_diam_rx_rs_bandwidth);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Status", &ogs_diam_rx_flow_status);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Codec-Data", &ogs_diam_rx_codec_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Sub-Component", &ogs_diam_rx_media_sub_component);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Number", &ogs_diam_rx_flow_number);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Usage", &ogs_diam_rx_flow_usage);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Description", &ogs_diam_rx_flow_description);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id", &ogs_diam_rx_subscription_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Type", &ogs_diam_rx_subscription_id_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Data", &ogs_diam_rx_subscription_id_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Specific-Action", &ogs_diam_rx_specific_action);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IP-Address", &ogs_diam_rx_framed_ip_address);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IPv6-Prefix", &ogs_diam_rx_framed_ipv6_prefix);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "IP-CAN-Type", &ogs_diam_rx_ip_can_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_rx_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Abort-Cause", &ogs_diam_rx_abort_cause);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Termination-Cause", &ogs_diam_rx_termination_cause);
return 0;
}
void ogs_diam_rx_message_free(ogs_diam_rx_message_t *rx_message)
{
int i, j, k;

View File

@ -28,6 +28,101 @@
extern "C" {
#endif
#define OGS_DIAM_RX_APPLICATION_ID 16777236
#define OGS_DIAM_RX_AVP_CODE_SUBSCRIPTION_ID (443)
#define OGS_DIAM_RX_AVP_CODE_SPECIFIC_ACTION (513)
#define OGS_DIAM_RX_AVP_CODE_MEDIA_COMPONENT_DESCRIPTION (517)
#define OGS_DIAM_RX_AVP_CODE_MEDIA_TYPE (520)
#define OGS_DIAM_RX_AVP_CODE_MAX_REQUESTED_BANDWIDTH_DL (515)
#define OGS_DIAM_RX_AVP_CODE_MAX_REQUESTED_BANDWIDTH_UL (516)
#define OGS_DIAM_RX_AVP_CODE_RR_BANDWIDTH (521)
#define OGS_DIAM_RX_AVP_CODE_RS_BANDWIDTH (522)
#define OGS_DIAM_RX_AVP_CODE_MIN_REQUESTED_BANDWIDTH_DL (534)
#define OGS_DIAM_RX_AVP_CODE_MIN_REQUESTED_BANDWIDTH_UL (535)
#define OGS_DIAM_RX_AVP_CODE_MEDIA_COMPONENT_NUMBER (518)
#define OGS_DIAM_RX_AVP_CODE_MEDIA_SUB_COMPONENT (519)
#define OGS_DIAM_RX_AVP_CODE_FLOW_DESCRIPTION (507)
#define OGS_DIAM_RX_AVP_CODE_FLOW_NUMBER (509)
#define OGS_DIAM_RX_AVP_CODE_FLOW_USAGE (512)
extern struct dict_object *ogs_diam_rx_application;
extern struct dict_object *ogs_diam_rx_cmd_aar;
extern struct dict_object *ogs_diam_rx_cmd_aaa;
extern struct dict_object *ogs_diam_rx_cmd_asr;
extern struct dict_object *ogs_diam_rx_cmd_asa;
extern struct dict_object *ogs_diam_rx_cmd_str;
extern struct dict_object *ogs_diam_rx_cmd_sta;
extern struct dict_object *ogs_diam_rx_media_component_description;
extern struct dict_object *ogs_diam_rx_media_component_number;
extern struct dict_object *ogs_diam_rx_media_type;
extern struct dict_object *ogs_diam_rx_max_requested_bandwidth_ul;
extern struct dict_object *ogs_diam_rx_max_requested_bandwidth_dl;
extern struct dict_object *ogs_diam_rx_min_requested_bandwidth_ul;
extern struct dict_object *ogs_diam_rx_min_requested_bandwidth_dl;
extern struct dict_object *ogs_diam_rx_rr_bandwidth;
extern struct dict_object *ogs_diam_rx_rs_bandwidth;
#define OGS_DIAM_RX_FLOW_STATUS_ENABLED_UPLINK 0
#define OGS_DIAM_RX_FLOW_STATUS_ENABLED_DOWNLINK 1
#define OGS_DIAM_RX_FLOW_STATUS_ENABLED 2
#define OGS_DIAM_RX_FLOW_STATUS_DISABLED 3
extern struct dict_object *ogs_diam_rx_flow_status;
extern struct dict_object *ogs_diam_rx_codec_data;
extern struct dict_object *ogs_diam_rx_media_sub_component;
extern struct dict_object *ogs_diam_rx_flow_number;
extern struct dict_object *ogs_diam_rx_flow_usage;
extern struct dict_object *ogs_diam_rx_flow_description;
extern struct dict_object *ogs_diam_rx_subscription_id;
#define OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_E164 0
#define OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI 1
#define OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI 2
#define OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_NAI 3
extern struct dict_object *ogs_diam_rx_subscription_id_type;
extern struct dict_object *ogs_diam_rx_subscription_id_data;
extern struct dict_object *ogs_diam_rx_specific_action;
extern struct dict_object *ogs_diam_rx_framed_ip_address;
extern struct dict_object *ogs_diam_rx_framed_ipv6_prefix;
#define OGS_DIAM_RX_IP_CAN_TYPE_3GPP_GPRS 0
#define OGS_DIAM_RX_IP_CAN_TYPE_DOCSIS 1
#define OGS_DIAM_RX_IP_CAN_TYPE_xDSL 2
#define OGS_DIAM_RX_IP_CAN_TYPE_WiMAX 3
#define OGS_DIAM_RX_IP_CAN_TYPE_3GPP2 4
#define OGS_DIAM_RX_IP_CAN_TYPE_3GPP_EPS 5
#define OGS_DIAM_RX_IP_CAN_TYPE_Non_3GPP_EPS 6
extern struct dict_object *ogs_diam_rx_ip_can_type;
#define OGS_DIAM_RX_RAT_TYPE_WLAN 0
#define OGS_DIAM_RX_RAT_TYPE_VIRTUAL 1
#define OGS_DIAM_RX_RAT_TYPE_UTRAN 1000
#define OGS_DIAM_RX_RAT_TYPE_GERAN 1001
#define OGS_DIAM_RX_RAT_TYPE_GAN 1002
#define OGS_DIAM_RX_RAT_TYPE_HSPA_EVOLUTION 1003
#define OGS_DIAM_RX_RAT_TYPE_EUTRAN 1004
#define OGS_DIAM_RX_RAT_TYPE_EUTRAN_NB_IoT 1005
#define OGS_DIAM_RX_RAT_TYPE_CDMA2000_1X 2000
#define OGS_DIAM_RX_RAT_TYPE_HRPD 2001
#define OGS_DIAM_RX_RAT_TYPE_UMB 2002
#define OGS_DIAM_RX_RAT_TYPE_EHRPD 2003
extern struct dict_object *ogs_diam_rx_rat_type;
#define OGS_DIAM_RX_ABORT_CAUSE_BEARER_RELEASED 0
#define OGS_DIAM_RX_ABORT_CAUSE_INSUFFICIENT_SERVER_RESOURCES 1
#define OGS_DIAM_RX_ABORT_CAUSE_INSUFFICIENT_BEARER_RESOURCES 2
#define OGS_DIAM_RX_ABORT_CAUSE_PS_TO_CS_HANDOVER 3
#define OGS_DIAM_RX_ABORT_CAUSE_SPONSORED_DATA_CONNECTIVITY_DISALLOWED 4
extern struct dict_object *ogs_diam_rx_abort_cause;
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_LOGOUT 1
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_SERVICE_NOT_PROVIDED 2
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_BAD_ANSWER 3
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_DIAMETER_ADMINISTRATIVE 4
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_LINK_BROKEN 5
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_AUTH_EXPIRED 6
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_USER_MOVED 7
#define OGS_DIAM_RX_TERMINATION_CAUSE_DIAMETER_SESSION_TIMEOUT 8
extern struct dict_object *ogs_diam_rx_termination_cause;
typedef struct ogs_diam_rx_media_sub_component_s {
uint32_t flow_number;
#define OGS_DIAM_RX_FLOW_USAGE_NO_INFORMATION 0
@ -85,6 +180,7 @@ typedef struct ogs_diam_rx_message_s {
int num_of_media_component;
} ogs_diam_rx_message_t;
int ogs_diam_rx_init(void);
void ogs_diam_rx_message_free(ogs_diam_rx_message_t *rx_message);
#ifdef __cplusplus

View File

@ -24,7 +24,6 @@
#define OGS_DIAMETER_INSIDE
#include "diameter/rx/dict.h"
#include "diameter/rx/message.h"
#undef OGS_DIAMETER_INSIDE

View File

@ -1,125 +1,533 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*********************************************************************************************************
* Software License Agreement (BSD License) *
* Author: Sukchan Lee <acetcom@gmail.com>> *
* *
* Copyright (c) 2017, Open5gs Group
* All rights reserved. *
* *
* Written under contract by nfotex IT GmbH, http://nfotex.com/ *
* *
* Redistribution and use of this software in source and binary forms, with or without modification, are *
* permitted provided that the following conditions are met: *
* *
* * Redistributions of source code must retain the above *
* copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above *
* copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other *
* materials provided with the distribution. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF *
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*********************************************************************************************************/
#include "ogs-diameter-s6a.h"
#include <freeDiameter/extension.h>
/* The content of this file follows the same structure as dict_base_proto.c */
#define CHECK_dict_new( _type, _data, _parent, _ref ) \
CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) );
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_s6a_application = NULL;
struct local_rules_definition {
struct dict_avp_request avp_vendor_plus_name;
enum rule_position position;
int min;
int max;
};
struct dict_object *ogs_diam_s6a_cmd_air = NULL;
struct dict_object *ogs_diam_s6a_cmd_aia = NULL;
struct dict_object *ogs_diam_s6a_cmd_ulr = NULL;
struct dict_object *ogs_diam_s6a_cmd_ula = NULL;
struct dict_object *ogs_diam_s6a_cmd_pur = NULL;
struct dict_object *ogs_diam_s6a_cmd_pua = NULL;
#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 )
struct dict_object *ogs_diam_s6a_visited_plmn_id = NULL;
struct dict_object *ogs_diam_s6a_rat_type = NULL;
struct dict_object *ogs_diam_s6a_ulr_flags = NULL;
struct dict_object *ogs_diam_s6a_ula_flags = NULL;
struct dict_object *ogs_diam_s6a_subscription_data = NULL;
struct dict_object *ogs_diam_s6a_req_eutran_auth_info = NULL;
struct dict_object *ogs_diam_s6a_number_of_requested_vectors = NULL;
struct dict_object *ogs_diam_s6a_immediate_response_preferred = NULL;
struct dict_object *ogs_diam_s6a_authentication_info = NULL;
struct dict_object *ogs_diam_s6a_re_synchronization_info = NULL;
struct dict_object *ogs_diam_s6a_service_selection = NULL;
struct dict_object *ogs_diam_s6a_ue_srvcc_capability = NULL;
struct dict_object *ogs_diam_s6a_e_utran_vector = NULL;
struct dict_object *ogs_diam_s6a_rand = NULL;
struct dict_object *ogs_diam_s6a_xres = NULL;
struct dict_object *ogs_diam_s6a_autn = NULL;
struct dict_object *ogs_diam_s6a_kasme = NULL;
struct dict_object *ogs_diam_s6a_subscriber_status = NULL;
struct dict_object *ogs_diam_s6a_ambr = NULL;
struct dict_object *ogs_diam_s6a_network_access_mode = NULL;
struct dict_object *ogs_diam_s6a_access_restriction_data = NULL;
struct dict_object *ogs_diam_s6a_apn_configuration_profile = NULL;
struct dict_object *ogs_diam_s6a_subscribed_rau_tau_timer = NULL;
struct dict_object *ogs_diam_s6a_context_identifier = NULL;
struct dict_object *ogs_diam_s6a_all_apn_configuration_included_indicator = NULL;
struct dict_object *ogs_diam_s6a_apn_configuration = NULL;
struct dict_object *ogs_diam_s6a_max_bandwidth_ul = NULL;
struct dict_object *ogs_diam_s6a_max_bandwidth_dl = NULL;
struct dict_object *ogs_diam_s6a_pdn_type = NULL;
struct dict_object *ogs_diam_s6a_eps_subscribed_qos_profile = NULL;
struct dict_object *ogs_diam_s6a_qos_class_identifier = NULL;
struct dict_object *ogs_diam_s6a_allocation_retention_priority = NULL;
struct dict_object *ogs_diam_s6a_priority_level = NULL;
struct dict_object *ogs_diam_s6a_pre_emption_capability = NULL;
struct dict_object *ogs_diam_s6a_pre_emption_vulnerability = NULL;
/* Attention! This version of the macro uses AVP_BY_NAME_AND_VENDOR, in contrast to most other copies! */
#define PARSE_loc_rules( _rulearray, _parent) { \
int __ar; \
for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \
struct dict_rule_data __data = { NULL, \
(_rulearray)[__ar].position, \
0, \
(_rulearray)[__ar].min, \
(_rulearray)[__ar].max}; \
__data.rule_order = RULE_ORDER(__data.rule_position); \
CHECK_FCT( fd_dict_search( \
fd_g_config->cnf_dict, \
DICT_AVP, \
AVP_BY_NAME_AND_VENDOR, \
&(_rulearray)[__ar].avp_vendor_plus_name, \
&__data.rule_avp, 0 ) ); \
if ( !__data.rule_avp ) { \
TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return ENOENT; \
} \
CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \
{ \
TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \
(_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
return EINVAL; \
} ); \
} \
}
int ogs_diam_s6a_dict_init(void)
#define enumval_def_u32( _val_, _str_ ) \
{ _str_, { .u32 = _val_ }}
#define enumval_def_os( _len_, _val_, _str_ ) \
{ _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}}
int ogs_dict_s6a_entry(char *conffile)
{
application_id_t id = OGS_DIAM_S6A_APPLICATION_ID;
struct dict_object *s6a;
TRACE_ENTRY("%p", conffile);
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID, (void *)&id, &ogs_diam_s6a_application);
/* Applications section */
{
struct dict_object * vendor;
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor, ENOENT));
struct dict_application_data app_data = { 16777251, "S6A" };
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &app_data, vendor, &s6a));
}
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Authentication-Information-Request", &ogs_diam_s6a_cmd_air);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Authentication-Information-Answer", &ogs_diam_s6a_cmd_aia);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Update-Location-Request", &ogs_diam_s6a_cmd_ulr);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Update-Location-Answer", &ogs_diam_s6a_cmd_ula);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Purge-UE-Request", &ogs_diam_s6a_cmd_pur);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Purge-UE-Answer", &ogs_diam_s6a_cmd_pua);
/* AVP section */
{
{
/* AIR-Flags AVP - 3GPP TS 29.272 #7.3.201 */
struct dict_avp_data data = {
1679, /* Code */
10415, /* Vendor */
"AIR-Flags", /* Name */
AVP_FLAG_VENDOR |AVP_FLAG_MANDATORY, /* Fixed flags */
AVP_FLAG_VENDOR, /* Fixed flag values */
AVP_TYPE_UNSIGNED32 /* base type of data */
};
CHECK_dict_new(DICT_AVP, &data, NULL, NULL);
}
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Visited-PLMN-Id", &ogs_diam_s6a_visited_plmn_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_s6a_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "ULR-Flags", &ogs_diam_s6a_ulr_flags);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "ULA-Flags", &ogs_diam_s6a_ula_flags);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "UE-SRVCC-Capability", &ogs_diam_s6a_ue_srvcc_capability);
/* Terminal Information AVP - 3GPP TS 29.272 #7.3.3 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "IMEI" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP2-MEID" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Software-Version" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-EUTRAN-Authentication-Info", &ogs_diam_s6a_req_eutran_auth_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Number-Of-Requested-Vectors", &ogs_diam_s6a_number_of_requested_vectors);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Immediate-Response-Preferred", &ogs_diam_s6a_immediate_response_preferred);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Re-Synchronization-Info", &ogs_diam_s6a_re_synchronization_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Terminal-Information", &avp);
PARSE_loc_rules( rules, avp );
}
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Authentication-Info", &ogs_diam_s6a_authentication_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "E-UTRAN-Vector", &ogs_diam_s6a_e_utran_vector);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAND", &ogs_diam_s6a_rand);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "XRES", &ogs_diam_s6a_xres);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AUTN", &ogs_diam_s6a_autn);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "KASME", &ogs_diam_s6a_kasme);
/* Requested-EUTRAN-Authentication-Info AVP - 3GPP TS 29.272 #7.3.11 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Number-Of-Requested-Vectors" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Immediate-Response-Preferred" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Re-Synchronization-Info" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "EPS-Subscribed-QoS-Profile", &ogs_diam_s6a_eps_subscribed_qos_profile);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier", &ogs_diam_s6a_qos_class_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Allocation-Retention-Priority", &ogs_diam_s6a_allocation_retention_priority);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Priority-Level", &ogs_diam_s6a_priority_level);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Capability", &ogs_diam_s6a_pre_emption_capability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Vulnerability", &ogs_diam_s6a_pre_emption_vulnerability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-EUTRAN-Authentication-Info", &avp);
PARSE_loc_rules( rules, avp );
}
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AMBR", &ogs_diam_s6a_ambr);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL", &ogs_diam_s6a_max_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL", &ogs_diam_s6a_max_bandwidth_dl);
/* Requested-UTRAN-GERAN-Authentication-Info AVP - 3GPP TS 29.272 #7.3.12 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Number-Of-Requested-Vectors" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Immediate-Response-Preferred" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Re-Synchronization-Info" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration-Profile", &ogs_diam_s6a_apn_configuration_profile);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Context-Identifier", &ogs_diam_s6a_context_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "All-APN-Configurations-Included-Indicator", &ogs_diam_s6a_all_apn_configuration_included_indicator);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration", &ogs_diam_s6a_apn_configuration);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Service-Selection", &ogs_diam_s6a_service_selection);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "PDN-Type", &ogs_diam_s6a_pdn_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Data", &ogs_diam_s6a_subscription_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscriber-Status", &ogs_diam_s6a_subscriber_status);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Network-Access-Mode", &ogs_diam_s6a_network_access_mode);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Access-Restriction-Data", &ogs_diam_s6a_access_restriction_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscribed-Periodic-RAU-TAU-Timer", &ogs_diam_s6a_subscribed_rau_tau_timer);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-UTRAN-GERAN-Authentication-Info", &avp);
PARSE_loc_rules( rules, avp );
}
/* E-UTRAN-Vector - 3GPP TS 29.272 #7.3.18 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Item-Number" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAND" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "XRES" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AUTN" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "KASME" }, RULE_REQUIRED, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "E-UTRAN-Vector", &avp);
PARSE_loc_rules( rules, avp );
}
/* UTRAN-Vector - 3GPP TS 29.272 #7.3.19 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Item-Number" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAND" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "XRES" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AUTN" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Confidentiality-Key" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Integrity-Key" }, RULE_REQUIRED, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "UTRAN-Vector", &avp);
PARSE_loc_rules( rules, avp );
}
/* GERAN-Vector - 3GPP TS 29.272 #7.3.20 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Item-Number" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAND" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SRES" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Kc" }, RULE_REQUIRED, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "GERAN-Vector", &avp);
PARSE_loc_rules( rules, avp );
}
/* Authentication-Info - 3GPP TS 29.272 #7.3.17 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "E-UTRAN-Vector" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "UTRAN-Vector" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "GERAN-Vector" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Authentication-Info", &avp);
PARSE_loc_rules( rules, avp );
}
/* EPS-Subscribed-QoS-Profile AVP - 3GPP TS 29.272 #7.3.37 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "QoS-Class-Identifier" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Allocation-Retention-Priority" }, RULE_REQUIRED, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "EPS-Subscribed-QoS-Profile", &avp);
PARSE_loc_rules( rules, avp );
}
/* AMBR AVP - 3GPP TS 29.272 #7.3.41 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Max-Requested-Bandwidth-UL" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Max-Requested-Bandwidth-DL" }, RULE_REQUIRED, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AMBR", &avp);
PARSE_loc_rules( rules, avp );
}
/* Specific-APN-Info AVP - 3GPP TS 29.272 #7.3.82 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_name = "Service-Selection" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "MIP6-Agent-Info" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Visited-Network-Identifier" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Specific-APN-Info", &avp);
PARSE_loc_rules( rules, avp );
}
/* APN-Configuration AVP - 3GPP TS 29.272 #7.3.35 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Context-Identifier" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Served-Party-IP-Address" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "PDN-Type" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Service-Selection" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "EPS-Subscribed-QoS-Profile" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "VPLMN-Dynamic-Address-Allowed" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "MIP6-Agent-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Visited-Network-Identifier" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "PDN-GW-Allocation-Type" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-Charging-Characteristics" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AMBR" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Specific-APN-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "APN-OI-Replacement" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SIPTO-Permission" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "LIPA-Permission" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration", &avp);
PARSE_loc_rules( rules, avp );
}
/* APN-Configuration-Profile AVP - 3GPP TS 29.272 #7.3.34 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Context-Identifier" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "All-APN-Configurations-Included-Indicator" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "APN-Configuration" }, RULE_REQUIRED, -1, -1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration-Profile", &avp);
PARSE_loc_rules( rules, avp );
}
/* Subscription-Data AVP - 3GPP TS 29.272 #7.3.2 */
{
struct dict_object * avp;
struct local_rules_definition rules[] =
{
{ { .avp_vendor = 10415, .avp_name = "Subscriber-Status" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "MSISDN" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "STN-SR" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "ICS-Indicator" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Network-Access-Mode" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Operator-Determined-Barring" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "HPLMN-ODB" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Regional-Subscription-Zone-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Access-Restriction-Data" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "APN-OI-Replacement" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "LCS-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Teleservice-List" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Call-Barring-Infor-List" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "3GPP-Charging-Characteristics" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AMBR" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "APN-Configuration-Profile" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAT-Frequency-Selection-Priority-ID" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Trace-Data" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "GPRS-Subscription-Data" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "CSG-Subscription-Data" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Roaming-Restricted-Due-To-Unsupported-Feature" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Subscribed-Periodic-RAU-TAU-Timer" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "MPS-Priority" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "VPLMN-LIPA-Allowed" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Relay-Node-Indicator" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "MDT-User-Consent" }, RULE_OPTIONAL, -1, 1 },
};
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Data", &avp);
PARSE_loc_rules( rules, avp );
}
};
/* Command section */
{
/* S6A-Update Location Request - 3GPP TS 29.272 #7.2.3 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
316, /* Code */
"Update-Location-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Host" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Destination-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Terminal-Information" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "ULR-Flags" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Visited-PLMN-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Equivalent-PLMN-List" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "RAT-Type" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "SGSN-Number" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Homogeneous-Support-of-IMS-Voice-Over-PS-Sessions" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Active-APN" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "UE-SRVCC-Capability" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
CHECK_dict_new(DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules(rules, cmd);
}
/* S6A-Update Location Answer - 3GPP TS 29.272 #7.2.4 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
316, /* Code */
"Update-Location-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Error-Diagnostic" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "ULA-Flags" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Subscription-Data" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
CHECK_dict_new(DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules(rules, cmd);
}
/* S6A-Authentication-Information-Request - 3GPP TS 29.272 #7.2.4 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
318, /* Code */
"Authentication-Information-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Host" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Destination-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Requested-EUTRAN-Authentication-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Requested-UTRAN-GERAN-Authentication-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Visited-PLMN-Id" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "AIR-Flags" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
CHECK_dict_new(DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules(rules, cmd);
}
/* S6A-Authentication-Information-Answer - 3GPP TS 29.272 #7.2.6 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
318, /* Code */
"Authentication-Information-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Error-Diagnostic" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "Authentication-Info" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
CHECK_dict_new(DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules(rules, cmd);
}
/* Purge-UE-Request (PUR) Command - 3GPP TS 29.272 #7.2.13 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
321, /* Code */
"Purge-UE-Request", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Destination-Host" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Destination-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "User-Name" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_vendor = 10415, .avp_name = "PUR-Flags" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
/* Purge-UE-Answer (PUA) Command - 3GPP TS 29.272 #7.2.14 */
{
struct dict_object * cmd;
struct dict_cmd_data data = {
321, /* Code */
"Purge-UE-Answer", /* Name */
CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */
CMD_FLAG_PROXIABLE /* Fixed flag values */
};
struct local_rules_definition rules[] =
{
{ { .avp_name = "Session-Id" }, RULE_FIXED_HEAD, -1, 1 },
{ { .avp_name = "Vendor-Specific-Application-Id" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Result-Code" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Experimental-Result" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Auth-Session-State" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Host" }, RULE_REQUIRED, -1, 1 },
{ { .avp_name = "Origin-Realm" }, RULE_REQUIRED, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "Error-Diagnostic" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_vendor = 10415, .avp_name = "PUA-Flags" }, RULE_OPTIONAL, -1, 1 },
{ { .avp_name = "Failed-AVP" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
};
CHECK_dict_new( DICT_COMMAND, &data, s6a, &cmd);
PARSE_loc_rules( rules, cmd );
}
}
LOG_D( "Extension 'Dictionary definitions for DCCA 3GPP S6A' initialized");
return 0;
}
#if 0 /* modified by acetcom */
EXTENSION_ENTRY("dict_s6a", ogs_dict_s6a_entry, "dict_dcca_3gpp");
#endif

View File

@ -1,113 +0,0 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(OGS_DIAMETER_INSIDE) && !defined(OGS_DIAMETER_COMPILATION)
#error "This header cannot be included directly."
#endif
#ifndef OGS_DIAM_S6A_DICT_H
#define OGS_DIAM_S6A_DICT_H
#ifdef __cplusplus
extern "C" {
#endif
#define OGS_DIAM_S6A_APPLICATION_ID 16777251
#define OGS_DIAM_S6A_AVP_CODE_CONTEXT_IDENTIFIER (1423)
#define OGS_DIAM_S6A_AVP_CODE_ALL_APN_CONFIG_INC_IND (1428)
#define OGS_DIAM_S6A_AVP_CODE_APN_CONFIGURATION (1430)
#define OGS_DIAM_S6A_AVP_CODE_MIP_HOME_AGENT_ADDRESS (334)
#define OGS_DIAM_S6A_RAT_TYPE_WLAN 0
#define OGS_DIAM_S6A_RAT_TYPE_VIRTUAL 1
#define OGS_DIAM_S6A_RAT_TYPE_UTRAN 1000
#define OGS_DIAM_S6A_RAT_TYPE_GERAN 1001
#define OGS_DIAM_S6A_RAT_TYPE_GAN 1002
#define OGS_DIAM_S6A_RAT_TYPE_HSPA_EVOLUTION 1003
#define OGS_DIAM_S6A_RAT_TYPE_EUTRAN 1004
#define OGS_DIAM_S6A_RAT_TYPE_EUTRAN_NB_IOT 1005
#define OGS_DIAM_S6A_RAT_TYPE_CDMA2000_1X 2000
#define OGS_DIAM_S6A_RAT_TYPE_HRPD 2001
#define OGS_DIAM_S6A_RAT_TYPE_UMB 2002
#define OGS_DIAM_S6A_RAT_TYPE_EHRPD 2003
#define OGS_DIAM_S6A_ULR_SINGLE_REGISTRATION_IND (1)
#define OGS_DIAM_S6A_ULR_S6A_S6D_INDICATOR (1 << 1)
#define OGS_DIAM_S6A_ULR_SKIP_SUBSCRIBER_DATA (1 << 2)
#define OGS_DIAM_S6A_ULR_GPRS_SUBSCRIPTION_DATA_IND (1 << 3)
#define OGS_DIAM_S6A_ULR_NODE_TYPE_IND (1 << 4)
#define OGS_DIAM_S6A_ULR_INITIAL_ATTACH_IND (1 << 5)
#define OGS_DIAM_S6A_ULR_PS_LCS_SUPPORTED_BY_UE (1 << 6)
#define OGS_DIAM_S6A_UE_SRVCC_NOT_SUPPORTED (0)
#define OGS_DIAM_S6A_UE_SRVCC_SUPPORTED (1)
extern struct dict_object *ogs_diam_s6a_application;
extern struct dict_object *ogs_diam_s6a_cmd_air;
extern struct dict_object *ogs_diam_s6a_cmd_aia;
extern struct dict_object *ogs_diam_s6a_cmd_ulr;
extern struct dict_object *ogs_diam_s6a_cmd_ula;
extern struct dict_object *ogs_diam_s6a_cmd_pur;
extern struct dict_object *ogs_diam_s6a_cmd_pua;
extern struct dict_object *ogs_diam_s6a_visited_plmn_id;
extern struct dict_object *ogs_diam_s6a_rat_type;
extern struct dict_object *ogs_diam_s6a_ulr_flags;
extern struct dict_object *ogs_diam_s6a_ula_flags;
extern struct dict_object *ogs_diam_s6a_subscription_data;
extern struct dict_object *ogs_diam_s6a_req_eutran_auth_info;
extern struct dict_object *ogs_diam_s6a_number_of_requested_vectors;
extern struct dict_object *ogs_diam_s6a_immediate_response_preferred;
extern struct dict_object *ogs_diam_s6a_authentication_info;
extern struct dict_object *ogs_diam_s6a_re_synchronization_info;
extern struct dict_object *ogs_diam_s6a_service_selection;
extern struct dict_object *ogs_diam_s6a_ue_srvcc_capability;
extern struct dict_object *ogs_diam_s6a_e_utran_vector;
extern struct dict_object *ogs_diam_s6a_rand;
extern struct dict_object *ogs_diam_s6a_xres;
extern struct dict_object *ogs_diam_s6a_autn;
extern struct dict_object *ogs_diam_s6a_kasme;
extern struct dict_object *ogs_diam_s6a_subscriber_status;
extern struct dict_object *ogs_diam_s6a_ambr;
extern struct dict_object *ogs_diam_s6a_network_access_mode;
extern struct dict_object *ogs_diam_s6a_access_restriction_data;
extern struct dict_object *ogs_diam_s6a_apn_configuration_profile;
extern struct dict_object *ogs_diam_s6a_subscribed_rau_tau_timer;
extern struct dict_object *ogs_diam_s6a_context_identifier;
extern struct dict_object *ogs_diam_s6a_all_apn_configuration_included_indicator;
extern struct dict_object *ogs_diam_s6a_apn_configuration;
extern struct dict_object *ogs_diam_s6a_max_bandwidth_ul;
extern struct dict_object *ogs_diam_s6a_max_bandwidth_dl;
extern struct dict_object *ogs_diam_s6a_pdn_type;
extern struct dict_object *ogs_diam_s6a_eps_subscribed_qos_profile;
extern struct dict_object *ogs_diam_s6a_qos_class_identifier;
extern struct dict_object *ogs_diam_s6a_allocation_retention_priority;
extern struct dict_object *ogs_diam_s6a_priority_level;
extern struct dict_object *ogs_diam_s6a_pre_emption_capability;
extern struct dict_object *ogs_diam_s6a_pre_emption_vulnerability;
int ogs_diam_s6a_dict_init(void);
#ifdef __cplusplus
}
#endif
#endif /* OGS_DIAM_OGS_DIAM_S6A_DICT_H */

View File

@ -18,10 +18,10 @@
libdiameter_s6a_sources = files('''
ogs-diameter-s6a.h
dict.h
message.h
dict.c
message.c
'''.split())
libdiameter_s6a_inc = include_directories('.')
@ -29,7 +29,7 @@ libdiameter_s6a_inc = include_directories('.')
libdiameter_s6a = library('ogsdiameter-s6a',
sources : libdiameter_s6a_sources,
version : libogslib_version,
c_args : '-DOGS_DIAM_COMPILATION',
c_args : libdiameter_common_cc_flags,
include_directories : [libdiameter_s6a_inc, libcrypt_inc],
dependencies : libdiameter_common_dep,
install : true)

129
lib/diameter/s6a/message.c Normal file
View File

@ -0,0 +1,129 @@
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-diameter-s6a.h"
#define CHECK_dict_search( _type, _criteria, _what, _result ) \
CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
struct dict_object *ogs_diam_s6a_application = NULL;
struct dict_object *ogs_diam_s6a_cmd_air = NULL;
struct dict_object *ogs_diam_s6a_cmd_aia = NULL;
struct dict_object *ogs_diam_s6a_cmd_ulr = NULL;
struct dict_object *ogs_diam_s6a_cmd_ula = NULL;
struct dict_object *ogs_diam_s6a_cmd_pur = NULL;
struct dict_object *ogs_diam_s6a_cmd_pua = NULL;
struct dict_object *ogs_diam_s6a_visited_plmn_id = NULL;
struct dict_object *ogs_diam_s6a_rat_type = NULL;
struct dict_object *ogs_diam_s6a_ulr_flags = NULL;
struct dict_object *ogs_diam_s6a_ula_flags = NULL;
struct dict_object *ogs_diam_s6a_subscription_data = NULL;
struct dict_object *ogs_diam_s6a_req_eutran_auth_info = NULL;
struct dict_object *ogs_diam_s6a_number_of_requested_vectors = NULL;
struct dict_object *ogs_diam_s6a_immediate_response_preferred = NULL;
struct dict_object *ogs_diam_s6a_authentication_info = NULL;
struct dict_object *ogs_diam_s6a_re_synchronization_info = NULL;
struct dict_object *ogs_diam_s6a_service_selection = NULL;
struct dict_object *ogs_diam_s6a_ue_srvcc_capability = NULL;
struct dict_object *ogs_diam_s6a_e_utran_vector = NULL;
struct dict_object *ogs_diam_s6a_rand = NULL;
struct dict_object *ogs_diam_s6a_xres = NULL;
struct dict_object *ogs_diam_s6a_autn = NULL;
struct dict_object *ogs_diam_s6a_kasme = NULL;
struct dict_object *ogs_diam_s6a_subscriber_status = NULL;
struct dict_object *ogs_diam_s6a_ambr = NULL;
struct dict_object *ogs_diam_s6a_network_access_mode = NULL;
struct dict_object *ogs_diam_s6a_access_restriction_data = NULL;
struct dict_object *ogs_diam_s6a_apn_configuration_profile = NULL;
struct dict_object *ogs_diam_s6a_subscribed_rau_tau_timer = NULL;
struct dict_object *ogs_diam_s6a_context_identifier = NULL;
struct dict_object *ogs_diam_s6a_all_apn_configuration_included_indicator = NULL;
struct dict_object *ogs_diam_s6a_apn_configuration = NULL;
struct dict_object *ogs_diam_s6a_max_bandwidth_ul = NULL;
struct dict_object *ogs_diam_s6a_max_bandwidth_dl = NULL;
struct dict_object *ogs_diam_s6a_pdn_type = NULL;
struct dict_object *ogs_diam_s6a_eps_subscribed_qos_profile = NULL;
struct dict_object *ogs_diam_s6a_qos_class_identifier = NULL;
struct dict_object *ogs_diam_s6a_allocation_retention_priority = NULL;
struct dict_object *ogs_diam_s6a_priority_level = NULL;
struct dict_object *ogs_diam_s6a_pre_emption_capability = NULL;
struct dict_object *ogs_diam_s6a_pre_emption_vulnerability = NULL;
extern int ogs_dict_s6a_entry(char *conffile);
int ogs_diam_s6a_init(void)
{
application_id_t id = OGS_DIAM_S6A_APPLICATION_ID;
ogs_assert(ogs_dict_s6a_entry(NULL) == 0);
CHECK_dict_search(DICT_APPLICATION, APPLICATION_BY_ID, (void *)&id, &ogs_diam_s6a_application);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Authentication-Information-Request", &ogs_diam_s6a_cmd_air);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Authentication-Information-Answer", &ogs_diam_s6a_cmd_aia);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Update-Location-Request", &ogs_diam_s6a_cmd_ulr);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Update-Location-Answer", &ogs_diam_s6a_cmd_ula);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Purge-UE-Request", &ogs_diam_s6a_cmd_pur);
CHECK_dict_search(DICT_COMMAND, CMD_BY_NAME, "Purge-UE-Answer", &ogs_diam_s6a_cmd_pua);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Visited-PLMN-Id", &ogs_diam_s6a_visited_plmn_id);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_s6a_rat_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "ULR-Flags", &ogs_diam_s6a_ulr_flags);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "ULA-Flags", &ogs_diam_s6a_ula_flags);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "UE-SRVCC-Capability", &ogs_diam_s6a_ue_srvcc_capability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Requested-EUTRAN-Authentication-Info", &ogs_diam_s6a_req_eutran_auth_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Number-Of-Requested-Vectors", &ogs_diam_s6a_number_of_requested_vectors);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Immediate-Response-Preferred", &ogs_diam_s6a_immediate_response_preferred);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Re-Synchronization-Info", &ogs_diam_s6a_re_synchronization_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Authentication-Info", &ogs_diam_s6a_authentication_info);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "E-UTRAN-Vector", &ogs_diam_s6a_e_utran_vector);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAND", &ogs_diam_s6a_rand);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "XRES", &ogs_diam_s6a_xres);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AUTN", &ogs_diam_s6a_autn);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "KASME", &ogs_diam_s6a_kasme);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "EPS-Subscribed-QoS-Profile", &ogs_diam_s6a_eps_subscribed_qos_profile);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier", &ogs_diam_s6a_qos_class_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Allocation-Retention-Priority", &ogs_diam_s6a_allocation_retention_priority);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Priority-Level", &ogs_diam_s6a_priority_level);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Capability", &ogs_diam_s6a_pre_emption_capability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Vulnerability", &ogs_diam_s6a_pre_emption_vulnerability);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AMBR", &ogs_diam_s6a_ambr);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL", &ogs_diam_s6a_max_bandwidth_ul);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-DL", &ogs_diam_s6a_max_bandwidth_dl);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration-Profile", &ogs_diam_s6a_apn_configuration_profile);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Context-Identifier", &ogs_diam_s6a_context_identifier);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "All-APN-Configurations-Included-Indicator", &ogs_diam_s6a_all_apn_configuration_included_indicator);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration", &ogs_diam_s6a_apn_configuration);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Service-Selection", &ogs_diam_s6a_service_selection);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "PDN-Type", &ogs_diam_s6a_pdn_type);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Data", &ogs_diam_s6a_subscription_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscriber-Status", &ogs_diam_s6a_subscriber_status);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Network-Access-Mode", &ogs_diam_s6a_network_access_mode);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Access-Restriction-Data", &ogs_diam_s6a_access_restriction_data);
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscribed-Periodic-RAU-TAU-Timer", &ogs_diam_s6a_subscribed_rau_tau_timer);
return 0;
}

View File

@ -30,6 +30,82 @@
extern "C" {
#endif
#define OGS_DIAM_S6A_APPLICATION_ID 16777251
#define OGS_DIAM_S6A_AVP_CODE_CONTEXT_IDENTIFIER (1423)
#define OGS_DIAM_S6A_AVP_CODE_ALL_APN_CONFIG_INC_IND (1428)
#define OGS_DIAM_S6A_AVP_CODE_APN_CONFIGURATION (1430)
#define OGS_DIAM_S6A_AVP_CODE_MIP_HOME_AGENT_ADDRESS (334)
#define OGS_DIAM_S6A_RAT_TYPE_WLAN 0
#define OGS_DIAM_S6A_RAT_TYPE_VIRTUAL 1
#define OGS_DIAM_S6A_RAT_TYPE_UTRAN 1000
#define OGS_DIAM_S6A_RAT_TYPE_GERAN 1001
#define OGS_DIAM_S6A_RAT_TYPE_GAN 1002
#define OGS_DIAM_S6A_RAT_TYPE_HSPA_EVOLUTION 1003
#define OGS_DIAM_S6A_RAT_TYPE_EUTRAN 1004
#define OGS_DIAM_S6A_RAT_TYPE_EUTRAN_NB_IOT 1005
#define OGS_DIAM_S6A_RAT_TYPE_CDMA2000_1X 2000
#define OGS_DIAM_S6A_RAT_TYPE_HRPD 2001
#define OGS_DIAM_S6A_RAT_TYPE_UMB 2002
#define OGS_DIAM_S6A_RAT_TYPE_EHRPD 2003
#define OGS_DIAM_S6A_ULR_SINGLE_REGISTRATION_IND (1)
#define OGS_DIAM_S6A_ULR_S6A_S6D_INDICATOR (1 << 1)
#define OGS_DIAM_S6A_ULR_SKIP_SUBSCRIBER_DATA (1 << 2)
#define OGS_DIAM_S6A_ULR_GPRS_SUBSCRIPTION_DATA_IND (1 << 3)
#define OGS_DIAM_S6A_ULR_NODE_TYPE_IND (1 << 4)
#define OGS_DIAM_S6A_ULR_INITIAL_ATTACH_IND (1 << 5)
#define OGS_DIAM_S6A_ULR_PS_LCS_SUPPORTED_BY_UE (1 << 6)
#define OGS_DIAM_S6A_UE_SRVCC_NOT_SUPPORTED (0)
#define OGS_DIAM_S6A_UE_SRVCC_SUPPORTED (1)
extern struct dict_object *ogs_diam_s6a_application;
extern struct dict_object *ogs_diam_s6a_cmd_air;
extern struct dict_object *ogs_diam_s6a_cmd_aia;
extern struct dict_object *ogs_diam_s6a_cmd_ulr;
extern struct dict_object *ogs_diam_s6a_cmd_ula;
extern struct dict_object *ogs_diam_s6a_cmd_pur;
extern struct dict_object *ogs_diam_s6a_cmd_pua;
extern struct dict_object *ogs_diam_s6a_visited_plmn_id;
extern struct dict_object *ogs_diam_s6a_rat_type;
extern struct dict_object *ogs_diam_s6a_ulr_flags;
extern struct dict_object *ogs_diam_s6a_ula_flags;
extern struct dict_object *ogs_diam_s6a_subscription_data;
extern struct dict_object *ogs_diam_s6a_req_eutran_auth_info;
extern struct dict_object *ogs_diam_s6a_number_of_requested_vectors;
extern struct dict_object *ogs_diam_s6a_immediate_response_preferred;
extern struct dict_object *ogs_diam_s6a_authentication_info;
extern struct dict_object *ogs_diam_s6a_re_synchronization_info;
extern struct dict_object *ogs_diam_s6a_service_selection;
extern struct dict_object *ogs_diam_s6a_ue_srvcc_capability;
extern struct dict_object *ogs_diam_s6a_e_utran_vector;
extern struct dict_object *ogs_diam_s6a_rand;
extern struct dict_object *ogs_diam_s6a_xres;
extern struct dict_object *ogs_diam_s6a_autn;
extern struct dict_object *ogs_diam_s6a_kasme;
extern struct dict_object *ogs_diam_s6a_subscriber_status;
extern struct dict_object *ogs_diam_s6a_ambr;
extern struct dict_object *ogs_diam_s6a_network_access_mode;
extern struct dict_object *ogs_diam_s6a_access_restriction_data;
extern struct dict_object *ogs_diam_s6a_apn_configuration_profile;
extern struct dict_object *ogs_diam_s6a_subscribed_rau_tau_timer;
extern struct dict_object *ogs_diam_s6a_context_identifier;
extern struct dict_object *ogs_diam_s6a_all_apn_configuration_included_indicator;
extern struct dict_object *ogs_diam_s6a_apn_configuration;
extern struct dict_object *ogs_diam_s6a_max_bandwidth_ul;
extern struct dict_object *ogs_diam_s6a_max_bandwidth_dl;
extern struct dict_object *ogs_diam_s6a_pdn_type;
extern struct dict_object *ogs_diam_s6a_eps_subscribed_qos_profile;
extern struct dict_object *ogs_diam_s6a_qos_class_identifier;
extern struct dict_object *ogs_diam_s6a_allocation_retention_priority;
extern struct dict_object *ogs_diam_s6a_priority_level;
extern struct dict_object *ogs_diam_s6a_pre_emption_capability;
extern struct dict_object *ogs_diam_s6a_pre_emption_vulnerability;
typedef struct ogs_diam_e_utran_vector_s {
uint8_t xres[OGS_MAX_RES_LEN];
uint8_t xres_len;
@ -95,6 +171,8 @@ typedef struct ogs_diam_s6a_message_s {
ogs_diam_s6a_ula_message_t ula_message;
} ogs_diam_s6a_message_t;
int ogs_diam_s6a_init(void);
#ifdef __cplusplus
}
#endif

View File

@ -24,7 +24,6 @@
#define OGS_DIAMETER_INSIDE
#include "diameter/s6a/dict.h"
#include "diameter/s6a/message.h"
#undef OGS_DIAMETER_INSIDE

View File

@ -109,9 +109,6 @@ add_project_arguments(
cc.get_supported_arguments(possible_cc_flags),
language : 'c')
freediameter_subdir = 'freeDiameter-1.2.1'
freediameter_proj = subproject(freediameter_subdir)
subdir('configs')
subdir('lib')
subdir('src')

View File

@ -681,7 +681,7 @@ int hss_fd_init(void)
ogs_assert(ret == 0);
/* Install objects definitions for this application */
ret = ogs_diam_s6a_dict_init();
ret = ogs_diam_s6a_init();
ogs_assert(ret == 0);
memset(&data, 0, sizeof(data));

View File

@ -1007,7 +1007,7 @@ int mme_fd_init(void)
ogs_assert(ret == OGS_OK);
/* Install objects definitions for this application */
ret = ogs_diam_s6a_dict_init();
ret = ogs_diam_s6a_init();
ogs_assert(ret == OGS_OK);
/* Create handler for sessions */

View File

@ -1077,7 +1077,7 @@ int pcrf_gx_init(void)
struct disp_when data;
/* Install objects definitions for this application */
ret = ogs_diam_gx_dict_init();
ret = ogs_diam_gx_init();
ogs_assert(ret == 0);
/* Create handler for sessions */

View File

@ -717,7 +717,7 @@ int pcrf_rx_init(void)
struct disp_when data;
/* Install objects definitions for this application */
ret = ogs_diam_rx_dict_init();
ret = ogs_diam_rx_init();
ogs_assert(ret == 0);
/* Create handler for sessions */

View File

@ -1024,7 +1024,7 @@ int pgw_fd_init(void)
ogs_assert(ret == 0);
/* Install objects definitions for this application */
ret = ogs_diam_gx_dict_init();
ret = ogs_diam_gx_init();
ogs_assert(ret == 0);
/* Create handler for sessions */

View File

@ -1,4 +0,0 @@
repo: 13530e1f02e3d918eaec5cf9ad027d752c1cf2ab
node: 2cb8d71a405df19cf385e49e237f649589513e8d
branch: default
tag: 1.2.1

View File

@ -1,12 +0,0 @@
syntax: glob
*.orig
*.rej
*~
*.log
*.sum
.hg
build*
test.*
GPATH
GRTAGS
GTAGS

View File

@ -1,78 +0,0 @@
195096819152dcceb181b01f05e3e22594e33bbd 1.0.0-rc1
478173cb832ac426090c8ef4c37783303fe7931d 1.0.0
478173cb832ac426090c8ef4c37783303fe7931d 1.0.0
e9ab851f6dca2d4b0c3ca11821d0efda78d9c3c5 1.0.0
25440e53a48e96c1cff0e29569a4a8ec32019cf9 1.0.1-rc1
62ad61238af2b83dcdb8848c2fedb1f3e482010d 1.0.1
144eeab1e3a45288e79321e5783b4f02e10851ca 1.0.2-rc1
f27b40a9dd82152f4587679f397e6ff571a70efb 1.0.2
7ae66129fd7341846df8b6c51ddc2d525707bc3b 1.0.3-rc1
18c4a738e3e910e4e6863aebe5ecb8a61948f5f5 1.0.3-rc2
69d3579f6c6cd3b16daeedc60ca94ca6056a3748 1.0.3-rc3
f065e3cb846ee557b13279b99272032a4ad913a9 1.0.3
5b05d85682f1a23fcd0ecfc87649a65b841e7ca8 1.0.x-last
2e94ef0515d71fb7e932e48894feb84487939c3f 1.1.0-rc1
ff23fecac0b2214818e19f1d4b74b2d4b97f1142 1.1.0-rc2
b2bc31410425527e4c0930580d185c4f15b1cb56 1.1.0-rc3
5d529eb0ad331e9a381de9100a9670e1148b7a98 1.1.0
36caa2c02d1e25309bc9cc6a1f0bb3333ddf7e80 1.1.1
36caa2c02d1e25309bc9cc6a1f0bb3333ddf7e80 1.1.1
0925471e2a88d4d7e2993214e83d925b37908991 1.1.1
69ef21d4a7fea3a812bf19b909df8e56c43adce8 1.1.2
066e1ad7e9fa1eccd6e1d2174d5b57eb6bd33507 1.1.3
7541554029bfbca3370a2ae58a09e91946c6bd78 1.1.4-rc1
4ae6da028be7582a0b3fe98054d5fa0940f8985b 1.1.4
4ae6da028be7582a0b3fe98054d5fa0940f8985b 1.1.4
0000000000000000000000000000000000000000 1.1.4
0000000000000000000000000000000000000000 1.1.4
a39848239f3ab933d5e62089357dd6fd3a59e393 1.1.4
5c4cf8d15ef0e298734daf16203278d7fa62fa7a 1.1.5-rc1
226f5957186ae4369467b070aeb61b1c631c9a5c 1.1.5-rc2
ae96ae28f3ddc48b9e2676e9538008eab2b9d60a 1.1.5
8500947421cb412b5f4f2dfffdf1a35b6fb369e0 FORK
155d45d0653025f45b58ab96b6ba0d5e6fb7fcf8 1.1.6
8500947421cb412b5f4f2dfffdf1a35b6fb369e0 FORK
0000000000000000000000000000000000000000 FORK
ec348f6043998ca77d2b3122ef47157c82055ccd proposed_merged
ec348f6043998ca77d2b3122ef47157c82055ccd proposed_merged
371f899276ed15d796ae324a88421109c847922b proposed_merged
371f899276ed15d796ae324a88421109c847922b proposed_merged
80584f0e851a725470a42e41607fe21775f2dac8 proposed_merged
80584f0e851a725470a42e41607fe21775f2dac8 proposed_merged
cf09fde3d7f5da1aac5b8ec0412da83af732ac8d proposed_merged
cf09fde3d7f5da1aac5b8ec0412da83af732ac8d proposed_merged
7ca81c10ba06a3a722c825ce94b6a01bc6b39b04 proposed_merged
7ca81c10ba06a3a722c825ce94b6a01bc6b39b04 proposed_merged
2a510c541472ccd14e2fe83051ade7ddc5ae23f5 proposed_merged
2a510c541472ccd14e2fe83051ade7ddc5ae23f5 proposed_merged
0117a7746b2166b861ff66c42b21115cd17bfcc5 proposed_merged
0117a7746b2166b861ff66c42b21115cd17bfcc5 proposed_merged
09e2a6d796ef8cd55295c635e36ba5a0e2bf7cad proposed_merged
09e2a6d796ef8cd55295c635e36ba5a0e2bf7cad proposed_merged
7c5449ddc434828e77517cb893c882d740b5a4d6 proposed_merged
f916f4fc3d99b05adf5e6c94cef089568de7b252 1.2.0-rc1
7c5449ddc434828e77517cb893c882d740b5a4d6 proposed_merged
75633912f364ad94a82e197d918c75b4745998f8 proposed_merged
75633912f364ad94a82e197d918c75b4745998f8 proposed_merged
7ef8ab1d664f300fb5ad8f102c8b2fdafa609518 proposed_merged
7ef8ab1d664f300fb5ad8f102c8b2fdafa609518 proposed_merged
7b57dc5a681fd642a218971da9af9af7356152d9 proposed_merged
7b57dc5a681fd642a218971da9af9af7356152d9 proposed_merged
5d19d6f3e1bd03adc8869e294d0c4b13e0977fd6 proposed_merged
5d19d6f3e1bd03adc8869e294d0c4b13e0977fd6 proposed_merged
d00b5914351e83fa90b2ea09f8c51cd82b312157 proposed_merged
d00b5914351e83fa90b2ea09f8c51cd82b312157 proposed_merged
fb9282c75ec51eb43690413c5b66a3192dfc79d3 proposed_merged
fb9282c75ec51eb43690413c5b66a3192dfc79d3 proposed_merged
043b894b0511b6beb155576e9e2c509a21be8360 proposed_merged
08e72b858f03a77869792cb8ad8e0acbc83c2590 1.2.0-rc2
f937feb727347445f8afb7759a97e34c76c0ba7b 1.2.0
ab6457399be2762b3e85bd173ba754ff758ef060 1.2.1-rc1
043b894b0511b6beb155576e9e2c509a21be8360 proposed_merged
0000000000000000000000000000000000000000 proposed_merged
13948c684c354d8c891ca5e2a5f1d76d1f176afe 1.2.1-rc2
19d01728f26f7318b5e851d3e5aae9703fa540ff 1.2.1
9caedf4a058b5ec7274c84201bfad986bc7f943c 1.2.1a
6446c0eea54742c8745c2efdad7963c65e74df5a 1.2.1b
19d01728f26f7318b5e851d3e5aae9703fa540ff 1.2.1
0000000000000000000000000000000000000000 1.2.1

View File

@ -1,112 +0,0 @@
# This file is the source for generating the Makefile for the project, using cmake tool (cmake.org)
# Name of the project
PROJECT("freeDiameter")
# Informations to display in daemon's help
SET(FD_PROJECT_NAME freeDiameter)
SET(FD_PROJECT_BINARY freeDiameterd)
SET(FD_PROJECT_COPYRIGHT "Copyright (c) 2008-2015, WIDE Project (www.wide.ad.jp) and NICT (www.nict.go.jp)")
# Version of the source code
SET(FD_PROJECT_VERSION_MAJOR 1)
SET(FD_PROJECT_VERSION_MINOR 2)
SET(FD_PROJECT_VERSION_REV 1)
# Version of the API with the library
SET(FD_PROJECT_VERSION_API 6)
# The test framework, using CTest and CDash.
INCLUDE(CTest)
# CMake version
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# Location of additional CMake modules
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# The default directories
SET(DEFAULT_CONF_PATH ${CMAKE_INSTALL_PREFIX}/etc/freeDiameter CACHE PATH "Default location of freeDiameter configuration files")
IF (NOT DEFINED LIB_INSTALL_DIR)
SET(LIB_INSTALL_DIR lib CACHE PATH "Default library path name on the system, to accomodate RPM-based systems that use lib64")
ENDIF (NOT DEFINED LIB_INSTALL_DIR)
SET(INSTALL_HEADERS_SUFFIX include/freeDiameter CACHE PATH "Directory where the headers are installed (relative to CMAKE_INSTALL_PREFIX).")
SET(INSTALL_DAEMON_SUFFIX bin CACHE PATH "Directory where the daemon binary is installed (relative to CMAKE_INSTALL_PREFIX).")
SET(INSTALL_LIBRARY_SUFFIX ${LIB_INSTALL_DIR} CACHE PATH "Directory where the freeDiameter libraries are installed (relative to CMAKE_INSTALL_PREFIX).")
SET(INSTALL_EXTENSIONS_SUFFIX ${LIB_INSTALL_DIR}/freeDiameter CACHE PATH "Directory where the extensions are installed / searched (relative to CMAKE_INSTALL_PREFIX).")
# All source code should be POSIX 200112L compatible, but some other extensions might be used, so:
ADD_DEFINITIONS(-D_GNU_SOURCE)
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo" "Profiling" "MaxPerformance" "DebianPackage" "DebugValgrind")
endif()
# Add a "Profiling" build type
# SET(CMAKE_BUILD_TYPE Profiling)
SET(CMAKE_C_FLAGS_PROFILING "-fprofile-arcs -ftest-coverage -fstack-protector -g -Wall")
# Add a "MaxPerformance" build type -- this is very silent...
# SET(CMAKE_BUILD_TYPE MaxPerformance)
SET(CMAKE_C_FLAGS_MAXPERFORMANCE "${CMAKE_C_FLAGS_RELEASE} -DSTRIP_DEBUG_CODE")
# Add a "DebianPackage" build type used when creating the Debian packages
SET(CMAKE_C_FLAGS_DEBIANPACKAGE "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
# Set the "Debug" flags
SET(CMAKE_C_FLAGS_DEBUG "-Wall -g -O0")
# Add a "DebugValgrind" build type used for checking execution with Valgrind tool
SET(CMAKE_C_FLAGS_DEBUGVALGRIND "-Wall -g -O0")
# Set the DEBUG flag for Debug and Profiling builds
IF (CMAKE_BUILD_TYPE MATCHES "Debug|Profiling|DebugValgrind")
SET(DEBUG 1)
ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug|Profiling|DebugValgrind")
# some subfolders use yacc and lex parsers
SET(BISON_GENERATE_DEFINES TRUE)
SET(BISON_PREFIX_OUTPUTS TRUE)
INCLUDE(CMakeUserUseBison)
SET(FLEX_PREFIX_OUTPUTS TRUE)
INCLUDE(CMakeUserUseFlex)
IF( NOT BISON_EXECUTABLE OR NOT FLEX_EXECUTABLE )
MESSAGE( SEND_ERROR "Bison and Flex are required" )
ENDIF( NOT BISON_EXECUTABLE OR NOT FLEX_EXECUTABLE )
# Check that flex is at least 2.5.20 to support bison-bridge
# how to do the check with cmake???
# Add this to workaround an apparent bug in FreeBSD cmake (already defined in Linux)
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-rdynamic")
# For Darwin systems
IF(APPLE)
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined dynamic_lookup")
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -flat_namespace -undefined dynamic_lookup")
ENDIF(APPLE)
# Location for the include files
INCLUDE_DIRECTORIES(include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
SUBDIRS(include/freeDiameter)
# Location for the source code
SUBDIRS(libfdproto)
SUBDIRS(libfdcore)
SUBDIRS(freeDiameterd)
# Extensions (there is no use of freeDiameter without any extension)
SUBDIRS(extensions)
# The unary tests directory
IF ( BUILD_TESTING )
SUBDIRS(tests)
ENDIF ( BUILD_TESTING )

View File

@ -1,10 +0,0 @@
# Configuration for sumitting the test result.
# Check http://www.freediameter.net/CDash for detail.
set(CTEST_PROJECT_NAME "freeDiameter")
set(CTEST_NIGHTLY_START_TIME "00:00:00 JST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.freediameter.net")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=freeDiameter")
set(CTEST_DROP_SITE_CDASH TRUE)

View File

@ -1,39 +0,0 @@
This package uses CMake (cmake.org) as building system. You'll need the cmake tool in order
to generate the Makefiles for your platform. You can also select which extensions must be built
with cmake. After the initial cmake configuration, you will need several tools such as make, a
C compiler (tested mostly with gcc), flex (> 2.5.4), bison, ...
You may retrieve the source package in several ways:
- as a pre-packaged version for your platform. Check the website for supported platforms.
- as a tarball containing the source.
- directly from the repository using Mercurial tool:
hg clone http://www.freediameter.net/hg/freeDiameter
In order to update later:
hg pull -u
Building in a separate directory is recommended:
# mkdir build
# cd build
# cmake ../
# make
You can pass options to instruct cmake about which components to compile on the command-line.
You can also use a CMake front-end (for example ccmake or cmake-gui).
If your cmake installation is recent, the edit_cache target is a good help as well:
# mkdir build
# cd build
# cmake ../
# make help
# make edit_cache
# make
You can disable the unit tests by doing:
# cmake -DBUILD_TESTING:BOOL=OFF ../
# make
When the tests are enabled, you can run them with:
# make test
See the INSTALL.* files for additional platform-specific information.
Note that the most up-to-date INSTALL file is the Ubuntu one. You may want to read there
in addition to your own platform file.

View File

@ -1,37 +0,0 @@
### Very short install notes for Fedora (tested on Fedora 13 and 14)
# Please refer to other INSTALL files for more detailed instructions (e.g. extension-specific notes).
Dependencies on Fedora 13 (from minimal system):
# yum install cmake make gcc gcc-c++ flex bison lksctp-tools-devel gnutls-devel libgcrypt-devel libidn-devel
In addition, if you have not already retrieved the latest source:
# yum install mercurial
Following dependencies are optional, depending on which extensions you plan to compile
app_acct:
# yum install postgresql-devel
optional:
# yum install postgresql-server
app_sip:
app_diameap:
# yum install mysql-devel
optional:
# yum install mysql-server
dict_legacy_xml:
# yum install libxml2 libxml2-devel
dbg_interactive:
# yum install swig python-devel
NOTE: You may need to change something in SELinux to allow binding the SCTP socket on Diameter port.
The following command is the very naive way to do it, you can probably do better (feedback appreciated!)
# setenforce Permissive
There is currently no Fedora-specific package for freeDiameter.
You are welcome to contribute packaging scripts.
Please contact dev@freediameter.net for more details.

View File

@ -1,125 +0,0 @@
See INSTALL file for general instructions on building freeDiameter.
------------------
QUICK INSTRUCTIONS
------------------
On FreeBSD-8.0 at least the following ports packages were required (should be same on FreeBSD-7.x):
cmake flex bison gnutls
Then the cmake command had to look like:
cmake -DFLEX_EXECUTABLE:FILEPATH=/usr/local/bin/flex -DSCTP_USE_MAPPED_ADDRESSES:BOOL=ON ...
---------------------
COMPLETE INSTRUCTIONS
---------------------
1) If you don't have freeBSD yet:
Install minimal system + ports using initial installer /usr/sbin/sysinstall
2) Install 'cmake'
a) from sources:
# cd /usr/ports/devel/cmake
# make install
b) or from package (don't forget to set your PACKAGEROOT appropriately. Ex: set PACKAGEROOT=ftp://ftp.jp.freebsd.org):
# pkg_add -v -r cmake
3) Install 'mercurial' (optional)
(replace 'cmake' by 'mercurial' in the previous command)
4) Install 'flex' and 'bison', same way.
5) Install 'gnutls' and 'libidn', same way also.
6) Retrieve freeDiameter source code:
# cd ~
# /usr/local/bin/hg clone http://www.freediameter.net/hg/freeDiameter/
6b) Make a build directory
# mkdir fD-build
# cd fD-build
7) Run cmake for freeDiameter (add other flags as you see fit, see INSTALL for more details)
# /usr/local/bin/cmake -DFLEX_EXECUTABLE:FILEPATH=/usr/local/bin/flex -DSCTP_USE_MAPPED_ADDRESSES:BOOL=ON ../freeDiameter
8) Compile, optionnaly test
# make
# make test
9) Install
# make install
10) Run (the install path can be changed during cmake step):
# /usr/local/bin/freeDiameterd --help
------------------------------
app_acct test ADDITIONAL STEPS
------------------------------
Here is additional steps in order to run the test for app_acct
1) Install the required packages
# pkg_add -v -r postgresql84-client
# pkg_add -v -r postgresql84-server
2) Prepare access to the database:
# echo postgresql_enable=YES >> /etc/rc.conf
# /usr/local/etc/rc.d/postgresql initdb
# su - pgsql
> /usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
> /usr/local/bin/createuser root
Shall the new user be allowed to create databases? (y/n) y
> logout
# /usr/local/bin/createdb root
# /usr/local/bin/psql root
root=# CREATE TABLE incoming_test (
root(# recorded_on timestamp with time zone NOT NULL,
root(# "Accounting-Record-Type" integer,
root(# "Session-Id" bytea,
root(# "Accounting-Record-Number" integer,
root(# "Route-Record1" bytea,
root(# "Route-Record2" bytea,
root(# "Route-Record3" bytea,
root(# "Route-Record4" bytea );
root=# \q
3) configure the sources
# make edit_cache
BUILD_APP_ACCT:BOOL=ON
TEST_APP_ACCT:BOOL=ON
TEST_APP_ACCT_CONNINFO:STRING="user=root dbname=root"
4) run the test
# tests/testappacct -d
or
# make test
----------------------------------
Segmentation fault on program exit
----------------------------------
In case you encounter a segmentation fault on program termination like this:
[...]
freeDiameterd framework is terminated.
Segmentation fault: 11 (core dumped)
with a backtrace like this:
#0 0x0000000801a414a0 in ?? ()
#1 0x0000000800f99274 in __cxa_finalize () from /lib/libc.so.7
#2 0x0000000800f460b7 in exit () from /lib/libc.so.7
You may try to add the following compilation directive in cmake:
-DSKIP_DLCLOSE:BOOL=ON
Note: this segmentation fault was experienced with:
- FreeBSD 8.1
- 64 bits architecture only.
- Profiling mode only.

View File

@ -1,85 +0,0 @@
See INSTALL file for general instructions on building freeDiameter.
------------------
QUICK INSTRUCTIONS
------------------
Starting from version 1.1.5, freeDiameter is available through Homebrew:
1) Install Homebrew
a) Install Command Line Tools for Xcode or Xcode:
- Command Line Tools (your OS X Version) for Xcode:
https://developer.apple.com/downloads (Free Apple Developer ID Registration Required)
- or Xcode:
https://itunes.apple.com/us/app/xcode/id497799835 (Free App Store Account Required)
b) Install Homebrew
$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
2) Install freeDiameter:
$ brew install freediameter
After installation is done "Caveats" section will provide information
how to start freeDiameterd through launchd at system startup.
To view this information again:
$ brew info freediameter
To learn more about freeDiameter configuration options, read:
http://www.freediameter.net/trac/wiki/Configuration
For more information on available extension and how to configure them, read:
http://www.freediameter.net/trac/wiki/Extensions
------------
FROM SOURCES
------------
1) Install Homebrew:
See QUICK INSTRUCTIONS Step #1 above.
2) Install dependencies:
$ brew install mercurial cmake gnutls libgcrypt postgres mysql libidn
Notes:
* GNU IDN (libidn) is optional, see below
* When libusrsctp package is available, you can use it as well.
However, it requires some rework on the source code as libusrsctp is not fully
compliant with the other SCTP stack.
3) Retrieve source code:
$ hg clone http://www.freediameter.net/hg/freeDiameter
4) Enter source folder:
$ cd freeDiameter
5) Create build folder:
$ mkdir freeDiameter-build
6) Enter build folder:
$ cd freeDiameter-build
7) Configure:
$ cmake .. -DDISABLE_SCTP:BOOL=ON
or for ncurses-based configuration:
$ ccmake .. -DDISABLE_SCTP:BOOL=ON
Notes:
* GNU IDN (Support for International Domain Names) can be disabled with:
-DDIAMID_IDNA_IGNORE=ON or -DDIAMID_IDNA_REJECT=ON
* For more information on available configuration options, read:
http://www.freediameter.net/trac/wiki/Installation
8) Compile:
$ make
9) Install (might require to be root):
$ make install
------------------------------------------------
These instructions have been tested on OS X:
- 10.6.8 (Snow Leopard)
- 10.7.5 (Lion)
- 10.8.2 (Mountain Lion)

View File

@ -1,29 +0,0 @@
### Very short install notes for OpenSUSE (tested on OpenSUSE 11.3)
# Please refer to other INSTALL files for more detailed instructions (e.g. extension-specific notes).
Dependencies on OpenSUSE 11.3 (from minimal server system installation):
# zypper install cmake make gcc gcc-c++ flex bison lksctp-tools-devel libgnutls-devel libgcrypt-devel libidn-devel
# zypper install mercurial
Following dependencies are optional, depending on which extensions you plan to compile
app_acct:
# zypper install postgresql-server postgresql-devel
app_sip:
app_diameap:
# zypper install libmysqlclient-devel
(would also need a server, not sure which package is appropriate)
dict_legacy_xml:
# zypper install libxml2 libxml2-devel
dbg_interactive:
# zypper install swig python-devel
sample:
# zypper install gcc-c++
There is currently no OpenSUSE-specific package for freeDiameter.
You are welcome to contribute packaging scripts! Please contact with
dev@freediameter.net for more details.

View File

@ -1,3 +0,0 @@
There is a package script available for the OpenWRT platform.
Please refer to contrib/OpenWRT/HOWTO for more information.

View File

@ -1,123 +0,0 @@
See http://www.freediameter.net/trac/wiki/DebRepository for instructions on how to
install freeDiameter from existing package.
See INSTALL file for general instructions on building freeDiameter from sources.
The remaining of this file contains specific instructions for building the freeDiameter
package files for Debian and Ubuntu systems.
freeDiameter is shipped with the necessary files to generate the Debian package.
All related files are in the directory "contrib/debian" of the distribution.
As a first step, you have to link this directory from your top-level dir:
ln -s contrib/debian
============================================
The following packages are required to compile freeDiameter from source:
cmake make gcc g++ flex bison libsctp1 libsctp-dev libgnutls-dev libgcrypt-dev libidn11-dev
(note that libidn and libsctp can be avoided by defining DISABLE_SCTP and DIAMID_IDNA_REJECT)
Additionnaly, these ones may be useful:
mercurial gdb
Extensions additional dependencies:
app_acct:
libpq-dev
app_sip:
app_diameap:
libmysqlclient-dev
dict_legacy_xml:
libxml2-dev
dbg_interactive:
swig python-dev
============================================
If your debhelper environment is recent (> 7.3.9 for cmake support),
the following commands should generate the freeDiameter packages for you:
# Install the dependencies for building the source:
sudo apt-get -y install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn11-dev ssl-cert debhelper fakeroot \
libpq-dev libmysqlclient-dev libxml2-dev swig python-dev
# Retrieve the latest version of the source package
cd
hg clone http://www.freediameter.net/hg/freeDiameter
cd freeDiameter
# Prepare for Debian package
ln -s contrib/debian
# Build the packages
fakeroot dh binary
# Install the packages
cd ..
sudo dpkg -i *.deb
# The following lines may help you getting started.... (execute as root)
ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/ssl/certs/freeDiameter.pem
ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/private/freeDiameter.key
zcat /usr/share/doc/freediameter-daemon/examples/freediameter.conf.sample.gz > /etc/freeDiameter/freeDiameter.conf
echo "Identity=\"localhost.localdomain\";" >> /etc/freeDiameter/freeDiameter.conf
freeDiameterd
===========================================
freeDiameter is tested regularly on all current Ubuntu distributions since Intrepid (compiled from source as described below)
Ubuntu Hardy support is known to be broken.
The Debian package has been generated with success on Debian (>=Squeeze) and Ubuntu (>=Karmic).
===========================================-
Step by step instructions without using the debhelper tools:
1) Install all packages dependencies
# sudo apt-get install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn11-dev
2) (OPTION) If you will compile modules that require postgresql, also install:
# sudo apt-get install libpq-dev
and for mysql:
# sudo apt-get install libmysqlclient-dev
3) (OPTION) If you want a more user-friendly interface, install this:
# sudo apt-get install cmake-curses-gui
4) Retrieve the source files
# hg clone http://www.freediameter.net/hg/freeDiameter
5) Create a build directory, and enter it
# mkdir fDbuild
# cd fDbuild
6) Configure and generate the Makefiles
# cmake ../freeDiameter
# make edit_cache
7) Compile all files:
# make
8) (OPTION) See available targets:
# make help
9) (OPTION) Check the software has a correct basic behavior on your environment. -- only if you did not disable the tests in step 6
# make test
10) (OPTION) Install the software in configured locations:
# sudo make install
===========================================
Note: On Ubuntu Quantal Quetzal, you may have to force use of python 2.7
library for the dbg_interactive extension, as on some systems CMake selects the 3.2 library
by default.

View File

@ -1,21 +0,0 @@
The simplest way to install on NetBSD, DragonFly, MirBSD or other
pkgsrc platforms is:
pkg_add freeDiameter
If no binary package exists:
cd /usr/pkgsrc/net/freeDiameter
make install
If you want to build and install freeDiameter from the repository,
you'll need to install:
pkg_add bison pkg-config libidn gnutls libgcrypt mercurial
and follow the usual installation note.
NetBSD does not support SCTP, so you have to add
-DDISABLE_SCTP:BOOL=ON
to the cmake command line.
For the optional extensions, you need mysql*-client, postgres*-client,
libxml2. For the debugging extensions, you also need swig and a
python -- install as usual.

View File

@ -1,51 +0,0 @@
Unless specified otherwise, this software package is copyrighted under the terms of the BSD license, as follow:
Software License Agreement (BSD License)
Copyright (c) 2008-2011, WIDE Project and NICT
All rights reserved.
Redistribution and use of this software in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the WIDE Project or NICT nor the
names of its contributors may be used to endorse or
promote products derived from this software without
specific prior written permission of WIDE Project and
NICT.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The following authors have contributed the following files. See source files for copyright information.
* Alexandre Westfahl:
extensions/dict_sip/*
extensions/app_sip/*
extensions/app_radgw/rgwx_sip.c
* Souheil Ben Ayed:
extensions/app_diameap/*
* Francois Bard:
extensions/dict_mip6a/*
extensions/dict_mip6i/*
extensions/dict_nas_mipv6/*
extensions/dict_rfc5777/*

View File

@ -1,5 +0,0 @@
The digested changelog can be found under:
contrib/debian/changelog
You can also find the exhaustive list of change using mercurial history,
or at the following URL: http://www.freediameter.net/hg/freeDiameter/shortlog

View File

@ -1,43 +0,0 @@
freeDiameter is an implementation of the Diameter protocol.
Diameter is a protocol designed to carry Authentication, Authorization and
Accounting (AAA) payload. It is an evolution of the RADIUS protocol (as the
name suggests).
Diameter is an extensible protocol. RFC3588 (currently under revision) defines the
Base Protocol that all Diameter nodes must support, while other documents define
the additional protocol support for specific applications. Such applications include
for example Network Access Servers (RFC4005), EAP (RFC4072), ...
The implementation consists in several components:
- libfdproto : this shared library provides the functions to manipulate Diameter
messages and dictionary. This library is meant to be re-used by other projects
that would require parsing or manipulating Diameter messages.
- libfdcore : this shared library contains the core of the framework. It establishes
the network connections with other Diameter peers and performs the tasks described
in Diameter Base Protocol, such as watchdogs, basic routing, ... It also handles
the loading of extensions (see below).
- freeDiameterd : this simple daemon parses the command line and initializes the
freeDiameter framework. Use it for your Diameter server & agent components.
In case of Diameter clients, you probably will prefer linking the libfdcore
directly with your client application that must be made Diameter-aware.
- extensions : the extensions provide the mean to augment the features of the
freeDiameterd framework. Extensions can provide the handling of a Diameter
server application, but also advanced routing features, peer management, etc.
See http://www.freediameter.net/ for more information on the project.
freeDiameter was previously known as the "waaad" project (WIDE AAA Daemon)
This project is not related to the "freediameter" project from Sun on sourceforge.
Author: Sebastien Decugis.
See LICENSE file for legal information on this software.
See INSTALL for information on building and using this software.

View File

@ -1,72 +0,0 @@
# - Look for GNU Bison, the parser generator
# Based off a news post from Andy Cedilnik at Kitware
# Defines the following:
# BISON_EXECUTABLE - path to the bison executable
# BISON_FILE - parse a file with bison
# BISON_PREFIX_OUTPUTS - Set to true to make BISON_FILE produce prefixed
# symbols in the generated output based on filename.
# So for ${filename}.y, you'll get ${filename}parse(), etc.
# instead of yyparse().
# BISON_GENERATE_DEFINES - Set to true to make BISON_FILE output the matching
# .h file for a .c file. You want this if you're using
# flex.
IF(NOT DEFINED BISON_PREFIX_OUTPUTS)
SET(BISON_PREFIX_OUTPUTS FALSE)
ENDIF(NOT DEFINED BISON_PREFIX_OUTPUTS)
IF(NOT DEFINED BISON_GENERATE_DEFINES)
SET(BISON_GENERATE_DEFINES FALSE)
ENDIF(NOT DEFINED BISON_GENERATE_DEFINES)
IF(NOT BISON_EXECUTABLE)
MESSAGE(STATUS "Looking for bison")
FIND_PROGRAM(BISON_EXECUTABLE bison)
IF(BISON_EXECUTABLE)
MESSAGE(STATUS "Looking for bison -- ${BISON_EXECUTABLE}")
ENDIF(BISON_EXECUTABLE)
MARK_AS_ADVANCED(BISON_EXECUTABLE)
ENDIF(NOT BISON_EXECUTABLE)
IF(BISON_EXECUTABLE)
MACRO(BISON_FILE FILENAME)
GET_FILENAME_COMPONENT(PATH "${FILENAME}" PATH)
IF("${PATH}" STREQUAL "")
SET(PATH_OPT "")
ELSE("${PATH}" STREQUAL "")
SET(PATH_OPT "/${PATH}")
ENDIF("${PATH}" STREQUAL "")
GET_FILENAME_COMPONENT(HEAD "${FILENAME}" NAME_WE)
IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}")
FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}")
ENDIF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}")
IF(BISON_PREFIX_OUTPUTS)
SET(PREFIX "${HEAD}")
ELSE(BISON_PREFIX_OUTPUTS)
SET(PREFIX "yy")
ENDIF(BISON_PREFIX_OUTPUTS)
SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}/${HEAD}.tab.c")
IF(BISON_GENERATE_DEFINES)
SET(HEADER "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}/${HEAD}.tab.h")
ADD_CUSTOM_COMMAND(
OUTPUT "${OUTFILE}" "${HEADER}"
COMMAND "${BISON_EXECUTABLE}"
ARGS "--name-prefix=${PREFIX}"
"--defines"
"--output-file=${OUTFILE}"
"${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}")
SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" "${HEADER}" PROPERTIES GENERATED TRUE)
SET_SOURCE_FILES_PROPERTIES("${HEADER}" PROPERTIES HEADER_FILE_ONLY TRUE)
ELSE(BISON_GENERATE_DEFINES)
ADD_CUSTOM_COMMAND(
OUTPUT "${OUTFILE}"
COMMAND "${BISON_EXECUTABLE}"
ARGS "--name-prefix=${PREFIX}"
"--output-file=${OUTFILE}"
"${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}")
SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" PROPERTIES GENERATED TRUE)
ENDIF(BISON_GENERATE_DEFINES)
ENDMACRO(BISON_FILE)
ENDIF(BISON_EXECUTABLE)

View File

@ -1,47 +0,0 @@
# - Look for GNU flex, the lexer generator.
# Defines the following:
# FLEX_EXECUTABLE - path to the flex executable
# FLEX_FILE - parse a file with flex
# FLEX_PREFIX_OUTPUTS - Set to true to make FLEX_FILE produce outputs of
# lex.${filename}.c, not lex.yy.c . Passes -P to flex.
IF(NOT DEFINED FLEX_PREFIX_OUTPUTS)
SET(FLEX_PREFIX_OUTPUTS FALSE)
ENDIF(NOT DEFINED FLEX_PREFIX_OUTPUTS)
IF(NOT FLEX_EXECUTABLE)
MESSAGE(STATUS "Looking for flex")
FIND_PROGRAM(FLEX_EXECUTABLE flex)
IF(FLEX_EXECUTABLE)
MESSAGE(STATUS "Looking for flex -- ${FLEX_EXECUTABLE}")
ENDIF(FLEX_EXECUTABLE)
MARK_AS_ADVANCED(FLEX_EXECUTABLE)
ENDIF(NOT FLEX_EXECUTABLE)
IF(FLEX_EXECUTABLE)
MACRO(FLEX_FILE FILENAME)
GET_FILENAME_COMPONENT(PATH "${FILENAME}" PATH)
IF("${PATH}" STREQUAL "")
SET(PATH_OPT "")
ELSE("${PATH}" STREQUAL "")
SET(PATH_OPT "/${PATH}")
ENDIF("${PATH}" STREQUAL "")
IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}")
FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}")
ENDIF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}")
IF(FLEX_PREFIX_OUTPUTS)
GET_FILENAME_COMPONENT(PREFIX "${FILENAME}" NAME_WE)
ELSE(FLEX_PREFIX_OUTPUTS)
SET(PREFIX "yy")
ENDIF(FLEX_PREFIX_OUTPUTS)
SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}/lex.${PREFIX}.c")
ADD_CUSTOM_COMMAND(
OUTPUT "${OUTFILE}"
COMMAND "${FLEX_EXECUTABLE}"
ARGS "-P${PREFIX}"
"-o${OUTFILE}"
"${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}")
SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" PROPERTIES GENERATED TRUE)
ENDMACRO(FLEX_FILE)
ENDIF(FLEX_EXECUTABLE)

View File

@ -1,36 +0,0 @@
# - Find gnutls
# Find the native GCRYPT includes and library
#
# GCRYPT_FOUND - True if gnutls found.
# GCRYPT_INCLUDE_DIR - where to find gnutls.h, etc.
# GCRYPT_LIBRARIES - List of libraries when using gnutls.
if (GCRYPT_INCLUDE_DIR AND GCRYPT_LIBRARIES)
set(GCRYPT_FIND_QUIETLY TRUE)
endif (GCRYPT_INCLUDE_DIR AND GCRYPT_LIBRARIES)
# Include dir
find_path(GCRYPT_INCLUDE_DIR
NAMES
gcrypt.h
)
# Library
find_library(GCRYPT_LIBRARY
NAMES gcrypt
)
# handle the QUIETLY and REQUIRED arguments and set GCRYPT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GCRYPT DEFAULT_MSG GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR)
IF(GCRYPT_FOUND)
SET( GCRYPT_LIBRARIES ${GCRYPT_LIBRARY} )
ELSE(GCRYPT_FOUND)
SET( GCRYPT_LIBRARIES )
ENDIF(GCRYPT_FOUND)
# Lastly make it so that the GCRYPT_LIBRARY and GCRYPT_INCLUDE_DIR variables
# only show up under the advanced options in the gui cmake applications.
MARK_AS_ADVANCED( GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR )

View File

@ -1,64 +0,0 @@
# - Find gnutls
# Find the native GNUTLS includes and library
#
# GNUTLS_FOUND - True if gnutls found.
# GNUTLS_INCLUDE_DIR - where to find gnutls.h, etc.
# GNUTLS_LIBRARIES - List of libraries when using gnutls.
# GNUTLS_VERSION_210 - true if GnuTLS version is >= 2.10.0 (does not require additional separate gcrypt initialization)
# GNUTLS_VERSION_212 - true if GnuTLS version is >= 2.12.0 (supports gnutls_transport_set_vec_push_function)
# GNUTLS_VERSION_300 - true if GnuTLS version is >= 3.00.0 (x509 verification functions changed)
# GNUTLS_VERSION_310 - true if GnuTLS version is >= 3.01.0 (stabilization branch with new APIs)
if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARIES)
set(GNUTLS_FIND_QUIETLY TRUE)
endif (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARIES)
# Include dir
find_path(GNUTLS_INCLUDE_DIR
NAMES
gnutls.h
gnutls/gnutls.h
)
# Library
find_library(GNUTLS_LIBRARY
NAMES gnutls
)
# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNUTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)
IF(GNUTLS_FOUND)
SET( GNUTLS_LIBRARIES ${GNUTLS_LIBRARY} )
ELSE(GNUTLS_FOUND)
SET( GNUTLS_LIBRARIES )
ENDIF(GNUTLS_FOUND)
# Lastly make it so that the GNUTLS_LIBRARY and GNUTLS_INCLUDE_DIR variables
# only show up under the advanced options in the gui cmake applications.
MARK_AS_ADVANCED( GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR )
# Now check if the library is recent. gnutls_hash was added in 2.10.0.
# Also test library is even more recent. gnutls_x509_trust_list_verify_crt was added in 3.00.0.
IF(GNUTLS_FOUND)
IF( NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" ))
INCLUDE (CheckLibraryExists)
MESSAGE(STATUS "Checking GNUTLS version")
UNSET(GNUTLS_VERSION_210)
UNSET(GNUTLS_VERSION_210 CACHE)
UNSET(GNUTLS_VERSION_212)
UNSET(GNUTLS_VERSION_212 CACHE)
UNSET(GNUTLS_VERSION_300)
UNSET(GNUTLS_VERSION_300 CACHE)
UNSET(GNUTLS_VERSION_310)
UNSET(GNUTLS_VERSION_310 CACHE)
GET_FILENAME_COMPONENT(GNUTLS_PATH ${GNUTLS_LIBRARY} PATH)
CHECK_LIBRARY_EXISTS(gnutls gnutls_hash ${GNUTLS_PATH} GNUTLS_VERSION_210)
CHECK_LIBRARY_EXISTS(gnutls gnutls_transport_set_vec_push_function ${GNUTLS_PATH} GNUTLS_VERSION_212)
CHECK_LIBRARY_EXISTS(gnutls gnutls_x509_trust_list_verify_crt ${GNUTLS_PATH} GNUTLS_VERSION_300)
CHECK_LIBRARY_EXISTS(gnutls gnutls_handshake_set_timeout ${GNUTLS_PATH} GNUTLS_VERSION_310)
SET( GNUTLS_VERSION_TEST_FOR ${GNUTLS_LIBRARY} CACHE INTERNAL "Version the test was made against" )
ENDIF (NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" ))
ENDIF(GNUTLS_FOUND)

View File

@ -1,40 +0,0 @@
# - Try to find GNU IDN library and headers
# Once done, this will define
#
# IDNA_FOUND - system has IDNA
# IDNA_INCLUDE_DIR - the IDNA include directories (<idna.h>)
# IDNA_LIBRARIES - link these to use IDNA (idna_to_ascii_8z)
if (IDNA_INCLUDE_DIR AND IDNA_LIBRARIES)
set(IDNA_FIND_QUIETLY TRUE)
endif (IDNA_INCLUDE_DIR AND IDNA_LIBRARIES)
# Include dir
find_path(IDNA_INCLUDE_DIR
NAMES idna.h
)
# Library
find_library(IDNA_LIBRARY
NAMES idn
)
# handle the QUIETLY and REQUIRED arguments and set IDNA_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(IDNA DEFAULT_MSG IDNA_LIBRARY IDNA_INCLUDE_DIR)
# If we successfully found the idn library then add the library to the
# IDNA_LIBRARIES cmake variable otherwise set IDNA_LIBRARIES to nothing.
IF(IDNA_FOUND)
SET( IDNA_LIBRARIES ${IDNA_LIBRARY} )
ELSE(IDNA_FOUND)
SET( IDNA_LIBRARIES )
ENDIF(IDNA_FOUND)
# Lastly make it so that the IDNA_LIBRARY and IDNA_INCLUDE_DIR variables
# only show up under the advanced options in the gui cmake applications.
MARK_AS_ADVANCED( IDNA_LIBRARY IDNA_INCLUDE_DIR )

View File

@ -1,53 +0,0 @@
# - Try to find the LibXml2 xml processing library
# Once done this will define
#
# LIBXML2_FOUND - System has LibXml2
# LIBXML2_INCLUDE_DIR - The LibXml2 include directory
# LIBXML2_LIBRARIES - The libraries needed to use LibXml2
# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_LIBXML libxml-2.0)
SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
HINTS
${PC_LIBXML_INCLUDEDIR}
${PC_LIBXML_INCLUDE_DIRS}
PATH_SUFFIXES libxml2
)
FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
HINTS
${PC_LIBXML_LIBDIR}
${PC_LIBXML_LIBRARY_DIRS}
)
FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
# for backwards compat. with KDE 4.0.x:
SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)

View File

@ -1,56 +0,0 @@
# - Find mysqlclient
#
# -*- cmake -*-
#
# Find the native MySQL includes and library
#
# MySQL_INCLUDE_DIR - where to find mysql.h, etc.
# MySQL_LIBRARIES - List of libraries when using MySQL.
# MySQL_FOUND - True if MySQL found.
IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
# Already in cache, be silent
SET(MySQL_FIND_QUIETLY TRUE)
ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
# Include dir
FIND_PATH(MySQL_INCLUDE_DIR
NAMES mysql.h
PATH_SUFFIXES mysql
)
# Library
#SET(MySQL_NAMES mysqlclient mysqlclient_r)
#SET(MySQL_NAMES mysqlclient_r)
SET(MySQL_NAMES mysqlclient_r mysqlclient)
FIND_LIBRARY(MySQL_LIBRARY
NAMES ${MySQL_NAMES}
PATHS /usr/lib /usr/local/lib
PATH_SUFFIXES mysql
)
IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
SET(MySQL_FOUND TRUE)
SET( MySQL_LIBRARIES ${MySQL_LIBRARY} )
ELSE (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
SET(MySQL_FOUND FALSE)
SET( MySQL_LIBRARIES )
ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
IF (MySQL_FOUND)
IF (NOT MySQL_FIND_QUIETLY)
MESSAGE(STATUS "Found MySQL: ${MySQL_LIBRARY}")
ENDIF (NOT MySQL_FIND_QUIETLY)
ELSE (MySQL_FOUND)
IF (MySQL_FIND_REQUIRED)
MESSAGE(STATUS "Looked for MySQL libraries named ${MySQL_NAMES}.")
MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
ENDIF (MySQL_FIND_REQUIRED)
ENDIF (MySQL_FOUND)
MARK_AS_ADVANCED(
MySQL_LIBRARY
MySQL_INCLUDE_DIR
)

View File

@ -1,36 +0,0 @@
# - Find PostgreSQL library
#
# This module defines:
# POSTGRESQL_FOUND - True if the package is found
# POSTGRESQL_INCLUDE_DIR - containing libpq-fe.h
# POSTGRESQL_LIBRARIES - Libraries to link to use PQ functions.
if (POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES)
set(POSTGRESQL_FIND_QUIETLY TRUE)
endif (POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES)
# Include dir
find_path(POSTGRESQL_INCLUDE_DIR
NAMES libpq-fe.h
PATH_SUFFIXES pgsql postgresql
)
# Library
find_library(POSTGRESQL_LIBRARY
NAMES pq
)
# handle the QUIETLY and REQUIRED arguments and set POSTGRESQL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(POSTGRESQL DEFAULT_MSG POSTGRESQL_LIBRARY POSTGRESQL_INCLUDE_DIR)
IF(POSTGRESQL_FOUND)
SET( POSTGRESQL_LIBRARIES ${POSTGRESQL_LIBRARY} )
ELSE(POSTGRESQL_FOUND)
SET( POSTGRESQL_LIBRARIES )
ENDIF(POSTGRESQL_FOUND)
# Lastly make it so that the POSTGRESQL_LIBRARY and POSTGRESQL_INCLUDE_DIR variables
# only show up under the advanced options in the gui cmake applications.
MARK_AS_ADVANCED( POSTGRESQL_LIBRARY POSTGRESQL_INCLUDE_DIR )

View File

@ -1,46 +0,0 @@
# - Try to find SCTP library and headers
# Once done, this will define
#
# SCTP_FOUND - system has SCTP
# SCTP_INCLUDE_DIR - the SCTP include directories
# SCTP_LIBRARIES - link these to use SCTP
if (SCTP_INCLUDE_DIR AND SCTP_LIBRARIES)
set(SCTP_FIND_QUIETLY TRUE)
endif (SCTP_INCLUDE_DIR AND SCTP_LIBRARIES)
# Include dir
find_path(SCTP_INCLUDE_DIR
NAMES netinet/sctp.h
)
# Library
find_library(SCTP_LIBRARY
NAMES sctp
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
#set(SCTP_PROCESS_INCLUDES SCTP_INCLUDE_DIR)
#set(SCTP_PROCESS_LIBS SCTP_LIBRARY)
#libfind_process(SCTP)
# handle the QUIETLY and REQUIRED arguments and set SCTP_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCTP DEFAULT_MSG SCTP_LIBRARY SCTP_INCLUDE_DIR)
# If we successfully found the sctp library then add the library to the
# SCTP_LIBRARIES cmake variable otherwise set SCTP_LIBRARIES to nothing.
IF(SCTP_FOUND)
SET( SCTP_LIBRARIES ${SCTP_LIBRARY} )
ELSE(SCTP_FOUND)
SET( SCTP_LIBRARIES )
ENDIF(SCTP_FOUND)
# Lastly make it so that the SCTP_LIBRARY and SCTP_INCLUDE_DIR variables
# only show up under the advanced options in the gui cmake applications.
MARK_AS_ADVANCED( SCTP_LIBRARY SCTP_INCLUDE_DIR )

View File

@ -1,23 +0,0 @@
# This file is called at build time. It regenerates the version.h file based on the hg version.
EXECUTE_PROCESS(
COMMAND ${HGCOMMAND} id -i
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE reshash
OUTPUT_VARIABLE verhash
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(
COMMAND ${HGCOMMAND} id -n
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE resval
OUTPUT_VARIABLE verval
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (reshash EQUAL 0)
SET(FD_PROJECT_VERSION_HG "${verval}(${verhash})")
message(STATUS "Source version: ${FD_PROJECT_VERSION_HG}")
endif (reshash EQUAL 0)
CONFIGURE_FILE(${SRC} ${DST})

View File

@ -1,17 +0,0 @@
Date: Thu, 13 Oct 2011 14:01:40 -0300
From: "Norberto R. de Goes Jr." <norberto@cpqd.com.br>
To: help@freediameter.net
Subject: [Help] Cx dictionary (samples "c" and "xml")
Hi.
Just a contribution, they were not tested.
Best regards,
--
Norberto R. de Goes Jr.
CPqD - DRC
Tel.: +55 19 3705-4241 / Fax: +55 19 3705-6125
norberto@cpqd.com.br
www.cpqd.com.br

File diff suppressed because it is too large Load Diff

View File

@ -1,407 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "dictionary.dtd">
<!--**************************************************************************************
=== CpqD/DRC - Projeto ADRIMS - Mar/2011 ===
=== Dicionario Dx/Cx ===
Baseado no "dict_sip" do FreeDiameter (www.freediameter.net)
Norberto R Goes Jr
**************************************************************************************-->
<dictionary>
<!-- ******************************************************** -->
<!-- ********************* Vendors ************************** -->
<!-- ******************************************************** -->
<vendor id="13019" name="ETSI" />
<vendor id="10415" name="3GPP" />
<!-- ******************************************************** -->
<!-- ***************** CxDx Application *********************-->
<!-- ******************************************************** -->
<application id="16777216" name="Diameter CxDx Application"
uri="http://www.cpqd.com.br">
<!-- ******************************************************** -->
<!-- ******************** Commands ************************** -->
<!-- ******************************************************** -->
<command name="User-Authorization" code="300" >
<requestrules>
<fixed>
<avprule name="Session-Id" minimum="1" maximum="1"/>
</fixed>
<required>
<avprule name="Vendor-Specific-Application-Id" maximum="1" />
<avprule name="Auth-Session-State" maximum="1" />
<avprule name="Origin-Host" maximum="1" />
<avprule name="Origin-Realm" maximum="1" />
<avprule name="Destination-Realm" maximum="1" />
<avprule name="User-Name" maximum="1" />
<avprule name="Public-Identity" maximum="1" />
<avprule name="Visited-Network-Identifier" maximum="1" />
</required>
<optional>
<avprule name="Destination-Host" maximum="1"/>
<avprule name="Supported-Features" />
<avprule name="User-Authorization-Type" maximum="1"/>
<avprule name="UAR-Flags" maximum="1" />
<avprule name="AVP" />
<avprule name="Proxy-Info" />
<avprule name="Route-Record" />
</optional>
</requestrules>
<answerrules>
<fixed>
<avprule name="Session-Id" minimum="1" maximum="1"/>
</fixed>
<required>
<avprule name="Vendor-Specific-Application-Id" maximum="1" />
<avprule name="Auth-Session-State" maximum="1" />
<avprule name="Origin-Host" maximum="1" />
<avprule name="Origin-Realm" maximum="1"/>
</required>
<optional>
<avprule name="Result-Code" maximum="1"/>
<avprule name="Experimental-Result" maximum="1"/>
<avprule name="Supported-Features" />
<avprule name="Server-Name" maximum="1"/>
<avprule name="Server-Capabilities" maximum="1"/>
<avprule name="Wildcarded-IMPU" maximum="1"/>
<avprule name="AVP" />
<avprule name="Failed-AVP" />
<avprule name="Proxy-Info" />
<avprule name="Route-Record" />
</optional>
</answerrules>
</command>
<command name="Server-Assignment" code="301" >
<requestrules>
<fixed>
<avprule name="Session-Id" minimum="1" maximum="1"/>
</fixed>
<required>
<avprule name="Vendor-Specific-Application-Id" maximum="1" />
<avprule name="Auth-Session-State" maximum="1" />
<avprule name="Origin-Host" maximum="1" />
<avprule name="Origin-Realm" maximum="1" />
<avprule name="Destination-Realm" maximum="1" />
<avprule name="Server-Name" maximum="1"/>
<avprule name="Server-Assignment-Type" maximum="1" />
<avprule name="User-Data-Already-Available" maximum="1" />
</required>
<optional>
<avprule name="Destination-Host" maximum="1"/>
<avprule name="User-Name" maximum="1" />
<avprule name="Supported-Features" />
<avprule name="Public-Identity" />
<avprule name="Wildcarded-PSI" maximum="1"/>
<avprule name="Wildcarded-IMPU" maximum="1"/>
<!-- avprule name="SCSCF-Restoration-Info" maximum="1"/> -->
<!-- avprule name="Multiple-Registration-Indication" maximum="1"/> -->
<!--avprule name="Session-Priority" maximum="1"/> -->
<avprule name="AVP" />
<avprule name="Proxy-Info" />
<avprule name="Route-Record" />
</optional>
</requestrules>
<answerrules>
<fixed>
<avprule name="Session-Id" minimum="1" maximum="1"/>
</fixed>
<required>
<avprule name="Vendor-Specific-Application-Id" maximum="1" />
<avprule name="Auth-Session-State" maximum="1" />
<avprule name="Origin-Host" maximum="1" />
<avprule name="Origin-Realm" maximum="1"/>
</required>
<optional>
<avprule name="Result-Code" maximum="1"/>
<avprule name="Experimental-Result" maximum="1"/>
<avprule name="User-Name" maximum="1" />
<avprule name="Supported-Features" />
<!--avprule name="User-Data" maximum="1"/> -->
<!--avprule name="Charging-Information" maximum="1"/> -->
<!--avprule name="Associated-Identities" maximum="1"/> -->
<!--avprule name="Loose-Route-Indication" maximum="1"/> -->
<!--avprule name="SCSCF-Restoration-Info" /> -->
<!--avprule name="Associated-Registered-Identities " maximum="1"/> -->
<avprule name="AVP" />
<avprule name="Server-Name" maximum="1"/>
<avprule name="Failed-AVP" />
<avprule name="Proxy-Info" />
<avprule name="Route-Record" />
</optional>
</answerrules>
</command>
<!-- ******************************************************** -->
<!-- *********************** AVPs *************************** -->
<!-- ******************************************************** -->
<avp name="Visited-Network-Identifier" code="600" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="OctetString" />
</avp>
<avp name="Public-Identity" code="601" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="UTF8String" />
</avp>
<avp name="Server-Name" code="602" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="UTF8String" />
</avp>
<!-- "Server-Capabilites" (603) usa as duas AVPs a seguir : -->
<avp name="Feature-List-ID" code="629" vendor-id="10415" mandatory="must"
may-encrypt="no"> <!-- verificar flags / NRGJ -->
<type type-name="Unsigned32" />
</avp>
<avp name="Feature-List" code="630" vendor-id="10415" mandatory="must"
may-encrypt="no"> <!-- verificar flags / NRGJ -->
<type type-name="Unsigned32" />
</avp>
<avp name="Server-Capabilities" code="603" vendor-id="10415" mandatory="must"
may-encrypt="no">
<grouped>
<optional>
<avprule name="Vendor-Id" maximum="1" />
<avprule name="Feature-List-ID" maximum="1" />
<avprule name="Feature-List" maximum="1" />
</optional>
</grouped>
</avp>
<avp name="Mandatory-Capability" code="604" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="Unsigned32" />
</avp>
<avp name="Optional-Capability" code="605" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="Unsigned32" />
</avp>
<avp name="User-Data" code="606" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="OctetString" />
</avp>
<avp name="SIP-Number-Auth-Items" code="607" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="Unsigned32" />
</avp>
<avp name="SIP-Authentication-Scheme" code="608" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="UTF8String" />
</avp>
<avp name="SIP-Authenticate" code="609" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="OctetString" />
</avp>
<avp name="SIP-Authorization" code="610" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="OctetString" />
</avp>
<avp name="SIP-Authentication-Context" code="611" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="OctetString" />
</avp>
<!-- "SIP-Auth-Data-Item" (612) usa as AVPs a seguir : -->
<avp name="SIP-Item-Number" code="613" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="Unsigned32" />
</avp>
<avp name="Confidentiality-Key" code="625" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="OctetString" />
</avp>
<avp name="Integrity-Key" code="626" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="OctetString" />
</avp>
<avp name="Digest-Realm" code="104" vendor-id="10415" mandatory="must"
may-encrypt="no"> <!-- verificar flags / NRGJ -->
<type type-name="UTF8String" />
</avp>
<avp name="Digest-Algorithm" code="111" vendor-id="10415" mandatory="must"
may-encrypt="no"> <!-- verificar flags / NRGJ -->
<type type-name="UTF8String" />
</avp>
<avp name="Digest-QoP" code="110" vendor-id="10415" mandatory="must"
may-encrypt="no"> <!-- verificar flags / NRGJ -->
<type type-name="UTF8String" />
</avp>
<avp name="Digest-HA1" code="121" vendor-id="10415" mandatory="must"
may-encrypt="no"> <!-- verificar flags / NRGJ -->
<type type-name="UTF8String" />
</avp>
<avp name="SIP-Digest-Authenticate" code="635" vendor-id="10415"
may-encrypt="no"> <!-- verificar flags / NRGJ -->
<grouped>
<required>
<avprule name="Digest-Realm" minimum="1" maximum="1" />
</required>
<optional>
<avprule name="Digest-Algorithm" maximum="1" />
<avprule name="Digest-QoP" maximum="1" />
<avprule name="Digest-HA1" maximum="1" />
<avprule name="AVP" />
</optional>
</grouped>
</avp>
<avp name="Line-Identifier" code="500" vendor-id="13019" mandatory="must"
may-encrypt="no"> <!-- verificar flags / NRGJ -->
<type type-name="OctetString" />
</avp>
<avp name="SIP-Auth-Data-Item" code="612" vendor-id="10415" mandatory="must"
may-encrypt="no">
<grouped>
<optional>
<avprule name="SIP-Item-Number" maximum="1" />
<avprule name="SIP-Authentication-Scheme" maximum="1" />
<avprule name="SIP-Authenticate" maximum="1" />
<avprule name="SIP-Authorization" maximum="1" />
<avprule name="SIP-Authentication-Context" maximum="1" />
<avprule name="Confidentiality-Key" maximum="1" />
<avprule name="Integrity-Key" maximum="1" />
<avprule name="SIP-Digest-Authenticate" maximum="1" />
<avprule name="Framed-IP-Address" maximum="1" />
<avprule name="Framed-IPv6-Prefix" maximum="1" />
<avprule name="Framed-Interface-Id" maximum="1" />
<avprule name="Line-Identifier" />
<avprule name="AVP" />
</optional>
</grouped>
</avp>
<avp name="Server-Assignment-Type" code="614" mandatory="must"
may-encrypt="no">
<type type-name="Enumerated"/>
<enum name="NO_ASSIGNMENT" code="0"/>
<enum name="REGISTRATION" code="1"/>
<enum name="RE_REGISTRATION" code="2"/>
<enum name="UNREGISTERED_USER" code="3"/>
<enum name="TIMEOUT_DEREGISTRATION" code="4"/>
<enum name="USER_DEREGISTRATION" code="5"/>
<enum name="TIMEOUT_DEREGISTRATION_STORE_SERVER_NAME" code="6"/>
<enum name="USER_DEREGISTRATION_STORE_SERVER_NAME" code="7"/>
<enum name="ADMINISTRATIVE_DEREGISTRATION " code="8"/>
<enum name="AUTHENTICATION_FAILURE" code="9"/>
<enum name="AUTHENTICATION_TIMEOUT" code="10"/>
<enum name="DEREGISTRATION_TOO_MUCH_DATA" code="11"/>
<enum name="AAA_USER_DATA_REQUEST" code="12"/>
<enum name="PGW_UPDATE " code="13"/>
</avp>
<avp name="User-Data-Already-Available" code="624" mandatory="must"
may-encrypt="no">
<type type-name="Enumerated"/>
<enum name="USER_DATA_NOT_AVAILABLE" code="0"/>
<enum name="USER_DATA_ALREADY_AVAILABLE" code="1"/>
</avp>
<avp name="Wildcarded-PSI" code="634" vendor-id="10415"
may-encrypt="no">
<type type-name="UTF8String" />
</avp>
<avp name="User-Authorization-Type" code="623" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="UTF8String" />
</avp>
<avp name="Wildcarded-IMPU" code="636" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="UTF8String" />
</avp>
<avp name="UAR-Flags" code="637" vendor-id="10415" mandatory="must"
may-encrypt="no">
<type type-name="Unsigned32" />
</avp>
<avp name="Supported-Features" code="628" vendor-id="10415"
may-encrypt="no">
<grouped>
<optional>
<avprule name="Vendor-Id" maximum="1" />
<avprule name="Feature-List-ID" maximum="1" />
<avprule name="Feature-List" maximum="1" />
</optional>
</grouped>
</avp>
</application>
</dictionary>

View File

@ -1,305 +0,0 @@
#####################
# !! IMPORTANT !! #
#####################
The uClibc library that is shipped with OpenWRT lacks support for several POSIX thread
features, such as pthread_cleanup_{push,pop}, that are required by the freeDiameter
framework.
Until these features are included in the base OpenWRT system, the framework will not
behave correctly on this platform.
Therefore, the OpenWRT port is NOT usable properly at this moment with uClibc.
A test software is included in test_required for checking if new uClibc distributions
support the required features. You'll have to adapt the Makefile according to your environment.
An alternative choice if your hardware allows it is to use (e)glibc in your openwrt image.
#####################
This HOWTO describes how to generate a set of ipkg modules for
providing support of freeDiameter in an OpenWRT system.
This HOWTO is written for OpenWRT 10.03 (BackFire) and no guarantee is provided
that it will work for you. Be prepared to eventually brick your routeur...
Table of contents:
0) Quick HOWTO: optimistic step-by-step instructions.
1) Prerequisites: get the OpenWRT development environment ready.
2) Supplied packages: use the existing packages when possible (gnutls, ...)
3) Other dependencies: provide for additional missing dependencies (sctp ...)
4) freediameter package: now create the freeDiameter package
5) Configuration: how to set the configuration on the router.
This HOWTO will NOT cover how to install OpenWRT on your access device, nor
its basic configuration. Please refer to OpenWRT website for this type of HOWTOs.
==============================================
0) Quick HOWTO
==============================================
The following instructions should allow you to put freeDiameter on your OpenWRT-compatible router.
In case something goes wrong, you should follow the detailed instructions in the remaining of
this file.
Be warned: playing with the software in your router may brick it, i.e. make it unusable forever.
Do it at your own risk.
1) Get the OpenWRT environment:
$ git clone git://nbd.name/openwrt.git
$ cd openwrt
2) Get the feeds
$ cp feeds.conf.default feeds.conf
$ echo "src-hg freediameter http://www.freediameter.net/hg/fD-OWRT-packages" >> feeds.conf
$ scripts/feeds update
$ scripts/feeds install freeDiameter
3) Configure your image
$ make menuconfig
(set Target System and Target Profile as needed for your equipment)
- Network --->
freeDiameter (M)
freeDiameter-test (M)
wpad (*)
wpad-mini ( )
4) Set the C library to glibc instead of uClibc (broken support, see #26)
- Advanced configuration options (for developers) --->
- Toolchain Options ---->
C Library implementation (Use eglibc)
5) Build the image and packages, this takes a while
$ make world
6) Export the bin/* directory through a webserver.
We assume it is available at http://192.168.1.25/owrt
7) Flash the router with your new image -- THIS DESTROYS ALL CONFIG ON THE ROUTER!
$ ssh root@192.168.1.1
# cd /tmp
# wget http://192.168.1.25/owrt/openwrt-brcm47xx-squashfs.trx
;; change the file name with yours
# mtd -r write openwrt-brcm47xx-squashfs.trx linux
;; wait for reboot
$ telnet 192.168.1.1
# passwd
# sync
# exit
8) Update the opkg router's config to get your new packages
ssh root@192.168.1.1
# echo "src/gz localrepo http://192.168.1.25/owrt/packages" >> /etc/opkg.conf
# opkg update
9) Install freeDiameter, you're done. Optionnaly, install also certtool on the router before, to
generate the TLS certificate automatically.
# opkg install freeDiameter
==============================================
1) Prerequisites:
==============================================
We will first need a working OpenWRT toolchain environment. You can retrieve
pre-compiled binaries of such toolchains ("Image builder") on the OpenWRT website. Anyway,
in case the architecture you are interested in is not listed, you can build
the full toolchain from source. This is the path we are following in this HOWTO.
a) Retrieve the latest OpenWRT source, using subversion or git.
Since I have to go through a proxy, I use the later here, svn being quite annoying with proxies.
Note, the following commands must not be run as root.
$ git clone git://nbd.name/openwrt.git
(Note: you might instead use "backfire.git" if you want to stick with an OpenWRT release.)
$ cd openwrt
$ cp feeds.conf.default feeds.conf
b) If you are using git, you have to edit the feeds.conf file to use git as well for packages.
Do the following modifications in this case:
$ vi feeds.conf
Comment out this line:
src-svn packages https://svn.openwrt.org/openwrt/packages
Add this line instead:
src-git packages git://nbd.name/packages.git
You can leave uncommented the luci (for GNUTLS) and Xwrt (webif) repositories. Since these repositories
use svn over http, you can use subversion even if you are behind a proxy.
c) Then issue the following command to update the package list:
$ scripts/feeds update
d) Now, let's already create the toolchain and basic image.
$ make menuconfig
This will open a menu for you. You must select the target you are building for.
See http://wiki.openwrt.org/toh/start for the table of hardware and associated information.
In my case, I am using a Buffalo WZR-HP-G300NH router. I therefore select these options:
- Target System --->
Atheros AR71xx/AR7240/AR913x
- Target Profile --->
Buffalo WZR-HP-G300NH
For many routeurs, the recommended kernel is a 2.4x version. I have NOT tried with such kernel,
and the SCTP support is likely to be different in this generation of kernels. I strongly recommend
to go with a 2.6x kernel, whenever possible.
e) As per freeDiameter ticket #26, you also need to change the library to glibc instead of uClibc.
Change the option as follow:
- Advanced configuration options (for developers) --->
- Toolchain Options ---->
C Library implementation (Use eglibc)
f) Once configured, create the toolchain and default image (this takes a while):
$ make world
After this command completes successfully, your build environment is ready.
The resulting image and packages are stored in the "bin/" subdirectory.
It is very convenient if you make this repository available in http to your routeur.
You should probably try at this early stage to flash your device with the image you have generated.
If the default basic image does not work, it is probably not worth adding new problems on top of it.
For troubleshooting, please consult OpenWRT documentation directly.
"make prereq" may help you building the initial image also.
See http://downloads.openwrt.org/docs/buildroot-documentation.html for additional information
concerning this step.
You should now be able to login on your routeur with telnet (first time) or ssh (after setting a password).
==============================================
2) Supplied packages:
==============================================
There are some dependencies of freeDiameter already available in the OpenWRT packages repository.
You can check for the available packages with the script:
$ ./scripts/feeds search <package>
We will now describe how to install these dependencies. At the time this HOWTO is written,
the OpenWRT repositories contains packages for sctp, ipv6, gnutls, pthreads and hostapd.
Follow these instructions to build them.
Alternatively, you can find these packages pre-compiled in the OpenWRT packages repository.
a) Add the packages
$ scripts/feeds install libgnutls
$ scripts/feeds install sctp
b) Select the following components in the menu:
$ make menuconfig
- Base system --->
libpthread (M)
- Network --->
sctp (M)
hostapd (M)
wpad-mini ( )
- Libraries --->
SSL --->
libgnutls (M)
- Kernel modules --->
Network Support --->
kmod-ipv6 (M)
Quit and save the new config, then:
$ make world
This will add a bunch of modules in your bin directory that will be required for freeDiameter.
Since we are removing the wpad-mini daemon from the base image, this image (trx or bin file) is also recompiled.
Note that if you are setting your device as WPA supplicant also (wireless client), you must select wpad instead of hostapd.
(in any case, the -mini version is not suitable since we will use the RADIUS authentication).
You should now reflash your routeur with the new firmware image. The simplest way to achieve if your routeur has enough
flash memory is to:
- copy the new trx image to your routeur's /tmp (using wget or scp)
- run this command (on the device) -- replace <newfile.trx> with your actual filename:
root@OpenWrt:~# mtd -r write <newfile.trx> linux
WARNING: this will erase your existing configuration on the routeur.
In case you need to save it, you may try the sysupgrade command instead.
This will reboot the device after writing the new image file.
Afterwards, if you have set up the http server on your development machine properly
(let's assume it has IP address 192.168.1.25)
you can run the following command on your router:
root@OpenWrt:~# echo "src/gz mydev http://192.168.1.25/packages" >> /etc/opkg.conf
root@OpenWrt:~# opkg update
Install the newly compiled packages with:
root@OpenWrt:~# opkg install kmod-ipv6 hostapd libpthread sctp
==============================================
3) Missing packages:
==============================================
UPDATE: Starting from revision r22917, sctp and kmod-sctp are included in the OpenWRT distribution, and have been removed
from freeDiameter package. One may consider using a freeDiameter package prior to 2010/09/05 in order to get the sctp
package, or a more recent OpenWRT environment.
PREVIOUS SITUATION: If you are using components prior to 2010/09/05, the following applies:
P:
P: There are other dependencies for freeDiameter that are not provided by OpenWRT packages.
P: For convenience, we include these meta-packages in the freeDiameter distribution -- but they
P: might not be up-to-date.
P:
P: a) Adding the contributed directory to the feeds
P: Add the following line in your feeds.conf file:
P: src-link freediameter /path/to/freediameter/contrib/OpenWRT/packages/
P:
P: Then run:
P: $ scripts/feeds update
P:
P: This should allow you to install the missing dependencies as follow:
P:
P:
P: b) SCTP library (note: you might alternatively compile freeDiameter without SCTP support).
P: $ scripts/feeds install sctp
P:
P:
P: c) Select these components in the menu:
P: $ make menuconfig
P: - Libraries --->
P: sctp (M)
P:
P: Quit and save the new config, then:
P: $ make world
P:
P:
P: d) Install this on the router as well:
P: root@OpenWrt:~# opkg update
P: root@OpenWrt:~# opkg install sctp
==============================================
4) freediameter package:
==============================================
Now, your environment should be ready to compile the freeDiameter ipkg package.
$ scripts/feeds install freeDiameter
Note that in order to build this package, you need to have cmake & flex on your compilation machine.
$ make menuconfig
- Network --->
freeDiameter (M)
freeDiameter-test (M)
Quit and save the new config, then:
$ make world
On your router, run:
# opkg update
# opkg install freeDiameter

View File

@ -1,35 +0,0 @@
diff --git a/target/linux/brcm47xx/base-files/etc/init.d/netconfig b/target/linux/brcm47xx/base-files/etc/init.d/netconfig
index d7839b6..6446483 100755
--- a/target/linux/brcm47xx/base-files/etc/init.d/netconfig
+++ b/target/linux/brcm47xx/base-files/etc/init.d/netconfig
@@ -150,6 +150,30 @@ start() {
}
}
}
+ if (model == "D-Link DIR-330") { # boardtype is 0x0472, so we need to reset the parameters
+ # The switch is on eth1, this script defaults to switch on eth0, so we write the values directly instead.
+ print "#### DIR-330: eth1 must be up for configuring the switch "
+ print "config interface switchport"
+ print " option ifname \"eth1\""
+ print " option proto none"
+ print ""
+ print "config switch eth1"
+ print " option enable 1"
+ print ""
+ print "config switch_vlan eth1_0"
+ print " option device \"eth1\""
+ print " option vlan 0"
+ print " option ports \"0 1 2 3 5t\""
+ print ""
+ print "config switch_vlan eth1_1"
+ print " option device \"eth1\""
+ print " option vlan 1"
+ print " option ports \"4 5t\""
+ print ""
+ c["lan_ifname"] = "eth0.0"
+ c["wan_ifname"] = "eth0.1"
+ }
+
# Buffalo WBR-B11 and Buffalo WBR-G54
if (nvram["boardtype"] == "bcm94710ap") {
c["vlan0ports"] = "0 1 2 3 4 5u"

View File

@ -1,19 +0,0 @@
diff -Nur freeDiameter/CMakeLists.txt freeDiameter-OpenWRT/CMakeLists.txt
--- freeDiameter/CMakeLists.txt 2010-08-13 16:19:35.000000000 +0900
+++ freeDiameter-OpenWRT/CMakeLists.txt 2010-08-13 16:21:32.000000000 +0900
@@ -51,6 +51,14 @@
SET(DEBUG 1)
ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug|Profiling|DebugValgrind")
+# OpenWRT
+SET(IN_OPENWRT $ENV{IN_OPENWRT})
+IF (IN_OPENWRT)
+ ADD_DEFINITIONS("$ENV{TARGET_LDFLAGS}" "$ENV{TARGET_CPPFLAGS}" "$ENV{TARGET_CFLAGS}")
+ INCLUDE_DIRECTORIES("$ENV{TARGET_LDFLAGS}" "$ENV{TARGET_CPPFLAGS}" "$ENV{TARGET_CFLAGS}")
+ENDIF(IN_OPENWRT)
+
+
# some subfolders use yacc and lex parsers
SET(BISON_GENERATE_DEFINES TRUE)
SET(BISON_PREFIX_OUTPUTS TRUE)
Binary files freeDiameter/.hg/dirstate and freeDiameter-OpenWRT/.hg/dirstate differ

View File

@ -1,90 +0,0 @@
#include <pthread.h>
#include <stdio.h>
#include <strings.h>
#include <assert.h>
static pthread_barrier_t bar;
static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cnd = PTHREAD_COND_INITIALIZER;
static int called = 0;
#ifndef ASSERT
#define ASSERT(x) assert(x)
#endif /* ASSERT */
static void cleanupmutex(void * arg)
{
printf("cancelation cleanup handler called\n");
if (arg) {
ASSERT( pthread_mutex_unlock((pthread_mutex_t *)arg) == 0 );
called++;
}
}
static void * mythread(void * a)
{
int ret;
/* lock mutex */
ASSERT( pthread_mutex_lock(&mtx) == 0 );
/* Push cleanup */
pthread_cleanup_push(cleanupmutex, &mtx);
printf("thread synchronization (mutex acquired)\n");
/* Wake the other thread */
ret = pthread_barrier_wait(&bar);
ASSERT( (ret == 0) || (ret == PTHREAD_BARRIER_SERIAL_THREAD) );
/* Now wait for the condition, this unlocks the mutex */
do {
printf("thread waiting cond\n");
ASSERT( pthread_cond_wait(&cnd, &mtx) == 0);
printf("thread woken\n");
} while (1);
/* Cleanup, never reached */
pthread_cleanup_pop(1);
return NULL;
}
int main(int argc, char * argv[])
{
int ret;
pthread_t thr;
void * dummy;
/* initialize the barrier */
ASSERT( pthread_barrier_init(&bar, NULL, 2) == 0 );
printf("Creating thread\n");
/* Create the thread */
ASSERT( pthread_create(&thr, NULL, mythread, NULL) == 0 );
printf("main synchronization\n");
ret = pthread_barrier_wait(&bar);
ASSERT( (ret == 0) || (ret == PTHREAD_BARRIER_SERIAL_THREAD) );
ASSERT( pthread_mutex_lock(&mtx) == 0 );
printf("main: thread is now waiting for condvar\n");
/* Cancel the thread */
ASSERT( pthread_cancel(thr) == 0 );
/* Now, unlock, so that the thread can actually really exit */
ASSERT( pthread_mutex_unlock(&mtx) == 0 );
/* Release thread resources */
ASSERT( pthread_join(thr, &dummy) == 0 );
if (called == 1)
printf("Test successful!\n");
else
printf("Test failed! Cleanup was not called (& lock not released)\n");
return 0;
}

View File

@ -1,315 +0,0 @@
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd
# Extra OBJECT IDENTIFIER info:
#oid_file = $ENV::HOME/.oid
oid_section = new_oids
# To use this configuration file with the "-extfile" option of the
# "openssl x509" utility, name here the section containing the
# X.509v3 extensions to use:
# extensions =
# (Alternatively, use a configuration file that has only
# X.509v3 extensions in its main [= default] section.)
[ new_oids ]
# We can add new OIDs in here for use by 'ca' and 'req'.
# Add a simple OID like this:
# testoid1=1.2.3.4
# Or use config file substitution like this:
# testoid2=${testoid1}.5.6
####################################################################
[ ca ]
default_ca = CA_default # The default ca section
####################################################################
[ CA_default ]
dir = /etc/openssl-ca # Where everything is kept
certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file.
#unique_subject = no # Set to 'no' to allow creation of
# several ctificates with same subject.
new_certs_dir = $dir/newcerts # default place for new certs.
certificate = $dir/public-www/cacert.pem # The CA certificate
serial = $dir/serial # The current serial number
# crlnumber = $dir/crlnumber # the current crl number
# must be commented out to leave a V1 CRL
crl = $dir/public-www/crl.pem # The current CRL
private_key = $dir/private/cakey.pem# The private key
RANDFILE = $dir/private/.rand # private random number file
x509_extensions = usr_cert # The extentions to add to the cert
# Comment out the following two lines for the "traditional"
# (and highly broken) format.
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field options
# Extension copying option: use with caution.
# copy_extensions = copy
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
# so this is commented out by default to leave a V1 CRL.
# crlnumber must also be commented out to leave a V1 CRL.
# crl_extensions = crl_ext
default_days = 365 # how long to certify for
default_crl_days= 30 # how long before next CRL
default_md = sha1 # which md to use.
preserve = no # keep passed DN ordering
# A few difference way of specifying how similar the request should look
# For type CA, the listed attributes must be the same, and the optional
# and supplied fields are just that :-)
# policy = policy_match
policy = policy_anything
# For the CA policy
[ policy_match ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
# For the 'anything' policy
# At this point in time, you must list all acceptable 'object'
# types.
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
####################################################################
[ req ]
default_bits = 1024
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_ca # The extentions to add to the self signed cert
# Passwords for private keys if not present they will be prompted for
# input_password = fdsecret
# output_password = fdsecret
# This sets a mask for permitted string types. There are several options.
# default: PrintableString, T61String, BMPString.
# pkix : PrintableString, BMPString.
# utf8only: only UTF8Strings.
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
# MASK:XXXX a literal mask value.
# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
# so use this option with caution!
string_mask = utf8only
# req_extensions = v3_req # The extensions to add to a certificate request
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = JP
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Tokyo
localityName = Locality Name (eg, city)
localityName_default = Koganei
0.organizationName = Organization Name (eg, company)
0.organizationName_default = WIDE
# we can do this but it is not needed normally :-)
1.organizationName = Second Organization Name (eg, company)
1.organizationName_default = NICT
organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = AAA WG
commonName = Common Name (i.e. Diameter Agent hostname)
commonName_max = 64
emailAddress = Email Address (i.e. Diameter agent administrator)
emailAddress_max = 64
# SET-ex3 = SET extension number 3
[ req_attributes ]
challengePassword = A challenge password
challengePassword_min = 0
challengePassword_max = 20
unstructuredName = An optional company name
[ usr_cert ]
# These extensions are added when 'ca' signs a request.
# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.
basicConstraints=CA:FALSE
# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.
# This is OK for an SSL server.
# nsCertType = server
# For an object signing certificate this would be used.
# nsCertType = objsign
# For normal client use this is typical
# nsCertType = client, email
# and for everything including object signing:
# nsCertType = client, email, objsign
# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
# This will be displayed in Netscape's comment listbox.
nsComment = "OpenSSL Generated Certificate"
# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer
# This stuff is for subjectAltName and issuerAltname.
# Import the email address.
# subjectAltName=email:copy
# An alternative to produce certificates that aren't
# deprecated according to PKIX.
# subjectAltName=email:move
# Copy subject details
# issuerAltName=issuer:copy
#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName
[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
[ v3_ca ]
# Extensions for a typical CA
# PKIX recommendation.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
# This is what PKIX recommends but some broken software chokes on critical
# extensions.
#basicConstraints = critical,CA:true
# So we do this instead.
basicConstraints = CA:true
# Key usage: this is typical for a CA certificate. However since it will
# prevent it being used as an test self-signed certificate it is best
# left out by default.
# keyUsage = cRLSign, keyCertSign
# Some might want this also
# nsCertType = sslCA, emailCA
# Include email address in subject alt name: another PKIX recommendation
# subjectAltName=email:copy
# Copy issuer details
# issuerAltName=issuer:copy
# DER hex encoding of an extension: beware experts only!
# obj=DER:02:03
# Where 'obj' is a standard or added object
# You can even override a supported extension:
# basicConstraints= critical, DER:30:03:01:01:FF
[ crl_ext ]
# CRL extensions.
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
# issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always,issuer:always
[ proxy_cert_ext ]
# These extensions should be added when creating a proxy certificate
# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.
basicConstraints=CA:FALSE
# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.
# This is OK for an SSL server.
# nsCertType = server
# For an object signing certificate this would be used.
# nsCertType = objsign
# For normal client use this is typical
# nsCertType = client, email
# and for everything including object signing:
# nsCertType = client, email, objsign
# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
# This will be displayed in Netscape's comment listbox.
nsComment = "OpenSSL Generated Certificate"
# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always
# This stuff is for subjectAltName and issuerAltname.
# Import the email address.
# subjectAltName=email:copy
# An alternative to produce certificates that aren't
# deprecated according to PKIX.
# subjectAltName=email:move
# Copy subject details
# issuerAltName=issuer:copy
#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName
# This really needs to be in place for it to be a proxy certificate.
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo

View File

@ -1,120 +0,0 @@
# Note: for this file to be working, an environment var CA_ROOT_DIR = directory
# must be defined and pointing to the CA top-level directory.
HOME = .
RANDFILE = $ENV::HOME/.rnd
oid_section = new_oids
[ new_oids ]
####################################################################
[ req ]
default_bits = 1024
# default_keyfile = privkey.pem
string_mask = utf8only
distinguished_name = req_distinguished_name
attributes = req_attributes
req_extensions = v3_req # overwrite with -reqexts
x509_extensions = ca_cert # overwrite with -extensions; used for self-signed keys only
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = JP
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Tokyo
localityName = Locality Name (eg, city)
localityName_default = Koganei
0.organizationName = Organization Name (eg, company)
0.organizationName_default = WIDE
1.organizationName = Second Organization Name (eg, company)
1.organizationName_default = NICT
organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = AAA WG testbed
[ req_attributes ]
challengePassword = A challenge password
challengePassword_min = 0
challengePassword_max = 20
unstructuredName = An optional company name
[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
[ v3_req_ca ]
# Extensions to add to a certificate request for CA
basicConstraints = CA:TRUE
####################################################################
[ ca ]
default_ca = CA_default # The default ca section
[ CA_default ]
dir = $ENV::CA_ROOT_DIR # Where everything is kept
certs = $dir/public # Where the issued certs are kept
crl_dir = $dir/public # Where the issued crl are kept
database = $dir/index.txt # database index file.
#unique_subject = no # Set to 'no' to allow creation of
# several ctificates with same subject.
new_certs_dir = $dir/public # default place for new certs.
certificate = $dir/public/cacert.pem # The CA certificate
serial = $dir/serial # The current serial number
crlnumber = $dir/crlnumber # the current crl number
crl = $dir/public/local.pem # The current CRL
private_key = $dir/private/cakey.pem # The private key
x509_extensions = usr_cert # The extentions to add to the cert
# overwrite with -extensions
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field options
crl_extensions = crl_ext
default_days = 3650 # how long to certify for
default_crl_days= 365 # how long before next CRL
default_md = sha1 # which md to use.
preserve = no # keep passed DN ordering
# We accept to sign anything, but a real deployment would limit to proper domain etc...
policy = policy_anything
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ usr_cert ]
basicConstraints=CA:FALSE
# This is typical in keyUsage for a client certificate.
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer
[ ca_cert ]
# Extensions for a typical CA
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = critical,CA:true # Remove "critical," in case of problems
keyUsage = cRLSign, keyCertSign
# subjectAltName=email:copy
# Copy issuer details
# issuerAltName=issuer:copy
[ crl_ext ]
# CRL extensions.
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
# issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always,issuer:always

View File

@ -1,284 +0,0 @@
diff -Nur phpki-0.82/ca/main.php phpki-0.82-fD/ca/main.php
--- phpki-0.82/ca/main.php 2005-11-17 10:17:20.000000000 +0900
+++ phpki-0.82-fD/ca/main.php 2010-05-27 17:04:44.000000000 +0900
@@ -36,7 +36,7 @@
else {
?>
<font color=#ff0000>
- <h2>There was an error updating the Certificate Revocation List.</h2></font><br>
+ <h2>There was an error updating the Certificate Revocation List.</h2></font><br />
<blockquote>
<h3>Debug Info:</h3>
<pre><?=$errtxt?></pre>
@@ -53,8 +53,11 @@
default:
printHeader('ca');
?>
- <br>
- <br>
+ <br />
+ <br />
+
+ <center><h3>For <span style="color: #FF0000;">freeDiameter</span> specific instructions, scroll down this page...</h3></center><br />
+
<center>
<table class=menu width=600><th class=menu colspan=2><big>CERTIFICATE MANAGEMENT MENU</big></th>
@@ -89,7 +92,57 @@
</table>
</center>
- <br><br>
+ <br /><br />
+ <center>
+ <table class=menu width=900><th class=menu colspan=2><big>FREEDIAMETER INSTRUCTIONS</big></th>
+ <tr><td style="text-align: center; vertical-align: middle; font-weight: bold;">
+ Create a new certificate</td>
+
+ <td>Use the <strong><cite>Create a New Certificate</cite></strong> link in previous table to request a new certificate. Fill the form as follow:
+ <ul>
+ <li><strong>Common Name</strong>: use your new freeDiameter identity (usually the FQDN).</li>
+ <li><strong>E-mail Address</strong>: Provide your address so that you can be contacted in case of inquiry.</li>
+ <li><strong>Organization</strong>: use "freeDiameter testbed" for example.</li>
+ <li><strong>Certificate Password</strong>: Do not loose the password you provide, you'll need it in the next step. <br />
+ The password must be >= 8 chars.</li>
+ <li>The other fields can be filled at your taste.</li>
+ </ul>
+ Once you have validated, you can check the values, and then proceed to download the new certificate and private key.
+ You will receive a file in PEM format. Let's call this file <em>mycertprotected.pem</em>.
+ It contains:
+ <ul>
+ <li>Your password-protected RSA private key.</li>
+ <li>Your certificate in PEM format.</li>
+ <li>The CA certificate.</li>
+ </ul></td></tr>
+
+ <tr><td style="text-align: center; vertical-align: middle; font-weight: bold;">
+ Split the file</td>
+
+ <td>In order to use the information with freeDiameter daemon, you must transform the data as follow:
+ <ul>
+ <li><strong>Decode the private key</strong>: <br />
+ <code>openssl rsa -in <em>mycertprotected.pem</em> -out /etc/ssl/private/freeDiameter.key</code><br />
+ OpenSSL will ask for the password you entered when creating the certificate.</li>
+ <li><strong>Extract your certificate</strong>: <br />
+ <code>openssl x509 -in <em>mycertprotected.pem</em> > /etc/ssl/certs/freeDiameter.pem</code></li>
+ <li><strong>Get the CA certificate</strong>: <br />
+ <code>wget --no-check-certificate "$config[base_url]index.php?stage=dl_root" -O /etc/ssl/certs/freeDiameter_testbed_CA.pem</code></li>
+ </ul>
+ Note: for the last step, you could also extract it directly from the PEM file you received.<br />
+ Note: the CRL is also available from the website, but this feature is not tested yet.</td></tr>
+
+ <tr><td style="text-align: center; vertical-align: middle; font-weight: bold;">
+ Configure freeDiameter</td>
+
+ <td>Here is the configuration related to TLS that you should set in your <em>/etc/freeDiameter/freeDiameter.conf</em> file:
+ <blockquote>TLS_Cred = "/etc/ssl/certs/freeDiameter.pem", "/etc/ssl/private/freeDiameter.key";<br />
+TLS_CA = "/etc/ssl/certs/freeDiameter_testbed_CA.pem";</blockquote></td></tr>
+
+
+ </table>
+ </center>
+ <br /><br />
<?
printFooter();
}
diff -Nur phpki-0.82/ca/request_cert.php phpki-0.82-fD/ca/request_cert.php
--- phpki-0.82/ca/request_cert.php 2007-01-04 14:45:09.000000000 +0900
+++ phpki-0.82-fD/ca/request_cert.php 2010-05-27 16:59:16.000000000 +0900
@@ -197,6 +197,7 @@
switch($cert_type) {
case 'server':
+ case 'freediameter':
upload(array("$config[private_dir]/$serial-key.pem","$config[new_certs_dir]/$serial.pem",$config['cacert_pem']), "$common_name ($email).pem",'application/pkix-cert');
break;
case 'email':
@@ -225,7 +226,7 @@
if (! $email) $email = "";
if (! $expiry) $expiry = 1;
if (! $keysize) $keysize = 1024;
- if (! $cert_type) $cert_type = 'email';
+ if (! $cert_type) $cert_type = 'freediameter';
printHeader();
?>
@@ -302,13 +303,14 @@
<td>Certificate Use: </td>
<td><select name=cert_type>
<?
- print '<option value="email" '.($cert_type=='email'?'selected':'').'>E-mail, SSL Client</option>';
- print '<option value="email_signing" '.($cert_type=='email_signing'?'selected':'').'>E-mail, SSL Client, Code Signing</option>';
- print '<option value="server" '.($cert_type=='server'?'selected':'').'>SSL Server</option>';
- print '<option value="vpn_client" '.($cert_type=='vpn_client'?'selected':'').'>VPN Client Only</option>';
- print '<option value="vpn_server" '.($cert_type=='vpn_server'?'selected':'').'>VPN Server Only</option>';
- print '<option value="vpn_client_server" '.($cert_type=='vpn_client_server'?'selected':'').'>VPN Client, VPN Server</option>';
- print '<option value="time_stamping" '.($cert_type=='time_stamping'?'selected':'').'>Time Stamping</option>';
+ print '<option value="email" disabled '.($cert_type=='email'?'selected':'').'>E-mail, SSL Client</option>';
+ print '<option value="email_signing" disabled '.($cert_type=='email_signing'?'selected':'').'>E-mail, SSL Client, Code Signing</option>';
+ print '<option value="server" disabled '.($cert_type=='server'?'selected':'').'>SSL Server</option>';
+ print '<option value="freediameter" '.($cert_type=='freediameter'?'selected':'').'>freeDiameter node</option>';
+ print '<option value="vpn_client" disabled '.($cert_type=='vpn_client'?'selected':'').'>VPN Client Only</option>';
+ print '<option value="vpn_server" disabled '.($cert_type=='vpn_server'?'selected':'').'>VPN Server Only</option>';
+ print '<option value="vpn_client_server" disabled '.($cert_type=='vpn_client_server'?'selected':'').'>VPN Client, VPN Server</option>';
+ print '<option value="time_stamping" disabled '.($cert_type=='time_stamping'?'selected':'').'>Time Stamping</option>';
?>
</select></td>
</tr>
diff -Nur phpki-0.82/include/openssl_functions.php phpki-0.82-fD/include/openssl_functions.php
--- phpki-0.82/include/openssl_functions.php 2007-01-04 15:47:57.000000000 +0900
+++ phpki-0.82-fD/include/openssl_functions.php 2010-05-27 16:59:57.000000000 +0900
@@ -69,6 +69,13 @@
default_days = 365
policy = policy_supplied
+[ freediameter_cert ]
+x509_extensions = freediameter_ext
+default_days = 730
+policy = policy_supplied
+
+
+
[ vpn_cert ]
x509_extensions = vpn_client_server_ext
default_days = 365
@@ -152,6 +159,24 @@
nsRevocationUrl = ns_revoke_query.php?
nsCaPolicyUrl = $config[base_url]policy.html
+[ freediameter_ext ]
+basicConstraints = CA:false
+keyUsage = critical, digitalSignature, keyEncipherment
+extendedKeyUsage = critical, serverAuth, clientAuth
+nsCertType = critical, server, client
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid:always, issuer:always
+subjectAltName = DNS:$common_name,email:copy
+issuerAltName = issuer:copy
+crlDistributionPoints = URI:$config[base_url]index.php?stage=dl_crl
+nsComment = \"PHPki/OpenSSL Generated Secure Certificate for freeDiameter\"
+nsBaseUrl = $config[base_url]
+nsRevocationUrl = ns_revoke_query.php?
+nsCaPolicyUrl = $config[base_url]policy.html
+
+
+
+
[ time_stamping_ext ]
basicConstraints = CA:false
keyUsage = critical, nonRepudiation, digitalSignature
diff -Nur phpki-0.82/openssl.cnf phpki-0.82-fD/openssl.cnf
--- phpki-0.82/openssl.cnf 2006-07-23 00:33:34.000000000 +0900
+++ phpki-0.82-fD/openssl.cnf 2010-05-27 17:00:33.000000000 +0900
@@ -39,6 +39,11 @@
default_days = 365
policy = policy_supplied
+[ freediameter_cert ]
+x509_extensions = freediameter_ext
+default_days = 730
+policy = policy_supplied
+
[ vpn_cert ]
x509_extensions = vpn_client_server_ext
default_days = 365
@@ -115,6 +120,23 @@
nsRevocationUrl = ns_revoke_query.php?
nsCaPolicyUrl = http://www.somewhere.com/phpki/policy.html
+[ freediameter_ext ]
+basicConstraints = CA:false
+keyUsage = critical, digitalSignature, keyEncipherment
+extendedKeyUsage = critical, serverAuth, clientAuth
+nsCertType = critical, server, client
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid:always, issuer:always
+subjectAltName = DNS:$common_name,email:copy
+issuerAltName = issuer:copy
+crlDistributionPoints = URI:$config[base_url]index.php?stage=dl_crl
+nsComment = "PHPki/OpenSSL Generated Secure Certificate for freeDiameter"
+nsBaseUrl = $config[base_url]
+nsRevocationUrl = ns_revoke_query.php?
+nsCaPolicyUrl = $config[base_url]policy.html
+
+
+
[ vpn_client_ext ]
basicConstraints = critical, CA:false
keyUsage = critical, digitalSignature
diff -Nur phpki-0.82/setup.php phpki-0.82-fD/setup.php
--- phpki-0.82/setup.php 2007-07-22 23:34:08.000000000 +0900
+++ phpki-0.82-fD/setup.php 2010-05-27 17:01:41.000000000 +0900
@@ -339,6 +339,11 @@
default_days = 365
policy = policy_supplied
+[ freediameter_cert ]
+x509_extensions = freediameter_ext
+default_days = 730
+policy = policy_supplied
+
[ vpn_cert ]
x509_extensions = vpn_client_server_ext
default_days = 365
@@ -418,6 +423,22 @@
nsRevocationUrl = ns_revoke_query.php?
nsCaPolicyUrl = $config[base_url]policy.html
+[ freediameter_ext ]
+basicConstraints = CA:false
+keyUsage = critical, digitalSignature, keyEncipherment
+extendedKeyUsage = critical, serverAuth, clientAuth
+nsCertType = critical, server, client
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid:always, issuer:always
+subjectAltName = DNS:$common_name,email:copy
+issuerAltName = issuer:copy
+crlDistributionPoints = URI:$config[base_url]index.php?stage=dl_crl
+nsComment = "PHPki/OpenSSL Generated Secure Certificate for freeDiameter"
+nsBaseUrl = $config[base_url]
+nsRevocationUrl = ns_revoke_query.php?
+nsCaPolicyUrl = $config[base_url]policy.html
+
+
[ time_stamping_ext ]
basicConstraints = CA:false
keyUsage = critical, nonRepudiation, digitalSignature
diff -Nur phpki-0.82/setup.php-presetup phpki-0.82-fD/setup.php-presetup
--- phpki-0.82/setup.php-presetup 2007-07-22 23:34:08.000000000 +0900
+++ phpki-0.82-fD/setup.php-presetup 2010-05-27 17:01:41.000000000 +0900
@@ -339,6 +339,11 @@
default_days = 365
policy = policy_supplied
+[ freediameter_cert ]
+x509_extensions = freediameter_ext
+default_days = 730
+policy = policy_supplied
+
[ vpn_cert ]
x509_extensions = vpn_client_server_ext
default_days = 365
@@ -418,6 +423,22 @@
nsRevocationUrl = ns_revoke_query.php?
nsCaPolicyUrl = $config[base_url]policy.html
+[ freediameter_ext ]
+basicConstraints = CA:false
+keyUsage = critical, digitalSignature, keyEncipherment
+extendedKeyUsage = critical, serverAuth, clientAuth
+nsCertType = critical, server, client
+subjectKeyIdentifier = hash
+authorityKeyIdentifier = keyid:always, issuer:always
+subjectAltName = DNS:$common_name,email:copy
+issuerAltName = issuer:copy
+crlDistributionPoints = URI:$config[base_url]index.php?stage=dl_crl
+nsComment = "PHPki/OpenSSL Generated Secure Certificate for freeDiameter"
+nsBaseUrl = $config[base_url]
+nsRevocationUrl = ns_revoke_query.php?
+nsCaPolicyUrl = $config[base_url]policy.html
+
+
[ time_stamping_ext ]
basicConstraints = CA:false
keyUsage = critical, nonRepudiation, digitalSignature

View File

@ -1,61 +0,0 @@
This file describes the content of the "contrib" directory.
For information about the freeDiameter project, please refer
to top-level README file.
- update_copyright.sh : This script will simply update the copyright information
in all source files in the freeDiameter mercurial repository, based
on the last modification time. Thought I might share it if other people find
it useful for their own project...
- debian : This directory contains the packaging information to create native Debian / Ubuntu
packages. It requires debhelper >= 7.3.9 (support for cmake). To use, simply link the
debian folder from the main freeDiameter folder, then use your building script as
usual ('dh binary' or 'pdebuild' or ...).
If you simply intend to use freeDiameter package, the relevant information is located
at: http://www.freediameter.net/trac/wiki/DebRepository
- PKI : This directory contains useful material related to establishing a
Public Key Infrastructure (PKI) for deploying x509 certificates
and use these for TLS authentication of the freeDiameter nodes.
IMPORTANT: Please note that these solutions are NOT suitable
for use in a production environment! It allows easy deployment of
certificates for tests, and that is their sole purpose.
The directory contains:
- ca_script: a simple Makefile allowing you to generate a self-signed certificate (root)
and then issue new certificates and private keys for your users.
Run "make" without argument to get the help.
- ca_script2: An evolution of the previous Makefile. This one allows you
to create a hierarchy of CA and certificates.
- phpki-0.82.patch : This patch is to be applied to PHPki to customize the use for freeDiameter.
PHPki (http://sourceforge.net/projects/phpki/) is a PHP-based web interface
that provides more or less the same services as ca_script.
- OpenWRT : This directory contains the scripts and documentation related to
the integration of freeDiameter RADIUS/Diameter gateway component in the openWRT
distribution (http://openwrt.org) -- the goal is to give the access point the
ability to "talk" Diameter instead of RADIUS.
- nightly_tests : This directory contains the scripts and documentation for the nightly
tests run on freeDiameter. The results are published at the following URL:
http://www.freediameter.net/CDash/index.php?project=freeDiameter
- dict_legacy: XML and DTD files for the dict_legacy_xml.fdx extension.
- dict_dcca: partial implementations of the DCCA dictionary
- dict_gx: untested implementation of the Gx interface.
- test_Gx: a responder on the Gx interface that always send SUCCESS status.
- wireshark: This contains some information on how to use Wireshark to monitor Diameter
exchange protected with TLS. It involves patching the wireshark software.

View File

@ -1,6 +0,0 @@
[krum@ThinkPad DelMe]$ cp freeDiameter.spec /home/krum/rpmbuild/SPECS/
[krum@ThinkPad DelMe]$ cd /home/krum/rpmbuild/SOURCES/
[krum@ThinkPad ~]$ cd /home/krum/rpmbuild/SOURCES/
[krum@ThinkPad SOURCES]$ wget http://www.freediameter.net/hg/freeDiameter/archive/1.1.6.tar.gz
[krum@ThinkPad SOURCES]$ cd ../SPECS/
[krum@ThinkPad SPECS]$ rpmbuild -ba freeDiameter.spec

View File

@ -1,78 +0,0 @@
Name: freeDiameter
Version: 1.1.6
Release: 1%{?dist}
Packager: krum.boy4ev@gmail.com
Summary: freeDiameter is an implementation of the Diameter protocol.
Group: Development/Libraries
License: BSD License
URL: http://www.freediameter.net
Source0: http://www.freediameter.net/hg/freeDiameter/archive/1.1.6.tar.gz
BuildRequires: cmake make gcc gcc-c++ flex bison lksctp-tools-devel
BuildRequires: gnutls-devel libgcrypt-devel libidn-devel
BuildRequires: mercurial
Requires: lksctp-tools
%description
freeDiameter is an implementation of the Diameter protocol.
Diameter is a protocol designed to carry Authentication, Authorization and
Accounting (AAA) payload. It is an evolution of the RADIUS protocol (as the
name suggests).
See http://www.freediameter.net/ for more information on the project.
freeDiameter was previously known as the "waaad" project (WIDE AAA Daemon)
This project is not related to the "freediameter" project from Sun on sourceforge.
Author: Sebastien Decugis.
%package daemon
Summary: Simple daemon parses the command line and initializes the freeDiameter framework.
Group: Development/Libraries
Requires: freeDiameter
%description daemon
freeDiameterd : this simple daemon parses the command line and initializes the
freeDiameter framework. Use it for your Diameter server & agent components.
In case of Diameter clients, you probably will prefer linking the libfdcore
directly with your client application that must be made Diameter-aware.
%prep
%setup -qn %{name}-%{version}
%build
mkdir -p build
cd build
cmake ../
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
cd build
make install DESTDIR=$RPM_BUILD_ROOT
make test
%post daemon
echo "/usr/local/lib/" > /etc/ld.so.conf.d/%{name}.conf
/sbin/ldconfig
%files
%defattr(-,root,root,-)
/usr/local/include/
/usr/local/lib/
%files daemon
%defattr(-,root,root,-)
/usr/local/bin/
%changelog
* Sat Jul 5 2013 Krum Boychev <krum.boy4ev@gmail.com> - 1.1.6-1
- initial version

View File

@ -1,47 +0,0 @@
This folder contains several tools to use and parse the data from the app_acct.fdx extension.
- database.sql :
An example database format for use with the scripts in this folder.
- app_acct.conf :
The part of app_acct.conf that is relevant to this database schema.
- purge_to_file.php :
This PHP script is used to take the records from the incoming table (stored by app_acct.fdx
extension) and save these records in a file in SQL format. This is similar to pg_dump
command, except that all the records that have been saved in the file are removed from
the table. This can be used in cron jobs for example to maintain a reasonable size of
the incoming table and move the data to another host for off-line processing. It can
also be useful to aggregate the data from different hosts, if you are load-balancing your
accounting servers for example (granted that all app_acct.fdx use identical table format
on all the servers). See the top of the file for configuration parameters.
- process_records.php :
This PHP script processes the records pertaining to users sessions, as follow:
* when a session is complete (STOP record received), it stores a session summary
into the processed records table (see process_database.sql file for format).
* It optionally archives the processed records into a different table, before deleting them.
* It can also move records of unterminated sessions that are older than a configurable time
to an orphan_records table, so that they are not re-processed every time.
This orphans table must have the same structure as the "incoming" table.
- display_results.php, display_self.php, display_stats.php :
These scripts give a few examples of how to display the processed data.
USAGE:
*) Initial: create your database using database.sql file
*) Configure the app_acct.fdx extension using tips from app_acct.conf
The following processing can be run for example as cron jobs.
1) On each accounting server for the realm, configure the app_acct.fdx extension to
dump the records in a local database (all servers must use the same database format).
The table would typically be "incoming".
2) Run the purge_to_file.php script on each server regularly, then move the generated
files onto a single server for processing. This server only needs the other tables.
3) Add the data from the files into the database in this server by running:
psql < file.sql
Each file that has been added should then be archived and removed so that it is not
re-added later.
4) Run the process_records.php script on this processing server. Now, the database
contains the aggregated data that can be visualized with display_*.php scripts.

View File

@ -1,227 +0,0 @@
-- database.sql
-- Script to create the tables for process_records.php script to perform.
-- IMPORTANT NOTE: No constraint and almost no index are created by this script.
-- One should consider adding the appropriate indexes according to their utilization of the data.
-- Incoming table table.
-- This table is used by app_acct.fdx to store the Accounting records.
CREATE TABLE incoming (
"Origin-Host" bytea NOT NULL,
"Origin-Realm" bytea NOT NULL,
"Destination-Realm" bytea,
"Destination-Host" bytea,
"Session-Id" bytea NOT NULL,
"Origin-State-Id" integer,
"Accounting-Record-Type" integer NOT NULL,
"Accounting-Record-Number" integer NOT NULL,
"User-Name" bytea,
"Event-Timestamp" bytea,
"Acct-Application-Id" integer,
"Accounting-Sub-Session-Id" bigint,
"Acct-Session-Id" bytea,
"Acct-Multi-Session-Id" bytea,
"Origin-AAA-Protocol" integer,
"Acct-Delay-Time" integer,
"NAS-Identifier" bytea,
"NAS-IP-Address" bytea,
"NAS-IPv6-Address" bytea,
"NAS-Port" integer,
"NAS-Port-Id" bytea,
"NAS-Port-Type" integer,
"Service-Type" integer,
"Termination-Cause" integer,
"Accounting-Input-Octets" bigint,
"Accounting-Input-Packets" bigint,
"Accounting-Output-Octets" bigint,
"Accounting-Output-Packets" bigint,
"Acct-Authentic" integer,
"Acct-Link-Count" integer,
"Acct-Session-Time" integer,
"Acct-Tunnel-Connection" bytea,
"Acct-Tunnel-Packets-Lost" integer,
"Callback-Id" bytea,
"Callback-Number" bytea,
"Called-Station-Id" bytea,
"Calling-Station-Id" bytea,
"Connect-Info" bytea,
"Originating-Line-Info" bytea,
"Authorization-Lifetime" integer,
"Session-Timeout" integer,
"Idle-Timeout" integer,
"Port-Limit" integer,
"Accounting-Realtime-Required" integer,
"Acct-Interim-Interval" integer,
"Filter-Id" bytea,
"NAS-Filter-Rule" bytea,
"QoS-Filter-Rule" bytea,
"Login-IP-Host" bytea,
"Login-IPv6-Host" bytea,
"Login-LAT-Group" bytea,
"Login-LAT-Node" bytea,
"Login-LAT-Port" bytea,
"Login-LAT-Service" bytea,
"Login-Service" integer,
"Login-TCP-Port" integer,
"Route-Record1" bytea,
"Route-Record2" bytea,
"Route-Record3" bytea,
"Route-Record4" bytea,
"Route-Record5" bytea,
"recorded_on" timestamp with time zone NOT NULL,
"recorded_serv" bytea
);
-- Accounting Data.
-- This is is the processed data that is used also by display_results.php
CREATE TABLE processed (
user_name bytea,
user_device bytea,
nas_info bytea,
sess_start timestamp with time zone,
sess_duration interval,
downl_bytes bigint,
upl_bytes bigint,
downl_packets bigint,
upl_packets bigint
);
CREATE INDEX un_index ON processed (user_name);
-- Orphans table.
-- This is optional, and it must match the structure of your incoming table.
CREATE TABLE orphans (
"Origin-Host" bytea NOT NULL,
"Origin-Realm" bytea NOT NULL,
"Destination-Realm" bytea,
"Destination-Host" bytea,
"Session-Id" bytea NOT NULL,
"Origin-State-Id" integer,
"Accounting-Record-Type" integer NOT NULL,
"Accounting-Record-Number" integer NOT NULL,
"User-Name" bytea,
"Event-Timestamp" bytea,
"Acct-Application-Id" integer,
"Accounting-Sub-Session-Id" bigint,
"Acct-Session-Id" bytea,
"Acct-Multi-Session-Id" bytea,
"Origin-AAA-Protocol" integer,
"Acct-Delay-Time" integer,
"NAS-Identifier" bytea,
"NAS-IP-Address" bytea,
"NAS-IPv6-Address" bytea,
"NAS-Port" integer,
"NAS-Port-Id" bytea,
"NAS-Port-Type" integer,
"Service-Type" integer,
"Termination-Cause" integer,
"Accounting-Input-Octets" bigint,
"Accounting-Input-Packets" bigint,
"Accounting-Output-Octets" bigint,
"Accounting-Output-Packets" bigint,
"Acct-Authentic" integer,
"Acct-Link-Count" integer,
"Acct-Session-Time" integer,
"Acct-Tunnel-Connection" bytea,
"Acct-Tunnel-Packets-Lost" integer,
"Callback-Id" bytea,
"Callback-Number" bytea,
"Called-Station-Id" bytea,
"Calling-Station-Id" bytea,
"Connect-Info" bytea,
"Originating-Line-Info" bytea,
"Authorization-Lifetime" integer,
"Session-Timeout" integer,
"Idle-Timeout" integer,
"Port-Limit" integer,
"Accounting-Realtime-Required" integer,
"Acct-Interim-Interval" integer,
"Filter-Id" bytea,
"NAS-Filter-Rule" bytea,
"QoS-Filter-Rule" bytea,
"Login-IP-Host" bytea,
"Login-IPv6-Host" bytea,
"Login-LAT-Group" bytea,
"Login-LAT-Node" bytea,
"Login-LAT-Port" bytea,
"Login-LAT-Service" bytea,
"Login-Service" integer,
"Login-TCP-Port" integer,
"Route-Record1" bytea,
"Route-Record2" bytea,
"Route-Record3" bytea,
"Route-Record4" bytea,
"Route-Record5" bytea,
"recorded_on" timestamp with time zone NOT NULL,
"recorded_serv" bytea
);
-- Archives table.
-- This is also optional, and it must match the structure of your incoming table.
CREATE TABLE archived (
"Origin-Host" bytea NOT NULL,
"Origin-Realm" bytea NOT NULL,
"Destination-Realm" bytea,
"Destination-Host" bytea,
"Session-Id" bytea NOT NULL,
"Origin-State-Id" integer,
"Accounting-Record-Type" integer NOT NULL,
"Accounting-Record-Number" integer NOT NULL,
"User-Name" bytea,
"Event-Timestamp" bytea,
"Acct-Application-Id" integer,
"Accounting-Sub-Session-Id" bigint,
"Acct-Session-Id" bytea,
"Acct-Multi-Session-Id" bytea,
"Origin-AAA-Protocol" integer,
"Acct-Delay-Time" integer,
"NAS-Identifier" bytea,
"NAS-IP-Address" bytea,
"NAS-IPv6-Address" bytea,
"NAS-Port" integer,
"NAS-Port-Id" bytea,
"NAS-Port-Type" integer,
"Service-Type" integer,
"Termination-Cause" integer,
"Accounting-Input-Octets" bigint,
"Accounting-Input-Packets" bigint,
"Accounting-Output-Octets" bigint,
"Accounting-Output-Packets" bigint,
"Acct-Authentic" integer,
"Acct-Link-Count" integer,
"Acct-Session-Time" integer,
"Acct-Tunnel-Connection" bytea,
"Acct-Tunnel-Packets-Lost" integer,
"Callback-Id" bytea,
"Callback-Number" bytea,
"Called-Station-Id" bytea,
"Calling-Station-Id" bytea,
"Connect-Info" bytea,
"Originating-Line-Info" bytea,
"Authorization-Lifetime" integer,
"Session-Timeout" integer,
"Idle-Timeout" integer,
"Port-Limit" integer,
"Accounting-Realtime-Required" integer,
"Acct-Interim-Interval" integer,
"Filter-Id" bytea,
"NAS-Filter-Rule" bytea,
"QoS-Filter-Rule" bytea,
"Login-IP-Host" bytea,
"Login-IPv6-Host" bytea,
"Login-LAT-Group" bytea,
"Login-LAT-Node" bytea,
"Login-LAT-Port" bytea,
"Login-LAT-Service" bytea,
"Login-Service" integer,
"Login-TCP-Port" integer,
"Route-Record1" bytea,
"Route-Record2" bytea,
"Route-Record3" bytea,
"Route-Record4" bytea,
"Route-Record5" bytea,
"recorded_on" timestamp with time zone NOT NULL,
"recorded_serv" bytea
);

View File

@ -1,141 +0,0 @@
<?php
# The copyright of this file is the same as the freeDiameter project. Licence is BSD.
# This file should no be called directly;
# instead it should be included from another script that sets its parameters as described below.
## $USERS
# An array of the user names to display; the empty array will display all users.
# This parameter MUST be set.
if (!isset($USERS))
die('Do not call this file directly');
## $START_TIME:
# If set, this restricts the displayed data to sessions starting after $START
## $END_TIME:
# If set, this restricts the displayed data to sessions starting before $END
## $LIMIT:
## $LIMIT_OFFSET:
# If set, these limit the number of accounting records displayed (for pagination purpose)
#------------------------------------------------------------------------------------------
# DATABASE:
/* The Connection String used to access that database:
Example: "host=localhost dbname=app_acct user=freediameter password=foo" */
$CONNSTR="";
/* The name of the table containing the processed data (from process_records.php script) */
$PROCESSED="processed";
#------------------------------------------------------------------------------------------
/* Connect to the database */
$dbconn = pg_connect($CONNSTR)
or die('Could not connect: ' . pg_last_error() . "\n");
/* Function to format download size (from php.net) */
function human_readable( $size )
{
$count = 0;
$format = array("B","KB","MB","GB","TB","PB","EB","ZB","YB");
while(($size/1024)>1 && $count<8)
{
$size=$size/1024;
$count++;
}
if( $size >= 100 ) $decimals = 0;
elseif ($size >= 10 ) $decimals = 1;
else $decimals = 2;
$return = number_format($size,$decimals,'.',' ')." ".$format[$count];
return $return;
}
/* Build the SQL query */
$sql = 'SELECT *, to_char(sess_start, \'YYYY-MM-DD&nbsp;HH24:MI:SS&nbsp;(TZ)\') as fmt_sess_start FROM "'.$PROCESSED.'"';
$where=0;
if ($USERS) {
$USERS = array_map(pg_escape_bytea, $USERS);
$sql .= " WHERE user_name IN ('". join("', '", array_values($USERS))."') ";
$where = 1;
}
if ($START_TIME) {
$START_TIME = pg_escape_string($START_TIME);
if ($where++)
$sql .= " AND ";
else
$sql .= " WHERE ";
$sql .= "sess_start >= '".$START_TIME."'";
}
if ($END_TIME) {
$END_TIME = pg_escape_string($END_TIME);
if ($where++)
$sql .= " AND ";
else
$sql .= " WHERE ";
$sql .= "sess_start <= '".$END_TIME."'";
}
$sql .= " ORDER BY sess_start, sess_duration";
if ($LIMIT)
$sql .= " LIMIT $LIMIT";
if ($LIMIT_OFFSET)
$sql .= " OFFSET $LIMIT_OFFSET";
/* Execute the query */
$result = pg_query($dbconn, $sql) or die('Query failed: ' . pg_last_error() . "\n");
$recs = pg_num_rows($result);
if ($recs == 0) {
echo "<p><em>Sorry, no data is available in this selection.</em></p>\n";
} else {
echo "<p><strong>$recs</strong> records found.</p>\n";
?>
<table>
<tr>
<th>Device identifier</th>
<th>Access Device information</th>
<th>Session started on</th>
<th>Duration</th>
<th>Downloaded</th>
<th>Uploaded</th>
</tr>
<?php
while ($record = pg_fetch_array($result, null, PGSQL_ASSOC)) {
echo " <tr title='".htmlentities(pg_unescape_bytea($record["user_name"]))."'>\n";
echo " <td>";
echo htmlentities(pg_unescape_bytea($record["user_device"]));
echo "</td>\n";
echo " <td>";
echo htmlentities(pg_unescape_bytea($record["nas_info"]));
echo "</td>\n";
echo " <td>";
echo $record["fmt_sess_start"];
echo "</td>\n";
echo " <td>";
echo htmlentities($record["sess_duration"]);
echo "</td>\n";
echo " <td>";
echo human_readable( $record["downl_bytes"] )." (".$record["downl_packets"]."pckts)";
echo "</td>\n";
echo " <td>";
echo human_readable( $record["upl_bytes"] )." (".$record["upl_packets"]."pckts)";
echo "</td>\n";
echo " </tr>\n";
}
}
pg_free_result($result);
/* Closing connection */
pg_close($dbconn);
?>

View File

@ -1,139 +0,0 @@
<?php
# This file is an example wrapper around display_results.php.
# It relies on clients authentication based on certificate usage
# (it must be the same certificate as used during AAA access, so that the User-Name matches).
# See your web server documentation for details.
# Example for apache2:
# (+ detail in http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html#allclients )
# - in vhost definition file, refence the CA chain of your users certificates:
# SSLCACertificateFile /var/www/conf/ssl.crt/ca.crt
# - in vhost file or .htaccess file (adjust Depth to your setup):
# <IfModule mod_ssl.c>
# SSLVerifyClient require
# SSLVerifyDepth 2
# </IfModule>
/* Check the client is correctly SSL authenticated with his server */
if (!isset($_SERVER["SSL_CLIENT_VERIFY"]) || $_SERVER["SSL_CLIENT_VERIFY"] != "SUCCESS")
die("SSL authentication failed, the webserver is probably not configured correctly.\n");
/* Force some parameters to integer values */
if ($_GET["t_limit"])
$_GET["t_limit"] = (int) $_GET["t_limit"];
if ($_GET["t_offset"])
$_GET["t_offset"] = (int) $_GET["t_offset"];
/* Default form values */
if (!isset($_GET["Submit"])) {
$_GET["t_limit"] = 50;
$_GET["c_limit"] = 1;
$_GET["t_offset"] = 0;
}
/* Output the form */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Accounting Data</title>
<meta name="description" content="This page gives you access to your personal accounting data.">
<meta name="keywords" content="accounting">
<style type="text/css">
body { text-align:center; }
table { border-collapse:collapse; margin-left:auto; margin-right:auto; }
table, td, th { border:1px solid green; padding-left:.5em; padding-right:.5em;}
th { background-color:green; color:white; }
</style>
</head>
<body >
<h1>Accounting data</h1>
<p>Note well: this page displays only data about <em>terminated</em> sessions.</p>
<form method="GET">
<table>
<tr>
<th colspan="3">
Filtering parameters
</th>
</tr>
<tr>
<td><input type="checkbox" name="c_starttime"<?php if (isset($_GET["c_starttime"])) echo " checked"; ?>></td>
<td>Show only sessions starting from (<a href="http://www.postgresql.org/docs/8.4/static/datatype-datetime.html">YYYY-MM-DD HH:MM:SS</a>):</td>
<td><input type="text" name="t_starttime"<?php if (isset($_GET["t_starttime"])) echo 'value="'.$_GET["t_starttime"].'"'; ?>></td>
</tr>
<tr>
<td><input type="checkbox" name="c_endtime"<?php if (isset($_GET["c_endtime"])) echo " checked"; ?>></td>
<td>Show only sessions starting until (<a href="http://www.postgresql.org/docs/8.4/static/datatype-datetime.html">YYYY-MM-DD HH:MM:SS</a>):</td>
<td><input type="text" name="t_endtime"<?php if (isset($_GET["t_endtime"])) echo 'value="'.$_GET["t_endtime"].'"'; ?>></td>
</tr>
<tr>
<td><input type="checkbox" name="c_limit"<?php if (isset($_GET["c_limit"])) echo " checked"; ?>></td>
<td>Show only this number of records:</td>
<td><input type="text" name="t_limit"<?php if (isset($_GET["t_limit"])) echo 'value="'.$_GET["t_limit"].'"'; ?>></td>
</tr>
<tr>
<td><input type="checkbox" name="c_offset"<?php if (isset($_GET["c_offset"])) echo " checked"; ?>></td>
<td>Starting from record:</td>
<td><input type="text" name="t_offset"<?php if (isset($_GET["t_offset"])) echo 'value="'.$_GET["t_offset"].'"'; ?>></td>
</tr>
<tr>
<th colspan="3">
Apply this filter: <input type="submit" name="Submit">
</th>
</tr>
</table>
</form>
<p>
Currently displaying user <em><?php echo htmlentities($_SERVER["SSL_CLIENT_S_DN_CN"]); ?></em><?php
/* Search user by CN or Email since some OS use the later during EAP-TLS authentication */
$USERS = array($_SERVER["SSL_CLIENT_S_DN_CN"], $_SERVER["SSL_CLIENT_S_DN_Email"]);
/* If the start time boundary was specified... */
if ($_GET["c_starttime"] && $_GET["t_starttime"]) {
$START_TIME=$_GET["t_starttime"];
}
if ($_GET["c_endtime"] && $_GET["t_endtime"]) {
$END_TIME=$_GET["t_endtime"];
}
/* idem with end time */
if ($START_TIME && $END_TIME) {
echo ", sessions starting between $START_TIME and $END_TIME";
} elseif ($START_TIME) {
echo ", sessions starting after $START_TIME";
} elseif ($END_TIME) {
echo ", sessions starting before $END_TIME";
}
/* Pagination */
if ($_GET["c_limit"] && $_GET["t_limit"]) {
$LIMIT=$_GET["t_limit"];
}
if ($_GET["c_offset"] && $_GET["t_offset"]) {
$LIMIT_OFFSET=$_GET["t_offset"];
}
if ($LIMIT) {
echo ", limited to ".$LIMIT." records";
if ($LIMIT_OFFSET)
echo " starting at ".$LIMIT_OFFSET;
} else if ($LIMIT_OFFSET) {
echo " starting at record ".$LIMIT_OFFSET;
}
echo ".\n";
?>
</p>
<?php
/* This file will generate the array of data matching the selection */
require("display_results.php");
?>
</body>
</html>

View File

@ -1,269 +0,0 @@
<?php
# The copyright of this file is the same as the freeDiameter project. Licence is BSD.
#------------------------------------------------------------------------------------------
# DATABASE:
/* The Connection String used to access that database:
Example: "host=localhost dbname=app_acct user=freediameter password=foo" */
$CONNSTR="";
/* The name of the table containing the processed data (from process_records.php script) */
$PROCESSED="processed";
#------------------------------------------------------------------------------------------
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Accounting Data</title>
<meta name="description" content="This page gives you access to your personal accounting data.">
<meta name="keywords" content="accounting">
<style type="text/css">
body { text-align:center; }
table.colored { border-collapse:collapse; margin-left:auto; margin-right:auto; }
table.colored td, table.colored th { border:1px solid green; padding-left:.5em; padding-right:.5em;}
.colored th { background-color:green; color:white; }
hr { width:15px; margin-top:2em;margin-bottom:2em; }
</style>
</head>
<body >
<h1>Statistical accounting data</h1>
<form method="GET">
<table class="colored">
<tr>
<th colspan="3">
Filtering options
</th>
</tr>
<tr>
<td><input type="checkbox" name="c_starttime"<?php if (isset($_GET["c_starttime"])) echo " checked"; ?>></td>
<td>Limit to sessions starting from (<a href="http://www.postgresql.org/docs/8.4/static/datatype-datetime.html">hint</a>):</td>
<td><input type="text" title="YYYY-MM-DD HH:MM:SS" name="t_starttime"<?php if (isset($_GET["t_starttime"])) echo 'value="'.$_GET["t_starttime"].'"'; ?>></td>
</tr>
<tr>
<td><input type="checkbox" name="c_endtime"<?php if (isset($_GET["c_endtime"])) echo " checked"; ?>></td>
<td>Limit to sessions starting until (<a href="http://www.postgresql.org/docs/8.4/static/datatype-datetime.html">hint</a>):</td>
<td><input type="text" title="YYYY-MM-DD HH:MM:SS" name="t_endtime"<?php if (isset($_GET["t_endtime"])) echo 'value="'.$_GET["t_endtime"].'"'; ?>></td>
</tr>
<tr>
<th colspan="3">
Apply this filter: <input type="submit" name="Submit">
</th>
</tr>
</table>
</form>
<p>Note well: this page displays only data about <em>terminated</em> sessions.</p>
<?php
/* Connect to the database */
$dbconn = pg_connect($CONNSTR)
or die('Could not connect: ' . pg_last_error() . "\n");
if ($_GET["c_starttime"] && $_GET["t_starttime"]) {
$START_TIME=$_GET["t_starttime"];
}
if ($_GET["c_endtime"] && $_GET["t_endtime"]) {
$END_TIME=$_GET["t_endtime"];
}
$sql_cond="";
if ($START_TIME) {
$sql_cond = "sess_start >= '".pg_escape_string($START_TIME)."'";
}
if ($END_TIME) {
if ($sql_cond)
$sql_cond .= " AND ";
$sql_cond .= "sess_start =< '".pg_escape_string($END_TIME)."'";
}
/* Function to format download size (from php.net) */
function human_readable( $size )
{
$count = 0;
$format = array("B","KB","MB","GB","TB","PB","EB","ZB","YB");
while(($size/1024)>1 && $count<8)
{
$size=$size/1024;
$count++;
}
if( $size >= 100 ) $decimals = 0;
elseif ($size >= 10 ) $decimals = 1;
else $decimals = 2;
$return = number_format($size,$decimals,'.',' ')." ".$format[$count];
return $return;
}
?>
<hr />
<?php
/* First query: global data */
$sql = 'SELECT SUM(downl_bytes) as total_down, SUM(upl_bytes) as total_up,';
$sql .= ' to_char(min(sess_start), \'YYYY-MM-DD&nbsp;HH24:MI:SS&nbsp;TZ\') as first_sess,';
$sql .= ' to_char(max(sess_start), \'YYYY-MM-DD&nbsp;HH24:MI:SS&nbsp;TZ\') as last_sess,';
$sql .= ' count(distinct user_name) as nb_users,';
$sql .= ' count(distinct nas_info) as nb_ap';
$sql .= ' FROM "'.$PROCESSED.'"';
if ($sql_cond)
$sql .= ' WHERE '.$sql_cond;
/* Execute the query */
$result = pg_query($dbconn, $sql) or die('Query failed: ' . pg_last_error() . "\n");
if (pg_num_rows($result) == 0) {
echo "<p><em>No data is available in the selected period.</em></p>\n";
die("</body></html>\n");
}
$data = pg_fetch_array($result, null, PGSQL_ASSOC);
?>
<table class="colored">
<tr>
<th colspan="2">Total accounted data</th>
</tr>
<?php
echo " <tr><td>First session started:</td><td>".$data["first_sess"]."</td></tr>\n";
echo " <tr><td>Last session started:</td><td>".$data["last_sess"]."</td></tr>\n";
echo " <tr><td>Total data downloaded:</td><td><strong>".human_readable($data["total_down"])."</strong></td></tr>\n";
echo " <tr><td>Total data uploaded:</td><td><strong>".human_readable($data["total_up"])."</strong></td></tr>\n";
echo " <tr><td>Number of users who connected at least once:</td><td>".$data["nb_users"]."</td></tr>\n";
echo " <tr><td>Number of access points involved:</td><td>".$data["nb_ap"]."</td></tr>\n";
echo " </tr>\n";
echo " </table>\n";
pg_free_result($result);
?>
<hr />
<table class="colored">
<tr>
<th colspan="2">Top-5 <strong>downloading</strong> users</th>
</tr>
<?php
/* Now, get the top 5 downloaders */
$sql = 'SELECT SUM(downl_bytes) as total_down, user_name';
$sql .= ' FROM "'.$PROCESSED.'"';
if ($sql_cond)
$sql .= ' WHERE '.$sql_cond;
$sql .= ' GROUP BY user_name';
$sql .= ' ORDER BY total_down desc, user_name';
$sql .= ' LIMIT 5';
/* Execute the query */
$result = pg_query($dbconn, $sql) or die('Query failed: ' . pg_last_error() . "\n");
while ($data = pg_fetch_array($result, null, PGSQL_ASSOC)) {
echo " <tr>\n";
echo " <td>".htmlentities(pg_unescape_bytea($data["user_name"]))."</td>\n";
echo " <td>".human_readable($data["total_down"])."</td>\n";
echo " </tr>\n";
}
pg_free_result($result);
?>
</table>
<hr />
<table class="colored">
<tr>
<th colspan="2">Top-5 <strong>uploading</strong> users</th>
</tr>
<?php
/* Now, get the top 5 downloaders */
$sql = 'SELECT SUM(upl_bytes) as total_up, user_name';
$sql .= ' FROM "'.$PROCESSED.'"';
if ($sql_cond)
$sql .= ' WHERE '.$sql_cond;
$sql .= ' GROUP BY user_name';
$sql .= ' ORDER BY total_up desc, user_name';
$sql .= ' LIMIT 5';
/* Execute the query */
$result = pg_query($dbconn, $sql) or die('Query failed: ' . pg_last_error() . "\n");
while ($data = pg_fetch_array($result, null, PGSQL_ASSOC)) {
echo " <tr>\n";
echo " <td>".htmlentities(pg_unescape_bytea($data["user_name"]))."</td>\n";
echo " <td>".human_readable($data["total_up"])."</td>\n";
echo " </tr>\n";
}
pg_free_result($result);
?>
</table>
<hr />
<table class="colored">
<tr>
<th colspan="2">Top-8 access devices (by number of users)</th>
</tr>
<?php
/* Now, get the top 5 downloaders */
$sql = 'SELECT count(distinct user_name) as unc, nas_info';
$sql .= ' FROM "'.$PROCESSED.'"';
if ($sql_cond)
$sql .= ' WHERE '.$sql_cond;
$sql .= ' GROUP BY nas_info';
$sql .= ' ORDER BY unc desc, nas_info';
$sql .= ' LIMIT 8';
/* Execute the query */
$result = pg_query($dbconn, $sql) or die('Query failed: ' . pg_last_error() . "\n");
while ($data = pg_fetch_array($result, null, PGSQL_ASSOC)) {
echo " <tr>\n";
echo " <td>".htmlentities(pg_unescape_bytea($data["nas_info"]))."</td>\n";
echo " <td>".$data["unc"]."</td>\n";
echo " </tr>\n";
}
pg_free_result($result);
?>
</table>
<hr />
<table class="colored">
<tr>
<th colspan="2">Top-8 access devices (by traffic: up+down)</th>
</tr>
<?php
/* Now, get the top 5 downloaders */
$sql = 'SELECT SUM(upl_bytes) + SUM(downl_bytes) as traffic, nas_info';
$sql .= ' FROM "'.$PROCESSED.'"';
if ($sql_cond)
$sql .= ' WHERE '.$sql_cond;
$sql .= ' GROUP BY nas_info';
$sql .= ' ORDER BY traffic desc, nas_info';
$sql .= ' LIMIT 8';
/* Execute the query */
$result = pg_query($dbconn, $sql) or die('Query failed: ' . pg_last_error() . "\n");
while ($data = pg_fetch_array($result, null, PGSQL_ASSOC)) {
echo " <tr>\n";
echo " <td>".htmlentities(pg_unescape_bytea($data["nas_info"]))."</td>\n";
echo " <td>".human_readable($data["traffic"])."</td>\n";
echo " </tr>\n";
}
pg_free_result($result);
?>
</table>
<hr />
<?php
/* Closing connection */
pg_close($dbconn);
?>
<p><small>Data generated by scripts from the <a href="http://www.freediameter.net">freeDiameter</a> project.</small></p>
</body>
</html>

View File

@ -1,205 +0,0 @@
<?php
# This file may be called either from CLI or web PHP installation.
# The copyright is the same as the freeDiameter project. Licence is BSD.
# IMPORTANT: This script is highly experimental, PLEASE KEEP A COPY OF YOUR ACCOUNTING DATA
# if this data has any importance.
/*-------------------------------------------------------*/
/* This script supports only one database where all tables are kept.
The Connection String used to access that database:
Example: "host=localhost dbname=app_acct user=freediameter password=foo" */
$CONNSTR="";
/**** 1 : Incoming records (output of app_acct.fdx) ****/
/* The name of the table were the raw records are saved (from app_acct.conf) */
$INCOMING="incoming";
/* Note: For this script, this table MUST contain the following fields (with these names):
Session-Id, User-Name, Accounting-Record-Type, Accounting-Record-Number, Acct-Session-Id,
Accounting-{In,Out}put-{Octets,Packets},
NAS-Identifier, Called-Station-Id, Calling-Station-Id, recorded_on.
*/
/**** 2 : Processed records (output of this script, input for display_results.php) ****/
/* The name of the table */
$PROCESSED="processed";
/* See process_database.sql for command to create this database */
/**** 3 : Orphan records (optional) ****/
/* The script can move records belonging to an unterminated session that has not received any new
record for more than $ORPHAN_DELAY (based on recorded_on field) into an $ORPHANED_TABLE table, so that
these records are not re-processed everytime the script runs.
If $ORPHANED_TABLE is empty, this feature is disabled. */
$ORPHANED_TABLE="orphans";
$ORPHAN_DELAY = "2 days";
/**** 4 : Archived records (optional) ****/
/* When data has been processed successfully, the records can be saved into an archive table before being deleted. */
/* This table also must have the same structure as $INCOMING */
$ARCHIVES_TABLE="archived";
/*-------------------------------------------------------*/
/* Connect to the database */
$dbconn = pg_connect($CONNSTR)
or die('Could not connect: ' . pg_last_error() . "\n");
/* Handle orphans first */
if ($ORPHANED_TABLE) {
$orphans_sql = 'SELECT * FROM "'.$INCOMING.'" ';
$orphans_sql.= 'WHERE "Acct-Session-Id" IN (';
$orphans_sql.= ' SELECT data.asid ';
$orphans_sql.= ' FROM (';
$orphans_sql.= ' SELECT "Acct-Session-Id" as asid, MAX("recorded_on") as latest, bool_or("Accounting-Record-Type" = 2) as got_start, bool_or("Accounting-Record-Type" = 4) as got_stop ';
$orphans_sql.= ' FROM "'.$INCOMING.'"';
$orphans_sql.= ' GROUP BY "Acct-Session-Id") ';
$orphans_sql.= ' as data';
$orphans_sql.= ' WHERE data.latest < current_timestamp - interval \''. $ORPHAN_DELAY .'\' AND NOT ( got_start AND got_stop )';
$orphans_sql.= ');';
/* Execute, move the orphaned records to the appropriate table. */
$result = pg_query($dbconn, $orphans_sql) or die('Query failed: ' . pg_last_error() . "\n");
if (pg_num_rows($result) > 0) {
$i = 0;
while ($orphan = pg_fetch_array($result, null, PGSQL_ASSOC)) {
$i++;
// this doesn't work: pg_insert( $dbconn, $ORPHANED_TABLE, $orphan ) or die('Insert failed: ' . pg_last_error() . "\n");
$sql = "INSERT INTO \"$ORPHANED_TABLE\" ";
$sql .= '("';
$sql .= join('", "', array_keys($orphan));
$sql .= '") VALUES (';
for($c = 0; $c < count($orphan); $c++)
$sql .= ($c ? ', ' : '').'$'.($c+1);
$sql .= ')';
pg_query_params($dbconn, $sql, array_values($orphan)) or die('Insert failed: ' . pg_last_error() . "\n");
// This also doesn't work: pg_delete( $dbconn, $INCOMING, $orphan ) or die('Removing orphan failed: ' . pg_last_error() . "\n");
$sql = "DELETE FROM \"$INCOMING\" WHERE ";
$sql .= '"Acct-Session-Id" = $1 AND "recorded_on" = $2';
pg_query_params($dbconn, $sql, array($orphan["Acct-Session-Id"], $orphan["recorded_on"])) or die('Removing orphan failed: ' . pg_last_error() . "\n");
}
echo $i." orphans have been moved to '".$ORPHANED_TABLE."'\n";
}
pg_free_result($result);
}
/* Delete duplicate records (which might have been received by different servers on different time, but are identical otherwise */
$duplicate_sql = ' SELECT * FROM (SELECT count(*) as cnt, min("recorded_on") as first, "Session-Id", "Acct-Session-Id", "Accounting-Record-Type", "Accounting-Record-Number"';
$duplicate_sql .= ' FROM "'.$INCOMING.'" GROUP BY "Session-Id", "Acct-Session-Id", "Accounting-Record-Type", "Accounting-Record-Number") as qry WHERE qry.cnt > 1';
$result = pg_query($dbconn, $orphans_sql) or die('Query failed: ' . pg_last_error() . "\n");
if (pg_num_rows($result) > 0) {
/* We have some duplicates to delete */
$i=0;
while ($dup = pg_fetch_array($result, null, PGSQL_ASSOC)) {
$i++;
$sql = "DELETE FROM \"$INCOMING\" WHERE ";
$sql .= '"Session-Id" = $1 AND "Acct-Session-Id" = $2 AND "Accounting-Record-Type" = $3 AND "Accounting-Record-Number" = $4 AND "recorded_on" <> $5';
$params = array($dup["Session-Id"], $dup["Acct-Session-Id"], $dup["Accounting-Record-Type"], $dup["Accounting-Record-Number"], $dup["first"]);
pg_query_params($dbconn, $sql, $params) or die('Removing duplicates failed: ' . pg_last_error() . "\n");
}
echo $i." duplicate records have been deleted from '".$INCOMING."'\n";
}
pg_free_result($result);
/* Now, find Acct-Session-Id of completed sessions */
$completed_sql = ' SELECT "Session-Id", "Acct-Session-Id" FROM (';
$completed_sql .= ' SELECT "Session-Id", "Acct-Session-Id", bool_or("Accounting-Record-Type" = 2) as got_start, bool_or("Accounting-Record-Type" = 4) as got_stop ';
$completed_sql .= ' FROM "'.$INCOMING.'" GROUP BY "Session-Id", "Acct-Session-Id"';
$completed_sql .= ' ) as input';
$completed_sql .= ' WHERE got_start AND got_stop';
$sids = pg_query($dbconn, $completed_sql) or die('Query failed: ' . pg_last_error() . "\n");
if (pg_num_rows($sids) > 0) {
while ($sids_line = pg_fetch_array($sids, null, PGSQL_ASSOC)) {
$sid = $sids_line["Session-Id"];
$asid = $sids_line["Acct-Session-Id"];
echo "Processing Acct-Session-Id '".$asid."', Session-Id '".$sid ."'... ";
$data=array();
/* We simply ignore the interim record(s) in this first version, since they contain only cumulative data. It could be used in later version to draw the session details for example. */
$result = pg_query_params($dbconn, 'SELECT *, "recorded_on" - CAST(textcat(text("Acct-Session-Time"), text(\' seconds\')) as INTERVAL) as start_time FROM "'.$INCOMING.
'" WHERE "Session-Id" = $1 AND "Acct-Session-Id" = $2 AND "Accounting-Record-Type" = 4 ORDER BY "recorded_on"',
array($sid, $asid)) or die('Query failed: ' . pg_last_error() . "\n");
$record = pg_fetch_array($result, null, PGSQL_ASSOC) or die('Internal error, got_stop is true but no record was returned');
$data[/* "user_name" */] = $record["User-Name"];
$data[/* "user_device" */] = $record["Calling-Station-Id"];
$nas_id= ($record["NAS-Identifier"] ?: $record["Origin-Host"]) ?: "<unidentified NAS>";
$ip = $record["NAS-IP-Address"] ?: $record["NAS-IPv6-Address"];
$nas_ip= $ip ? inet_ntop(pg_unescape_bytea($ip)) : "<unknown NAS IP>";
$nas_csi = $record["Called-Station-Id"];
$data[/* "nas_info" */] = $nas_id . " (".$nas_ip.")" . ($nas_csi ? " - Called Station: ".$nas_csi : "");
/* Is it possible to infer the session start time from this record only? */
if ($record["Acct-Session-Time"]) {
/* Yes, let's go */
$data[/* "sess_start" */] = $record["start_time"];
$data[/* "sess_duration" */] = $record["Acct-Session-Time"]." seconds";
} else {
/* No the information is missing, let's compute the approx value with the START record timestamp */
$res = pg_query_params($dbconn, 'SELECT t_start."recorded_on" as begining, t_end."recorded_on" - t_start."recorded_on" as duration'.
' FROM (SELECT "recorded_on" FROM "'.$INCOMING.'" WHERE "Session-Id" = $1 AND "Acct-Session-Id" = $2 AND "Accounting-Record-Type" = 4 ORDER BY "recorded_on" LIMIT 1) as t_end, '.
' (SELECT "recorded_on" FROM "'.$INCOMING.'" WHERE "Session-Id" = $1 AND "Acct-Session-Id" = $2 AND "Accounting-Record-Type" = 2 ORDER BY "Accounting-Record-Number", "recorded_on" LIMIT 1) as t_start',
array($sid, $asid)) or die('Query failed: ' . pg_last_error() . "\n");
$vals = pg_fetch_array($result, null, PGSQL_ASSOC) or die('Internal error, unable to compute session time');
$data[/* "sess_start" */] = $vals["begining"];
$data[/* "sess_duration" */] = $vals["duration"];
pg_free_result($res);
}
$data[/* "downl_bytes" */] = $record["Accounting-Output-Octets"];
$data[/* "downl_packets" */] = $record["Accounting-Output-Packets"];
$data[/* "upl_bytes" */] = $record["Accounting-Input-Octets"];
$data[/* "upl_packets" */] = $record["Accounting-Input-Packets"];
pg_free_result($result);
$result = pg_query_params($dbconn,
'INSERT INTO "'.$PROCESSED.'" (user_name, user_device, nas_info, sess_start, sess_duration, downl_bytes, downl_packets, upl_bytes, upl_packets) '.
'VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)', $data) or die('Query failed: ' . pg_last_error() . "\n");
pg_free_result($result);
echo "Data stored into '$PROCESSED'... ";
/* Now that we have processed it, move these records to the $ARCHIVES_TABLE table. */
if ($ARCHIVES_TABLE) {
$result = pg_query_params($dbconn, 'SELECT * FROM "'.$INCOMING.'" WHERE "Session-Id" = $1 AND "Acct-Session-Id" = $2', array($sid, $asid)) or die('Query failed: ' . pg_last_error() . "\n");
$i = 0;
while ($rec = pg_fetch_array($result, null, PGSQL_ASSOC)) {
$i++;
$sql = "INSERT INTO \"$ARCHIVES_TABLE\" ";
$sql .= '("';
$sql .= join('", "', array_keys($rec));
$sql .= '") VALUES (';
for($c = 0; $c < count($rec); $c++)
$sql .= ($c ? ', ' : '').'$'.($c+1);
$sql .= ')';
pg_query_params($dbconn, $sql, array_values($rec)) or die('Insert failed: ' . pg_last_error() . "\n");
}
echo $i." records archived into '".$ARCHIVES_TABLE."'";
pg_free_result($result);
}
echo "\n";
$result = pg_query_params($dbconn, 'DELETE FROM "'.$INCOMING.'" WHERE "Session-Id" = $1 AND "Acct-Session-Id" = $2', array($sid, $asid)) or die('Query failed: ' . pg_last_error() . "\n");
pg_free_result($result);
}
}
pg_free_result($sids);
echo "Operation completed with success!\n";
/* Closing connection */
pg_close($dbconn);
?>

View File

@ -1,157 +0,0 @@
<?php
# This file may be called either from CLI or web PHP installation.
# The copyright is the same as the freeDiameter project. Licence is BSD.
/*-------------------------------------------------------*/
/* -- These parameters must match the app_acct.conf file -- */
/* The Connection String used to access the database.
Example: "host=localhost dbname=app_acct user=freediameter password=foo" */
$CONNSTR="";
/* The name of the table were the records are saved by app_acct.fdx */
$TABLE="incoming";
/* -- These parameters are specific to this script -- */
/* Name of the dump file to create. It can be relative or absolute.
The script fails if this file already exists.
Use for example "data-".date("Ymdhis").".sql" to avoid collisions. */
$DUMPFILE="incoming_data.sql";
/* Does the script also echoes an HTML TABLE of the data processed? */
$DISPLAY_HTML=FALSE; // it would be better to detect if we are called through Web or CLI...
/* In addition, issue a full HTML page (including headers) ? */
$HTML_HEADERS=TRUE;
/*-------------------------------------------------------*/
/* Connect to the database */
$dbconn = pg_connect($CONNSTR)
or die('Could not connect: ' . pg_last_error() . "\n");
/* Check if the file exists */
$file = fopen($DUMPFILE, "xb")
or die("The file '$DUMPFILE' already exists or cannot be created, aborting.\n");
/* First, query the table format */
$format_sql = "SELECT ".
" a.attname AS field,".
" t.typname AS type,".
/* " a.attlen AS length,". */
" a.atttypmod AS lengthvar,".
" a.attnotnull AS notnull".
" FROM".
" pg_class c,".
" pg_attribute a,".
" pg_type t".
" WHERE".
" c.relname = '" . $TABLE . "'".
" AND a.attnum > 0".
" AND a.attrelid = c.oid".
" AND a.atttypid = t.oid".
" ORDER BY a.attnum";
$result = pg_query($dbconn, $format_sql) or die('Query failed: ' . pg_last_error() . "\n");
/* app_acct.fdx only uses a few different fields types: */
$conv_types = array(
"timestamptz" => "timestamp with time zone", /* recorded on */
"bytea" => "bytea", /* octet string */
"int4" => "integer", /* unsigned32, integer32, float32 */
"int8" => "bigint" /* unsigned64, integer64, float64 */
);
$fields_types=array();
fwrite($file, " -- Data purged on ".date(DATE_RFC822)."\n\n");
fwrite($file, " -- Format of the table it was extracted from:\n");
fwrite($file, " -- CREATE TABLE \"".$TABLE."\" (\n");
$i = 0;
while ($field = pg_fetch_array($result, null, PGSQL_ASSOC)) {
if ($i++)
fwrite($file, ",\n");
fwrite($file, " -- \"".$field["field"]."\" ");
if (array_key_exists($field["type"], $conv_types))
$fields_types[$field["field"]] = $conv_types[$field["type"]];
else
$fields_types[$field["field"]] = $field["type"];
fwrite($file, $fields_types[$field["field"]]);
if ($field["lengthvar"] != "-1")
fwrite($file, "(".$field["lengthvar"].")");
if ($field["notnull"] == "t")
fwrite($file, " NOT NULL");
}
fwrite($file, "\n -- );\n\n");
pg_free_result($result);
/* Now, the data */
$result = pg_query($dbconn, "SELECT * FROM \"".$TABLE."\"") or die('Query failed: ' . pg_last_error() . "\n");
if (pg_num_rows($result) > 0) {
fwrite($file, "INSERT INTO \"".$TABLE."\"\n (\n");
$i = pg_num_fields($result);
if ($DISPLAY_HTML && $HTML_HEADERS) echo "<HTML>\n<HEAD><TITLE>Purge</TITLE></HEAD>\n<BODY>\n";
if ($DISPLAY_HTML) echo "<TABLE>\n <TR>\n";
for ($j = 0; $j < $i; $j++) {
fwrite($file, ($j ? ", " : "") . "\"" . pg_escape_string(pg_field_name($result, $j)). "\"");
if ($DISPLAY_HTML) echo " <TD>".htmlentities(pg_field_name($result, $j))."</TD>\n";
}
fwrite($file, "\n )\n VALUES \n");
if ($DISPLAY_HTML) echo " </TR>\n";
$i = 0;
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
if ($i++)
fwrite($file, ",\n");
fwrite($file, " ( ");
if ($DISPLAY_HTML) echo " <TR>\n";
$j = 0;
$sql = "";
foreach ($line as $f => $v) {
if (!is_null($v))
switch ($fields_types[$f]) {
case "bytea":
$v = "E'".pg_escape_bytea(pg_unescape_bytea($v))."'";
break;
case "timestamp with time zone":
$v = "E'".pg_escape_string($v)."'";
break;
}
else
$v = "NULL";
if ($DISPLAY_HTML) echo " <TD>".htmlentities(print_r($line[$f], TRUE))."</TD>\n";
fwrite($file, ($j ? ", " : "") . $v);
$sql .= ($j ? " AND " : "") . "\"".pg_escape_string($f)."\" ";
if (is_null($line[$f]))
$sql .= " IS NULL";
else
$sql .= " = " . $v;
$j++;
}
fwrite($file, ")");
if ($DISPLAY_HTML) echo " </TR>\n";
$res = pg_query( "DELETE FROM \"".$TABLE."\" WHERE ".$sql) or die('DELETE query failed: ' . pg_last_error() . "\n");
pg_free_result($res);
}
fwrite($file, "\n;\n");
if ($DISPLAY_HTML) echo "</TABLE>\n";
if ($DISPLAY_HTML && $HTML_HEADERS) echo "</BODY>\n</HTML>\n";
else echo $i." records have been successfully written to '".$DUMPFILE."' and removed from database.\n";
} else {
if ($DISPLAY_HTML) echo "<p><em>No new record in the database</em></p>\n";
else echo "No new record in the database, the generated file is empty.\n";
}
pg_free_result($result);
/* Closing connection */
pg_close($dbconn);
/* Closing the file */
fclose($file);
?>

View File

@ -1,209 +0,0 @@
freediameter (1.2.1) UNRELEASED; urgency=low
* New extension: rt_randomize (load-balancing on possible destinations)
* New contrib: Gx extension.
* rt_redirect.fdx and rt_load_balance.fdx improvement: use a hash table. Thanks Thomas.
* New hook HOOK_MESSAGE_SENDING to give a last chance to edit messages before they are sent.
This will be mostly used for enforcing interoperability constraints on non-compliant peers.
* Simplified log output. Old output can be recovered with DEBUG_WITH_META build option.
* Updated the internal counters for finer control on the load.
* Fixes in message expiry mechanism.
* Bug fixes in error messages generation and various parts.
* Improvements on shutdown sequence handling.
* Improvements to the dict_dcca_* extensions.
* Improved default CMake configuration.
* Improved build for MacOSX
* Fixes for a few newer operating systems compatibility.
* Fixed default secure Diameter port number 5868 instead of5658 (errata of RFC 6733)
-- Sebastien Decugis <sdecugis@freediameter.net> Sat, 30 Jan 2016 23:38:03 +0800
freediameter (1.2.0) UNRELEASED; urgency=low
* Major changes in the logging system to be more syslog and production friendly
* New extension: dict_dcca_3gpp
* New extension: dict_dcca_starent (Starent DCCA vendor-specific AVPs)
* New extension: rt_ignore_dh (hide network topology by proxying Destination-Host).
* New extension: rt_load_balance (load balancer based on pending queue size).
* New extension: rt_busypeers. See doc/rt_busypeers.conf.sample.
* New extension: dbg_msg_timings. Measures timing of message operations.
* New extension: dbg_msg_dumps. Use to control hooks display.
* New API (fd_hook_*) for extensions to control messages logging & profiling
* New API (fd_stats_*) for extensions to monitor framework state (e.g. SNMP implem)
* API change: all the fd_*_dump functions now return malloc'd strings instead of logging directly.
* API change: callback parameter of fd_rt_out_register had its signature updated.
* Updated dbg_monitoring extension to use the new API
* New script to generate dictionary extensions from org file (see contrib/tools)
* New compilation option: WORKAROUND_ACCEPT_INVALID_VSAI to improve compatibility
with invalid Vendor-Specific-Application-Id AVPs received from some equipments (e.g. Cisco).
* New compilation option: DISABLE_PEER_EXPIRY for use in test environments.
* Extensions are now also searched in LD_LIBRARY_PATH.
* Copy Proxy-Info AVP automatically in new answers.
* Port value 0 allowed in configuration to disable local server (e.g. disable non-secure port).
* API change: fd_msg_send_timeout now takes a separate callback for timeout situation.
* Function changes: fd_msg_dump_* now split in three different type of output.
* New test testmesg_stress to measure message parser performance
* Fix termination of the framework to avoid failures.
* Fix invalid timespec value in peer PSM appearing randomly (leading to crash).
* Return DIAMETER_LOOP_DETECTED if local peer in the Route-Record list of a message.
* Allow running without TLS configuration.
* Upgraded SCTP code to comply with RFC 6458
* Using default secure Diameter port number 5658 as per RFC 6733
* Updated TLS code for performance improvements with new GNU TLS.
* Fix interlocking problem when large number of requests were failed over.
* New option in test_app.fdx extension for long messages payload.
* Performance improvement in message sending code path.
-- Sebastien Decugis <sdecugis@freediameter.net> Sat, 14 Sep 2013 18:08:07 +0800
freediameter (1.1.6) UNRELEASED; urgency=low
* Fix major issue in 1.1.5 preventing to send answers to a received message.
* New command-line option: --enable_msg_log=( DROPPED | RECEIVED | SENT | NODELIVER | TIMING )
* Improved parsing error handling and Failed-AVP generation.
* Added support for some timings measurements in freeDiameter (in the logs)
* Fix port handling when using non-default port.
* Some cleanups in several dictionary files.
* New option to fd_dict_search: AVP_BY_STRUCT
* Improved compatibility with C++ compilers.
* Cleanups in sessions creation/destruction to avoid memory corruption under stress.
* Add support for "include" directive in freeDiameter.conf file.
-- Sebastien Decugis <sdecugis@freediameter.net> Sun, 03 Mar 2013 07:40:43 +0100
freediameter (1.1.5) UNRELEASED; urgency=low
* Added compatibility with MAC OS X
* Fix behavior of timeout whe nsending messages to allow re-send.
* Several cleanups and new contributions included.
* Added dependency on C++ compiler for CMakeLists.txt
-- Sebastien Decugis <sdecugis@freediameter.net> Sat, 03 Nov 2012 17:58:11 +0100
freediameter (1.1.4) UNRELEASED; urgency=low
* Compatibility with GnuTLS 3.x versions / updated packaging files accordingly
* Fix crash on Sparc 64 (possibly other 64b machines)
* Updated dict_dcca in extensions and contrib (thanks Konstantin)
* Changed dumping of messages to avoid interleaved information
-- Sebastien Decugis <sdecugis@freediameter.net> Fri, 24 Aug 2012 00:17:05 +0200
freediameter (1.1.3) UNRELEASED; urgency=low
* Fixed a memory leak
* Clean-up of some extensions
-- Sebastien Decugis <sdecugis@freediameter.net> Tue, 03 Jul 2012 08:15:49 +0200
freediameter (1.1.2) UNRELEASED; urgency=low
* FIFO queues are now capped to avoid memory exhaustion.
* Cleanups in MIPv6 dictionaries.
* app_acct upgraded: enabled vendor-specific AVP logging, thread-safe version.
* New function: fd_dict_getlistof to list dictionary contents.
* New function: fd_dict_delete to remove an entry (dangerous function!)
* New function: fd_sess_getcount to get count of session objects.
* A few additional bug fixes, check hg log for details.
-- Sebastien Decugis <sdecugis@freediameter.net> Tue, 21 Feb 2012 18:38:10 +0100
freediameter (1.1.1) UNRELEASED; urgency=low
* Bug fix release
* Supports newer GNUTLS versions
* Allow empty OctetString AVPs (l=0)
* Allow two instances of freeDiameter on a single host.
-- Sebastien Decugis <sdecugis@nict.go.jp> Fri, 30 Sep 2011 21:56:50 +0200
freediameter (1.1.0) UNRELEASED; urgency=low
* Source package restructured. Most of the
framework now contained in the libfdcore library.
libfreeDiameter renamed as libfdproto.
This closes #15.
* API version bumped to version 4.
* Improved fd_dict_new() when the same object already exists.
* Improvements to dict_legacy_xml extension.
* Cleanups in links to shared libraries
* (app_radgw.fdx) Better handling conversion of DEA with error status
to RADIUS (closes #25)
* Allow default signals such as SIGTSTP (ctrl-z) to be used with
freeDiameterd
* Improved DiameterIdentity handling (esp. interationalization issues),
and improve efficiency of some string operations in peers, sessions,
and dictionary modules (closes #7)
* Cleanup in the session module to free only unreferenced sessions (#16)
* Removed fd_cpu_flush_cache(), replaced by more robust alternatives.
* Improved peer state machine algorithm to counter SCTP multistream race
condition.
* New extension rt_redirect.fdx that handles the Diameter Redirect errors.
* New extension app_redirect that allows sending Redirect indications to
other peers. See doc/app_redirect.conf.sample for more information.
* Added incomplete dictionary extension for rfc4006 (DCCA), courtesy
of Konstantin Chekushin <koch@lmt.lv>
-- Sebastien Decugis <sdecugis@freediameter.net> Tue, 29 Mar 2011 10:41:19 +0900
freediameter (1.0.4) UNRELEASED; urgency=low
* Added new API to specify timeout on receiving answer (#10)
* Bumped API version number accordingly.
* New test_netemul extension (simple network emulator proxy)
* Improved API compatibility to C++ compilers
-- Sebastien Decugis <sdecugis@nict.go.jp> Tue, 11 Jan 2011 12:28:22 +0900
freediameter (1.0.3) UNRELEASED; urgency=low
* Fixed a couple of issues for portability (#21, #22, #23)
* Fixed issue with ListenOn bit ordering (#20)
* Added dictionary support for MIPv6 application objects.
* Added dictionary support for legacy XML files.
* Added python interface dbg_interactive (experimental).
* Added parameters to fd_disp_register() and fd_sess_handler_create(),
Bumped API version number accordingly.
-- Sebastien Decugis <sdecugis@nict.go.jp> Tue, 14 Dec 2010 11:39:29 +0900
freediameter (1.0.2) UNRELEASED; urgency=low
* Fix an issue in app_diameap.fdx with user names (#18)
* Allow DH parameters loaded from a file (#17)
* Fixed a few compilation warnings on 64bits architectures.
* New ALL_EXTENSIONS build option.
-- Sebastien Decugis <sdecugis@nict.go.jp> Wed, 27 Oct 2010 11:17:32 +0900
freediameter (1.0.1) UNRELEASED; urgency=low
* app_acct.fdx: new set of PHP scripts available in source
contrib/app_acct_tools
* app_acct.fdx: new directive 'Server_name_field' in the
configuration.
* app_radgw.fdx: new directive 'nonai' in acct and auth plugins to
disable NAI processing.
* app_radgw.fdx: New support for RADIUS proxies.
* app_radgw.fdx: many bug fixes.
* daemon: Check the local certificate is valid during TLS
initialization.
* daemon: Fixed issue for IP addresses in the form x.x.x.235
* daemon: new option --dbg_gnutls to get GNUTLS debug messages.
* debian: some cleanups in the packaging (dependencies, meta-data)
* rt_ereg.fdx: New routing extension based on regular expression
matching in package freediameter-daemon.
-- Sebastien Decugis <sdecugis@nict.go.jp> Wed, 15 Sep 2010 18:30:28 +0900
freediameter (1.0.0-2) experimental; urgency=low
* Official release 1.0.0
-- Sebastien Decugis <sdecugis@nict.go.jp> Thu, 29 Jul 2010 17:27:13 +0900
freediameter (1.0.0-1) experimental; urgency=low
* Initial Release.
-- Sebastien Decugis <sdecugis@nict.go.jp> Wed, 19 May 2010 15:36:54 +0900

View File

@ -1,229 +0,0 @@
Source: freediameter
Section: contrib/net
Priority: extra
Maintainer: Sebastien Decugis <sdecugis@freediameter.net>
Build-Depends: debhelper ( >= 7.3.9),
cmake, make, gcc, g++, bison, flex,
libsctp-dev, libgnutls-dev | gnutls-dev, libidn11-dev,
libpq-dev, libmysqlclient-dev, libxml2-dev, swig, python-dev,
libgcrypt11-dev | libgcrypt20-dev
Standards-Version: 3.8.3
Homepage: http://www.freediameter.net
Package: freediameter-common
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: The freeDiameter libraries.
This package contains the freeDiameter framework core libraries,
required by all freeDiameter components.
It may also be useful for other projects which need to
perform operations on Diameter messages.
.
The freeDiameter framework provides support for the Diameter
Base Protocol. Without any extension, the framework can only
be used as a Diameter routing agent. You probably want to
install some freeDiameter extension(s) to extend its
features, and also the freediameter-daemon package that
will initialize the framework for you.
.
See 'freeDiameter-dev' package to retrieve the API for the library.
Package: freediameter-dev
Architecture: any
Section: contrib/devel
Depends: freediameter-common (= ${binary:Version}), libsctp-dev, libgnutls-dev, libgcrypt-dev
Description: This package provides the development files for freeDiameter.
Package: freediameter-daemon
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, freediameter-common (= ${binary:Version})
Suggests: ssl-cert, freediameter-dictionary-rfc4005, freediameter-dictionary-rfc4072, freediameter-dictionary-rfc4740,
freediameter-dictionary-mip6, freediameter-dictionary-legacy
Description: The freeDiameter daemon.
This daemon is a simple loader for the freeDiameter framework.
It is shipped with a small set of extensions, for
example to configure the routing behavior. See the
examples in /usr/share/freediameter* for more details.
Package: freediameter-debug-tools
Architecture: any
Section: contrib/debug
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
Suggests: python, libmysqlclient16 | libmysqlclient18
Description: freeDiameter debug tools.
This package provides useful tools to help tracking
problems in freeDiameter installation. For example,
the dbg_interactive.fdx extension allows access to the
framework via a python interpreter console.
Package: freediameter-dictionary-rfc4005
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
Description: RFC4005 (NASREQ) dictionary support.
This freeDiameter extension provides the dictionary support
for commands and AVP defined in RFC4005 (NASREQ).
.
In order to use this extension, your main freeDiameter
configuration file must contain a LoadExtension directive.
See freeDiameter documentation for more details.
.
This extension does not require a configuration file.
Package: freediameter-dictionary-rfc4006
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
Description: RFC4006 (DCCA) dictionary support (incomplete).
This freeDiameter extension provides the dictionary support
for commands and AVP defined in RFC4006 (DCCA).
.
In order to use this extension, your main freeDiameter
configuration file must contain a LoadExtension directive.
See freeDiameter documentation for more details.
.
This extension does not require a configuration file.
.
Currently this extension is not complete: only AVP definitions
are included. See the source file for more details.
Package: freediameter-dictionary-rfc4072
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version}), freediameter-dictionary-rfc4005 (= ${binary:Version})
Description: RFC4072 (Diameter EAP) dictionary support.
This freeDiameter extension provides the dictionary support
for commands and AVP defined in RFC4072 (Diameter EAP).
.
In order to use this extension, your main freeDiameter
configuration file must contain a LoadExtension directive.
See freeDiameter documentation for more details.
.
This extension does not require a configuration file.
Package: freediameter-dictionary-rfc4740
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
Description: RFC4740 (Diameter SIP) dictionary support.
This freeDiameter extension provides the dictionary support
for commands and AVP defined in RFC4740 (Diameter SIP).
.
In order to use this extension, your main freeDiameter
configuration file must contain a LoadExtension directive.
See freeDiameter documentation for more details.
.
This extension does not require a configuration file.
Package: freediameter-dictionary-mip6
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
Description: Diameter Mobile IPv6 application dictionary support.
This package contains a set of extensions to provide the support
for commands and AVP defined in several RFCs related to
Diameter MIPv6. It is split is several extensions:
mip6a, mip6i, nas-mipv6, rfc5777.
.
In order to use these extensions, your main freeDiameter
configuration file must contain LoadExtension directives.
See freeDiameter documentation for more details.
.
These extensions do not require a configuration file.
Package: freediameter-dictionary-legacy
Architecture: any
Depends: ${misc:Depends}, freediameter-common (= ${binary:Version}), libxml2
Description: Legacy XML dictionary files support.
This freeDiameter extension allows the use of XML dictionary
files with the freeDiameter framework. Please note that
dictionaries provided as XML files come with less features
than native binary format, so the later should be preferred
when possible.
.
In order to use this extension, your main freeDiameter
configuration file must contain a LoadExtension directive.
See freeDiameter documentation for more details.
.
This extension requires a configuration file. See
dict_legacy_xml.conf.sample for documentation.
Package: freediameter-radius-gateway
Architecture: any
Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version})
Suggests: freediameter-dictionary-rfc4072 (= ${binary:Version}), freediameter-dictionary-rfc4740 (= ${binary:Version})
Description: RADIUS/Diameter extensible gateway.
This freeDiameter extension implements a RADIUS to Diameter
gateway. It allows a RADIUS client to connect to a Diameter
server.
.
The support for specific Diameter applications and/or RADIUS
extensions is provided in the gateway by the use of plugins.
Currently, the following plugins are available:
- echodrop.rgwx : drop or echo a RADIUS attribute.
The attribute is not converted to Diameter.
See echodrop.rgwx.conf.sample for details.
- auth.rgwx : Convert Access-Request to Diameter AAR or DER.
Requests For Comments: RADIUS: 2865, 3162, 2868,
2869, 3579; Diameter: 4005, 4072.
Requires freediameter-dictionary-rfc4072.
- sip.rgwx : Convert Access-Request to Diameter SIP messages.
Requests For Comments: Diameter: 4740.
Requires freediameter-dictionary-rfc4740.
- acct.rgwx : Converts Accounting-Request (2866) to Diameter
ACR (3588).
Requires freediameter-dictionary-rfc4072.
.
In order to use this extension, your main freeDiameter
configuration file must contain a LoadExtension directive.
See freeDiameter documentation for more details.
.
This extension requires a configuration file.
See app_radgw.conf.sample for more details.
Package: freediameter-accounting-server
Architecture: any
Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version}), libpq5
Suggests: freediameter-dictionary-rfc4072
Description: freeDiameter simple Accounting server.
This freeDiameter extension implements the Diameter Base
Accounting application. It saves the accounting records
in a PostgreSQL database backend in a highly configurable
maneer.
.
In order to use this extension, your main freeDiameter
configuration file must contain a LoadExtension directive.
See freeDiameter documentation for more details.
.
This extension requires a configuration file.
See app_acct.conf.sample for more details.
.
You may find some useful resources to parse the saved records
in the contrib/app_acct_tools folder in source package.
Package: freediameter-eap-server
Architecture: any
Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version}), libmysqlclient16 | libmysqlclient18, freediameter-dictionary-rfc4072 (= ${binary:Version})
Description: freeDiameter Diameter EAP server implementation.
This freeDiameter extension implements a Diameter EAP server.
It supports EAP-MD5 and EAP-TLS methods currently.
.
In order to use this extension, your main freeDiameter
configuration file must contain a LoadExtension directive.
See freeDiameter documentation for more details.
.
This extension requires a configuration file.
See app_diameap.conf.sample and
http://diameap.yagami.freediameter.net for more details.
Package: freediameter-sip-server
Architecture: any
Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version}), libmysqlclient16 | libmysqlclient18, freediameter-dictionary-rfc4740 (= ${binary:Version})
Description: freeDiameter Diameter SIP server implementation.
This freeDiameter extension implements a prototype
Diameter SIP server.
See http://www.freediameter.net/trac/wiki/app_sip.fdx for
status information.
.
In order to use this extension, your main freeDiameter
configuration file must contain a LoadExtension directive.
See freeDiameter documentation for more details.
.
This extension requires a configuration file.
See app_sip.conf.sample for more details.

View File

@ -1,35 +0,0 @@
Format-Specification: http://dep.debian.net/deps/dep5/
Name: freeDiameter
Maintainer: Sebastien Decugis <sdecugis@freediameter.net>
Source: http://www.freediameter.net
Files: *
Copyright: 2008-2011, WIDE Project and NICT.
License: BSD
Redistribution and use of this software in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
.
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
.
* Neither the name of the WIDE Project or NICT nor the
names of its contributors may be used to endorse or
promote products derived from this software without
specific prior written permission of WIDE Project and
NICT.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1 +0,0 @@
etc/freeDiameter/

View File

@ -1,3 +0,0 @@
INSTALL*
LICENSE
README

View File

@ -1 +0,0 @@
usr/lib/freeDiameter/app_acct.fdx

View File

@ -1,5 +0,0 @@
doc/freediameter.conf.sample
doc/acl_wl.conf.sample
doc/rt_default.conf.sample
doc/rt_ereg.conf.sample
doc/single_host

View File

@ -1,6 +0,0 @@
usr/lib/libfdproto.so*
usr/lib/libfdcore.so*
usr/lib/freeDiameter/acl_wl.fdx
usr/lib/freeDiameter/rt_default.fdx
usr/lib/freeDiameter/rt_ereg.fdx
usr/lib/freeDiameter/dbg_monitor.fdx

View File

@ -1,7 +0,0 @@
# Defaults for freediameter initscript
# sourced by /etc/init.d/freediameter
# installed at /etc/default/freediameter by the maintainer scripts
# Additional options that are passed to the Daemon.
# See "freeDiameterd --help" for supported flags.
DAEMON_OPTS=""

View File

@ -1,160 +0,0 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: freediameter
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Short-Description: Start freeDiameter daemon at boot time
# Description: Start the freeDiameter daemon at boot time.
# freeDiameter is an extensible implementation of the Diameter protocol,
# designed for Authentication, Authorization and Accounting. Diameter is
# an evolution of the RADIUS protocol.
### END INIT INFO#
DAEMON=/usr/bin/freeDiameterd
CONF=/etc/freeDiameter/freeDiameter.conf
NAME=freediameter
DESC="freeDiameter daemon"
test -x $DAEMON || exit 0
LOGDIR=/var/log/freediameter
PIDFILE=/var/run/$NAME.pid
DODTIME=30 # Time to wait for the server to die, in seconds
# The value is high because we wait for STA answers
# before disconnecting the peers.
# Include freediameter defaults if available
if [ -f /etc/default/freediameter ] ; then
. /etc/default/freediameter
fi
test x"" != x$DAEMON_OPTS || test -f $CONF || exit 0
set -e
running_pid()
{
# Check if a given process pid's cmdline matches a given name
pid=$1
name=$2
[ -z "$pid" ] && return 1
[ ! -d /proc/$pid ] && return 1
cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
# Is this the expected child?
[ "$cmd" != "$name" ] && return 1
return 0
}
running()
{
# Check if the process is running looking at /proc
# (works for all users)
# No pidfile, probably no daemon present
[ ! -f "$PIDFILE" ] && return 1
# Obtain the pid and check it against the binary name
pid=`cat $PIDFILE`
running_pid $pid $DAEMON || return 1
return 0
}
force_stop() {
# Forcefully kill the process
[ ! -f "$PIDFILE" ] && return
if running ; then
kill -15 $pid
# Is it really dead?
[ -n "$DODTIME" ] && sleep "$DODTIME"s
if running ; then
kill -9 $pid
[ -n "$DODTIME" ] && sleep "$DODTIME"s
if running ; then
echo "Cannot kill $LABEL (pid=$pid)!"
exit 1
fi
fi
fi
rm -f $PIDFILE
return 0
}
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $DAEMON_OPTS
if running ; then
echo "$NAME."
else
echo " ERROR."
fi
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
echo "$NAME."
;;
force-stop)
echo -n "Forcefully stopping $DESC: "
force_stop
if ! running ; then
echo "$NAME."
else
echo " ERROR."
fi
;;
#reload)
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo "Reloading $DESC configuration files."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
#;;
force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart" except that it does nothing if the
# daemon isn't already running.
# check wether $DAEMON is running. If so, restart
start-stop-daemon --stop --test --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON \
&& $0 restart \
|| exit 0
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
[ -n "$DODTIME" ] && sleep $DODTIME
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
status)
echo -n "$LABEL is "
if running ; then
echo "running"
else
echo " not running."
exit 1
fi
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
exit 1
;;
esac
exit 0

View File

@ -1 +0,0 @@
usr/bin/freeDiameterd*

View File

@ -1,3 +0,0 @@
doc/test_app.conf.sample
doc/test_netemul.conf.sample
doc/dbg_interactive.py.sample

View File

@ -1,5 +0,0 @@
usr/lib/freeDiameter/dbg_rt.fdx
usr/lib/freeDiameter/test_app.fdx
usr/lib/freeDiameter/test_sip.fdx
usr/lib/freeDiameter/test_netemul.fdx
usr/lib/freeDiameter/dbg_interactive.fdx

View File

@ -1 +0,0 @@
usr/include/freeDiameter/*

View File

@ -1,2 +0,0 @@
doc/dict_legacy_xml.conf.sample
contrib/dict_legacy/dictionary.dtd

View File

@ -1 +0,0 @@
usr/lib/freeDiameter/dict_legacy_xml.fdx

View File

@ -1,4 +0,0 @@
usr/lib/freeDiameter/dict_nas_mipv6.fdx
usr/lib/freeDiameter/dict_mip6i.fdx
usr/lib/freeDiameter/dict_mip6a.fdx
usr/lib/freeDiameter/dict_rfc5777.fdx

Some files were not shown because too many files have changed in this diff Show More