├── contrib ├── debian │ ├── compat │ ├── dirs │ ├── docs │ ├── freediameter-daemon.install │ ├── freediameter-dev.install │ ├── freediameter-accounting-server.examples │ ├── freediameter-accounting-server.install │ ├── freediameter-dictionary-rfc4006.install │ ├── freediameter-dictionary-rfc4072.install │ ├── freediameter-dictionary-rfc4740.install │ ├── freediameter-dictionary-legacy.install │ ├── freediameter-dictionary-rfc4005.install │ ├── freediameter-eap-server.install │ ├── freediameter-radius-gateway.examples │ ├── freediameter-eap-server.examples │ ├── freediameter-radius-gateway.install │ ├── freediameter-dictionary-legacy.examples │ ├── freediameter-debug-tools.examples │ ├── freediameter-sip-server.examples │ ├── freediameter-sip-server.install │ ├── update_changelog.txt │ ├── freediameter-common.examples │ ├── freediameter-dictionary-mip6.install │ ├── freediameter-debug-tools.install │ ├── freediameter-common.install │ ├── freediameter-daemon.default │ ├── rules │ └── copyright ├── nightly_tests │ ├── alldefault.conf │ ├── idnaignore.conf │ ├── idnareject.conf │ ├── nosctp.conf │ ├── tests.list │ ├── prereqs.ubuntu │ ├── cronjob.sh │ ├── prereqs.freebsd │ ├── allext.conf │ ├── allextrel.conf │ ├── allextdeb.conf │ ├── allextmax.conf │ ├── allextdbg.conf │ ├── allextprof.conf │ ├── allextval.conf │ ├── prereqs.opensuse │ └── prereqs.fedora ├── wireshark │ ├── sample │ │ ├── capture.cap │ │ ├── 192.168.103.10.priv.pem │ │ ├── 192.168.103.20.priv.pem │ │ └── README │ └── HOWTO ├── dict_gx │ └── README ├── dict_dcca │ └── README ├── test_Gx │ ├── readme.txt │ └── CMakeLists.txt ├── RPM │ ├── build_rpm.txt │ └── freeDiameter.spec ├── CxDx │ └── README ├── tools │ ├── grep_fd_dict_dump │ ├── org_to_csv │ └── README ├── dict_legacy │ ├── README │ └── dictionary.dtd ├── OpenWRT │ ├── test_required │ │ ├── Makefile │ │ └── testcase.c │ ├── packages │ │ └── freeDiameter │ │ │ └── patches │ │ │ └── 01-freeDiameter-OpenWRT.patch │ └── others │ │ └── D-Link_DIR-330_netconfig.patch ├── update_copyright.sh ├── app_acct_tools │ ├── app_acct.conf │ └── README └── README ├── doc ├── single_host │ ├── test_app1.conf │ ├── test_app2.conf │ ├── freeDiameter-2.conf │ ├── freeDiameter-1.conf │ └── make_certs.sh ├── test_sip.conf.sample ├── eap_tls_plugin.diameap.conf.sample ├── rt_deny_by_size.conf.sample ├── dbg_loglevel.conf.sample ├── app_sip_SL.sql ├── dict_json.json.sample ├── app_sip.conf.sample ├── dict_legacy_xml.conf.sample ├── rt_rewrite.conf.sample ├── acl_wl.conf.sample ├── rt_ereg.conf.sample ├── echodrop.rgwx.conf.sample ├── app_diameap.conf.sample ├── rt_busypeers.conf.sample ├── test_netemul.conf.sample └── test_app.conf.sample ├── INSTALL.OpenWRT ├── extensions ├── app_diameap │ ├── plugins │ │ ├── eap_md5 │ │ │ └── CMakeLists.txt │ │ ├── eap_identity │ │ │ └── CMakeLists.txt │ │ ├── eap_tls │ │ │ ├── CMakeLists.txt │ │ │ └── eap_tls.h │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── LICENSE │ ├── libcrypt.h │ ├── libcrypt.c │ ├── diameap_mysql.h │ └── diameap_plugins.h ├── dbg_msg_dumps │ └── CMakeLists.txt ├── dbg_monitor │ └── CMakeLists.txt ├── test_as │ └── CMakeLists.txt ├── test_cc │ └── CMakeLists.txt ├── test_acct │ └── CMakeLists.txt ├── dbg_dict_dump │ └── CMakeLists.txt ├── dbg_rt │ └── CMakeLists.txt ├── dbg_msg_timings │ └── CMakeLists.txt ├── test_ccload │ └── CMakeLists.txt ├── test_rt_any │ └── CMakeLists.txt ├── dict_eap │ └── CMakeLists.txt ├── dict_sip │ └── CMakeLists.txt ├── dict_mip6a │ └── CMakeLists.txt ├── dict_mip6i │ └── CMakeLists.txt ├── dict_nasreq │ └── CMakeLists.txt ├── dict_nas_mipv6 │ └── CMakeLists.txt ├── dict_dcca │ └── CMakeLists.txt ├── _sample │ ├── CMakeLists.txt │ ├── fini.c │ └── hello.cpp ├── app_sip │ ├── tools │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── md5.h │ └── README ├── dict_rfc5777 │ └── CMakeLists.txt ├── dict_dcca_3gpp │ └── CMakeLists.txt ├── dict_dcca_starent │ ├── CMakeLists.txt │ └── dict_dcca_starent.csv ├── rt_redirect │ └── CMakeLists.txt ├── rt_ignore_dh │ └── CMakeLists.txt ├── rt_randomize │ └── CMakeLists.txt ├── rt_load_balance │ └── CMakeLists.txt ├── dbg_dict_dump_json │ └── CMakeLists.txt ├── test_app │ └── CMakeLists.txt ├── test_sip │ ├── CMakeLists.txt │ └── registrationtermination.c ├── acl_wl │ ├── CMakeLists.txt │ └── acl_wl.h ├── dbg_loglevel │ ├── CMakeLists.txt │ └── dbg_loglevel.h ├── rt_rewrite │ └── CMakeLists.txt ├── rt_busypeers │ ├── CMakeLists.txt │ └── rtbusy.h ├── rt_deny_by_size │ ├── CMakeLists.txt │ └── rt_deny_by_size.h ├── app_acct │ └── CMakeLists.txt ├── dict_legacy_xml │ ├── CMakeLists.txt │ ├── dict_lxml.c │ └── dict_lxml.h ├── test_netemul │ ├── CMakeLists.txt │ └── test_netemul.h ├── app_redirect │ ├── CMakeLists.txt │ └── ard-host.h.in ├── rt_ereg │ └── CMakeLists.txt ├── rt_default │ ├── CMakeLists.txt │ └── rt_default-host.h.in ├── app_radgw │ └── md5.h ├── dict_json │ └── CMakeLists.txt └── dbg_interactive │ └── CMakeLists.txt ├── include └── freeDiameter │ └── version.h.in ├── NEWS ├── CTestConfig.cmake ├── INSTALL.pkgsrc ├── freeDiameterd └── CMakeLists.txt ├── cmake └── Modules │ ├── GetVersionWithHg.cmake │ ├── FindGcrypt.cmake │ ├── FindPostgreSQL.cmake │ ├── FindIDNA.cmake │ ├── FindSCTP.cmake │ ├── FindMySQL.cmake │ ├── CMakeUserUseFlex.cmake │ ├── FindLibXml2.cmake │ ├── FindGnuTLS.cmake │ └── CMakeUserUseBison.cmake ├── INSTALL.OpenSUSE ├── INSTALL.Fedora ├── libfdproto ├── CMakeLists.txt ├── version.c └── portability.c ├── INSTALL ├── libfdcore ├── CMakeLists.txt └── version.c ├── README ├── LICENSE └── INSTALL.OSX /contrib/debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /doc/single_host/test_app1.conf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/single_host/test_app2.conf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contrib/debian/dirs: -------------------------------------------------------------------------------- 1 | etc/freeDiameter/ 2 | -------------------------------------------------------------------------------- /contrib/debian/docs: -------------------------------------------------------------------------------- 1 | INSTALL* 2 | LICENSE 3 | README 4 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-daemon.install: -------------------------------------------------------------------------------- 1 | usr/bin/freeDiameterd* 2 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/freeDiameter/* 2 | -------------------------------------------------------------------------------- /contrib/nightly_tests/alldefault.conf: -------------------------------------------------------------------------------- 1 | 2 | set(CTEST_BUILD_NAME "Default") 3 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-accounting-server.examples: -------------------------------------------------------------------------------- 1 | doc/app_acct.conf.sample 2 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-accounting-server.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/app_acct.fdx 2 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-dictionary-rfc4006.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/dict_dcca.fdx 2 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-dictionary-rfc4072.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/dict_eap.fdx 2 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-dictionary-rfc4740.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/dict_sip.fdx 2 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-dictionary-legacy.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/dict_legacy_xml.fdx 2 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-dictionary-rfc4005.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/dict_nasreq.fdx 2 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-eap-server.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/app_diameap.fdx 2 | usr/lib/freeDiameter/*.emp 3 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-radius-gateway.examples: -------------------------------------------------------------------------------- 1 | doc/app_radgw.conf.sample 2 | doc/echodrop.rgwx.conf.sample 3 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-eap-server.examples: -------------------------------------------------------------------------------- 1 | doc/app_diameap.conf.sample 2 | doc/eap_tls_plugin.diameap.conf.sample 3 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-radius-gateway.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/app_radgw.fdx 2 | usr/lib/freeDiameter/*.rgwx 3 | -------------------------------------------------------------------------------- /contrib/wireshark/sample/capture.cap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open5gs/freeDiameter/HEAD/contrib/wireshark/sample/capture.cap -------------------------------------------------------------------------------- /contrib/debian/freediameter-dictionary-legacy.examples: -------------------------------------------------------------------------------- 1 | doc/dict_legacy_xml.conf.sample 2 | contrib/dict_legacy/dictionary.dtd 3 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-debug-tools.examples: -------------------------------------------------------------------------------- 1 | doc/test_app.conf.sample 2 | doc/test_netemul.conf.sample 3 | doc/dbg_interactive.py.sample 4 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-sip-server.examples: -------------------------------------------------------------------------------- 1 | doc/app_sip.conf.sample 2 | doc/app_sip.sql 3 | doc/app_sip_SL.sql 4 | doc/test_sip.conf.sample 5 | -------------------------------------------------------------------------------- /INSTALL.OpenWRT: -------------------------------------------------------------------------------- 1 | There is a package script available for the OpenWRT platform. 2 | 3 | Please refer to contrib/OpenWRT/HOWTO for more information. 4 | -------------------------------------------------------------------------------- /contrib/dict_gx/README: -------------------------------------------------------------------------------- 1 | File sent to the mailing-list by German Barros . 2 | To be used with the dict_legacy_xml extension. 3 | 4 | -------------------------------------------------------------------------------- /extensions/app_diameap/plugins/eap_md5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # EAP MD5 Plugin 2 | PROJECT("EAP MD5 Plugin" C) 3 | 4 | EAP_ADD_METHOD(eap_md5 eap_md5.c) 5 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-sip-server.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/app_sip.fdx 2 | usr/share/doc/freeDiameter-sip-server/* 3 | usr/bin/freediameter-sip-* 4 | -------------------------------------------------------------------------------- /contrib/debian/update_changelog.txt: -------------------------------------------------------------------------------- 1 | new release: dch -v 1.0.3 -D UNRELEASED --release-heuristic log 2 | Simple addition: dch "changelog entry text" 3 | 4 | -------------------------------------------------------------------------------- /contrib/nightly_tests/idnaignore.conf: -------------------------------------------------------------------------------- 1 | 2 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DDIAMID_IDNA_IGNORE:BOOL=ON") 3 | 4 | set(CTEST_BUILD_NAME "IDNA Ignore") 5 | -------------------------------------------------------------------------------- /contrib/nightly_tests/idnareject.conf: -------------------------------------------------------------------------------- 1 | 2 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DDIAMID_IDNA_REJECT:BOOL=ON") 3 | 4 | set(CTEST_BUILD_NAME "IDNA Reject") 5 | -------------------------------------------------------------------------------- /extensions/app_diameap/plugins/eap_identity/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # EAP Identity plugin 2 | PROJECT("EAP Identity Plugin" C) 3 | 4 | EAP_ADD_METHOD(eap_identity eap_identity.c) 5 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-common.examples: -------------------------------------------------------------------------------- 1 | doc/freediameter.conf.sample 2 | doc/acl_wl.conf.sample 3 | doc/rt_default.conf.sample 4 | doc/rt_ereg.conf.sample 5 | doc/single_host 6 | -------------------------------------------------------------------------------- /contrib/nightly_tests/nosctp.conf: -------------------------------------------------------------------------------- 1 | 2 | # Remove SCTP support at compilation 3 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DDISABLE_SCTP:BOOL=ON") 4 | 5 | set(CTEST_BUILD_NAME "No SCTP") 6 | -------------------------------------------------------------------------------- /contrib/nightly_tests/tests.list: -------------------------------------------------------------------------------- 1 | allext 2 | allextdbg 3 | allextval 4 | allextret 5 | allextprof 6 | allextmax 7 | allextdeb 8 | alldefault 9 | nosctp 10 | idnaignore 11 | idnareject 12 | #noext 13 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-dictionary-mip6.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/dict_nas_mipv6.fdx 2 | usr/lib/freeDiameter/dict_mip6i.fdx 3 | usr/lib/freeDiameter/dict_mip6a.fdx 4 | usr/lib/freeDiameter/dict_rfc5777.fdx 5 | -------------------------------------------------------------------------------- /contrib/dict_dcca/README: -------------------------------------------------------------------------------- 1 | Files provided courtesy of Konstantin Chekushin under the same license as freeDiameter. 2 | 3 | Comment: 4 | "They are not full, I've filled only that I wanted to use in our app_dcca module. " 5 | 6 | -------------------------------------------------------------------------------- /include/freeDiameter/version.h.in: -------------------------------------------------------------------------------- 1 | /* Following variable is expended at build time based on the result of "hg id" command */ 2 | #cmakedefine FD_PROJECT_VERSION_HG 3 | #define FD_PROJECT_VERSION_HG_VAL "@FD_PROJECT_VERSION_HG@" 4 | -------------------------------------------------------------------------------- /contrib/nightly_tests/prereqs.ubuntu: -------------------------------------------------------------------------------- 1 | # Packages (Ubuntu names) 2 | cmake mercurial make gcc g++ flex bison binutils libsctp-dev libgnutls-dev valgrind wget libpq-dev postgresql libmysqlclient-dev libxml2-dev libxml2 swig python-dev 3 | 4 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | The digested changelog can be found under: 2 | contrib/debian/changelog 3 | 4 | You can also find the exhaustive list of change using mercurial history, 5 | or at the following URL: http://www.freediameter.net/hg/freeDiameter/shortlog 6 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-debug-tools.install: -------------------------------------------------------------------------------- 1 | usr/lib/freeDiameter/dbg_rt.fdx 2 | usr/lib/freeDiameter/test_app.fdx 3 | usr/lib/freeDiameter/test_sip.fdx 4 | usr/lib/freeDiameter/test_netemul.fdx 5 | usr/lib/freeDiameter/dbg_interactive.fdx 6 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-common.install: -------------------------------------------------------------------------------- 1 | usr/lib/libfdproto.so* 2 | usr/lib/libfdcore.so* 3 | usr/lib/freeDiameter/acl_wl.fdx 4 | usr/lib/freeDiameter/rt_default.fdx 5 | usr/lib/freeDiameter/rt_ereg.fdx 6 | usr/lib/freeDiameter/dbg_monitor.fdx 7 | -------------------------------------------------------------------------------- /contrib/test_Gx/readme.txt: -------------------------------------------------------------------------------- 1 | This content was contributed by Krishnan Srinivasan from Allot Communication. 2 | 3 | The dictionary entries may need some adjustments to 4 | match the content of the dict_dcca_3gpp extension. 5 | 6 | Thank you Krishnan! 7 | -------------------------------------------------------------------------------- /doc/test_sip.conf.sample: -------------------------------------------------------------------------------- 1 | #User configuration 2 | username = "awestfahl" 3 | password = "test" 4 | sip_aor = "sip:awestfahl@tera.ics.keio.ac.jp" 5 | 6 | #Destination information 7 | destination_realm = "freediameter.net" 8 | destination_sip = "sip:awestfahl@freediameter.net" 9 | -------------------------------------------------------------------------------- /extensions/dbg_msg_dumps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROJECT("Messages dump extension" C) 2 | FD_ADD_EXTENSION(dbg_msg_dumps dbg_msg_dumps.c) 3 | 4 | 5 | #### 6 | ## INSTALL section ## 7 | 8 | INSTALL(TARGETS dbg_msg_dumps 9 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 10 | COMPONENT freeDiameter-debug-tools) 11 | 12 | -------------------------------------------------------------------------------- /contrib/debian/freediameter-daemon.default: -------------------------------------------------------------------------------- 1 | # Defaults for freediameter initscript 2 | # sourced by /etc/init.d/freediameter 3 | # installed at /etc/default/freediameter by the maintainer scripts 4 | 5 | # Additional options that are passed to the Daemon. 6 | # See "freeDiameterd --help" for supported flags. 7 | DAEMON_OPTS="" 8 | -------------------------------------------------------------------------------- /extensions/dbg_monitor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Monitoring extension 2 | PROJECT("Monitor extension" C) 3 | FD_ADD_EXTENSION(dbg_monitor dbg_monitor.c) 4 | 5 | 6 | #### 7 | ## INSTALL section ## 8 | 9 | INSTALL(TARGETS dbg_monitor 10 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 11 | COMPONENT freeDiameter-debug-tools) 12 | 13 | -------------------------------------------------------------------------------- /extensions/test_as/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The test_as extension 2 | PROJECT("Abort Session dummy server" C) 3 | 4 | FD_ADD_EXTENSION(test_as test_as.c) 5 | 6 | 7 | #### 8 | ## INSTALL section ## 9 | 10 | INSTALL(TARGETS test_as 11 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 12 | COMPONENT freeDiameter-debug-tools) 13 | 14 | -------------------------------------------------------------------------------- /extensions/test_cc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The test_cc extension 2 | PROJECT("Credit Control dummy server" C) 3 | 4 | FD_ADD_EXTENSION(test_cc test_cc.c) 5 | 6 | 7 | #### 8 | ## INSTALL section ## 9 | 10 | INSTALL(TARGETS test_cc 11 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 12 | COMPONENT freeDiameter-debug-tools) 13 | 14 | -------------------------------------------------------------------------------- /extensions/test_acct/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The test_acct extension 2 | PROJECT("Accounting dummy server" C) 3 | 4 | FD_ADD_EXTENSION(test_acct test_acct.c) 5 | 6 | 7 | #### 8 | ## INSTALL section ## 9 | 10 | INSTALL(TARGETS test_acct 11 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 12 | COMPONENT freeDiameter-debug-tools) 13 | 14 | -------------------------------------------------------------------------------- /extensions/dbg_dict_dump/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Dictionary dump extension 2 | PROJECT("Dictionary dump extension" C) 3 | FD_ADD_EXTENSION(dbg_dict_dump dbg_dict_dump.c) 4 | 5 | 6 | #### 7 | ## INSTALL section ## 8 | 9 | INSTALL(TARGETS dbg_dict_dump 10 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 11 | COMPONENT freeDiameter-debug-tools) 12 | 13 | -------------------------------------------------------------------------------- /contrib/nightly_tests/cronjob.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script will simply retrieve the latest "runtest" script and run it. 4 | pushd ~/fDtests 5 | mv -f runtests.sh runtests.sh.prev 6 | wget "http://www.freediameter.net/hg/freeDiameter/raw-file/tip/contrib/nightly_tests/runtests.sh" 7 | chmod +x runtests.sh 8 | popd 9 | ~/fDtests/runtests.sh 10 | -------------------------------------------------------------------------------- /extensions/dbg_rt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_debug extension 2 | PROJECT("Routing module debug extension" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dbg_rt dbg_rt.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dbg_rt 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-debug-tools) 14 | -------------------------------------------------------------------------------- /extensions/dbg_msg_timings/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Messages timing extension 2 | PROJECT("Messages timing extension" C) 3 | FD_ADD_EXTENSION(dbg_msg_timings dbg_msg_timings.c) 4 | 5 | 6 | #### 7 | ## INSTALL section ## 8 | 9 | INSTALL(TARGETS dbg_msg_timings 10 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 11 | COMPONENT freeDiameter-debug-tools) 12 | 13 | -------------------------------------------------------------------------------- /extensions/test_ccload/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The test_ccload extension 2 | PROJECT("Credit Control load generator server" C) 3 | 4 | FD_ADD_EXTENSION(test_ccload test_ccload.c) 5 | 6 | 7 | #### 8 | ## INSTALL section ## 9 | 10 | INSTALL(TARGETS test_ccload 11 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 12 | COMPONENT freeDiameter-debug-tools) 13 | 14 | -------------------------------------------------------------------------------- /contrib/test_Gx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_nasreq extension 2 | PROJECT("Gx Interface for freediameter" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(app_gx main_gx.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS app_gx 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-rx-interface) 14 | -------------------------------------------------------------------------------- /doc/eap_tls_plugin.diameap.conf.sample: -------------------------------------------------------------------------------- 1 | #### a sample configuration file for EAP-TLS 2 | 3 | #Certificate and Private key files 4 | #Cred = "" : ""; 5 | 6 | #CA file 7 | #CA = ""; 8 | 9 | #CRL file 10 | #CRL = ""; 11 | 12 | #Enable/disable checking certificate's CN 13 | check_cert_cn_username = 1; 14 | -------------------------------------------------------------------------------- /extensions/test_rt_any/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The test_rt_any extension 2 | PROJECT("Random routing extension (for tests)" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(test_rt_any test_rt_any.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS test_rt_any 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-debug-tools) 14 | -------------------------------------------------------------------------------- /extensions/dict_eap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_eap extension 2 | PROJECT("Diameter EAP (RFC4072) dictionary definitions" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_eap dict_eap.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_eap 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-RFC4072) 14 | -------------------------------------------------------------------------------- /extensions/dict_sip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_sip extension 2 | PROJECT("Diameter SIP (RFC4740) dictionary definitions" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_sip dict_sip.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_sip 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-RFC4740) 14 | -------------------------------------------------------------------------------- /contrib/RPM/build_rpm.txt: -------------------------------------------------------------------------------- 1 | [krum@ThinkPad DelMe]$ cp freeDiameter.spec /home/krum/rpmbuild/SPECS/ 2 | [krum@ThinkPad DelMe]$ cd /home/krum/rpmbuild/SOURCES/ 3 | [krum@ThinkPad ~]$ cd /home/krum/rpmbuild/SOURCES/ 4 | [krum@ThinkPad SOURCES]$ wget http://www.freediameter.net/hg/freeDiameter/archive/1.1.6.tar.gz 5 | [krum@ThinkPad SOURCES]$ cd ../SPECS/ 6 | [krum@ThinkPad SPECS]$ rpmbuild -ba freeDiameter.spec 7 | -------------------------------------------------------------------------------- /extensions/dict_mip6a/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_mip6a extension 2 | PROJECT("Diameter Mobile IPv6 Auth (MIP6A) Dictionary Definitions" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_mip6a dict_mip6a.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_mip6a 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-mip6) 14 | -------------------------------------------------------------------------------- /extensions/dict_mip6i/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_mip6i extension 2 | PROJECT("Diameter Mobile IPv6 IKE (MIP6I) Dictionary Definition" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_mip6i dict_mip6i.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_mip6i 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-mip6) 14 | -------------------------------------------------------------------------------- /extensions/dict_nasreq/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_nasreq extension 2 | PROJECT("Diameter NASREQ (RFC4005) dictionary definitions" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_nasreq dict_nasreq.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_nasreq 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-RFC4005) 14 | -------------------------------------------------------------------------------- /CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | # Configuration for sumitting the test result. 2 | # Check http://www.freediameter.net/CDash for detail. 3 | 4 | set(CTEST_PROJECT_NAME "freeDiameter") 5 | set(CTEST_NIGHTLY_START_TIME "00:00:00 JST") 6 | 7 | set(CTEST_DROP_METHOD "http") 8 | set(CTEST_DROP_SITE "www.freediameter.net") 9 | set(CTEST_DROP_LOCATION "/CDash/submit.php?project=freeDiameter") 10 | set(CTEST_DROP_SITE_CDASH TRUE) 11 | -------------------------------------------------------------------------------- /extensions/dict_nas_mipv6/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_nas_mipv6 extension 2 | PROJECT("MIPv6 NAS-to-HAAA Interaction Dictionary Definition" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_nas_mipv6 dict_nas_mipv6.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_nas_mipv6 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-mip6) 14 | -------------------------------------------------------------------------------- /extensions/dict_dcca/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_dcca extension 2 | PROJECT("Diameter DCCA (Diameter Credit Control Application ) dictionary definitions" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_dcca dict_dcca.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_dcca 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-rfc4006) 14 | -------------------------------------------------------------------------------- /extensions/_sample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The sample extension 2 | PROJECT("Sample extension") 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dbg_sample sample.c hello.cpp fini.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | # Uncomment the following lines to have the extension installed 12 | # INSTALL(TARGETS dbg_sample 13 | # LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 14 | # COMPONENT freeDiameter-debug-tools) 15 | -------------------------------------------------------------------------------- /doc/single_host/freeDiameter-2.conf: -------------------------------------------------------------------------------- 1 | # -------- Test configuration --------- 2 | 3 | Identity = "peer2.localdomain"; 4 | Realm = "localdomain"; 5 | Port = 30868; 6 | SecPort = 30869; 7 | 8 | TLS_Cred = "peer2.cert.pem", 9 | "peer2.key.pem"; 10 | TLS_CA = "cacert.pem"; 11 | 12 | LoadExtension = "extensions/test_app.fdx" : "test_app2.conf"; 13 | 14 | ConnectPeer = "peer1.localdomain" { ConnectTo = "127.0.0.1"; No_TLS; }; 15 | 16 | -------------------------------------------------------------------------------- /extensions/app_sip/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Utilities for app_sip 2 | PROJECT("Diameter SIP Application (RFC4740) tools" C) 3 | 4 | ADD_EXECUTABLE(freediameter-sip-rtr app_sip_rtr.c) 5 | ADD_EXECUTABLE(freediameter-sip-ppr app_sip_ppr.c) 6 | 7 | #### 8 | ## INSTALL section ## 9 | 10 | INSTALL(TARGETS freediameter-sip-rtr freediameter-sip-ppr 11 | RUNTIME DESTINATION ${INSTALL_DAEMON_SUFFIX} 12 | COMPONENT freeDiameter-sip-server) 13 | -------------------------------------------------------------------------------- /contrib/nightly_tests/prereqs.freebsd: -------------------------------------------------------------------------------- 1 | # 1: install base system and ports 2 | # 2: install wget with command: pkg_add -r -v wget 3 | # Finally, install the other packages from this file 4 | # pkg_add -r -F -v `wget http://www.freediameter.net/hg/freeDiameter/raw-file/tip/contrib/nightly_tests/prereqs.freebsd -O - | grep -v -e "^#"` 5 | bash cmake mercurial flex bison libgcrypt gnutls postgresql84-client postgresql84-server mysql50-client libxml2 swig 6 | -------------------------------------------------------------------------------- /extensions/dict_rfc5777/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_rfc5777 extension 2 | PROJECT("Traffic Classification and Quality of Service (QoS) Attributes for Diameter (RFC 5777)" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_rfc5777 dict_rfc5777.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_rfc5777 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-RFC5777) 14 | -------------------------------------------------------------------------------- /contrib/CxDx/README: -------------------------------------------------------------------------------- 1 | Date: Thu, 13 Oct 2011 14:01:40 -0300 2 | From: "Norberto R. de Goes Jr." 3 | To: help@freediameter.net 4 | Subject: [Help] Cx dictionary (samples "c" and "xml") 5 | 6 | Hi. 7 | 8 | Just a contribution, they were not tested. 9 | Best regards, 10 | 11 | -- 12 | Norberto R. de Goes Jr. 13 | CPqD - DRC 14 | Tel.: +55 19 3705-4241 / Fax: +55 19 3705-6125 15 | norberto@cpqd.com.br 16 | www.cpqd.com.br 17 | 18 | -------------------------------------------------------------------------------- /contrib/tools/grep_fd_dict_dump: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Grep stdin for the output of fd_dict_dump() and reformat to remove 4 | # pointer addresses. Use to post-process the output of dict_dump.fdx 5 | # into a format that's diff-able between freeDiameter invocations. 6 | 7 | egrep '^ *{dict|VENDOR|APPLICATION|TYPE|ENUMVAL|AVP|COMMAND|RULE' \ 8 | | sed \ 9 | -e 's/{dict.*}(@0x[^ ]*): //' \ 10 | -e 's/{dict(0x[^ ]*) : \(.*\)}/\1/' \ 11 | -e 's/p:[^ ]* //' 12 | -------------------------------------------------------------------------------- /doc/single_host/freeDiameter-1.conf: -------------------------------------------------------------------------------- 1 | 2 | # -------- Test configuration --------- 3 | 4 | Identity = "peer1.localdomain"; 5 | Realm = "localdomain"; 6 | # Port = 3868; 7 | # SecPort = 3869; 8 | 9 | TLS_Cred = "peer1.cert.pem", 10 | "peer1.key.pem"; 11 | TLS_CA = "cacert.pem"; 12 | 13 | LoadExtension = "extensions/test_app.fdx" : "test_app1.conf"; 14 | 15 | ConnectPeer = "peer2.localdomain" { ConnectTo = "127.0.0.1"; No_TLS; port = 30868; }; 16 | 17 | -------------------------------------------------------------------------------- /extensions/dict_dcca_3gpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_dcca_3gpp extension 2 | PROJECT("Diameter DCCA (Diameter Credit Control Application) 3GPP dictionary definitions" C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_dcca_3gpp dict_dcca_3gpp.c add_avps.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_dcca_3gpp 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-rfc4006-extension-3gpp) 14 | -------------------------------------------------------------------------------- /contrib/tools/org_to_csv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Convert |-separated 11-column .org files to CSV, 5 | with first and last empty columns ignored. 6 | """ 7 | 8 | import csv 9 | import fileinput 10 | import re 11 | import sys 12 | 13 | csvout = csv.writer(sys.stdout) 14 | for line in fileinput.input(): 15 | row = re.split(r'\s*\|\s*', line) 16 | row.extend([''] * (10 - len(row))) 17 | csvout.writerow(row[1:10]) 18 | 19 | # vim: set et sw=4 sts=4 : 20 | -------------------------------------------------------------------------------- /contrib/nightly_tests/allext.conf: -------------------------------------------------------------------------------- 1 | 2 | # This configuration compiles all the extensions. It also performs a coverage test. 3 | # For this to pass, you need to setup the pg database for app_acct test. 4 | 5 | set(CTEST_BUILD_NAME "All extensions (default)") 6 | 7 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DALL_EXTENSIONS:BOOL=ON") 8 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DTEST_APP_ACCT:BOOL=ON -DTEST_APP_ACCT_CONNINFO:STRING=user=test\\ dbname=test") 9 | 10 | -------------------------------------------------------------------------------- /extensions/dict_dcca_starent/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_dcca_starent extension 2 | PROJECT("Diameter DCCA (Diameter Credit Control Application) Starent dictionary definitions " C) 3 | 4 | # Compile as a module 5 | FD_ADD_EXTENSION(dict_dcca_starent dict_dcca_starent.c add_avps.c) 6 | 7 | 8 | #### 9 | ## INSTALL section ## 10 | 11 | INSTALL(TARGETS dict_dcca_starent 12 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 13 | COMPONENT freeDiameter-dictionary-rfc4006-extension-starent) 14 | 15 | -------------------------------------------------------------------------------- /doc/rt_deny_by_size.conf.sample: -------------------------------------------------------------------------------- 1 | # This file contains information for configuring the rt_deny_by_size extension. 2 | # 3 | # The rt_deny_by_size extension returns errors for messages above a particular size. 4 | # 5 | # This extension supports configuration reload at runtime. Send 6 | # signal SIGUSR1 to the process to cause the process to reload its 7 | # config. 8 | # 9 | # Configure the maximum allowed message size to still pass through; 10 | # defaults to 4096, if config file is empty 11 | #MaximumSize=4096; 12 | -------------------------------------------------------------------------------- /extensions/rt_redirect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_redirect extension 2 | PROJECT("Diameter Redirect messages support" C) 3 | 4 | SET(RT_REDIR_SRC 5 | rt_redir.h 6 | rt_redir.c 7 | redir_entries.c 8 | redir_expiry.c 9 | redir_fwd.c 10 | redir_out.c 11 | uthash.h 12 | ) 13 | 14 | # Compile as a module 15 | FD_ADD_EXTENSION(rt_redirect ${RT_REDIR_SRC}) 16 | 17 | 18 | #### 19 | ## INSTALL section ## 20 | 21 | INSTALL(TARGETS rt_redirect 22 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 23 | COMPONENT freeDiameter-daemon) 24 | -------------------------------------------------------------------------------- /doc/dbg_loglevel.conf.sample: -------------------------------------------------------------------------------- 1 | # This file contains information for configuring the dbg_loglevel extension. 2 | # 3 | # The dbg_loglevel extension allows changing the logging level at startup, 4 | # and then changing it at runtime. 5 | # 6 | # This extension supports configuration reload at runtime. Send 7 | # signal SIGUSR1 to the process to cause the process to reload its 8 | # config. 9 | # 10 | # 3 is the default log level (FD_LOG_NOTICE) 11 | # smaller values increase the logging 12 | # bigger values reduce the logging 13 | LogLevel=3; 14 | -------------------------------------------------------------------------------- /extensions/app_diameap/plugins/eap_tls/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The EAP-TLS Plugin 2 | PROJECT("EAP-TLS Plugin" C) 3 | 4 | # Parser for the configuration file 5 | BISON_FILE(eaptls.y) 6 | FLEX_FILE(eaptls.l) 7 | 8 | SET_SOURCE_FILES_PROPERTIES(lex.eaptls.c eaptls.tab.c PROPERTIES COMPILE_FLAGS "-I \"${CMAKE_CURRENT_SOURCE_DIR}\"") 9 | 10 | EAP_ADD_METHOD(eap_tls 11 | eap_tls.c 12 | eap_tls.h 13 | lex.eaptls.c 14 | eaptls.tab.c 15 | eaptls.tab.h 16 | ) 17 | 18 | TARGET_LINK_LIBRARIES(eap_tls ${GNUTLS_LIBRARIES}) 19 | -------------------------------------------------------------------------------- /doc/app_sip_SL.sql: -------------------------------------------------------------------------------- 1 | 2 | 3 | SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; 4 | 5 | -- 6 | -- SUBSCRIBER LOCATOR DATABASE 7 | -- 8 | 9 | -- -------------------------------------------------------- 10 | 11 | -- 12 | -- Table structure for table `ds_sip_aor_map` 13 | -- 14 | 15 | CREATE TABLE IF NOT EXISTS `ds_sip_aor_map` ( 16 | `id_map` int(11) NOT NULL AUTO_INCREMENT, 17 | `sip_aor` varchar(255) NOT NULL, 18 | `diameter_uri` varchar(255) NOT NULL, 19 | PRIMARY KEY (`id_map`) 20 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; 21 | 22 | -------------------------------------------------------------------------------- /contrib/nightly_tests/allextrel.conf: -------------------------------------------------------------------------------- 1 | 2 | # This configuration compiles all the extensions. It also performs a coverage test. 3 | # For this to pass, you need to setup the pg database for app_acct test. 4 | 5 | set(CTEST_BUILD_NAME "All extensions (Release)") 6 | 7 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DALL_EXTENSIONS:BOOL=ON") 8 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DCMAKE_BUILD_TYPE:STRING=Release") 9 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DTEST_APP_ACCT:BOOL=ON -DTEST_APP_ACCT_CONNINFO:STRING=user=test\\ dbname=test") 10 | 11 | -------------------------------------------------------------------------------- /contrib/tools/README: -------------------------------------------------------------------------------- 1 | csv_to_fd converts CSV files containing RADIUS or Diameter AVP tables 2 | into various formats, including freeDiameter C code and JSON documents. 3 | 4 | grep_fd_dict_dump processes stdin for the output of fd_dict_dump() 5 | or dbg_dict_dump.fdx and reformats to remove pointer addresses, 6 | to allow diff of output between freeDiameter invocations. 7 | 8 | org_to_csv converts org files into CSV files, suitable for csv_to_fd. 9 | 10 | org_to_fd.pl converts org files like diameter-rfcs.org to C fragments 11 | that can be included in freeDiameter code. 12 | -------------------------------------------------------------------------------- /contrib/nightly_tests/allextdeb.conf: -------------------------------------------------------------------------------- 1 | 2 | # This configuration compiles all the extensions. It also performs a coverage test. 3 | # For this to pass, you need to setup the pg database for app_acct test. 4 | 5 | set(CTEST_BUILD_NAME "All extensions (DebianPackage)") 6 | 7 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DALL_EXTENSIONS:BOOL=ON") 8 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DCMAKE_BUILD_TYPE:STRING=DebianPackage") 9 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DTEST_APP_ACCT:BOOL=ON -DTEST_APP_ACCT_CONNINFO:STRING=user=test\\ dbname=test") 10 | 11 | -------------------------------------------------------------------------------- /contrib/nightly_tests/allextmax.conf: -------------------------------------------------------------------------------- 1 | 2 | # This configuration compiles all the extensions. It also performs a coverage test. 3 | # For this to pass, you need to setup the pg database for app_acct test. 4 | 5 | set(CTEST_BUILD_NAME "All extensions (MaxPerformance)") 6 | 7 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DALL_EXTENSIONS:BOOL=ON") 8 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DCMAKE_BUILD_TYPE:STRING=MaxPerformance") 9 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DTEST_APP_ACCT:BOOL=ON -DTEST_APP_ACCT_CONNINFO:STRING=user=test\\ dbname=test") 10 | 11 | -------------------------------------------------------------------------------- /contrib/nightly_tests/allextdbg.conf: -------------------------------------------------------------------------------- 1 | 2 | # This configuration compiles all the extensions. It also performs a coverage test. 3 | # For this to pass, you need to setup the pg database for app_acct test. 4 | 5 | set(WITH_COVERAGE TRUE) 6 | set(CTEST_BUILD_NAME "All extensions (Debug)") 7 | 8 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DALL_EXTENSIONS:BOOL=ON") 9 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DCMAKE_BUILD_TYPE:STRING=Debug") 10 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DTEST_APP_ACCT:BOOL=ON -DTEST_APP_ACCT_CONNINFO:STRING=user=test\\ dbname=test") 11 | 12 | -------------------------------------------------------------------------------- /contrib/dict_legacy/README: -------------------------------------------------------------------------------- 1 | The dictionary.dtd file originates from draft-frascone-xml-dictionary-00. 2 | A few modifications may have been performed (see file history in Mercurial) 3 | However, no DTD validation is performed by the parser, but the extension 4 | expects a known format therefore the flexibility is limited. 5 | 6 | 7 | Additional XML dictionary files can be found: 8 | - Circum project (circum.sf.net) 9 | under share/*.xml 10 | 11 | - OpenDiameter project (diameter.sf.net) 12 | under libdiameter/config/dictionary.xml (will probably require some stripping) 13 | 14 | 15 | -------------------------------------------------------------------------------- /contrib/nightly_tests/allextprof.conf: -------------------------------------------------------------------------------- 1 | 2 | # This configuration compiles all the extensions. It also performs a coverage test. 3 | # For this to pass, you need to setup the pg database for app_acct test. 4 | 5 | set(WITH_COVERAGE TRUE) 6 | set(CTEST_BUILD_NAME "All extensions (Profiling)") 7 | 8 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DALL_EXTENSIONS:BOOL=ON") 9 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DCMAKE_BUILD_TYPE:STRING=Profiling") 10 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DTEST_APP_ACCT:BOOL=ON -DTEST_APP_ACCT_CONNINFO:STRING=user=test\\ dbname=test") 11 | 12 | -------------------------------------------------------------------------------- /contrib/nightly_tests/allextval.conf: -------------------------------------------------------------------------------- 1 | 2 | # This configuration compiles all the extensions. It also performs a coverage test. 3 | # For this to pass, you need to setup the pg database for app_acct test. 4 | 5 | set(WITH_COVERAGE TRUE) 6 | set(CTEST_BUILD_NAME "All extensions (DebugValgrind)") 7 | 8 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DALL_EXTENSIONS:BOOL=ON") 9 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DCMAKE_BUILD_TYPE:STRING=DebugValgrind") 10 | set(CTEST_BUILD_OPTIONS "${CTEST_BUILD_OPTIONS} -DTEST_APP_ACCT:BOOL=ON -DTEST_APP_ACCT_CONNINFO:STRING=user=test\\ dbname=test") 11 | 12 | -------------------------------------------------------------------------------- /INSTALL.pkgsrc: -------------------------------------------------------------------------------- 1 | The simplest way to install on NetBSD, DragonFly, MirBSD or other 2 | pkgsrc platforms is: 3 | pkg_add freeDiameter 4 | 5 | If no binary package exists: 6 | cd /usr/pkgsrc/net/freeDiameter 7 | make install 8 | 9 | If you want to build and install freeDiameter from the repository, 10 | you'll need to install: 11 | pkg_add bison pkg-config libidn gnutls libgcrypt mercurial 12 | and follow the usual installation note. 13 | 14 | For the optional extensions, you need mysql*-client, postgres*-client, 15 | libxml2, jsoncpp, and json-schema. For the debugging extensions, 16 | you also need swig and a python -- install as usual. 17 | 18 | -------------------------------------------------------------------------------- /contrib/nightly_tests/prereqs.opensuse: -------------------------------------------------------------------------------- 1 | # OpenSUSE packages names of dependencies for nightly tests (using "zypper install "): 2 | # zypper install `wget http://www.freediameter.net/hg/freeDiameter/raw-file/tip/contrib/nightly_tests/prereqs.opensuse -O - | grep -v -e "^#"` 3 | cmake mercurial make gcc gcc-c++ flex bison lksctp-tools-devel libgnutls-devel libgcrypt-devel 4 | postgresql-server postgresql-devel libmysqlclient-devel libxml2-devel swig python-devel 5 | 6 | # Afterwards, you may need to issue the following command so that postgresql starts at boot: 7 | # insserv postgresql 8 | # or for open Suse 12.x: 9 | # systemctl enable postgresql.service 10 | -------------------------------------------------------------------------------- /extensions/rt_ignore_dh/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_ignore_dh extension 2 | PROJECT("Routing extension that removes Destination-Host from messages and restores from Proxy-Info for answers" C) 3 | 4 | # List of source files 5 | SET(RT_IGNORE_DH_SRC 6 | rt_ignore_dh.c 7 | ) 8 | 9 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 10 | 11 | # Compile these files as a freeDiameter extension 12 | FD_ADD_EXTENSION(rt_ignore_dh ${RT_IGNORE_DH_SRC}) 13 | 14 | #### 15 | ## INSTALL section ## 16 | 17 | # We install with the daemon component because it is a base feature. 18 | INSTALL(TARGETS rt_ignore_dh 19 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 20 | COMPONENT freeDiameter-daemon) 21 | -------------------------------------------------------------------------------- /contrib/nightly_tests/prereqs.fedora: -------------------------------------------------------------------------------- 1 | # Fedora packages names of dependencies for nightly tests (using "yum install "): 2 | cmake make gcc gcc-c++ flex bison gnutls-devel libgcrypt-devel mercurial 3 | lksctp-tools-devel kernel-modules-extra 4 | postgresql-server postgresql-devel 5 | mysql-server mysql-devel 6 | libxml2 libxml2-devel libidn-devel 7 | swig python-devel 8 | 9 | # For postgresql server to start automatically, you may have to issue: 10 | # service postgresql initdb 11 | # chkconfig --level 345 postgresql on 12 | 13 | # To allow SCTP sockets to be bound in SELinux, I don't know the command, 14 | # so let's disable SELinux for the moment: 15 | # setenforce Permissive 16 | -------------------------------------------------------------------------------- /extensions/rt_randomize/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_randomize extension 2 | PROJECT("Routing extension randomly increases the routing count for one of the highest-rated hosts, if there are multiple ones" C) 3 | 4 | # List of source files 5 | SET(RT_RANDOMIZE_SRC 6 | rt_randomize.c 7 | ) 8 | 9 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 10 | 11 | # Compile these files as a freeDiameter extension 12 | FD_ADD_EXTENSION(rt_randomize ${RT_RANDOMIZE_SRC}) 13 | 14 | #### 15 | ## INSTALL section ## 16 | 17 | # We install with the daemon component because it is a base feature. 18 | INSTALL(TARGETS rt_randomize 19 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 20 | COMPONENT freeDiameter-daemon) 21 | -------------------------------------------------------------------------------- /extensions/rt_load_balance/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_load_balance extension 2 | PROJECT("Routing extension splits requests evenly over multiple hosts, using current load as routing indicator" C) 3 | 4 | # List of source files 5 | SET(RT_LOAD_BALANCE_SRC 6 | rt_load_balance.c 7 | ) 8 | 9 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 10 | 11 | # Compile these files as a freeDiameter extension 12 | FD_ADD_EXTENSION(rt_load_balance ${RT_LOAD_BALANCE_SRC}) 13 | 14 | #### 15 | ## INSTALL section ## 16 | 17 | # We install with the daemon component because it is a base feature. 18 | INSTALL(TARGETS rt_load_balance 19 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 20 | COMPONENT freeDiameter-daemon) 21 | -------------------------------------------------------------------------------- /extensions/dbg_dict_dump_json/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROJECT("Dictionary dump to JSON extension" C) 2 | FD_ADD_EXTENSION(dbg_dict_dump_json dbg_dict_dump_json.cc) 3 | 4 | # sneakily uses dictionary-internal.h 5 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../libfdproto) 6 | 7 | INCLUDE(FindPkgConfig) 8 | 9 | # Uses JSONCPP to write JSON files 10 | PKG_CHECK_MODULES(JSONCPP REQUIRED jsoncpp) 11 | INCLUDE_DIRECTORIES(${JSONCPP_INCLUDE_DIRS}) 12 | LINK_DIRECTORIES(${JSONCPP_LIBDIR}) 13 | TARGET_LINK_LIBRARIES(dbg_dict_dump_json ${JSONCPP_LIBRARIES}) 14 | 15 | #### 16 | ## INSTALL section ## 17 | 18 | INSTALL(TARGETS dbg_dict_dump_json 19 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 20 | COMPONENT freeDiameter-debug-tools) 21 | 22 | -------------------------------------------------------------------------------- /freeDiameterd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The subproject name 2 | Project("freeDiameter simple daemon" C) 3 | 4 | # Since it uses the libfdcore.h, it needs the include dependencies 5 | INCLUDE_DIRECTORIES(${LFDCORE_INCLUDES}) 6 | 7 | # Build the executable 8 | ADD_EXECUTABLE(freeDiameterd main.c) 9 | 10 | # The version 11 | SET_TARGET_PROPERTIES(freeDiameterd PROPERTIES 12 | VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV}) 13 | 14 | # The link command 15 | TARGET_LINK_LIBRARIES(freeDiameterd libfdproto libfdcore ${GNUTLS_LIBRARIES}) 16 | 17 | #### 18 | ## INSTALL section ## 19 | 20 | INSTALL(TARGETS freeDiameterd 21 | RUNTIME DESTINATION ${INSTALL_DAEMON_SUFFIX} 22 | COMPONENT freeDiameter-daemon) 23 | -------------------------------------------------------------------------------- /extensions/test_app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The test_app extension 2 | PROJECT("Test Diameter Application" C) 3 | 4 | # Parser files 5 | BISON_FILE(ta_conf.y) 6 | FLEX_FILE(ta_conf.l) 7 | SET_SOURCE_FILES_PROPERTIES(lex.ta_conf.c ta_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 8 | 9 | # List of source files 10 | SET( APP_TEST_SRC 11 | test_app.h 12 | test_app.c 13 | lex.ta_conf.c 14 | ta_conf.tab.c 15 | ta_conf.tab.h 16 | ta_dict.c 17 | ta_cli.c 18 | ta_bench.c 19 | ta_serv.c 20 | ) 21 | 22 | # Compile as a module 23 | FD_ADD_EXTENSION(test_app ${APP_TEST_SRC}) 24 | 25 | 26 | #### 27 | ## INSTALL section ## 28 | 29 | INSTALL(TARGETS test_app 30 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 31 | COMPONENT freeDiameter-debug-tools) 32 | -------------------------------------------------------------------------------- /extensions/test_sip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The test_sip extension 2 | PROJECT("Diameter-SIP client Test Application (RFC4740)" C) 3 | 4 | FIND_PACKAGE(MySQL REQUIRED) 5 | INCLUDE_DIRECTORIES(${MySQL_INCLUDE_DIR}) 6 | 7 | # List of source files 8 | SET( TEST_SIP_SRC 9 | test_sip.c 10 | test_sip.h 11 | multimediaauth.c 12 | locationinfo.c 13 | locationinfosl.c 14 | registrationtermination.c 15 | userauthorization.c 16 | serverassignment.c 17 | ) 18 | 19 | # Compile as a module 20 | FD_ADD_EXTENSION(test_sip ${TEST_SIP_SRC}) 21 | 22 | TARGET_LINK_LIBRARIES(test_sip ${MySQL_LIBRARIES}) 23 | 24 | 25 | #### 26 | ## INSTALL section ## 27 | 28 | INSTALL(TARGETS test_sip 29 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 30 | COMPONENT freeDiameter-debug-tools) 31 | -------------------------------------------------------------------------------- /cmake/Modules/GetVersionWithHg.cmake: -------------------------------------------------------------------------------- 1 | # This file is called at build time. It regenerates the version.h file based on the hg version. 2 | 3 | EXECUTE_PROCESS( 4 | COMMAND ${HGCOMMAND} id -i 5 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 6 | RESULT_VARIABLE reshash 7 | OUTPUT_VARIABLE verhash 8 | ERROR_QUIET 9 | OUTPUT_STRIP_TRAILING_WHITESPACE) 10 | EXECUTE_PROCESS( 11 | COMMAND ${HGCOMMAND} id -n 12 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 13 | RESULT_VARIABLE resval 14 | OUTPUT_VARIABLE verval 15 | ERROR_QUIET 16 | OUTPUT_STRIP_TRAILING_WHITESPACE) 17 | 18 | if (reshash EQUAL 0) 19 | SET(FD_PROJECT_VERSION_HG "${verval}(${verhash})") 20 | message(STATUS "Source version: ${FD_PROJECT_VERSION_HG}") 21 | endif (reshash EQUAL 0) 22 | 23 | CONFIGURE_FILE(${SRC} ${DST}) 24 | -------------------------------------------------------------------------------- /extensions/acl_wl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The acl_wl extension 2 | PROJECT("Access Control / White List" C) 3 | 4 | # Parser files 5 | BISON_FILE(aw_conf.y) 6 | FLEX_FILE(aw_conf.l) 7 | SET_SOURCE_FILES_PROPERTIES(lex.aw_conf.c aw_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 8 | 9 | # List of source files 10 | SET( ACL_WL_SRC 11 | acl_wl.h 12 | acl_wl.c 13 | aw_tree.c 14 | lex.aw_conf.c 15 | aw_conf.tab.c 16 | aw_conf.tab.h 17 | ) 18 | 19 | # Compile as a module 20 | FD_ADD_EXTENSION(acl_wl ${ACL_WL_SRC}) 21 | 22 | 23 | #### 24 | ## INSTALL section ## 25 | 26 | # We install with the daemon component because it is a base feature. 27 | INSTALL(TARGETS acl_wl 28 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 29 | COMPONENT freeDiameter-daemon) 30 | -------------------------------------------------------------------------------- /doc/dict_json.json.sample: -------------------------------------------------------------------------------- 1 | # Configuration for the JSON dictionary extension (no config file needed) 2 | # 3 | # This extension allows configuration of diameter dictionaries 4 | # in JSON format. 5 | # 6 | # To load the JSON dictionaries, list their paths, separated with a semicolon (';') 7 | # as argument when loading the extension in the freeDiameter config file, i.e.: 8 | # 9 | # LoadExtension = "dict_json.so":"/path/to/dictionary.json;/path/to/another/dictionary_2.json"; 10 | # 11 | # Relative paths work but are hard to get right because they are 12 | # relative to where you started the freeDiameter daemon. 13 | # 14 | # The dictionaries must conform to the JSON schema in 15 | # extensions/dict_json/dict_json_dict_schema.json 16 | # 17 | # Example dictionaries are in contrib/dict_json. 18 | -------------------------------------------------------------------------------- /doc/app_sip.conf.sample: -------------------------------------------------------------------------------- 1 | 2 | # MODE Diameter-SIP server (DSSERVER) or Subscriber Locator (SL) 3 | #You must have at least in your network a Diameter SIP server and a Subscriber Locator (on different nodes) 4 | mode = DSSERVER; 5 | 6 | 7 | # Administrator commands port (port should be provided with "-p" in remote line) 8 | ppr_port=90; 9 | rtr_port=91; 10 | 11 | 12 | #******************# 13 | #*****DATABASE*****# 14 | #******************# 15 | # DATASOURCE: MYSQL 16 | datasource = MYSQL; 17 | 18 | #MYSQL connection details 19 | mysql_login = "login"; 20 | mysql_password = "password"; 21 | mysql_database = "db"; 22 | mysql_server = "server.fr"; 23 | 24 | #If value=0, default port for mysql will be set 25 | mysql_port = 0; 26 | 27 | #Prefix for tables (default is "ds") 28 | mysql_prefix = "ds"; 29 | -------------------------------------------------------------------------------- /contrib/OpenWRT/test_required/Makefile: -------------------------------------------------------------------------------- 1 | OWRT_ENV_ROOT=/root/openwrt-env/openwrt 2 | STAGING_UCLIBC_ROOT=$(OWRT_ENV_ROOT)/staging_dir/target-mipsel_uClibc-0.9.31 3 | STAGING_GCC_ROOT=$(OWRT_ENV_ROOT)/staging_dir/toolchain-mipsel_gcc-4.3.3+cs_uClibc-0.9.31 4 | 5 | CFLAGS=-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -fhonour-copts -msoft-float -I$(STAGING_UCLIBC_ROOT)/usr/include -I$(STAGING_UCLIBC_ROOT)/include -I$(STAGING_GCC_ROOT)/usr/include -I$(STAGING_GCC_ROOT)/include 6 | LDFLAGS=-L$(STAGING_UCLIBC_ROOT)/usr/lib -L$(STAGING_UCLIBC_ROOT)/lib -L$(STAGING_GCC_ROOT)/usr/lib -L$(STAGING_GCC_ROOT)/lib 7 | 8 | GCC=mipsel-openwrt-linux-uclibc-gcc 9 | PATH:=$(STAGING_GCC_ROOT)/bin/:$(PATH) 10 | 11 | testcase: testcase.o 12 | $(GCC) $(LDFLAGS) -lpthread testcase.o -o testcase 13 | 14 | testcase.o: testcase.c 15 | $(GCC) $(CFLAGS) -o testcase.o -c testcase.c 16 | -------------------------------------------------------------------------------- /doc/dict_legacy_xml.conf.sample: -------------------------------------------------------------------------------- 1 | # This file documents the configuration format for the dict_legacy_xml.fdx freeDiameter extension. 2 | # In order to load this extension, please refer to main freeDiameter.conf manual. 3 | 4 | # This extension allows the use of Diameter dictionary files in XML format, 5 | # as roughly specified in draft-frascone-xml-dictionary-00. 6 | # (the actual format is the one from OpenDiameter latest version) 7 | # Note that this format, although more widely used, is less efficient than the 8 | # internal freeDiameter format. It is recommended when possible to use the later. 9 | 10 | # You may refer to the contrib/dict_legacy/README file for information on where to find such resources. 11 | 12 | # This file simply consists in a list of XML dictionary files that must be parsed. 13 | # Example: 14 | # "/etc/freeDiameter/dictionary.xml"; 15 | 16 | -------------------------------------------------------------------------------- /doc/single_host/make_certs.sh: -------------------------------------------------------------------------------- 1 | rm -rf demoCA 2 | mkdir demoCA 3 | echo 01 > demoCA/serial 4 | touch demoCA/index.txt 5 | 6 | 7 | 8 | # CA self certificate 9 | openssl req -new -batch -x509 -days 3650 -nodes -newkey rsa:1024 -out cacert.pem -keyout cakey.pem -subj /CN=ca.localdomain/C=FR/ST=BdR/L=Aix/O=fD/OU=Tests 10 | 11 | #peer1 12 | openssl genrsa -out peer1.key.pem 1024 13 | openssl req -new -batch -out peer1.csr.pem -key peer1.key.pem -subj /CN=peer1.localdomain/C=FR/ST=BdR/L=Aix/O=fD/OU=Tests 14 | openssl ca -cert cacert.pem -keyfile cakey.pem -in peer1.csr.pem -out peer1.cert.pem -outdir . -batch 15 | 16 | #peer2 17 | openssl genrsa -out peer2.key.pem 1024 18 | openssl req -new -batch -out peer2.csr.pem -key peer2.key.pem -subj /CN=peer2.localdomain/C=FR/ST=BdR/L=Aix/O=fD/OU=Tests 19 | openssl ca -cert cacert.pem -keyfile cakey.pem -in peer2.csr.pem -out peer2.cert.pem -outdir . -batch 20 | 21 | -------------------------------------------------------------------------------- /contrib/OpenWRT/packages/freeDiameter/patches/01-freeDiameter-OpenWRT.patch: -------------------------------------------------------------------------------- 1 | diff -Nur freeDiameter/CMakeLists.txt freeDiameter-OpenWRT/CMakeLists.txt 2 | --- freeDiameter/CMakeLists.txt 2010-08-13 16:19:35.000000000 +0900 3 | +++ freeDiameter-OpenWRT/CMakeLists.txt 2010-08-13 16:21:32.000000000 +0900 4 | @@ -51,6 +51,14 @@ 5 | SET(DEBUG 1) 6 | ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug|Profiling|DebugValgrind") 7 | 8 | +# OpenWRT 9 | +SET(IN_OPENWRT $ENV{IN_OPENWRT}) 10 | +IF (IN_OPENWRT) 11 | + ADD_DEFINITIONS("$ENV{TARGET_LDFLAGS}" "$ENV{TARGET_CPPFLAGS}" "$ENV{TARGET_CFLAGS}") 12 | + INCLUDE_DIRECTORIES("$ENV{TARGET_LDFLAGS}" "$ENV{TARGET_CPPFLAGS}" "$ENV{TARGET_CFLAGS}") 13 | +ENDIF(IN_OPENWRT) 14 | + 15 | + 16 | # some subfolders use yacc and lex parsers 17 | SET(BISON_GENERATE_DEFINES TRUE) 18 | SET(BISON_PREFIX_OUTPUTS TRUE) 19 | Binary files freeDiameter/.hg/dirstate and freeDiameter-OpenWRT/.hg/dirstate differ 20 | -------------------------------------------------------------------------------- /extensions/dbg_loglevel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dbg_loglevel extension 2 | PROJECT("Debugging extension that allows changing the log level at runtime" C) 3 | 4 | # Parser files 5 | BISON_FILE(dbg_loglevel_conf.y) 6 | FLEX_FILE(dbg_loglevel_conf.l) 7 | SET_SOURCE_FILES_PROPERTIES(lex.dbg_loglevel_conf.c dbg_loglevel_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 8 | 9 | # List of source files 10 | SET(DBG_LOGLEVEL_SRC 11 | dbg_loglevel.c 12 | dbg_loglevel.h 13 | lex.dbg_loglevel_conf.c 14 | dbg_loglevel_conf.tab.c 15 | dbg_loglevel_conf.tab.h 16 | ) 17 | 18 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 19 | 20 | # Compile these files as a freeDiameter extension 21 | FD_ADD_EXTENSION(dbg_loglevel ${DBG_LOGLEVEL_SRC}) 22 | 23 | #### 24 | ## INSTALL section ## 25 | 26 | INSTALL(TARGETS dbg_loglevel 27 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 28 | COMPONENT freeDiameter-debug-tools) 29 | -------------------------------------------------------------------------------- /extensions/rt_rewrite/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_rewrite extension 2 | PROJECT("Routing extension that rewrites messages, replacing and removing AVPs" C) 3 | 4 | # List of source files 5 | SET(RT_REWRITE_SRC 6 | rt_rewrite.c 7 | lex.rt_rewrite_conf.c 8 | rt_rewrite_conf.tab.c 9 | rt_rewrite_conf.tab.h 10 | ) 11 | 12 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 13 | 14 | BISON_FILE(rt_rewrite_conf.y) 15 | FLEX_FILE(rt_rewrite_conf.l) 16 | SET_SOURCE_FILES_PROPERTIES(lex.rt_rewrite_conf.c rt_rewrite_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 17 | 18 | # Compile these files as a freeDiameter extension 19 | FD_ADD_EXTENSION(rt_rewrite ${RT_REWRITE_SRC}) 20 | 21 | #### 22 | ## INSTALL section ## 23 | 24 | # We install with the daemon component because it is a base feature. 25 | INSTALL(TARGETS rt_rewrite 26 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 27 | COMPONENT freeDiameter-daemon) 28 | -------------------------------------------------------------------------------- /extensions/rt_busypeers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_busypeer extension 2 | PROJECT("Handling of TOO_BUSY messages and relay timeout capability routing extension" C) 3 | 4 | # Parser files 5 | BISON_FILE(rtbusy_conf.y) 6 | FLEX_FILE(rtbusy_conf.l) 7 | SET_SOURCE_FILES_PROPERTIES(lex.rtbusy_conf.c rtbusy_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 8 | 9 | # List of source files 10 | SET( RTBUSY_SRC 11 | rtbusy.c 12 | rtbusy.h 13 | lex.rtbusy_conf.c 14 | rtbusy_conf.tab.c 15 | rtbusy_conf.tab.h 16 | ) 17 | 18 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 19 | 20 | # Compile these files as a freeDiameter extension 21 | FD_ADD_EXTENSION(rt_busypeers ${RTBUSY_SRC}) 22 | 23 | 24 | #### 25 | ## INSTALL section ## 26 | 27 | # We install with the daemon component because it is a base feature. 28 | INSTALL(TARGETS rt_busypeers 29 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 30 | COMPONENT freeDiameter-daemon) 31 | -------------------------------------------------------------------------------- /contrib/wireshark/sample/192.168.103.10.priv.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXAIBAAKBgQDMcXy2iVqcXkGaY44yNihVNzW/zHptqID49/ZyyyOinxHenvf9 3 | o/fr613XvUuyquaapL99yiMPuLU3I1UxxacWBSAb496eGd7fY1Udw1RtqKCeb60c 4 | jpTc3zKySGPHtnzOxeSMDK/R6uqkFirF6Lnu18mKZyAwJtvFYnh0wK3SwwIDAQAB 5 | AoGAa6kX08hhPxcj1Pm4WBjNBJMeavJzRmwF/xYVYj43ddvuvR1Z2ugOFt7LfGDj 6 | DCOTbLx1Wvinng/W3kJtCtjbM3w3k5cuFJdJcURXda73IHSaJOHnBAw5RlvFCE79 7 | 12yKqGOBgy80gGHDlqnSIjISCGb/9wLcHYLccakekckPc4ECQQDubt5fWzN4wUwU 8 | yW+e/SO9Vz4j+FiIC2aZy2OM9XXt6cgh4v0hQ3l0sWVJ6lTvK17aD9LXE5rluAOI 9 | thnPZElFAkEA24GH8Po/+3K6A5d5Zh1+hwoMLbWrykQDWSOgtmaOtbAvezlolF8O 10 | W18pVdvyMJg3gUiCA/rHG+r+OBxa4sx4ZwJAH4c1jHJo2fzlbJI+Wk2q3iydIPCD 11 | 9GldhdSpM0h58Z3KQwDa6/0aIF4cwKtl08JuZnNVM+95ugqdHQTHYO8n6QJBAIgO 12 | m+KEWxBSpnX/d+IRuhGd6rqSdu8ihSjFaqJko2R+1o98oBQHb3C3ZXmwoUf5sb3S 13 | 4bPxx2TIndbNzI/zyVUCQGqN7eyoeTxtPD8P08lUGTUnC2n0imZ1mU5p8Bnv8gw5 14 | lwt9qxuz0Ujr7uFPPu58bvGsYeoFUV23WRmS0rKLXv0= 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /contrib/wireshark/sample/192.168.103.20.priv.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXgIBAAKBgQDef8CrqawfvmCLBwmlPRlWjwB6V4TvVMRhivAYlwwFbUSoU5bm 3 | 2D780IBr3fNL3zP38ySa7r9cXxPgk7mbj3PhcJbI0Ix0AjQdFSB08AOXev4gqU8p 4 | qgEODFV04tnFhOcDysp77qH/DFuNwxd2xtFUbGKfGhroAssHxJuogOmiWQIDAQAB 5 | AoGAP6H7wVyCLIXu6HP3zzkdIQM+2L5k92mfzGHG7tFsD7VDWHyngJfB093xjGfq 6 | p/1KyJPSGTlEoy9R6P12rMWnFv7sYYKmPGfKdRUMxZYIXbplw6+L/gwW3MCiOMDD 7 | zRzRjknE3a+Mjo3e2XMHh6Z+GJ61megMeGInODP05/h66AECQQDyFhT+D8DVj1hp 8 | RlaYTFDKCmS9rgMQ+g4YyqMLzuakkKwaJwbCIlMbQortGBvY9I+0uZC4jklcOpnl 9 | YYcGIUEBAkEA60l5uAVBk6vKWKWX2cksBP/VlJM2B9pkvmlL7tPwJVEfoaAzZx4N 10 | rPpC9sOsFlX1ShpirAmIqmvY16in4xEJWQJBAOvULSEOcZjZapQrjEIS3gTkOR06 11 | fgw0vDTUeh8PsEmSEcXsTL4jt/fvS+0KNl6UZ8Xzm5LeMYLiJ3d4GZQUIwECQQCb 12 | vYLoH/KMQMYrb1DYQ6TzmjRRqC+3ewP8Vc6BQ6BN0yjQ3y2nL+l1eiIhHNwn3LYE 13 | Wvq9TYI87C4YcfbPAlPhAkEA0bNU/Utgdbv/yT4lUmw+0toqFHkcT5s13RFWzNJU 14 | KdQ308kwz9rSDmuQ8eYzn5V02TioJKV4r0NZz+WcCyDY3A== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /extensions/rt_deny_by_size/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_deny_by_size extension 2 | PROJECT("Routing extension to deny messages that are over a particular size" C) 3 | 4 | # Parser files 5 | BISON_FILE(rt_deny_by_size_conf.y) 6 | FLEX_FILE(rt_deny_by_size_conf.l) 7 | SET_SOURCE_FILES_PROPERTIES(lex.rt_deny_by_size_conf.c rt_deny_by_size_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 8 | 9 | # List of source files 10 | SET( RT_DENY_BY_SIZE_SRC 11 | rt_deny_by_size.c 12 | rt_deny_by_size.h 13 | lex.rt_deny_by_size_conf.c 14 | rt_deny_by_size_conf.tab.c 15 | rt_deny_by_size_conf.tab.h 16 | ) 17 | 18 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 19 | 20 | # Compile these files as a freeDiameter extension 21 | FD_ADD_EXTENSION(rt_deny_by_size ${RT_DENY_BY_SIZE_SRC}) 22 | 23 | #### 24 | ## INSTALL section ## 25 | 26 | # We install with the daemon component because it is a base feature. 27 | INSTALL(TARGETS rt_deny_by_size 28 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 29 | COMPONENT freeDiameter-daemon) 30 | -------------------------------------------------------------------------------- /extensions/app_acct/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The app_acct extension 2 | PROJECT("Simple Accounting server" C) 3 | 4 | ######################## 5 | # Search for libpg (postgresql package) 6 | FIND_PACKAGE(PostgreSQL REQUIRED) 7 | INCLUDE_DIRECTORIES(${POSTGRESQL_INCLUDE_DIR}) 8 | 9 | ######################## 10 | # Parser files 11 | BISON_FILE(acct_conf.y) 12 | FLEX_FILE(acct_conf.l) 13 | SET_SOURCE_FILES_PROPERTIES(lex.acct_conf.c acct_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 14 | 15 | # List of source files 16 | SET( APP_ACCT_SRC 17 | app_acct.h 18 | app_acct.c 19 | acct_db.c 20 | acct_records.c 21 | ) 22 | SET( APP_ACCT_SRC_GEN 23 | lex.acct_conf.c 24 | acct_conf.tab.c 25 | acct_conf.tab.h 26 | ) 27 | 28 | # Compile as a module 29 | FD_ADD_EXTENSION(app_acct ${APP_ACCT_SRC} ${APP_ACCT_SRC_GEN}) 30 | TARGET_LINK_LIBRARIES(app_acct ${POSTGRESQL_LIBRARIES}) 31 | 32 | 33 | #### 34 | ## INSTALL section ## 35 | 36 | INSTALL(TARGETS app_acct 37 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 38 | COMPONENT freeDiameter-accounting-server) 39 | -------------------------------------------------------------------------------- /extensions/dict_legacy_xml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_legacy_xml extension 2 | PROJECT("Legacy XML dictionary files support" C) 3 | 4 | # Parser files 5 | BISON_FILE(dict_lxml.y) 6 | FLEX_FILE(dict_lxml.l) 7 | SET_SOURCE_FILES_PROPERTIES(lex.dict_lxml.c dict_lxml.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 8 | 9 | # We use LibXml2 (from GNOME) to parse XML files 10 | FIND_PACKAGE(LibXml2 REQUIRED) 11 | 12 | # List of source files 13 | SET( DICT_LXML_SRC 14 | dict_lxml.c 15 | dict_lxml_xml.c 16 | dict_lxml.h 17 | lex.dict_lxml.c 18 | dict_lxml.tab.c 19 | dict_lxml.tab.h 20 | ) 21 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 22 | INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) 23 | 24 | # Compile these files as a freeDiameter extension 25 | FD_ADD_EXTENSION(dict_legacy_xml ${DICT_LXML_SRC}) 26 | 27 | TARGET_LINK_LIBRARIES(dict_legacy_xml ${LIBXML2_LIBRARIES} ) 28 | 29 | 30 | #### 31 | ## INSTALL section ## 32 | 33 | INSTALL(TARGETS dict_legacy_xml 34 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 35 | COMPONENT freeDiameter-dictionary-legacy) 36 | -------------------------------------------------------------------------------- /contrib/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # 5 | # This file was originally written by Joey Hess and Craig Small. 6 | # As a special exception, when this file is copied by dh-make into a 7 | # dh-make output file, you may use that output file without restriction. 8 | # This special exception was added by Craig Small in version 0.37 of dh-make. 9 | # 10 | # Modified to make a template file for a multi-binary package with separated 11 | # build-arch and build-indep targets by Bill Allombert 2001 12 | 13 | # Uncomment this to turn on verbose mode. 14 | #export DH_VERBOSE=1 15 | 16 | # This has to be exported to make some magic below work. 17 | export DH_OPTIONS 18 | 19 | # Comment this out if you want to include the tests when the package is built 20 | skip_the_tests=-DBUILD_TESTING:BOOL=OFF 21 | 22 | %: 23 | dh $@ 24 | 25 | override_dh_auto_configure: 26 | dh_auto_configure -- $(skip_the_tests) \ 27 | -DCMAKE_BUILD_TYPE:STRING=DebianPackage \ 28 | -DDEFAULT_CONF_PATH:PATH=/etc/freeDiameter \ 29 | -DALL_EXTENSIONS:BOOL=ON 30 | 31 | 32 | -------------------------------------------------------------------------------- /INSTALL.OpenSUSE: -------------------------------------------------------------------------------- 1 | ### Very short install notes for OpenSUSE (tested on OpenSUSE 11.3) 2 | # Please refer to other INSTALL files for more detailed instructions (e.g. extension-specific notes). 3 | 4 | 5 | Dependencies on OpenSUSE 11.3 (from minimal server system installation): 6 | # zypper install cmake make gcc gcc-c++ flex bison lksctp-tools-devel libgnutls-devel libgcrypt-devel libidn-devel 7 | # zypper install mercurial 8 | 9 | Following dependencies are optional, depending on which extensions you plan to compile 10 | app_acct: 11 | # zypper install postgresql-server postgresql-devel 12 | 13 | app_sip: 14 | app_diameap: 15 | # zypper install libmysqlclient-devel 16 | (would also need a server, not sure which package is appropriate) 17 | 18 | dict_legacy_xml: 19 | # zypper install libxml2 libxml2-devel 20 | 21 | dbg_interactive: 22 | # zypper install swig python-devel 23 | 24 | sample: 25 | # zypper install gcc-c++ 26 | 27 | There is currently no OpenSUSE-specific package for freeDiameter. 28 | You are welcome to contribute packaging scripts! Please contact with 29 | dev@freediameter.net for more details. 30 | -------------------------------------------------------------------------------- /doc/rt_rewrite.conf.sample: -------------------------------------------------------------------------------- 1 | # This file contains information for configuring the rt_rewrite extension 2 | # To find how to have freeDiameter load this extension, please refer to the freeDiameter documentation. 3 | # 4 | # The rt_rewrite extension allows moving data from one AVP into another one, or dropping AVPs altogether. 5 | 6 | # This extension supports configuration reload at runtime. Send 7 | # signal SIGUSR1 to the process to cause the process to reload its 8 | # config. 9 | 10 | # The config consists of MAP for AVP pairs of source/target, or DROP for a source. 11 | # 12 | # MAP = "Source-AVP" > "Destination-AVP"; 13 | # 14 | # It is possible to specify AVPs below GROUPED AVPs with the by separating AVPs with a colon (':'): 15 | # MAP = "Grouped-AVP1" : "Octetstring-AVP1" > "Grouped-AVP2" : "Grouped-AVP3" : "Octetstring-AVP2"; 16 | # Intermediate destination grouped AVPs will be created automatically. 17 | # 18 | # NOTE: you can not move grouped AVPs as a unit, you have to move each separate AVP. 19 | # i.e., this will not work: 20 | # MAP = "Grouped-AVP1" > "Grouped-AVP2"; 21 | # 22 | # For removing AVPs, use DROP: 23 | # DROP = "Grouped-AVP1" : "Octetstring-AVP1"; 24 | -------------------------------------------------------------------------------- /cmake/Modules/FindGcrypt.cmake: -------------------------------------------------------------------------------- 1 | # - Find gnutls 2 | # Find the native GCRYPT includes and library 3 | # 4 | # GCRYPT_FOUND - True if gnutls found. 5 | # GCRYPT_INCLUDE_DIR - where to find gnutls.h, etc. 6 | # GCRYPT_LIBRARIES - List of libraries when using gnutls. 7 | 8 | if (GCRYPT_INCLUDE_DIR AND GCRYPT_LIBRARIES) 9 | set(GCRYPT_FIND_QUIETLY TRUE) 10 | endif (GCRYPT_INCLUDE_DIR AND GCRYPT_LIBRARIES) 11 | 12 | # Include dir 13 | find_path(GCRYPT_INCLUDE_DIR 14 | NAMES 15 | gcrypt.h 16 | ) 17 | 18 | # Library 19 | find_library(GCRYPT_LIBRARY 20 | NAMES gcrypt 21 | ) 22 | 23 | # handle the QUIETLY and REQUIRED arguments and set GCRYPT_FOUND to TRUE if 24 | # all listed variables are TRUE 25 | INCLUDE(FindPackageHandleStandardArgs) 26 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GCRYPT DEFAULT_MSG GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR) 27 | 28 | IF(GCRYPT_FOUND) 29 | SET( GCRYPT_LIBRARIES ${GCRYPT_LIBRARY} ) 30 | ELSE(GCRYPT_FOUND) 31 | SET( GCRYPT_LIBRARIES ) 32 | ENDIF(GCRYPT_FOUND) 33 | 34 | # Lastly make it so that the GCRYPT_LIBRARY and GCRYPT_INCLUDE_DIR variables 35 | # only show up under the advanced options in the gui cmake applications. 36 | MARK_AS_ADVANCED( GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR ) 37 | -------------------------------------------------------------------------------- /contrib/update_copyright.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | # This script will search all copyrights dates from source files, and update these if 4 | # the file has been modified at a later date. 5 | 6 | if [ ! -f include/freeDiameter/libfdcore.h ]; 7 | then echo "This script must be run from the source top directory" 8 | exit 1; 9 | fi; 10 | 11 | # Create a clean working copy 12 | TMPDIR=`mktemp -d up_cop.XXXXXXX` || exit 1 13 | hg clone . $TMPDIR/fD || exit 1 14 | pushd $TMPDIR/fD 15 | 16 | # Now, for each file with a copyright 17 | for SRC_FILE in `find . -name .hg -prune -or -type f -exec grep -q 'Copyright (c) 20.., WIDE Project and NICT' {} \; -print`; 18 | do 19 | HG_YEAR=`hg log --template '{date|shortdate}' $SRC_FILE | tr - ' ' | awk '{print \$1}'` 20 | CPY_YEAR=`grep 'Copyright (c) 20.., WIDE Project and NICT' $SRC_FILE | awk '{print substr(\$4, 1, 4) }'` 21 | if [ $HG_YEAR -gt $CPY_YEAR ]; 22 | then 23 | echo "Updating copyright $CPY_YEAR -> $HG_YEAR in $SRC_FILE"; 24 | sed -i -e "s/Copyright (c) $CPY_YEAR, WIDE Project and NICT/Copyright (c) $HG_YEAR, WIDE Project and NICT/" $SRC_FILE 25 | fi; 26 | done 27 | 28 | hg commit -m"Updated copyright information" 29 | hg push 30 | popd 31 | rm -rf $TMPDIR 32 | hg update 33 | 34 | -------------------------------------------------------------------------------- /extensions/app_sip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The app_sip extension 2 | PROJECT("Diameter SIP Application (RFC4740)" C) 3 | 4 | FIND_PACKAGE(MySQL REQUIRED) 5 | INCLUDE_DIRECTORIES(${MySQL_INCLUDE_DIR}) 6 | 7 | # Parser files 8 | BISON_FILE(app_sip.y) 9 | FLEX_FILE(app_sip.l) 10 | SET_SOURCE_FILES_PROPERTIES(lex.app_sip.c app_sip.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 11 | 12 | # List of source files 13 | SET( DIAM_SIP_SRC 14 | lex.app_sip.c 15 | app_sip.tab.c 16 | app_sip.tab.h 17 | app_sip.c 18 | app_sip.h 19 | libapp_sip.c 20 | md5.c 21 | multimediaauth.c 22 | registrationtermination.c 23 | userauthorization.c 24 | pushprofile.c 25 | serverassignment.c 26 | locationinfo.c 27 | locationinfosl.c 28 | ) 29 | 30 | # Compile as a module 31 | FD_ADD_EXTENSION(app_sip ${DIAM_SIP_SRC}) 32 | 33 | TARGET_LINK_LIBRARIES(app_sip ${MySQL_LIBRARIES}) 34 | 35 | SUBDIRS(tools) 36 | 37 | #### 38 | ## INSTALL section ## 39 | 40 | INSTALL(TARGETS app_sip 41 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 42 | COMPONENT freeDiameter-sip-server) 43 | 44 | INSTALL(FILES README TODO 45 | DESTINATION /usr/share/doc/freeDiameter-sip-server 46 | CONFIGURATIONS DebianPackage 47 | COMPONENT freeDiameter-sip-server) 48 | -------------------------------------------------------------------------------- /extensions/test_netemul/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The test_netemul extension 2 | PROJECT("Simple Diameter network emulator proxy extension (latency, PDV, duplicates)" C) 3 | 4 | # Parser files 5 | BISON_FILE(test_netemul.y) 6 | FLEX_FILE(test_netemul.l) 7 | SET_SOURCE_FILES_PROPERTIES(lex.test_netemul.c test_netemul.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 8 | 9 | # List of source files 10 | SET( TNEMUL_SRC 11 | test_netemul.c 12 | test_netemul.h 13 | lex.test_netemul.c 14 | test_netemul.tab.c 15 | test_netemul.tab.h 16 | tne_process.c 17 | ) 18 | 19 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 20 | 21 | # Compile these files as a freeDiameter extension 22 | FD_ADD_EXTENSION(test_netemul ${TNEMUL_SRC}) 23 | 24 | 25 | # math functions 26 | CHECK_FUNCTION_EXISTS (sqrt HAVE_SQRT) 27 | IF (HAVE_SQRT) 28 | SET(MATH_LIBS "") 29 | ELSE (HAVE_SQRT) 30 | CHECK_LIBRARY_EXISTS (m sqrt "" HAVE_LIBM) 31 | IF (HAVE_LIBM) 32 | SET(MATH_LIBS "-lm") 33 | ENDIF (HAVE_LIBM) 34 | ENDIF (HAVE_SQRT) 35 | 36 | TARGET_LINK_LIBRARIES(test_netemul ${MATH_LIBS}) 37 | 38 | #### 39 | ## INSTALL section ## 40 | 41 | INSTALL(TARGETS test_netemul 42 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 43 | COMPONENT freeDiameter-debug-tools) 44 | -------------------------------------------------------------------------------- /extensions/app_redirect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The app_redirect extension 2 | PROJECT("Configurable Redirects server extension" C) 3 | 4 | # Check if REG_STARTEND is provided on the host 5 | SET(CHECK_REG_STARTEND_SOURCE_CODE " 6 | #include 7 | #include 8 | int main() { 9 | return regexec(NULL, NULL, 0, NULL, REG_STARTEND); 10 | } 11 | ") 12 | CHECK_C_SOURCE_COMPILES("${CHECK_REG_STARTEND_SOURCE_CODE}" HAVE_REG_STARTEND) 13 | # Generate the host.h file 14 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ard-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/ard-host.h) 15 | 16 | # Parser files 17 | BISON_FILE(ard_conf.y) 18 | FLEX_FILE(ard_conf.l) 19 | SET_SOURCE_FILES_PROPERTIES(lex.ard_conf.c ard_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 20 | 21 | # List of source files 22 | SET( APP_REDIR_SRC 23 | app_redir.c 24 | app_redir.h 25 | lex.ard_conf.c 26 | ard_conf.tab.c 27 | ard_conf.tab.h 28 | ard_rules.c 29 | ) 30 | 31 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 32 | 33 | # Compile these files as a freeDiameter extension 34 | FD_ADD_EXTENSION(app_redirect ${APP_REDIR_SRC}) 35 | 36 | 37 | #### 38 | ## INSTALL section ## 39 | 40 | INSTALL(TARGETS app_redirect 41 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 42 | COMPONENT freeDiameter-app_redirect) 43 | -------------------------------------------------------------------------------- /extensions/app_diameap/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROJECT("EAP Methods Plugins" C) 2 | 3 | MACRO(EAP_ADD_METHOD METHNAME) 4 | ADD_LIBRARY(${METHNAME} MODULE ${ARGN}) 5 | SET_TARGET_PROPERTIES(${METHNAME} PROPERTIES PREFIX "" ) 6 | SET_TARGET_PROPERTIES(${METHNAME} PROPERTIES SUFFIX ".emp" ) 7 | INSTALL(TARGETS ${METHNAME} 8 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 9 | COMPONENT freeDiameter-eap-server) 10 | ENDMACRO(EAP_ADD_METHOD) 11 | 12 | # Use the macro FD_EAP_PLUGIN(extmacroname subdir descr default) to 13 | # add a new extension subdirectory. 14 | MACRO(FD_EAP_PLUGIN EXTSUBDIR EXTDESCR EXTDEFAULT) 15 | STRING(TOUPPER ${EXTSUBDIR} EXTMACRONAME) 16 | IF (NOT ALL_EXTENSIONS) 17 | OPTION(BUILD_${EXTMACRONAME} ${EXTDESCR} ${EXTDEFAULT}) 18 | ENDIF (NOT ALL_EXTENSIONS) 19 | IF (BUILD_${EXTMACRONAME} OR ALL_EXTENSIONS) 20 | ADD_SUBDIRECTORY(${EXTSUBDIR}) 21 | ENDIF (BUILD_${EXTMACRONAME} OR ALL_EXTENSIONS) 22 | ENDMACRO(FD_EAP_PLUGIN) 23 | 24 | ########################### 25 | # EAP Methods Plugins Section 26 | 27 | # EAP Identity plugin 28 | FD_EAP_PLUGIN(eap_identity "Build EAP Identity Plugin " ON) 29 | 30 | # EAP MD5 plugin 31 | FD_EAP_PLUGIN(eap_md5 "Build EAP-MD5 Plugin " OFF) 32 | 33 | # EAP TLS plugin 34 | FD_EAP_PLUGIN(eap_tls "Build EAP-TLS Plugin " OFF) 35 | -------------------------------------------------------------------------------- /cmake/Modules/FindPostgreSQL.cmake: -------------------------------------------------------------------------------- 1 | # - Find PostgreSQL library 2 | # 3 | # This module defines: 4 | # POSTGRESQL_FOUND - True if the package is found 5 | # POSTGRESQL_INCLUDE_DIR - containing libpq-fe.h 6 | # POSTGRESQL_LIBRARIES - Libraries to link to use PQ functions. 7 | 8 | if (POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES) 9 | set(POSTGRESQL_FIND_QUIETLY TRUE) 10 | endif (POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES) 11 | 12 | # Include dir 13 | find_path(POSTGRESQL_INCLUDE_DIR 14 | NAMES libpq-fe.h 15 | PATH_SUFFIXES pgsql postgresql 16 | ) 17 | 18 | # Library 19 | find_library(POSTGRESQL_LIBRARY 20 | NAMES pq 21 | ) 22 | 23 | # handle the QUIETLY and REQUIRED arguments and set POSTGRESQL_FOUND to TRUE if 24 | # all listed variables are TRUE 25 | INCLUDE(FindPackageHandleStandardArgs) 26 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(POSTGRESQL DEFAULT_MSG POSTGRESQL_LIBRARY POSTGRESQL_INCLUDE_DIR) 27 | 28 | IF(POSTGRESQL_FOUND) 29 | SET( POSTGRESQL_LIBRARIES ${POSTGRESQL_LIBRARY} ) 30 | ELSE(POSTGRESQL_FOUND) 31 | SET( POSTGRESQL_LIBRARIES ) 32 | ENDIF(POSTGRESQL_FOUND) 33 | 34 | # Lastly make it so that the POSTGRESQL_LIBRARY and POSTGRESQL_INCLUDE_DIR variables 35 | # only show up under the advanced options in the gui cmake applications. 36 | MARK_AS_ADVANCED( POSTGRESQL_LIBRARY POSTGRESQL_INCLUDE_DIR ) 37 | -------------------------------------------------------------------------------- /doc/acl_wl.conf.sample: -------------------------------------------------------------------------------- 1 | # Configuration file for the peer whitelist extension. 2 | # 3 | # This extension is meant to allow connection from remote peers, without actively 4 | # maintaining this connection ourselves (as it would be the case by declaring the 5 | # peer in a ConnectPeer directive). 6 | # 7 | # This extension supports configuration reload at runtime. Send 8 | # signal SIGUSR1 to the process to cause the process to reload its 9 | # config. 10 | # 11 | # The format of this file is very simple. It contains a list of peer names 12 | # separated by spaces or newlines. 13 | # 14 | # The peer name must be a fqdn. We allow also a special "*" character as the 15 | # first label of the fqdn, to allow all fqdn with the same domain name. 16 | # Example: *.example.net will allow host1.example.net and host2.example.net 17 | # 18 | # At the beginning of a line, the following flags are allowed (case sensitive) -- either or both can appear: 19 | # ALLOW_OLD_TLS : we accept unprotected CER/CEA exchange with Inband-Security-Id = TLS 20 | # ALLOW_IPSEC : we accept implicitly protected connection with with peer (Inband-Security-Id = IPSec) 21 | # It is specified for example as: 22 | # ALLOW_IPSEC vpn.example.net vpn2.example.net *.vpn.example.net 23 | # These flag take effect from their position, until the end of the line. 24 | 25 | -------------------------------------------------------------------------------- /extensions/rt_ereg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_ereg extension 2 | PROJECT("Regular expression matching based routing extension" C) 3 | 4 | # Check if REG_STARTEND is provided on the host 5 | SET(CHECK_REG_STARTEND_SOURCE_CODE " 6 | #include 7 | #include 8 | int main() { 9 | return regexec(NULL, NULL, 0, NULL, REG_STARTEND); 10 | } 11 | ") 12 | CHECK_C_SOURCE_COMPILES("${CHECK_REG_STARTEND_SOURCE_CODE}" HAVE_REG_STARTEND) 13 | IF (HAVE_REG_STARTEND) 14 | ADD_DEFINITIONS(-DHAVE_REG_STARTEND) 15 | ENDIF (HAVE_REG_STARTEND) 16 | 17 | 18 | # Parser files 19 | BISON_FILE(rtereg_conf.y) 20 | FLEX_FILE(rtereg_conf.l) 21 | SET_SOURCE_FILES_PROPERTIES(lex.rtereg_conf.c rtereg_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 22 | 23 | # List of source files 24 | SET( RTEREG_SRC 25 | rtereg.c 26 | rtereg.h 27 | lex.rtereg_conf.c 28 | rtereg_conf.tab.c 29 | rtereg_conf.tab.h 30 | ) 31 | 32 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 33 | 34 | # Compile these files as a freeDiameter extension 35 | FD_ADD_EXTENSION(rt_ereg ${RTEREG_SRC}) 36 | 37 | 38 | #### 39 | ## INSTALL section ## 40 | 41 | # We install with the daemon component because it is a base feature. 42 | INSTALL(TARGETS rt_ereg 43 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 44 | COMPONENT freeDiameter-daemon) 45 | -------------------------------------------------------------------------------- /cmake/Modules/FindIDNA.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find GNU IDN library and headers 2 | # Once done, this will define 3 | # 4 | # IDNA_FOUND - system has IDNA 5 | # IDNA_INCLUDE_DIR - the IDNA include directories () 6 | # IDNA_LIBRARIES - link these to use IDNA (idna_to_ascii_8z) 7 | 8 | if (IDNA_INCLUDE_DIR AND IDNA_LIBRARIES) 9 | set(IDNA_FIND_QUIETLY TRUE) 10 | endif (IDNA_INCLUDE_DIR AND IDNA_LIBRARIES) 11 | 12 | # Include dir 13 | find_path(IDNA_INCLUDE_DIR 14 | NAMES idna.h 15 | ) 16 | 17 | # Library 18 | find_library(IDNA_LIBRARY 19 | NAMES idn 20 | ) 21 | 22 | 23 | # handle the QUIETLY and REQUIRED arguments and set IDNA_FOUND to TRUE if 24 | # all listed variables are TRUE 25 | INCLUDE(FindPackageHandleStandardArgs) 26 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(IDNA DEFAULT_MSG IDNA_LIBRARY IDNA_INCLUDE_DIR) 27 | 28 | # If we successfully found the idn library then add the library to the 29 | # IDNA_LIBRARIES cmake variable otherwise set IDNA_LIBRARIES to nothing. 30 | IF(IDNA_FOUND) 31 | SET( IDNA_LIBRARIES ${IDNA_LIBRARY} ) 32 | ELSE(IDNA_FOUND) 33 | SET( IDNA_LIBRARIES ) 34 | ENDIF(IDNA_FOUND) 35 | 36 | 37 | # Lastly make it so that the IDNA_LIBRARY and IDNA_INCLUDE_DIR variables 38 | # only show up under the advanced options in the gui cmake applications. 39 | MARK_AS_ADVANCED( IDNA_LIBRARY IDNA_INCLUDE_DIR ) 40 | 41 | -------------------------------------------------------------------------------- /INSTALL.Fedora: -------------------------------------------------------------------------------- 1 | ### Very short install notes for Fedora (tested on Fedora 13 and 14) 2 | # Please refer to other INSTALL files for more detailed instructions (e.g. extension-specific notes). 3 | 4 | 5 | Dependencies on Fedora 13 (from minimal system): 6 | # yum install cmake make gcc gcc-c++ flex bison lksctp-tools-devel gnutls-devel libgcrypt-devel libidn-devel 7 | 8 | In addition, if you have not already retrieved the latest source: 9 | # yum install mercurial 10 | 11 | Following dependencies are optional, depending on which extensions you plan to compile 12 | app_acct: 13 | # yum install postgresql-devel 14 | optional: 15 | # yum install postgresql-server 16 | 17 | app_sip: 18 | app_diameap: 19 | # yum install mysql-devel 20 | optional: 21 | # yum install mysql-server 22 | 23 | dict_legacy_xml: 24 | # yum install libxml2 libxml2-devel 25 | 26 | dbg_interactive: 27 | # yum install swig python-devel 28 | 29 | 30 | NOTE: You may need to change something in SELinux to allow binding the SCTP socket on Diameter port. 31 | The following command is the very naive way to do it, you can probably do better (feedback appreciated!) 32 | # setenforce Permissive 33 | 34 | 35 | There is currently no Fedora-specific package for freeDiameter. 36 | You are welcome to contribute packaging scripts. 37 | Please contact dev@freediameter.net for more details. 38 | -------------------------------------------------------------------------------- /extensions/rt_default/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rt_default extension 2 | PROJECT("Configurable routing extension" C) 3 | 4 | # Check if REG_STARTEND is provided on the host 5 | SET(CHECK_REG_STARTEND_SOURCE_CODE " 6 | #include 7 | #include 8 | int main() { 9 | return regexec(NULL, NULL, 0, NULL, REG_STARTEND); 10 | } 11 | ") 12 | CHECK_C_SOURCE_COMPILES("${CHECK_REG_STARTEND_SOURCE_CODE}" HAVE_REG_STARTEND) 13 | # Generate the host.h file 14 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/rt_default-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/rt_default-host.h) 15 | 16 | # Parser files 17 | BISON_FILE(rtd_conf.y) 18 | FLEX_FILE(rtd_conf.l) 19 | SET_SOURCE_FILES_PROPERTIES(lex.rtd_conf.c rtd_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 20 | 21 | # List of source files 22 | SET( RT_DEFAULT_SRC 23 | rt_default.c 24 | rt_default.h 25 | lex.rtd_conf.c 26 | rtd_conf.tab.c 27 | rtd_conf.tab.h 28 | rtd_rules.c 29 | ) 30 | 31 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 32 | 33 | # Compile these files as a freeDiameter extension 34 | FD_ADD_EXTENSION(rt_default ${RT_DEFAULT_SRC}) 35 | 36 | 37 | #### 38 | ## INSTALL section ## 39 | 40 | # We install with the daemon component because it is a base feature. 41 | INSTALL(TARGETS rt_default 42 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 43 | COMPONENT freeDiameter-daemon) 44 | -------------------------------------------------------------------------------- /libfdproto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Name of the subproject 2 | Project("libfdproto" C) 3 | 4 | # Configuration for newer cmake 5 | cmake_policy(VERSION 2.6) 6 | if (POLICY CMP0022) 7 | cmake_policy(SET CMP0022 OLD) 8 | endif (POLICY CMP0022) 9 | 10 | # List of source files for the library 11 | SET(LFDPROTO_SRC 12 | fdproto-internal.h 13 | dictionary.c 14 | dictionary_functions.c 15 | dispatch.c 16 | fifo.c 17 | init.c 18 | lists.c 19 | log.c 20 | messages.c 21 | ostr.c 22 | portability.c 23 | rt_data.c 24 | sessions.c 25 | utils.c 26 | version.c 27 | ) 28 | 29 | 30 | # Save the list of files for testcases in the core's directory 31 | SET(LFDPROTO_SRC ${LFDPROTO_SRC} PARENT_SCOPE) 32 | 33 | # Include path 34 | INCLUDE_DIRECTORIES(${LFDPROTO_INCLUDES}) 35 | 36 | # Build as a shared library 37 | ADD_LIBRARY(libfdproto SHARED ${LFDPROTO_SRC}) 38 | 39 | ADD_DEPENDENCIES(libfdproto version_information) 40 | 41 | # Avoid the liblib name, and set the version 42 | SET_TARGET_PROPERTIES(libfdproto PROPERTIES 43 | OUTPUT_NAME "fdproto" 44 | SOVERSION ${FD_PROJECT_VERSION_API} 45 | VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV} 46 | LINK_INTERFACE_LIBRARIES "${LFDPROTO_LINK_INTERFACES}") 47 | 48 | # The library itself needs other libraries 49 | TARGET_LINK_LIBRARIES(libfdproto ${LFDPROTO_LIBS}) 50 | 51 | 52 | #### 53 | ## INSTALL section ## 54 | 55 | INSTALL(TARGETS libfdproto 56 | LIBRARY DESTINATION ${INSTALL_LIBRARY_SUFFIX} 57 | COMPONENT freeDiameter-common) 58 | 59 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | This package uses CMake (cmake.org) as building system. You'll need the cmake tool in order 2 | to generate the Makefiles for your platform. You can also select which extensions must be built 3 | with cmake. After the initial cmake configuration, you will need several tools such as make, a 4 | C compiler (tested mostly with gcc), flex (> 2.5.4), bison, ... 5 | 6 | You may retrieve the source package in several ways: 7 | - as a pre-packaged version for your platform. Check the website for supported platforms. 8 | - as a tarball containing the source. 9 | - directly from the repository using Mercurial tool: 10 | hg clone http://www.freediameter.net/hg/freeDiameter 11 | In order to update later: 12 | hg pull -u 13 | 14 | Building in a separate directory is recommended: 15 | # mkdir build 16 | # cd build 17 | # cmake ../ 18 | # make 19 | 20 | You can pass options to instruct cmake about which components to compile on the command-line. 21 | You can also use a CMake front-end (for example ccmake or cmake-gui). 22 | If your cmake installation is recent, the edit_cache target is a good help as well: 23 | # mkdir build 24 | # cd build 25 | # cmake ../ 26 | # make help 27 | # make edit_cache 28 | # make 29 | 30 | You can disable the unit tests by doing: 31 | # cmake -DBUILD_TESTING:BOOL=OFF ../ 32 | # make 33 | 34 | When the tests are enabled, you can run them with: 35 | # make test 36 | 37 | See the INSTALL.* files for additional platform-specific information. 38 | Note that the most up-to-date INSTALL file is the Ubuntu one. You may want to read there 39 | in addition to your own platform file. 40 | -------------------------------------------------------------------------------- /cmake/Modules/FindSCTP.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find SCTP library and headers 2 | # Once done, this will define 3 | # 4 | # SCTP_FOUND - system has SCTP 5 | # SCTP_INCLUDE_DIR - the SCTP include directories 6 | # SCTP_LIBRARIES - link these to use SCTP 7 | 8 | if (SCTP_INCLUDE_DIR AND SCTP_LIBRARIES) 9 | set(SCTP_FIND_QUIETLY TRUE) 10 | endif (SCTP_INCLUDE_DIR AND SCTP_LIBRARIES) 11 | 12 | # Include dir 13 | find_path(SCTP_INCLUDE_DIR 14 | NAMES netinet/sctp.h 15 | ) 16 | 17 | # Library 18 | find_library(SCTP_LIBRARY 19 | NAMES sctp 20 | ) 21 | 22 | # Set the include dir variables and the libraries and let libfind_process do the rest. 23 | # NOTE: Singular variables for this library, plural for libraries this this lib depends on. 24 | #set(SCTP_PROCESS_INCLUDES SCTP_INCLUDE_DIR) 25 | #set(SCTP_PROCESS_LIBS SCTP_LIBRARY) 26 | #libfind_process(SCTP) 27 | 28 | 29 | # handle the QUIETLY and REQUIRED arguments and set SCTP_FOUND to TRUE if 30 | # all listed variables are TRUE 31 | INCLUDE(FindPackageHandleStandardArgs) 32 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCTP DEFAULT_MSG SCTP_LIBRARY SCTP_INCLUDE_DIR) 33 | 34 | # If we successfully found the sctp library then add the library to the 35 | # SCTP_LIBRARIES cmake variable otherwise set SCTP_LIBRARIES to nothing. 36 | IF(SCTP_FOUND) 37 | SET( SCTP_LIBRARIES ${SCTP_LIBRARY} ) 38 | ELSE(SCTP_FOUND) 39 | SET( SCTP_LIBRARIES ) 40 | ENDIF(SCTP_FOUND) 41 | 42 | 43 | # Lastly make it so that the SCTP_LIBRARY and SCTP_INCLUDE_DIR variables 44 | # only show up under the advanced options in the gui cmake applications. 45 | MARK_AS_ADVANCED( SCTP_LIBRARY SCTP_INCLUDE_DIR ) 46 | 47 | -------------------------------------------------------------------------------- /cmake/Modules/FindMySQL.cmake: -------------------------------------------------------------------------------- 1 | # - Find mysqlclient 2 | # 3 | # -*- cmake -*- 4 | # 5 | # Find the native MySQL includes and library 6 | # 7 | # MySQL_INCLUDE_DIR - where to find mysql.h, etc. 8 | # MySQL_LIBRARIES - List of libraries when using MySQL. 9 | # MySQL_FOUND - True if MySQL found. 10 | 11 | IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY) 12 | # Already in cache, be silent 13 | SET(MySQL_FIND_QUIETLY TRUE) 14 | ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY) 15 | 16 | # Include dir 17 | FIND_PATH(MySQL_INCLUDE_DIR 18 | NAMES mysql.h 19 | PATH_SUFFIXES mysql 20 | ) 21 | 22 | # Library 23 | #SET(MySQL_NAMES mysqlclient mysqlclient_r) 24 | #SET(MySQL_NAMES mysqlclient_r) 25 | SET(MySQL_NAMES mysqlclient_r mysqlclient) 26 | FIND_LIBRARY(MySQL_LIBRARY 27 | NAMES ${MySQL_NAMES} 28 | PATHS /usr/lib /usr/local/lib 29 | PATH_SUFFIXES mysql 30 | ) 31 | 32 | IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY) 33 | SET(MySQL_FOUND TRUE) 34 | SET( MySQL_LIBRARIES ${MySQL_LIBRARY} ) 35 | ELSE (MySQL_INCLUDE_DIR AND MySQL_LIBRARY) 36 | SET(MySQL_FOUND FALSE) 37 | SET( MySQL_LIBRARIES ) 38 | ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY) 39 | 40 | 41 | IF (MySQL_FOUND) 42 | IF (NOT MySQL_FIND_QUIETLY) 43 | MESSAGE(STATUS "Found MySQL: ${MySQL_LIBRARY}") 44 | ENDIF (NOT MySQL_FIND_QUIETLY) 45 | ELSE (MySQL_FOUND) 46 | IF (MySQL_FIND_REQUIRED) 47 | MESSAGE(STATUS "Looked for MySQL libraries named ${MySQL_NAMES}.") 48 | MESSAGE(FATAL_ERROR "Could NOT find MySQL library") 49 | ENDIF (MySQL_FIND_REQUIRED) 50 | ENDIF (MySQL_FOUND) 51 | 52 | MARK_AS_ADVANCED( 53 | MySQL_LIBRARY 54 | MySQL_INCLUDE_DIR 55 | ) 56 | 57 | -------------------------------------------------------------------------------- /doc/rt_ereg.conf.sample: -------------------------------------------------------------------------------- 1 | # This file contains information for configuring the rt_ereg extension. 2 | # To find how to have freeDiameter load this extension, please refer to the freeDiameter documentation. 3 | # 4 | # The rt_ereg extension allows creation of routing rules based on AVP value matching regular expressions. 5 | 6 | # This extension supports configuration reload at runtime. Send 7 | # signal SIGUSR1 to the process to cause the process to reload its 8 | # config. 9 | 10 | # First, one must indicate which AVP should be used for matching. 11 | # At the moment, only AVP with OCTETSTRING types are valid. 12 | # AVP = "User-Name"; 13 | # It is possible to specify AVPs below GROUPED AVPs with the by separating AVPs with a colon (':'): 14 | # AVP = "Grouped-AVP1" : "Grouped-AVP2" : "Octetstring-AVP"; 15 | # This parameter is mandatory. There is no default value. 16 | 17 | # Then a list of rules follow. A rule has this format: 18 | # "pattern" : "server" += score ; 19 | # Where: 20 | # pattern is the quoted-string regex to match, 21 | # server is the next hop in the routing list that will receive the 22 | # score, which can be positive or negative. 23 | # Example: 24 | # "[[:digit:]]*" : "serverA.example.net" += -3 ; 25 | # means that if the AVP value is only numeric, the ServerA will have its score decreased by 3 points. 26 | # (reminder: the server with the peer with the highest score gets the message) 27 | # Note that all rules are tested for each message that contain the AVP, not only the first match. 28 | 29 | # There can be multiple blocks of AVPs and rules; just start the next one with another AVP line: 30 | # AVP = "Other-AVP"; 31 | # and continue with rules as above. 32 | -------------------------------------------------------------------------------- /extensions/dict_dcca_starent/dict_dcca_starent.csv: -------------------------------------------------------------------------------- 1 | Attribute Name,AVP Code,Section defined,Value Type,MUST,MAY,SHOULD NOT,MUST NOT 2 | @vendor,8164,,,,,, 3 | #=,,,,,,, 4 | # Cisco ASR 5000 Series AAA Interface,,,,,,, 5 | # Administration and Reference,,,,,,, 6 | # Release 8.x and 9.0,,,,,,, 7 | "# Last Updated June 30, 2010",,,,,,, 8 | # updated using v15 docs from Jan 2014,,,,,,, 9 | # www.cisco.com/c/dam/en/us/td/docs/wireless/asr_5000/15-0/15-0-AAA-Reference.pdf,,,,,,, 10 | #=,,,,,,, 11 | #,,,,,,, 12 | SN-Volume-Quota-Threshold,501,,Unsigned32,"M,V",,, 13 | SN-Unit-Quota-Threshold,502,,Unsigned32,"M,V",,, 14 | SN-Time-Quota-Threshold,503,,Unsigned32,"M,V",,, 15 | SN-Total-Used-Service-Unit,504,,Grouped,V,,, 16 | SN-Absolute-Validity-Time,505,,Time,V,,, 17 | SN-Bandwidth-Control,512,,Enumerated,"M,V",,, 18 | SN-Transparent-Data,513,,OctetString,V,,, 19 | SN-Traffic-Policy,514,,UTF8String,V,,, 20 | SN-Firewall-Policy,515,,UTF8String,V,,, 21 | SN-Usage-Monitoring-Control,517,,Grouped,V,,, 22 | SN-Monitoring-Key,518,,Unsigned32,V,,, 23 | SN-Usage-Volume,519,,Unsigned64,V,,, 24 | SN-Service-Flow-Detection,520,,Enumerated,V,,, 25 | SN-Usage-Monitoring,521,,Enumerated,V,,, 26 | SN-Session-Start-Indicator,522,,OctetString,"M,V",,, 27 | SN-Phase0-PSAPName,523,,UTF8String,V,,, 28 | SN-Charging-Id,525,,OctetString,V,,, 29 | SN-Remaining-Service-Unit,526,,Grouped,V,,, 30 | SN-Service-Start-Timestamp,527,,Time,V,,, 31 | SN-Rulebase-Id,528,,UTF8String,"M,V",,, 32 | SN-CF-Policy-ID,529,,Unsigned32,"M,V",,, 33 | SN-Charging-Collection-Function-Name,530,,UTF8String,V,,, 34 | SN-Fast-Reauth-Username,11010,,OctetString,"M,V",,, 35 | SN-Pseudonym-Username,11011,,OctetString,"M,V",,, 36 | -------------------------------------------------------------------------------- /extensions/app_radgw/md5.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************/ 2 | /* freeDiameter author note: 3 | * The content from this file comes directly from the hostap project. 4 | * It is redistributed under the terms of the BSD license, as allowed 5 | * by the original copyright reproduced below. 6 | */ 7 | 8 | /*********************************************************************************/ 9 | 10 | /* 11 | * MD5 hash implementation and interface functions 12 | * Copyright (c) 2003-2005, Jouni Malinen 13 | * 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License version 2 as 16 | * published by the Free Software Foundation. 17 | * 18 | * Alternatively, this software may be distributed under the terms of BSD 19 | * license. 20 | * 21 | * See README and COPYING for more details. 22 | */ 23 | 24 | #ifndef MD5_H 25 | #define MD5_H 26 | 27 | #define MD5_MAC_LEN 16 28 | 29 | void hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, 30 | const u8 *addr[], const size_t *len, u8 *mac); 31 | void hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, 32 | u8 *mac); 33 | 34 | #ifdef CONFIG_CRYPTO_INTERNAL 35 | struct MD5Context; 36 | 37 | void MD5Init(struct MD5Context *context); 38 | void MD5Update(struct MD5Context *context, unsigned char const *buf, 39 | unsigned len); 40 | void MD5Final(unsigned char digest[16], struct MD5Context *context); 41 | #endif /* CONFIG_CRYPTO_INTERNAL */ 42 | 43 | /* Forward declaration: */ 44 | void md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac); 45 | 46 | #endif /* MD5_H */ 47 | -------------------------------------------------------------------------------- /doc/echodrop.rgwx.conf.sample: -------------------------------------------------------------------------------- 1 | # Sample configuration file for the echodrop.rgwx plugin of RADIUS/Diameter translation agent. 2 | # 3 | # This plugin allows to easily specify the following handling of RADIUS attributes 4 | # received in a RADIUS request: 5 | # - ECHO: the attribute will be copied verbatim in the RADIUS answer. 6 | # - DROP: the attribute is discarded. 7 | # 8 | # In both cases, the attribute is NOT translated in Diameter message. 9 | # 10 | # The format of this file is: 11 | # CODE [ VENDOR [ TLV | EXT ] ]; 12 | # Where: 13 | # : is either DROP or ECHO. 14 | # : is a (decimal) integer between 0 and 255, and designates the type of the attribute. 15 | # 16 | # The remaining of the line is optional, and should only be used 17 | # with lines containing "CODE 26" (Vendor-Specific Attribute) 18 | # : a Vendor value (32 bit), see RFC2865 section 5.26 for detail. 19 | # 20 | # : The attribute is interpreted as TLV (rfc3865, section 5.26) 21 | # and we match only this "vendor type" value (8 bits). 22 | # 23 | # : NOTE: THIS OPTION IS NOT SUPPORTED PROPERLY YET!!!! 24 | # The attribute is interpreted as extended attribute (draft-ietf-radext-extended-attributes-08) 25 | # and we match only this "Ext-Type" value (16 bits). 26 | # This option should only be used with "CODE 26 VENDOR 0". 27 | # 28 | # Note that the Proxy-State (code 33) attribute is handled directly as an ECHO parameter by the gateway core. 29 | 30 | # Examples: 31 | # DROP code 18 ; # Reply-Message attribute, should not be included in requests 32 | # DROP code 26 vendor 9 ; # Drop any Cisco-specific attribute 33 | # ECHO code 26 vendor 0 ext 256 ; # Echo any extended attribute with the type 256. 34 | -------------------------------------------------------------------------------- /contrib/app_acct_tools/app_acct.conf: -------------------------------------------------------------------------------- 1 | 2 | # This is the configuration for use with the database created by 'database.sql' file. 3 | # One should take care of configuring the ConnInfo properly. 4 | ConnInfo = ""; 5 | 6 | # The table and special fields names: 7 | Table = "incoming"; 8 | Timestamp_field = "recorded_on"; 9 | Server_name_field = "recorded_serv"; 10 | 11 | # The AVPs that are saved in the table: 12 | "Origin-Host"; 13 | "Origin-Realm"; 14 | "Destination-Realm"; 15 | "Destination-Host"; 16 | "Session-Id"; 17 | "Origin-State-Id"; 18 | "Accounting-Record-Type"; 19 | "Accounting-Record-Number"; 20 | "User-Name"; 21 | "Event-Timestamp"; 22 | "Acct-Application-Id"; 23 | "Accounting-Sub-Session-Id"; 24 | "Acct-Session-Id"; 25 | "Acct-Multi-Session-Id"; 26 | "Origin-AAA-Protocol"; 27 | "Acct-Delay-Time"; 28 | "NAS-Identifier"; 29 | "NAS-IP-Address"; 30 | "NAS-IPv6-Address"; 31 | "NAS-Port"; 32 | "NAS-Port-Id"; 33 | "NAS-Port-Type"; 34 | "Service-Type"; 35 | "Termination-Cause"; 36 | "Accounting-Input-Octets"; 37 | "Accounting-Input-Packets"; 38 | "Accounting-Output-Octets"; 39 | "Accounting-Output-Packets"; 40 | "Acct-Authentic"; 41 | "Acct-Link-Count"; 42 | "Acct-Session-Time"; 43 | "Acct-Tunnel-Connection"; 44 | "Acct-Tunnel-Packets-Lost"; 45 | "Callback-Id"; 46 | "Callback-Number"; 47 | "Called-Station-Id"; 48 | "Calling-Station-Id"; 49 | "Connect-Info"; 50 | "Originating-Line-Info"; 51 | "Authorization-Lifetime"; 52 | "Session-Timeout"; 53 | "Idle-Timeout"; 54 | "Port-Limit"; 55 | "Accounting-Realtime-Required"; 56 | "Acct-Interim-Interval"; 57 | "Filter-Id"; 58 | "NAS-Filter-Rule"; 59 | "QoS-Filter-Rule"; 60 | "Login-IP-Host"; 61 | "Login-IPv6-Host"; 62 | "Login-LAT-Group"; 63 | "Login-LAT-Node"; 64 | "Login-LAT-Port"; 65 | "Login-LAT-Service"; 66 | "Login-Service"; 67 | "Login-TCP-Port"; 68 | "Route-Record" = { multi=5; }; 69 | -------------------------------------------------------------------------------- /extensions/dict_json/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dict_json extension 2 | PROJECT("JSON dictionary files support" C) 3 | 4 | INCLUDE(FindPkgConfig) 5 | 6 | # We use JSONCPP and JSON-Schema to parse and validate JSON files 7 | PKG_CHECK_MODULES(JSONCPP REQUIRED jsoncpp) 8 | # https://github.com/nfotex/json-schema/ 9 | PKG_CHECK_MODULES(JSON_SCHEMA REQUIRED json-schema) 10 | PKG_CHECK_MODULES(PCRECPP REQUIRED libpcrecpp) 11 | 12 | # List of source files 13 | SET(DICT_JSON_SRC 14 | dict_json.cc 15 | ${CMAKE_CURRENT_BINARY_DIR}/dict_json_dict_schema.cc 16 | ) 17 | 18 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 19 | INCLUDE_DIRECTORIES(${JSONCPP_INCLUDE_DIRS}) 20 | INCLUDE_DIRECTORIES(${JSON_SCHEMA_INCLUDE_DIR}) 21 | 22 | LINK_DIRECTORIES(${JSONCPP_LIBDIR}) 23 | LINK_DIRECTORIES(${JSON_SCHEMA_LIBDIR}) 24 | 25 | # Compile these files as a freeDiameter extension 26 | FD_ADD_EXTENSION(dict_json ${DICT_JSON_SRC}) 27 | 28 | TARGET_LINK_LIBRARIES(dict_json ${JSONCPP_LIBRARIES} ${JSON_SCHEMA_STATIC_LIBRARIES}) 29 | 30 | ADD_EXECUTABLE(dict-json-diff dict-json-diff.cc) 31 | TARGET_LINK_LIBRARIES(dict-json-diff ${JSONCPP_LIBRARIES} ${JSON_SCHEMA_STATIC_LIBRARIES}) 32 | 33 | ADD_EXECUTABLE(json-schema-to-c json-schema-to-c.cc) 34 | TARGET_LINK_LIBRARIES(json-schema-to-c ${JSONCPP_LIBRARIES} ${JSON_SCHEMA_STATIC_LIBRARIES} ${PCRECPP_LIBRARIES}) 35 | 36 | ADD_CUSTOM_COMMAND( 37 | OUTPUT dict_json_dict_schema.cc 38 | COMMAND json-schema-to-c ${CMAKE_CURRENT_SOURCE_DIR}/dict_json_dict_schema.json ${CMAKE_CURRENT_BINARY_DIR}/dict_json_dict_schema.cc 39 | DEPENDS dict_json_dict_schema.json 40 | ) 41 | 42 | #### 43 | ## INSTALL section ## 44 | 45 | INSTALL(TARGETS dict_json 46 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 47 | COMPONENT freeDiameter-dictionary-json) 48 | INSTALL(TARGETS dict-json-diff 49 | RUNTIME DESTINATION ${INSTALL_DAEMON_SUFFIX} 50 | COMPONENT freeDiameter-dictionary-json) 51 | -------------------------------------------------------------------------------- /contrib/OpenWRT/others/D-Link_DIR-330_netconfig.patch: -------------------------------------------------------------------------------- 1 | diff --git a/target/linux/brcm47xx/base-files/etc/init.d/netconfig b/target/linux/brcm47xx/base-files/etc/init.d/netconfig 2 | index d7839b6..6446483 100755 3 | --- a/target/linux/brcm47xx/base-files/etc/init.d/netconfig 4 | +++ b/target/linux/brcm47xx/base-files/etc/init.d/netconfig 5 | @@ -150,6 +150,30 @@ start() { 6 | } 7 | } 8 | } 9 | + if (model == "D-Link DIR-330") { # boardtype is 0x0472, so we need to reset the parameters 10 | + # The switch is on eth1, this script defaults to switch on eth0, so we write the values directly instead. 11 | + print "#### DIR-330: eth1 must be up for configuring the switch " 12 | + print "config interface switchport" 13 | + print " option ifname \"eth1\"" 14 | + print " option proto none" 15 | + print "" 16 | + print "config switch eth1" 17 | + print " option enable 1" 18 | + print "" 19 | + print "config switch_vlan eth1_0" 20 | + print " option device \"eth1\"" 21 | + print " option vlan 0" 22 | + print " option ports \"0 1 2 3 5t\"" 23 | + print "" 24 | + print "config switch_vlan eth1_1" 25 | + print " option device \"eth1\"" 26 | + print " option vlan 1" 27 | + print " option ports \"4 5t\"" 28 | + print "" 29 | + c["lan_ifname"] = "eth0.0" 30 | + c["wan_ifname"] = "eth0.1" 31 | + } 32 | + 33 | # Buffalo WBR-B11 and Buffalo WBR-G54 34 | if (nvram["boardtype"] == "bcm94710ap") { 35 | c["vlan0ports"] = "0 1 2 3 4 5u" 36 | -------------------------------------------------------------------------------- /extensions/app_sip/md5.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************************/ 2 | /* freeDiameter author note: 3 | * The content from this file comes directly from the hostap project. 4 | * It is redistributed under the terms of the BSD license, as allowed 5 | * by the original copyright reproduced below. 6 | * The file has not been modified, except for this notice. 7 | */ 8 | /*********************************************************************************/ 9 | 10 | /* 11 | * MD5 hash implementation and interface functions 12 | * Copyright (c) 2003-2005, Jouni Malinen 13 | * 14 | * This program is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License version 2 as 16 | * published by the Free Software Foundation. 17 | * 18 | * Alternatively, this software may be distributed under the terms of BSD 19 | * license. 20 | * 21 | * See README and COPYING for more details. 22 | */ 23 | 24 | #ifndef MD5_H 25 | #define MD5_H 26 | 27 | #define MD5_MAC_LEN 16 28 | 29 | typedef uint64_t u64; 30 | typedef uint32_t u32; 31 | typedef uint16_t u16; 32 | typedef uint8_t u8; 33 | typedef int64_t s64; 34 | typedef int32_t s32; 35 | typedef int16_t s16; 36 | typedef int8_t s8; 37 | 38 | #define HASHLEN 16 39 | typedef char HASH[HASHLEN]; 40 | #define HASHHEXLEN 32 41 | typedef char HASHHEX[HASHHEXLEN+1]; 42 | #define IN 43 | #define OUT 44 | 45 | struct MD5Context { 46 | u32 buf[4]; 47 | u32 bits[2]; 48 | u8 in[64]; 49 | }; 50 | typedef struct MD5Context MD5_CTX; 51 | #define os_memcpy(d, s, n) memcpy((d), (s), (n)) 52 | #define os_memset(s, c, n) memset(s, c, n) 53 | 54 | 55 | void MD5Init(struct MD5Context *ctx); 56 | void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len); 57 | void MD5Final(unsigned char digest[16], struct MD5Context *ctx); 58 | 59 | #endif /* MD5_H */ 60 | -------------------------------------------------------------------------------- /contrib/debian/copyright: -------------------------------------------------------------------------------- 1 | Format-Specification: http://dep.debian.net/deps/dep5/ 2 | Name: freeDiameter 3 | Maintainer: Sebastien Decugis 4 | Source: http://www.freediameter.net 5 | 6 | Files: * 7 | Copyright: 2008-2011, WIDE Project and NICT. 8 | License: BSD 9 | Redistribution and use of this software in source and binary forms, with or without modification, are 10 | permitted provided that the following conditions are met: 11 | . 12 | * Redistributions of source code must retain the above 13 | copyright notice, this list of conditions and the 14 | following disclaimer. 15 | . 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer in the documentation and/or other 19 | materials provided with the distribution. 20 | . 21 | * Neither the name of the WIDE Project or NICT nor the 22 | names of its contributors may be used to endorse or 23 | promote products derived from this software without 24 | specific prior written permission of WIDE Project and 25 | NICT. 26 | . 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 28 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 29 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 30 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 33 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 34 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | -------------------------------------------------------------------------------- /contrib/dict_legacy/dictionary.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 21 | 22 | 28 | 29 | 30 | 35 | 36 | 43 | 44 | 47 | 48 | 49 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /cmake/Modules/CMakeUserUseFlex.cmake: -------------------------------------------------------------------------------- 1 | # - Look for GNU flex, the lexer generator. 2 | # Defines the following: 3 | # FLEX_EXECUTABLE - path to the flex executable 4 | # FLEX_FILE - parse a file with flex 5 | # FLEX_PREFIX_OUTPUTS - Set to true to make FLEX_FILE produce outputs of 6 | # lex.${filename}.c, not lex.yy.c . Passes -P to flex. 7 | 8 | IF(NOT DEFINED FLEX_PREFIX_OUTPUTS) 9 | SET(FLEX_PREFIX_OUTPUTS FALSE) 10 | ENDIF(NOT DEFINED FLEX_PREFIX_OUTPUTS) 11 | 12 | IF(NOT FLEX_EXECUTABLE) 13 | MESSAGE(STATUS "Looking for flex") 14 | FIND_PROGRAM(FLEX_EXECUTABLE flex) 15 | IF(FLEX_EXECUTABLE) 16 | MESSAGE(STATUS "Looking for flex -- ${FLEX_EXECUTABLE}") 17 | ENDIF(FLEX_EXECUTABLE) 18 | MARK_AS_ADVANCED(FLEX_EXECUTABLE) 19 | ENDIF(NOT FLEX_EXECUTABLE) 20 | 21 | IF(FLEX_EXECUTABLE) 22 | MACRO(FLEX_FILE FILENAME) 23 | GET_FILENAME_COMPONENT(PATH "${FILENAME}" PATH) 24 | IF("${PATH}" STREQUAL "") 25 | SET(PATH_OPT "") 26 | ELSE("${PATH}" STREQUAL "") 27 | SET(PATH_OPT "/${PATH}") 28 | ENDIF("${PATH}" STREQUAL "") 29 | IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}") 30 | FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}") 31 | ENDIF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}") 32 | IF(FLEX_PREFIX_OUTPUTS) 33 | GET_FILENAME_COMPONENT(PREFIX "${FILENAME}" NAME_WE) 34 | ELSE(FLEX_PREFIX_OUTPUTS) 35 | SET(PREFIX "yy") 36 | ENDIF(FLEX_PREFIX_OUTPUTS) 37 | SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}/lex.${PREFIX}.c") 38 | ADD_CUSTOM_COMMAND( 39 | OUTPUT "${OUTFILE}" 40 | COMMAND "${FLEX_EXECUTABLE}" 41 | ARGS "-P${PREFIX}" 42 | "-o${OUTFILE}" 43 | "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}" 44 | DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}") 45 | SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" PROPERTIES GENERATED TRUE) 46 | ENDMACRO(FLEX_FILE) 47 | ENDIF(FLEX_EXECUTABLE) 48 | -------------------------------------------------------------------------------- /extensions/app_diameap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The Diameter EAP Application extension 2 | PROJECT("Diameter EAP Application extension" C) 3 | 4 | INCLUDE (CheckCSourceCompiles) 5 | 6 | # Find MySQL 7 | FIND_PACKAGE(MySQL REQUIRED) 8 | FIND_PACKAGE(Gcrypt REQUIRED) 9 | INCLUDE_DIRECTORIES(${MySQL_INCLUDE_DIR}) 10 | 11 | # Check for my_bool, deprecated in MySQL 8.0 12 | SET(CHECK_MYSQL_MY_BOOL " 13 | #include 14 | int main() { 15 | my_bool f; 16 | }") 17 | SET(CMAKE_REQUIRED_INCLUDES ${MySQL_INCLUDE_DIR}) 18 | SET(CMAKE_REQUIRED_LIBRARIES ${MySQL_LIBRARY}) 19 | CHECK_C_SOURCE_COMPILES("${CHECK_MYSQL_MY_BOOL}" HAVE_MYSQL_MY_BOOL) 20 | IF (HAVE_MYSQL_MY_BOOL) 21 | ADD_DEFINITIONS(-DHAVE_MYSQL_MY_BOOL) 22 | ENDIF() 23 | 24 | # Parse plugins 25 | ADD_SUBDIRECTORY(plugins) 26 | 27 | # Parser 28 | BISON_FILE(diameap.y) 29 | FLEX_FILE(diameap.l) 30 | SET_SOURCE_FILES_PROPERTIES(lex.diameap.c diameap.tab.c PROPERTIES COMPILE_FLAGS "-I \"${CMAKE_CURRENT_SOURCE_DIR}\"") 31 | 32 | 33 | set( diameapsrc 34 | diameap_defs.h 35 | diameap.h 36 | diameap_server.h 37 | diameap_plugins.h 38 | diameap_eap.h 39 | plugins.h 40 | diameap_eappacket.h 41 | diameap_user.h 42 | diameap.tab.h 43 | diameap.tab.c 44 | lex.diameap.c 45 | diameap.c 46 | diameap_server.c 47 | diameap_plugins.c 48 | diameap_init.c 49 | diameap_common.h 50 | diameap_eappacket.c 51 | libdiameap.h 52 | diameap_eap.c 53 | diameap_mysql.h 54 | diameap_mysql.c 55 | diameap_tls.h 56 | diameap_tls.c 57 | libcrypt.h 58 | libcrypt.c 59 | diameap_user.c 60 | ) 61 | 62 | FD_ADD_EXTENSION(app_diameap ${diameapsrc}) 63 | 64 | TARGET_LINK_LIBRARIES(app_diameap ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES} ${MySQL_LIBRARY} ) 65 | 66 | #### 67 | ## INSTALL section ## 68 | 69 | INSTALL(TARGETS app_diameap 70 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 71 | COMPONENT freeDiameter-eap-server) 72 | -------------------------------------------------------------------------------- /extensions/app_diameap/LICENSE: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | Author : Souheil Ben Ayed 3 | 4 | Copyright (c) 2009-2010, Souheil Ben Ayed, Teraoka Laboratory of Keio University, and the WIDE Project 5 | All rights reserved. 6 | 7 | Redistribution and use of this software in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | 3. All advertising materials mentioning features or use of this software 18 | must display the following acknowledgement: 19 | This product includes software developed by Souheil Ben Ayed . 20 | 21 | 4. Neither the name of Souheil Ben Ayed, Teraoka Laboratory of Keio University or the WIDE Project nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' AND ANY 26 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | -------------------------------------------------------------------------------- /libfdcore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The subproject name 2 | Project("freeDiameter core library" C) 3 | 4 | # Configuration for newer cmake 5 | cmake_policy(VERSION 2.6) 6 | if (POLICY CMP0022) 7 | cmake_policy(SET CMP0022 OLD) 8 | endif (POLICY CMP0022) 9 | 10 | # Configuration parser 11 | BISON_FILE(fdd.y) 12 | FLEX_FILE(fdd.l) 13 | SET_SOURCE_FILES_PROPERTIES(lex.fdd.c fdd.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") 14 | 15 | # List of source files 16 | SET(FDCORE_SRC 17 | fdcore-internal.h 18 | apps.c 19 | cnxctx.h 20 | config.c 21 | core.c 22 | cnxctx.c 23 | endpoints.c 24 | events.c 25 | extensions.c 26 | fifo_stats.c 27 | hooks.c 28 | dict_base_proto.c 29 | messages.c 30 | queues.c 31 | peers.c 32 | p_ce.c 33 | p_cnx.c 34 | p_dw.c 35 | p_dp.c 36 | p_expiry.c 37 | p_out.c 38 | p_psm.c 39 | p_sr.c 40 | routing_dispatch.c 41 | server.c 42 | tcp.c 43 | version.c 44 | ) 45 | 46 | IF(NOT DISABLE_SCTP) 47 | SET(FDCORE_SRC ${FDCORE_SRC} sctp.c sctp3436.c) 48 | ENDIF(NOT DISABLE_SCTP) 49 | 50 | SET(FDCORE_GEN_SRC 51 | lex.fdd.c 52 | fdd.tab.c 53 | fdd.tab.h 54 | ) 55 | 56 | # Save the list of files for the tests 57 | SET(FDCORE_SRC ${FDCORE_SRC} PARENT_SCOPE) 58 | SET(FDCORE_GEN_SRC ${FDCORE_GEN_SRC} PARENT_SCOPE) 59 | 60 | # Include path 61 | INCLUDE_DIRECTORIES(${LFDCORE_INCLUDES}) 62 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 63 | 64 | # Build the executable 65 | ADD_LIBRARY(libfdcore SHARED ${FDCORE_SRC} ${FDCORE_GEN_SRC}) 66 | ADD_DEPENDENCIES(libfdcore version_information) 67 | 68 | # Avoid the liblib name, and set the version 69 | SET_TARGET_PROPERTIES(libfdcore PROPERTIES 70 | OUTPUT_NAME "fdcore" 71 | SOVERSION ${FD_PROJECT_VERSION_API} 72 | VERSION ${FD_PROJECT_VERSION_MAJOR}.${FD_PROJECT_VERSION_MINOR}.${FD_PROJECT_VERSION_REV} 73 | LINK_INTERFACE_LIBRARIES "${LFDCORE_LINK_INTERFACES}") 74 | 75 | # The library itself needs other libraries 76 | LINK_DIRECTORIES(${CURRENT_BINARY_DIR}/../libfdproto) 77 | TARGET_LINK_LIBRARIES(libfdcore libfdproto ${LFDCORE_LIBS}) 78 | 79 | 80 | #### 81 | ## INSTALL section ## 82 | 83 | INSTALL(TARGETS libfdcore 84 | LIBRARY DESTINATION ${INSTALL_LIBRARY_SUFFIX} 85 | COMPONENT freeDiameter-common) 86 | -------------------------------------------------------------------------------- /cmake/Modules/FindLibXml2.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the LibXml2 xml processing library 2 | # Once done this will define 3 | # 4 | # LIBXML2_FOUND - System has LibXml2 5 | # LIBXML2_INCLUDE_DIR - The LibXml2 include directory 6 | # LIBXML2_LIBRARIES - The libraries needed to use LibXml2 7 | # LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2 8 | # LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2 9 | 10 | #============================================================================= 11 | # Copyright 2006-2009 Kitware, Inc. 12 | # Copyright 2006 Alexander Neundorf 13 | # 14 | # Distributed under the OSI-approved BSD License (the "License"); 15 | # see accompanying file Copyright.txt for details. 16 | # 17 | # This software is distributed WITHOUT ANY WARRANTY; without even the 18 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | # See the License for more information. 20 | #============================================================================= 21 | # (To distributed this file outside of CMake, substitute the full 22 | # License text for the above reference.) 23 | 24 | # use pkg-config to get the directories and then use these values 25 | # in the FIND_PATH() and FIND_LIBRARY() calls 26 | FIND_PACKAGE(PkgConfig) 27 | PKG_CHECK_MODULES(PC_LIBXML libxml-2.0) 28 | SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) 29 | 30 | FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h 31 | HINTS 32 | ${PC_LIBXML_INCLUDEDIR} 33 | ${PC_LIBXML_INCLUDE_DIRS} 34 | PATH_SUFFIXES libxml2 35 | ) 36 | 37 | FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2 38 | HINTS 39 | ${PC_LIBXML_LIBDIR} 40 | ${PC_LIBXML_LIBRARY_DIRS} 41 | ) 42 | 43 | FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint) 44 | # for backwards compat. with KDE 4.0.x: 45 | SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}") 46 | 47 | # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if 48 | # all listed variables are TRUE 49 | INCLUDE(FindPackageHandleStandardArgs) 50 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) 51 | 52 | MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE) 53 | 54 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | freeDiameter is an implementation of the Diameter protocol. 2 | 3 | Diameter is a protocol designed to carry Authentication, Authorization and 4 | Accounting (AAA) payload. It is an evolution of the RADIUS protocol (as the 5 | name suggests). 6 | 7 | Diameter is an extensible protocol. RFC3588 (currently under revision) defines the 8 | Base Protocol that all Diameter nodes must support, while other documents define 9 | the additional protocol support for specific applications. Such applications include 10 | for example Network Access Servers (RFC4005), EAP (RFC4072), ... 11 | 12 | 13 | The implementation consists in several components: 14 | - libfdproto : this shared library provides the functions to manipulate Diameter 15 | messages and dictionary. This library is meant to be re-used by other projects 16 | that would require parsing or manipulating Diameter messages. 17 | 18 | - libfdcore : this shared library contains the core of the framework. It establishes 19 | the network connections with other Diameter peers and performs the tasks described 20 | in Diameter Base Protocol, such as watchdogs, basic routing, ... It also handles 21 | the loading of extensions (see below). 22 | 23 | - freeDiameterd : this simple daemon parses the command line and initializes the 24 | freeDiameter framework. Use it for your Diameter server & agent components. 25 | In case of Diameter clients, you probably will prefer linking the libfdcore 26 | directly with your client application that must be made Diameter-aware. 27 | 28 | - extensions : the extensions provide the mean to augment the features of the 29 | freeDiameterd framework. Extensions can provide the handling of a Diameter 30 | server application, but also advanced routing features, peer management, etc. 31 | 32 | 33 | See http://www.freediameter.net/ for more information on the project. 34 | 35 | freeDiameter was previously known as the "waaad" project (WIDE AAA Daemon) 36 | 37 | This project is not related to the "freediameter" project from Sun on sourceforge. 38 | 39 | Author: Sebastien Decugis. 40 | 41 | See LICENSE file for legal information on this software. 42 | 43 | See INSTALL for information on building and using this software. 44 | -------------------------------------------------------------------------------- /contrib/RPM/freeDiameter.spec: -------------------------------------------------------------------------------- 1 | 2 | Name: freeDiameter 3 | Version: 1.1.6 4 | Release: 1%{?dist} 5 | Packager: krum.boy4ev@gmail.com 6 | Summary: freeDiameter is an implementation of the Diameter protocol. 7 | Group: Development/Libraries 8 | License: BSD License 9 | URL: http://www.freediameter.net 10 | Source0: http://www.freediameter.net/hg/freeDiameter/archive/1.1.6.tar.gz 11 | 12 | BuildRequires: cmake make gcc gcc-c++ flex bison lksctp-tools-devel 13 | BuildRequires: gnutls-devel libgcrypt-devel libidn-devel 14 | BuildRequires: mercurial 15 | Requires: lksctp-tools 16 | 17 | %description 18 | freeDiameter is an implementation of the Diameter protocol. 19 | 20 | Diameter is a protocol designed to carry Authentication, Authorization and 21 | Accounting (AAA) payload. It is an evolution of the RADIUS protocol (as the 22 | name suggests). 23 | 24 | See http://www.freediameter.net/ for more information on the project. 25 | 26 | freeDiameter was previously known as the "waaad" project (WIDE AAA Daemon) 27 | This project is not related to the "freediameter" project from Sun on sourceforge. 28 | 29 | Author: Sebastien Decugis. 30 | 31 | %package daemon 32 | Summary: Simple daemon parses the command line and initializes the freeDiameter framework. 33 | Group: Development/Libraries 34 | Requires: freeDiameter 35 | 36 | %description daemon 37 | freeDiameterd : this simple daemon parses the command line and initializes the 38 | freeDiameter framework. Use it for your Diameter server & agent components. 39 | In case of Diameter clients, you probably will prefer linking the libfdcore 40 | directly with your client application that must be made Diameter-aware. 41 | 42 | 43 | %prep 44 | %setup -qn %{name}-%{version} 45 | 46 | 47 | %build 48 | mkdir -p build 49 | cd build 50 | cmake ../ 51 | 52 | make %{?_smp_mflags} 53 | 54 | 55 | %install 56 | rm -rf $RPM_BUILD_ROOT 57 | cd build 58 | make install DESTDIR=$RPM_BUILD_ROOT 59 | make test 60 | 61 | %post daemon 62 | echo "/usr/local/lib/" > /etc/ld.so.conf.d/%{name}.conf 63 | /sbin/ldconfig 64 | 65 | %files 66 | %defattr(-,root,root,-) 67 | /usr/local/include/ 68 | /usr/local/lib/ 69 | 70 | %files daemon 71 | %defattr(-,root,root,-) 72 | /usr/local/bin/ 73 | 74 | 75 | 76 | %changelog 77 | * Sat Jul 5 2013 Krum Boychev - 1.1.6-1 78 | - initial version 79 | -------------------------------------------------------------------------------- /contrib/wireshark/sample/README: -------------------------------------------------------------------------------- 1 | This folder contains an example capture file, as well as the two 2 | private keys required to decode the TLS-protected exchanges. 3 | 4 | In order to decrypt properly the packets, you'll need a patched wireshark (see parent directory) 5 | and the SSL "RSA Private Keys" properties set to (replace with real full path): 6 | 192.168.103.10,3869,diameter,freeDiameter/contrib/wireshark/sample/192.168.103.10.priv.pem;192.168.103.20,3869,diameter,freeDiameter/contrib/wireshark/sample/192.168.103.20.priv.pem 7 | 8 | 9 | This capture contains everything that was exchanged by the peer since it boot up. 10 | The captured peer is "relay.a.rt.freediameter.net" with IP address 192.168.103.20. 11 | 12 | Here is the detail of what you can see in the capture, if the decyphering 13 | works as expected, in chronological order: 14 | 15 | ----------------------------------------------------------------------------- 16 | Frames | Comments 17 | ----------------------------------------------------------------------------- 18 | 1-24 | Peer booting up: DHCP, NTP, ... 19 | | 20 | 25-29 | Connection attempt from 192.168.103.10 21 | | first attempt on SCTP (frames 26-27) 22 | | then on TCP (frames 28-29) 23 | | 24 | 32-35 | freeDiameter starting: Diameter Identities 25 | | from the peer's configuration file are 26 | | DNS resolved. 27 | | 28 | 36-39 | SCTP connection to 192.168.103.10 29 | | 30 | 40-45 | Failed attempt to connect to 192.168.103.30 31 | | where freeDiameter was not started. 32 | | 33 | 46-49 | (I think this is trigged by Debug output, 34 | | I have to check) 35 | | 36 | 50-73 | TLS handshake on first stream pair (#0). 37 | | 38 | 74-90 | Resumed handshakes on streams #1 and #2 in parallel. 39 | | (not sure where to find that it is resumed, 40 | | except that certificates are not re-exchanged) 41 | | 42 | 91-92 | CER/CEA exchange. 43 | 93-96 | DWR/DWA exchange. 44 | | 45 | 103-118 | SCTP heartbeats are exchanged more frequently than DWR/DWA. 46 | | 47 | 119-124 | Concurrent DWR/DWA (it happens sometimes) 48 | | 49 | 125-128 | Another failed attempt to 192.168.103.30 (cf. frames 40-45) 50 | | 51 | 137-140 | DPR/DPA exchange. 52 | | 53 | 141-153 | TLS clean shutdown on all streams in parallel. 54 | | 55 | 154-157 | SCTP association is closed. 56 | ----------------------------------------------------------------------------- 57 | -------------------------------------------------------------------------------- /contrib/OpenWRT/test_required/testcase.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static pthread_barrier_t bar; 7 | static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; 8 | static pthread_cond_t cnd = PTHREAD_COND_INITIALIZER; 9 | static int called = 0; 10 | 11 | #ifndef ASSERT 12 | #define ASSERT(x) assert(x) 13 | #endif /* ASSERT */ 14 | 15 | static void cleanupmutex(void * arg) 16 | { 17 | printf("cancelation cleanup handler called\n"); 18 | if (arg) { 19 | ASSERT( pthread_mutex_unlock((pthread_mutex_t *)arg) == 0 ); 20 | called++; 21 | } 22 | 23 | } 24 | 25 | static void * mythread(void * a) 26 | { 27 | int ret; 28 | 29 | /* lock mutex */ 30 | ASSERT( pthread_mutex_lock(&mtx) == 0 ); 31 | 32 | /* Push cleanup */ 33 | pthread_cleanup_push(cleanupmutex, &mtx); 34 | 35 | printf("thread synchronization (mutex acquired)\n"); 36 | 37 | /* Wake the other thread */ 38 | ret = pthread_barrier_wait(&bar); 39 | ASSERT( (ret == 0) || (ret == PTHREAD_BARRIER_SERIAL_THREAD) ); 40 | 41 | /* Now wait for the condition, this unlocks the mutex */ 42 | do { 43 | printf("thread waiting cond\n"); 44 | ASSERT( pthread_cond_wait(&cnd, &mtx) == 0); 45 | printf("thread woken\n"); 46 | } while (1); 47 | 48 | /* Cleanup, never reached */ 49 | pthread_cleanup_pop(1); 50 | return NULL; 51 | } 52 | 53 | int main(int argc, char * argv[]) 54 | { 55 | int ret; 56 | pthread_t thr; 57 | void * dummy; 58 | 59 | /* initialize the barrier */ 60 | ASSERT( pthread_barrier_init(&bar, NULL, 2) == 0 ); 61 | 62 | printf("Creating thread\n"); 63 | 64 | /* Create the thread */ 65 | ASSERT( pthread_create(&thr, NULL, mythread, NULL) == 0 ); 66 | 67 | printf("main synchronization\n"); 68 | ret = pthread_barrier_wait(&bar); 69 | ASSERT( (ret == 0) || (ret == PTHREAD_BARRIER_SERIAL_THREAD) ); 70 | 71 | ASSERT( pthread_mutex_lock(&mtx) == 0 ); 72 | printf("main: thread is now waiting for condvar\n"); 73 | 74 | /* Cancel the thread */ 75 | ASSERT( pthread_cancel(thr) == 0 ); 76 | 77 | /* Now, unlock, so that the thread can actually really exit */ 78 | ASSERT( pthread_mutex_unlock(&mtx) == 0 ); 79 | 80 | /* Release thread resources */ 81 | ASSERT( pthread_join(thr, &dummy) == 0 ); 82 | 83 | if (called == 1) 84 | printf("Test successful!\n"); 85 | else 86 | printf("Test failed! Cleanup was not called (& lock not released)\n"); 87 | 88 | return 0; 89 | 90 | } 91 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Unless specified otherwise, this software package is copyrighted under the terms of the BSD license, as follow: 2 | 3 | Software License Agreement (BSD License) 4 | 5 | Copyright (c) 2008-2019, WIDE Project and NICT 6 | All rights reserved. 7 | 8 | Redistribution and use of this software in source and binary forms, with or without modification, are 9 | permitted provided that the following conditions are met: 10 | 11 | * Redistributions of source code must retain the above 12 | copyright notice, this list of conditions and the 13 | following disclaimer. 14 | 15 | * Redistributions in binary form must reproduce the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer in the documentation and/or other 18 | materials provided with the distribution. 19 | 20 | * Neither the name of the WIDE Project or NICT nor the 21 | names of its contributors may be used to endorse or 22 | promote products derived from this software without 23 | specific prior written permission of WIDE Project and 24 | NICT. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 27 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 28 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 29 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 32 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 33 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | 36 | 37 | The following authors have contributed the following files. See source files for copyright information. 38 | 39 | * Alexandre Westfahl: 40 | extensions/dict_sip/* 41 | extensions/app_sip/* 42 | extensions/app_radgw/rgwx_sip.c 43 | 44 | * Souheil Ben Ayed: 45 | extensions/app_diameap/* 46 | 47 | * Francois Bard: 48 | extensions/dict_mip6a/* 49 | extensions/dict_mip6i/* 50 | extensions/dict_nas_mipv6/* 51 | extensions/dict_rfc5777/* 52 | 53 | * Thomas Klausner: 54 | several extensions and numerous fixes / improvements. 55 | 56 | * Luke Mewburn: 57 | numerous fixes / improvements. 58 | -------------------------------------------------------------------------------- /extensions/app_redirect/ard-host.h.in: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2011, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | /* Configuration from compile-time */ 37 | #ifndef RTD_IS_CONFIG 38 | #define RTD_IS_CONFIG 39 | 40 | #cmakedefine HAVE_REG_STARTEND 41 | 42 | #endif /* RTD_IS_CONFIG */ 43 | -------------------------------------------------------------------------------- /extensions/rt_default/rt_default-host.h.in: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2011, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | /* Configuration from compile-time */ 37 | #ifndef RTD_IS_CONFIG 38 | #define RTD_IS_CONFIG 39 | 40 | #cmakedefine HAVE_REG_STARTEND 41 | 42 | #endif /* RTD_IS_CONFIG */ 43 | -------------------------------------------------------------------------------- /extensions/app_sip/README: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Alexandre Westfahl * 4 | * * 5 | * Copyright (c) 2010, Alexandre Westfahl, Teraoka Laboratory (Keio University), and the WIDE Project. * 6 | * * 7 | * All rights reserved. * 8 | * * 9 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 10 | * permitted provided that the following conditions are met: * 11 | * * 12 | * * Redistributions of source code must retain the above * 13 | * copyright notice, this list of conditions and the * 14 | * following disclaimer. * 15 | * * 16 | * * Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the * 18 | * following disclaimer in the documentation and/or other * 19 | * materials provided with the distribution. * 20 | * * 21 | * * Neither the name of the Teraoka Laboratory nor the * 22 | * names of its contributors may be used to endorse or * 23 | * promote products derived from this software without * 24 | * specific prior written permission of Teraoka Laboratory * 25 | * * 26 | * * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 28 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 29 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 33 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 34 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 35 | *********************************************************************************************************/ 36 | 37 | 38 | Diameter-SIP Application will be fully compliant with RFC4740 (server part). However, there is still some work to do so it should be considered as experimental for now. 39 | 40 | -------------------------------------------------------------------------------- /extensions/test_sip/registrationtermination.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Alexandre Westfahl * 4 | * * 5 | * Copyright (c) 2010, Alexandre Westfahl, Teraoka Laboratory (Keio University), and the WIDE Project. * 6 | * * 7 | * All rights reserved. * 8 | * * 9 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 10 | * permitted provided that the following conditions are met: * 11 | * * 12 | * * Redistributions of source code must retain the above * 13 | * copyright notice, this list of conditions and the * 14 | * following disclaimer. * 15 | * * 16 | * * Redistributions in binary form must reproduce the above * 17 | * copyright notice, this list of conditions and the * 18 | * following disclaimer in the documentation and/or other * 19 | * materials provided with the distribution. * 20 | * * 21 | * * Neither the name of the Teraoka Laboratory nor the * 22 | * names of its contributors may be used to endorse or * 23 | * promote products derived from this software without * 24 | * specific prior written permission of Teraoka Laboratory * 25 | * * 26 | * * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 28 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 29 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 33 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 34 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 35 | *********************************************************************************************************/ 36 | #include "test_sip.h" 37 | 38 | 39 | int test_sip_RTR_cb( struct msg ** msg, struct avp * paramavp, struct session * sess, void * opaque, enum disp_action * act) 40 | { 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /doc/app_diameap.conf.sample: -------------------------------------------------------------------------------- 1 | ##### a sample Configuration file for DiamEAP 2 | 3 | # MySQL Database settings 4 | # Specify connection parameters for DiamEAP MySQL database: 5 | # - username and password to connect to the MySQL Server 6 | # - databaseserver : the MySQL server location. It can be the IP address or the host name where MySQL server is located. 'localhost' can be used as the location if the server is locatd in the same host than DiamEAP. 7 | # - database_name : the created database for DiamEAP. 8 | 9 | # Syntax : 10 | # DiamEAP_MySQL = "" , "" , "" , ""; 11 | 12 | 13 | 14 | ##### Extensible Authentication Protocol (EAP) Methods Plugins ##### 15 | # An EAP method is identified by its EAP method name, EAP TYPE, VENDOR and path to its EAP Method Plugin. 16 | # Optionally, path to a configuration file of plugin can also be provided. 17 | # Location of plugins and their configuration files can be provided by the absolute pathor the relative path from the location configured in cmake. 18 | # An EAP Method Plugin can not be loaded twice. Only the first added method will be loaded. 19 | # Any EAP Method plugin with a same EAP_TYPE value than an already loaded one will be discarded. 20 | # EAP Methods are added in the same order they are added to the the configuration file. 21 | 22 | # Syntax : 23 | # Load_plugin = "":EAP_TYPE:VENDOR:"":""; 24 | # 25 | # Example: 26 | # Load_plugin = "EAP MD5":4:0:"/extensions/eap_md5.emp":""; 27 | # Load_plugin = "EAP TLS":13:0;"/extensions/eap_tls.emp":"/doc/eap_tls_plugin.diameap.conf"; 28 | 29 | Load_plugin = "EAP Identity":1:0:"/extensions/eap_identity.emp":""; 30 | 31 | # Enable/disable checking User's Identity. If disabled, default parameters value will be used for authentication and authorization attributes. 32 | # Default values are defined in database for 'Default User'. 33 | Check_User_Identity = 1; 34 | 35 | # In addition to authentication DiamEAP can be configured to check authorization of authenticated users. If set to 0 authorization is disabled, otherwise enabled.( by default disabled). 36 | Authorization = 1; 37 | 38 | # This parameter specify the maximum number of seconds provided to the access device for responding to an EAP request. (by default set to 30 seconds) 39 | #Multi_Round_Time_Out=30; 40 | 41 | # After receivin a number of invalid EAP packets, DiamEAP reject the authentication by responding with Failure Authentication. 42 | # The default value of maximum number of invalid EAP packets is set to 5 packets. 43 | # The value of maximum invalid EAP packets can be modified by adding a new value. 44 | #MAX_Invalid_EAP_Packets=5; 45 | -------------------------------------------------------------------------------- /extensions/_sample/fini.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2011, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | #include 37 | 38 | /* The function MUST be called this */ 39 | void fd_ext_fini(void) 40 | { 41 | /* This code is executed when the daemon is exiting; cleanup management should be placed here */ 42 | TRACE_DEBUG(INFO, "Extension is terminated... Bye!"); 43 | return ; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /extensions/_sample/hello.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2013, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | /* Sample file demonstrating how to write some C++ code */ 37 | 38 | #include 39 | 40 | #include 41 | 42 | extern "C" void mycppfunc(); /* will be called from C code */ 43 | 44 | 45 | void mycppfunc() { 46 | std::cout << "Hello World!" << std::endl; 47 | /* done */ 48 | } 49 | -------------------------------------------------------------------------------- /extensions/app_diameap/libcrypt.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | * Software License Agreement (BSD License) 3 | * Author : Souheil Ben Ayed 4 | * 5 | * Copyright (c) 2009-2010, Souheil Ben Ayed, Teraoka Laboratory of Keio University, and the WIDE Project 6 | * All rights reserved. 7 | * 8 | * Redistribution and use of this software in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by Souheil Ben Ayed . 21 | * 22 | * 4. Neither the name of Souheil Ben Ayed, Teraoka Laboratory of Keio University or the WIDE Project nor the 23 | * names of its contributors may be used to endorse or promote products 24 | * derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' AND ANY 27 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 30 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | *****************************************************************************************************/ 37 | 38 | 39 | #ifndef LIBCRYPT_H_ 40 | #define LIBCRYPT_H_ 41 | 42 | /* EAP-TLS*/ 43 | #include "diameap_tls.h" 44 | 45 | GCC_DIAG_OFF("-Wdeprecated-declarations") 46 | #include 47 | GCC_DIAG_ON("-Wdeprecated-declarations") 48 | #include 49 | 50 | 51 | 52 | int md5hash(void * buffer, int length, void * digest); 53 | 54 | #endif /* LIBCRYPT_H_ */ 55 | -------------------------------------------------------------------------------- /extensions/dbg_interactive/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The dbg_interactive extension 2 | PROJECT("Interactive debug facility based on SWIG" C) 3 | 4 | 5 | # This module is using Python 6 | SET(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) 7 | FIND_PACKAGE(PythonLibs) 8 | INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) 9 | 10 | ##### 11 | # Wrapper to fD in python 12 | FIND_PACKAGE(SWIG REQUIRED) 13 | INCLUDE(${SWIG_USE_FILE}) 14 | SET(CMAKE_SWIG_FLAGS -castmode -threads) 15 | 16 | # Add the dependencies for re-swig-ing the file 17 | SET(SWIG_MODULE_fDpy_EXTRA_DEPS 18 | ${CMAKE_BINARY_DIR}/include/freeDiameter/freeDiameter-host.h 19 | ${CMAKE_SOURCE_DIR}/include/freeDiameter/libfdcore.h 20 | ${CMAKE_SOURCE_DIR}/include/freeDiameter/libfdproto.h 21 | lists.i 22 | dictionary.i 23 | sessions.i 24 | routing.i 25 | messages.i 26 | dispatch.i 27 | queues.i 28 | peers.i 29 | events.i 30 | endpoints.i 31 | posix.i 32 | hooks.i 33 | ) 34 | SET_SOURCE_FILES_PROPERTIES(dbg_interactive.i PROPERTIES SWIG_MODULE_NAME fDpy) 35 | 36 | # The following code is inspired from SWIG_ADD_MODULE, but we do only what we need 37 | SWIG_MODULE_INITIALIZE(fDpy python) 38 | SWIG_ADD_SOURCE_TO_MODULE(fDpy swig_generated_sources "dbg_interactive.i") 39 | 40 | # In order to avoid shipping the python file that contains the shadow class definitions, 41 | # we transform this file in a C-style string and compile it within our software. 42 | # We use for this purpose xxd tool provided with vim package. 43 | FIND_PROGRAM(XXD_EXECUTABLE xxd) 44 | # To avoid the dependency, simply compile it if not provided 45 | if (NOT XXD_EXECUTABLE) 46 | SET_SOURCE_FILES_PROPERTIES(helper/xxd.c PROPERTIES COMPILE_DEFINITIONS UNIX) 47 | ADD_EXECUTABLE(xxd helper/xxd.c) 48 | SET(XXD_EXECUTABLE xxd) 49 | endif (NOT XXD_EXECUTABLE) 50 | # And now the magic command 51 | ADD_CUSTOM_COMMAND( 52 | OUTPUT "fDpy-inc.c" 53 | COMMAND "${XXD_EXECUTABLE}" 54 | ARGS "-i" 55 | "fDpy.py" 56 | "fDpy-inc.c" 57 | MAIN_DEPENDENCY "${swig_extra_generated_files}" 58 | COMMENT "Shadow definitions") 59 | 60 | # Ensure that the generated source files are removed 61 | GET_DIRECTORY_PROPERTY(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES) 62 | SET_DIRECTORY_PROPERTIES(PROPERTIES 63 | ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources};fDpy-inc.c") 64 | 65 | 66 | ##### 67 | # Extension that embeds the python interpreter 68 | FD_ADD_EXTENSION(dbg_interactive dbg_interactive.c ${swig_generated_sources} fDpy-inc.c) 69 | TARGET_LINK_LIBRARIES(dbg_interactive ${PYTHON_LIBRARIES}) 70 | 71 | 72 | #### 73 | ## INSTALL section ## 74 | 75 | INSTALL(TARGETS dbg_interactive 76 | LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} 77 | COMPONENT freeDiameter-debug-tools) 78 | -------------------------------------------------------------------------------- /contrib/wireshark/HOWTO: -------------------------------------------------------------------------------- 1 | -------- 2 | FOREWORD 3 | -------- 4 | 5 | The patch in this folder allows Wireshark to process packets that contain TLS-protected 6 | Diameter messages over SCTP multi-stream associations. Each SCTP stream pairs is handled 7 | as a separate TLS channel (RFC3436), which is consistent with freeDiameter 1.0.x mechanism. 8 | 9 | It should be noted however that rfc3588bis (revised Diameter) recommends that DTLS is used 10 | instead of TLS over SCTP, for the reasons highlighted in the introduction of RFC6083. 11 | When this new mechanism is implemented in freeDiameter, a different patch will probably 12 | be required for wireshark. 13 | 14 | 15 | The instructions in this file will change your wireshark binary in a way suitable for 16 | analysis of Diameter over TLS over SCTP, but may have unexpected side-effects 17 | on some other protocols analysis (including DTLS). 18 | 19 | The instructions refer to Debian-style packaging (apt), you should adapt 20 | the process to build a new modified package of wireshark for your distribution. 21 | 22 | The provided patch has been successfully tested with: 23 | - wireshark-1.2.7 (Ubuntu Lucid) 24 | - wireshark-1.2.11 (Ubuntu Maverick) 25 | It may or may not work on more recent or ancient versions. 26 | 27 | 28 | ------------ 29 | INSTRUCTIONS 30 | ------------ 31 | 32 | The steps are: 33 | - get your wireshark source 34 | apt-get source wireshark 35 | cd wireshark-1.2.* 36 | 37 | - apply the patch 38 | cat ~/wireshark-1.2.7-diameter-tls.patch | patch -p1 39 | 40 | - increase the version number 41 | dch -lfD "Added support for Diameter over TLS over SCTP" 42 | 43 | - Create a new package, this might take a while 44 | fakeroot debian/rules binary 45 | 46 | - Install the modified version 47 | sudo dpkg --install ../wireshark-common_*fD*.deb ../wireshark_*fD*.deb 48 | 49 | - Start the new wireshark: 50 | wireshark & 51 | 52 | To analyze a capture file, you will need the private keys of both peers involved. 53 | 54 | Let's imagine for example: 55 | peer A with IP address 192.168.0.10 has private key privA.pem 56 | peer B with IP address 192.168.0.11 has private key privB.pem 57 | 58 | In wireshark you must do the following: 59 | - go to menu Edit->Preferences 60 | - In the left panel, under Protocols, scroll to "SSL" and select it. 61 | - In the right panel, fill "RSA keys list" as follow: 62 | 192.168.0.10,3869,diameter,/absolute/path/to/privA.pem;192.168.0.11,3869,diameter,/absolute/path/to/privB.pem 63 | - You may find also useful to select an SSL debug file to get a hint of any problem. 64 | 65 | Once this configuration is complete, you should be able to see the contents of SCTP packets, 66 | including protected Diameter payload. 67 | 68 | Check the "sample" subdirectory for a test capture file. 69 | -------------------------------------------------------------------------------- /extensions/dbg_loglevel/dbg_loglevel.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Thomas Klausner * 4 | * * 5 | * Copyright (c) 2019, Thomas Klausner * 6 | * All rights reserved. * 7 | * * 8 | * Written under contract by Effortel Technologies SA, http://effortel.com/ * 9 | * * 10 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 11 | * permitted provided that the following conditions are met: * 12 | * * 13 | * * Redistributions of source code must retain the above * 14 | * copyright notice, this list of conditions and the * 15 | * following disclaimer. * 16 | * * 17 | * * Redistributions in binary form must reproduce the above * 18 | * copyright notice, this list of conditions and the * 19 | * following disclaimer in the documentation and/or other * 20 | * materials provided with the distribution. * 21 | * * 22 | * * Neither the name of the WIDE Project or NICT nor the * 23 | * names of its contributors may be used to endorse or * 24 | * promote products derived from this software without * 25 | * specific prior written permission of WIDE Project and * 26 | * NICT. * 27 | * * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 30 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 31 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 34 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 35 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | *********************************************************************************************************/ 37 | 38 | /* 39 | * See the dbg_loglevel.conf.sample file for the format of the configuration file. 40 | */ 41 | 42 | /* FreeDiameter's common include file */ 43 | #include 44 | 45 | /* Parse the configuration file */ 46 | int dbg_loglevel_conf_handle(char *); 47 | 48 | -------------------------------------------------------------------------------- /INSTALL.OSX: -------------------------------------------------------------------------------- 1 | See INSTALL file for general instructions on building freeDiameter. 2 | 3 | ------------------ 4 | QUICK INSTRUCTIONS 5 | ------------------ 6 | 7 | Starting from version 1.1.5, freeDiameter is available through Homebrew: 8 | 9 | 1) Install Homebrew 10 | a) Install Command Line Tools for Xcode or Xcode: 11 | - Command Line Tools (your OS X Version) for Xcode: 12 | https://developer.apple.com/downloads (Free Apple Developer ID Registration Required) 13 | - or Xcode: 14 | https://itunes.apple.com/us/app/xcode/id497799835 (Free App Store Account Required) 15 | 16 | b) Install Homebrew 17 | $ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" 18 | 19 | 2) Install freeDiameter: 20 | $ brew install freediameter 21 | 22 | After installation is done "Caveats" section will provide information 23 | how to start freeDiameterd through launchd at system startup. 24 | 25 | To view this information again: 26 | $ brew info freediameter 27 | 28 | To learn more about freeDiameter configuration options, read: 29 | http://www.freediameter.net/trac/wiki/Configuration 30 | 31 | For more information on available extension and how to configure them, read: 32 | http://www.freediameter.net/trac/wiki/Extensions 33 | 34 | ------------ 35 | FROM SOURCES 36 | ------------ 37 | 38 | 1) Install Homebrew: 39 | See QUICK INSTRUCTIONS Step #1 above. 40 | 41 | 2) Install dependencies: 42 | $ brew install mercurial cmake gnutls libgcrypt postgres mysql libidn 43 | 44 | Notes: 45 | * GNU IDN (libidn) is optional, see below 46 | * When libusrsctp package is available, you can use it as well. 47 | However, it requires some rework on the source code as libusrsctp is not fully 48 | compliant with the other SCTP stack. 49 | 50 | 3) Retrieve source code: 51 | $ hg clone http://www.freediameter.net/hg/freeDiameter 52 | 53 | 4) Enter source folder: 54 | $ cd freeDiameter 55 | 56 | 5) Create build folder: 57 | $ mkdir freeDiameter-build 58 | 59 | 6) Enter build folder: 60 | $ cd freeDiameter-build 61 | 62 | 7) Configure: 63 | $ cmake .. -DDISABLE_SCTP:BOOL=ON 64 | 65 | or for ncurses-based configuration: 66 | $ ccmake .. -DDISABLE_SCTP:BOOL=ON 67 | 68 | Notes: 69 | * GNU IDN (Support for International Domain Names) can be disabled with: 70 | -DDIAMID_IDNA_IGNORE=ON or -DDIAMID_IDNA_REJECT=ON 71 | * For more information on available configuration options, read: 72 | http://www.freediameter.net/trac/wiki/Installation 73 | 74 | 8) Compile: 75 | $ make 76 | 77 | 9) Install (might require to be root): 78 | $ make install 79 | 80 | ------------------------------------------------ 81 | 82 | These instructions have been tested on OS X: 83 | - 10.6.8 (Snow Leopard) 84 | - 10.7.5 (Lion) 85 | - 10.8.2 (Mountain Lion) 86 | -------------------------------------------------------------------------------- /extensions/dict_legacy_xml/dict_lxml.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2011, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | /* 37 | * Legacy XML dictionary files support for freeDiameter. 38 | */ 39 | 40 | #include "dict_lxml.h" 41 | 42 | /* entry point */ 43 | static int dict_lxml_entry(char * conffile) 44 | { 45 | TRACE_ENTRY("%p", conffile); 46 | 47 | /* Parse the configuration file -- everything happens there */ 48 | CHECK_FCT( dict_lxml_handle(conffile) ); 49 | 50 | /* We're done */ 51 | return 0; 52 | } 53 | 54 | EXTENSION_ENTRY("dict_legacy_xml", dict_lxml_entry); 55 | -------------------------------------------------------------------------------- /extensions/app_diameap/libcrypt.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | * Software License Agreement (BSD License) 3 | * Author : Souheil Ben Ayed 4 | * 5 | * Copyright (c) 2009-2010, Souheil Ben Ayed, Teraoka Laboratory of Keio University, and the WIDE Project 6 | * All rights reserved. 7 | * 8 | * Redistribution and use of this software in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by Souheil Ben Ayed . 21 | * 22 | * 4. Neither the name of Souheil Ben Ayed, Teraoka Laboratory of Keio University or the WIDE Project nor the 23 | * names of its contributors may be used to endorse or promote products 24 | * derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' AND ANY 27 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 30 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | *****************************************************************************************************/ 37 | 38 | 39 | #include "libcrypt.h" 40 | 41 | int md5hash(void * buffer, int length, void * digest){ 42 | 43 | gcry_md_hd_t md5_ctx; 44 | 45 | gcry_md_open ( &md5_ctx, GCRY_MD_MD5, 0); 46 | 47 | if(!gcry_md_is_enabled(md5_ctx, GCRY_MD_MD5)){ 48 | fprintf(stderr,"[libcrypt] unable to initiate MD5 hash algorithm.\n"); 49 | } 50 | 51 | gcry_md_write(md5_ctx,buffer,length); 52 | 53 | memcpy (digest, gcry_md_read (md5_ctx, 0), 16); 54 | gcry_md_close (md5_ctx); 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /extensions/dict_legacy_xml/dict_lxml.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2011, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | /* Header file for the dict_legacy_xml extension. 37 | * 38 | * See the dict_legacy_xml.conf.sample file for the format of the configuration file. 39 | */ 40 | 41 | /* FreeDiameter's common include file */ 42 | #include 43 | 44 | /* Parse the configuration file */ 45 | int dict_lxml_handle(char * conffile); 46 | 47 | /* Parse an XML file and return the number of dictionary objects or -1 on error */ 48 | int dict_lxml_parse(char * xmlfilename); 49 | -------------------------------------------------------------------------------- /extensions/rt_busypeers/rtbusy.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2013, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | /* 37 | * See the rt_busypeers.conf.sample file for the format of the configuration file. 38 | */ 39 | 40 | /* FreeDiameter's common include file */ 41 | #include 42 | 43 | 44 | /* Parse the configuration file */ 45 | int rtbusy_conf_handle(char * conffile); 46 | 47 | /* The configuration structure */ 48 | extern struct rtbusy_conf { 49 | int SkipTooBusyErrors; 50 | int RetryDistantPeers; 51 | int RetryMaxPeers; 52 | int RelayTimeout; 53 | } rtbusy_conf; 54 | 55 | -------------------------------------------------------------------------------- /contrib/app_acct_tools/README: -------------------------------------------------------------------------------- 1 | This folder contains several tools to use and parse the data from the app_acct.fdx extension. 2 | 3 | - database.sql : 4 | An example database format for use with the scripts in this folder. 5 | 6 | - app_acct.conf : 7 | The part of app_acct.conf that is relevant to this database schema. 8 | 9 | - purge_to_file.php : 10 | This PHP script is used to take the records from the incoming table (stored by app_acct.fdx 11 | extension) and save these records in a file in SQL format. This is similar to pg_dump 12 | command, except that all the records that have been saved in the file are removed from 13 | the table. This can be used in cron jobs for example to maintain a reasonable size of 14 | the incoming table and move the data to another host for off-line processing. It can 15 | also be useful to aggregate the data from different hosts, if you are load-balancing your 16 | accounting servers for example (granted that all app_acct.fdx use identical table format 17 | on all the servers). See the top of the file for configuration parameters. 18 | 19 | - process_records.php : 20 | This PHP script processes the records pertaining to users sessions, as follow: 21 | * when a session is complete (STOP record received), it stores a session summary 22 | into the processed records table (see process_database.sql file for format). 23 | * It optionally archives the processed records into a different table, before deleting them. 24 | * It can also move records of unterminated sessions that are older than a configurable time 25 | to an orphan_records table, so that they are not re-processed every time. 26 | This orphans table must have the same structure as the "incoming" table. 27 | 28 | - display_results.php, display_self.php, display_stats.php : 29 | These scripts give a few examples of how to display the processed data. 30 | 31 | USAGE: 32 | *) Initial: create your database using database.sql file 33 | *) Configure the app_acct.fdx extension using tips from app_acct.conf 34 | 35 | The following processing can be run for example as cron jobs. 36 | 1) On each accounting server for the realm, configure the app_acct.fdx extension to 37 | dump the records in a local database (all servers must use the same database format). 38 | The table would typically be "incoming". 39 | 2) Run the purge_to_file.php script on each server regularly, then move the generated 40 | files onto a single server for processing. This server only needs the other tables. 41 | 3) Add the data from the files into the database in this server by running: 42 | psql < file.sql 43 | Each file that has been added should then be archived and removed so that it is not 44 | re-added later. 45 | 4) Run the process_records.php script on this processing server. Now, the database 46 | contains the aggregated data that can be visualized with display_*.php scripts. 47 | 48 | -------------------------------------------------------------------------------- /libfdcore/version.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2013, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | #include 37 | #include 38 | 39 | #ifdef FD_PROJECT_VERSION_HG 40 | # define FD_LIBFDCORE_VERSION \ 41 | _stringize(FD_PROJECT_VERSION_MAJOR) "." _stringize(FD_PROJECT_VERSION_MINOR) "." _stringize(FD_PROJECT_VERSION_REV) "-" FD_PROJECT_VERSION_HG_VAL 42 | #else 43 | # define FD_LIBFDCORE_VERSION \ 44 | _stringize(FD_PROJECT_VERSION_MAJOR) "." _stringize(FD_PROJECT_VERSION_MINOR) "." _stringize(FD_PROJECT_VERSION_REV) 45 | #endif 46 | 47 | const char fd_core_version[] = FD_LIBFDCORE_VERSION; 48 | -------------------------------------------------------------------------------- /libfdproto/version.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2013, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | #include "fdproto-internal.h" 37 | #include 38 | 39 | #ifdef FD_PROJECT_VERSION_HG 40 | # define FD_LIBFDPROTO_VERSION \ 41 | _stringize(FD_PROJECT_VERSION_MAJOR) "." _stringize(FD_PROJECT_VERSION_MINOR) "." _stringize(FD_PROJECT_VERSION_REV) "-" FD_PROJECT_VERSION_HG_VAL 42 | #else 43 | # define FD_LIBFDPROTO_VERSION \ 44 | _stringize(FD_PROJECT_VERSION_MAJOR) "." _stringize(FD_PROJECT_VERSION_MINOR) "." _stringize(FD_PROJECT_VERSION_REV) 45 | #endif 46 | 47 | const char fd_libproto_version[] = FD_LIBFDPROTO_VERSION; 48 | -------------------------------------------------------------------------------- /extensions/app_diameap/plugins/eap_tls/eap_tls.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | * Software License Agreement (BSD License) 3 | * Author : Souheil Ben Ayed 4 | * 5 | * Copyright (c) 2009-2010, Souheil Ben Ayed, Teraoka Laboratory of Keio University, and the WIDE Project 6 | * All rights reserved. 7 | * 8 | * Redistribution and use of this software in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by Souheil Ben Ayed . 21 | * 22 | * 4. Neither the name of Souheil Ben Ayed, Teraoka Laboratory of Keio University or the WIDE Project nor the 23 | * names of its contributors may be used to endorse or promote products 24 | * derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' AND ANY 27 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 30 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | *****************************************************************************************************/ 37 | 38 | #ifndef EAP_TLS_H_ 39 | #define EAP_TLS_H_ 40 | 41 | #include "../../plugins.h" 42 | 43 | struct tls_config tls_global_conf; 44 | 45 | int diameap_eap_tls_buildReq_ack(u8 id, struct eap_packet * eapPacket); 46 | int diameap_eap_tls_buildReq_start(u8 id, struct eap_packet * eapPacket); 47 | int diameap_eap_tls_buildReq_data(struct tls_data * data,int id,struct eap_packet * eapPacket); 48 | int diameap_eap_tls_parse(struct tls_msg * eaptls,struct eap_packet *eapPacket); 49 | int eaptlsparse(struct tls_config * conf); 50 | 51 | #endif /* EAP_TLS_H_ */ 52 | -------------------------------------------------------------------------------- /extensions/rt_deny_by_size/rt_deny_by_size.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Thomas Klausner * 4 | * * 5 | * Copyright (c) 2018, Thomas Klausner * 6 | * All rights reserved. * 7 | * * 8 | * Written under contract by Effortel Technologies SA, http://effortel.com/ * 9 | * * 10 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 11 | * permitted provided that the following conditions are met: * 12 | * * 13 | * * Redistributions of source code must retain the above * 14 | * copyright notice, this list of conditions and the * 15 | * following disclaimer. * 16 | * * 17 | * * Redistributions in binary form must reproduce the above * 18 | * copyright notice, this list of conditions and the * 19 | * following disclaimer in the documentation and/or other * 20 | * materials provided with the distribution. * 21 | * * 22 | * * Neither the name of the WIDE Project or NICT nor the * 23 | * names of its contributors may be used to endorse or * 24 | * promote products derived from this software without * 25 | * specific prior written permission of WIDE Project and * 26 | * NICT. * 27 | * * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 30 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 31 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 34 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 35 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 36 | *********************************************************************************************************/ 37 | 38 | /* 39 | * See the rt_deny_by_size.conf.sample file for the format of the configuration file. 40 | */ 41 | 42 | /* FreeDiameter's common include file */ 43 | #include 44 | 45 | 46 | /* Parse the configuration file */ 47 | int rt_deny_by_size_conf_handle(char * conffile); 48 | 49 | /* The configuration structure */ 50 | extern struct rt_deny_by_size_conf { 51 | int maximum_size; 52 | } rt_deny_by_size_conf; 53 | 54 | -------------------------------------------------------------------------------- /cmake/Modules/FindGnuTLS.cmake: -------------------------------------------------------------------------------- 1 | # - Find gnutls 2 | # Find the native GNUTLS includes and library 3 | # 4 | # GNUTLS_FOUND - True if gnutls found. 5 | # GNUTLS_INCLUDE_DIR - where to find gnutls.h, etc. 6 | # GNUTLS_LIBRARIES - List of libraries when using gnutls. 7 | # GNUTLS_VERSION_210 - true if GnuTLS version is >= 2.10.0 (does not require additional separate gcrypt initialization) 8 | # GNUTLS_VERSION_212 - true if GnuTLS version is >= 2.12.0 (supports gnutls_transport_set_vec_push_function) 9 | # GNUTLS_VERSION_300 - true if GnuTLS version is >= 3.00.0 (x509 verification functions changed) 10 | # GNUTLS_VERSION_310 - true if GnuTLS version is >= 3.01.0 (stabilization branch with new APIs) 11 | 12 | if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARIES) 13 | set(GNUTLS_FIND_QUIETLY TRUE) 14 | endif (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARIES) 15 | 16 | # Include dir 17 | find_path(GNUTLS_INCLUDE_DIR 18 | NAMES 19 | gnutls.h 20 | gnutls/gnutls.h 21 | ) 22 | 23 | # Library 24 | find_library(GNUTLS_LIBRARY 25 | NAMES gnutls 26 | ) 27 | 28 | # handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if 29 | # all listed variables are TRUE 30 | INCLUDE(FindPackageHandleStandardArgs) 31 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNUTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR) 32 | 33 | IF(GNUTLS_FOUND) 34 | SET( GNUTLS_LIBRARIES ${GNUTLS_LIBRARY} ) 35 | ELSE(GNUTLS_FOUND) 36 | SET( GNUTLS_LIBRARIES ) 37 | ENDIF(GNUTLS_FOUND) 38 | 39 | # Lastly make it so that the GNUTLS_LIBRARY and GNUTLS_INCLUDE_DIR variables 40 | # only show up under the advanced options in the gui cmake applications. 41 | MARK_AS_ADVANCED( GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR ) 42 | 43 | # Now check if the library is recent. gnutls_hash was added in 2.10.0. 44 | # Also test library is even more recent. gnutls_x509_trust_list_verify_crt was added in 3.00.0. 45 | IF(GNUTLS_FOUND) 46 | IF( NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" )) 47 | INCLUDE (CheckLibraryExists) 48 | MESSAGE(STATUS "Checking GNUTLS version") 49 | UNSET(GNUTLS_VERSION_210) 50 | UNSET(GNUTLS_VERSION_210 CACHE) 51 | UNSET(GNUTLS_VERSION_212) 52 | UNSET(GNUTLS_VERSION_212 CACHE) 53 | UNSET(GNUTLS_VERSION_300) 54 | UNSET(GNUTLS_VERSION_300 CACHE) 55 | UNSET(GNUTLS_VERSION_310) 56 | UNSET(GNUTLS_VERSION_310 CACHE) 57 | GET_FILENAME_COMPONENT(GNUTLS_PATH ${GNUTLS_LIBRARY} PATH) 58 | CHECK_LIBRARY_EXISTS(gnutls gnutls_hash ${GNUTLS_PATH} GNUTLS_VERSION_210) 59 | CHECK_LIBRARY_EXISTS(gnutls gnutls_transport_set_vec_push_function ${GNUTLS_PATH} GNUTLS_VERSION_212) 60 | CHECK_LIBRARY_EXISTS(gnutls gnutls_x509_trust_list_verify_crt ${GNUTLS_PATH} GNUTLS_VERSION_300) 61 | CHECK_LIBRARY_EXISTS(gnutls gnutls_handshake_set_timeout ${GNUTLS_PATH} GNUTLS_VERSION_310) 62 | SET( GNUTLS_VERSION_TEST_FOR ${GNUTLS_LIBRARY} CACHE INTERNAL "Version the test was made against" ) 63 | ENDIF (NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" )) 64 | ENDIF(GNUTLS_FOUND) 65 | -------------------------------------------------------------------------------- /doc/rt_busypeers.conf.sample: -------------------------------------------------------------------------------- 1 | # This file contains information for configuring the rt_busypeers extension. 2 | # To find how to have freeDiameter load this extension, please refer to the freeDiameter documentation. 3 | # 4 | # The rt_busypeers extension has two purposes. 5 | # - when the local peer receives an error DIAMETER_TOO_BUSY from a peer, 6 | # this extension catchs this error and attempts to retransmit the query to another peer if it makes sense, i.e.: 7 | # * the peer issuing the error is not the peer referenced in the Destination-Host AVP of the message, 8 | # * we have a direct link with the peer that issued the error (see parameter RetryDistantPeers below) 9 | # 10 | # - When a request is forwarded by the local peer, start a timer and if the corresponding answer/error has 11 | # not been received within RelayTimeout seconds, either send to another peer or return a DIAMETER_TOO_BUSY 12 | # error, depending on the RetryMaxPeers parameter. 13 | # 14 | # This extension is mainly useful for Diameter agents, for Diameter clients it is recommended to 15 | # implement this logic directly in the client application. 16 | 17 | 18 | # Parameter: SkipTooBusyErrors 19 | # If defined, this parameter disables the handling of Diameter Errors message with a Result-Code set to DIAMETER_TOO_BUSY in this extension. 20 | # When this parameter is defined, the parameter RetryDistantPeer has no effect. 21 | # Default: parameter is not defined. 22 | #SkipTooBusyErrors; 23 | 24 | 25 | # Parameter: RetryDistantPeers 26 | # By default, the extension only retries to send messages if the peer that issued the DIAMETER_TOO_BUSY error is directly connected to 27 | # the local peer (not through a Diameter agent). This avoids the situation where the message is sent to a different relay that will deliver 28 | # to the same busy peer afterwards. If the parameter is defined, then the extension will also retry sending messages for errors generated in 29 | # distant peers. This should increase the chance that the message is delivered, but also can increase the load of the network unnecessarily. 30 | # Default: parameter is not defined. 31 | #RetryDistantPeers; 32 | 33 | 34 | # Parameter: RetryMaxPeers 35 | # This parameter specifies the limit on the number of times a request can be re-sent to a different peer, before the local relay gives up and 36 | # forwards the error to upstream. 37 | # Default: 0, meaning all possible candidates are attempted before give up. 38 | #RetryMaxPeers=0; 39 | 40 | 41 | # Parameter: RelayTimeout 42 | # If the value of this parameter is not 0, it specifies the number of milliseconds (1/1000 s) that the local relay waits for an answer to a 43 | # forwarded request before considering the remote peer is busy and taking corrective action (similar as if that relay had returned TOO_BUSY status). 44 | # Note: this parameter does not apply for requests issued locally. In that case, the extension issuing the request should directly specify the timeout. 45 | # Default: 0, meaning that there is no timeout parameter. 46 | #RelayTimeout=0; 47 | 48 | -------------------------------------------------------------------------------- /doc/test_netemul.conf.sample: -------------------------------------------------------------------------------- 1 | # This file contains information for configuring the test_netemul extension. 2 | # To find how to have freeDiameter load this extension, please refer to the freeDiameter documentation. 3 | # 4 | # The test_netemul extension implements a Diameter proxy that behaves like simple forwarding agent, 5 | # with the exception that it can introduce delay in the forwarding of the messages and generate duplicates 6 | # of messages, as can be expected from a real Diameter network. It can also generate routing errors when 7 | # connected to more than 2 peers. 8 | 9 | 10 | # LATENCY: 11 | # Two parameters are used to control the delay introduced in the messages. 12 | # - latency_average: 13 | # This is the average delay introduced in the packets. 14 | # Set to 0 to not add any latency (beyond the normal processing time). 15 | # The value is expressed as an integer followed by a unit which can 16 | # be 's' (seconds) or 'ms' (milliseconds). Example: 17 | # latency_average = 700 ms; 18 | # 19 | # - latency_deviation: 20 | # This parameter controls the variance in the latency. It is expressed 21 | # as a value between 0 % and 100 %. When set to 0 %, all messages will be delayed 22 | # by exactly latency_average. Otherwise, it represents the width of the interval 23 | # "around" the average where "most" of the latency will be chosen (the distribution 24 | # has a Gaussian shape). Example: 25 | # latency_deviation = 25 %; 26 | # 27 | # The default values give an added latency "mostly" between 0.4 and 0.6 seconds: 28 | # latency_average = 500 ms; 29 | # latency_deviation = 20 % ; 30 | 31 | 32 | # REORDERING: 33 | # There is no special control over the reordering of messages. It may simply happen 34 | # as a result of the latency. If you want to get a lot of reordering, set the 35 | # latency_variance to a high value. 36 | 37 | 38 | # DUPLICATES: 39 | # Duplicate messages are expected in the Diameter protocol by design, as a consequence 40 | # of the failover mechanism that provides the protocol's reliability. 41 | # - dupl_proba: 42 | # This value gives the probability of producing a duplicate of a forwarded message. 43 | # The value is comprized between 0 (no duplicates) and 1 (duplicate all messages). 44 | # Duplicates are created for requests, but may result in duplicate answers 45 | # received by your Diameter client(s), depending on your server(s)'s behavior. 46 | # In the case of freeDiameter client, the duplicate answer is automatically filtered out 47 | # because the hop-by-hop id has already been used. 48 | # Note that each duplicate copy is an independent message, 49 | # which receives a different latency, and might be routed to a different server if you 50 | # use for example load-balancing. 51 | # The parameter can take several forms: 52 | # dupl_proba = 0 ; 53 | # Disables the generation of duplicate messages completely. 54 | # dupl_proba = 1 / 10000 ; 55 | # dupl_proba = 0.0001 ; 56 | # Around 1 messages over ten thousands will be duplicated. 57 | # 58 | # Default value: 59 | # dupl_proba = 1 / 100 ; 60 | -------------------------------------------------------------------------------- /extensions/test_netemul/test_netemul.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2011, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | /* 37 | * See the test_netemul.conf.sample file for the format of the configuration file. 38 | */ 39 | 40 | /* FreeDiameter's common include file */ 41 | #include 42 | 43 | /* Parse the configuration file */ 44 | int tne_conf_handle(char * conffile); 45 | 46 | /* The configuration structure */ 47 | extern struct tne_conf { 48 | unsigned long lat_avg; /* in milliseconds */ 49 | unsigned int lat_dev; /* between 0 and 100 */ 50 | float dupl_proba; 51 | } tne_conf; 52 | 53 | /* Apply the configured process to the message, then send it. */ 54 | int tne_process_message(struct msg * msg); 55 | int tne_process_init(); 56 | int tne_process_fini(); 57 | -------------------------------------------------------------------------------- /contrib/README: -------------------------------------------------------------------------------- 1 | This file describes the content of the "contrib" directory. 2 | For information about the freeDiameter project, please refer 3 | to top-level README file. 4 | 5 | - update_copyright.sh : This script will simply update the copyright information 6 | in all source files in the freeDiameter mercurial repository, based 7 | on the last modification time. Thought I might share it if other people find 8 | it useful for their own project... 9 | 10 | 11 | - debian : This directory contains the packaging information to create native Debian / Ubuntu 12 | packages. It requires debhelper >= 7.3.9 (support for cmake). To use, simply link the 13 | debian folder from the main freeDiameter folder, then use your building script as 14 | usual ('dh binary' or 'pdebuild' or ...). 15 | If you simply intend to use freeDiameter package, the relevant information is located 16 | at: http://www.freediameter.net/trac/wiki/DebRepository 17 | 18 | 19 | - PKI : This directory contains useful material related to establishing a 20 | Public Key Infrastructure (PKI) for deploying x509 certificates 21 | and use these for TLS authentication of the freeDiameter nodes. 22 | 23 | IMPORTANT: Please note that these solutions are NOT suitable 24 | for use in a production environment! It allows easy deployment of 25 | certificates for tests, and that is their sole purpose. 26 | 27 | The directory contains: 28 | 29 | - ca_script: a simple Makefile allowing you to generate a self-signed certificate (root) 30 | and then issue new certificates and private keys for your users. 31 | Run "make" without argument to get the help. 32 | 33 | - ca_script2: An evolution of the previous Makefile. This one allows you 34 | to create a hierarchy of CA and certificates. 35 | 36 | - phpki-0.82.patch : This patch is to be applied to PHPki to customize the use for freeDiameter. 37 | PHPki (http://sourceforge.net/projects/phpki/) is a PHP-based web interface 38 | that provides more or less the same services as ca_script. 39 | 40 | 41 | - OpenWRT : This directory contains the scripts and documentation related to 42 | the integration of freeDiameter RADIUS/Diameter gateway component in the openWRT 43 | distribution (http://openwrt.org) -- the goal is to give the access point the 44 | ability to "talk" Diameter instead of RADIUS. 45 | 46 | 47 | - nightly_tests : This directory contains the scripts and documentation for the nightly 48 | tests run on freeDiameter. The results are published at the following URL: 49 | http://www.freediameter.net/CDash/index.php?project=freeDiameter 50 | 51 | 52 | - dict_legacy: XML and DTD files for the dict_legacy_xml.fdx extension. 53 | 54 | - dict_dcca: partial implementations of the DCCA dictionary 55 | 56 | - dict_gx: untested implementation of the Gx interface. 57 | 58 | - test_Gx: a responder on the Gx interface that always send SUCCESS status. 59 | 60 | - wireshark: This contains some information on how to use Wireshark to monitor Diameter 61 | exchange protected with TLS. It involves patching the wireshark software. 62 | -------------------------------------------------------------------------------- /doc/test_app.conf.sample: -------------------------------------------------------------------------------- 1 | ####################### 2 | # This file contains the description of configuration and general information about the 3 | # "test_app" extension. 4 | 5 | # This extension provides a simple way to send a predefined message over the Diameter Network. 6 | # It may be used to test the Routing or other base mechanisms from the Diameter network. 7 | 8 | # In order to enable this extension, the main freeDiameter configuration file 9 | # must contain the following declaration: 10 | # LoadExtension = "extensions/app_test.fdx" : "/path/to/app_test.conf" ; 11 | # Note that the conffile may be omitted, in which case default parameters will be assumed. 12 | ####################### 13 | 14 | 15 | ####################### 16 | # Configuration of the test message 17 | 18 | # This application is defined as a Vendor-Specific application. 19 | # Since freeDiameter does not have a IANA-assigned Vendor ID, we let a configurable value here: 20 | # vendor-id = 999999; 21 | 22 | # The application id. Same remark as previously. 23 | # appli-id = 999999; 24 | 25 | # The command code for Test-Request and Test-Answer. The range 0xfffffe-ffffff (dec: 16777215) is reserved for experimental use. 26 | # cmd-id = 16777214; 27 | 28 | # The AVP id for the test. 29 | # avp-id = 345678; 30 | 31 | # Another AVP id for long payload test. default to value 0, meaning this is not used. 32 | # long-avp-id = 0; 33 | 34 | # Define the payload length of the long-avp. Default 5000 bytes. 35 | # long-avp-len = 5000; 36 | 37 | 38 | ####################### 39 | # Configuration of the extension behavior 40 | 41 | # The mode for the extension. 42 | # - server: Answer incoming requests. The signal is ignored. 43 | # - client: Send a request when the signal is received, and measure the time to receiving answer. 44 | # - both: acts as client and server 45 | # mode = both; 46 | 47 | # The behavior can be changed by specifying additional "benchmark;" keyword. 48 | # When this keyword appears, it changes the behavior as follow: 49 | # - server is silent on message reception, only the activity summary is displayed every 30 seconds 50 | # - client attempts to send as many messages as possible during 10 seconds and counts them. 51 | # The benchmark keyword can be followed optionally by two integers: 52 | # duration is the time for the measurement, in seconds (default 10). 53 | # concurrency is the number of messages that can be on the wire before waiting for an answer (default 100). 54 | # benchmark [duration concurrency]; 55 | 56 | 57 | ####################### 58 | # Client-specific configuration 59 | 60 | # The Destination-Realm for the message 61 | # (default is sending to same realm as local peer). 62 | # dest-realm = "foreign.net"; 63 | 64 | # The Destination-Host for the message. 65 | # (default is not providing this AVP). 66 | # dest-host = "server.foreign.net"; 67 | 68 | # The User-Name for the message (may be useful for some routing tests). 69 | # (default is not providing this AVP). 70 | # user-name = "user@server.foreign.net"; 71 | 72 | # The signal that triggers sending the test message 73 | # Note: Symbolic names are not recognized, you must use integers 74 | # signal = 10; 75 | -------------------------------------------------------------------------------- /extensions/app_diameap/diameap_mysql.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | * Software License Agreement (BSD License) 3 | * Author : Souheil Ben Ayed 4 | * 5 | * Copyright (c) 2009-2010, Souheil Ben Ayed, Teraoka Laboratory of Keio University, and the WIDE Project 6 | * All rights reserved. 7 | * 8 | * Redistribution and use of this software in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by Souheil Ben Ayed . 21 | * 22 | * 4. Neither the name of Souheil Ben Ayed, Teraoka Laboratory of Keio University or the WIDE Project nor the 23 | * names of its contributors may be used to endorse or promote products 24 | * derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' AND ANY 27 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 30 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | *****************************************************************************************************/ 37 | 38 | 39 | #ifndef DIAMEAP_MYSQL_H_ 40 | #define DIAMEAP_MYSQL_H_ 41 | 42 | #include "libdiameap.h" 43 | #include 44 | 45 | /* MySQL Database connection */ 46 | MYSQL *db_conn; 47 | 48 | int diameap_get_eap_user(struct eap_user * user, char * username); 49 | 50 | int diameap_mysql_connect(); 51 | 52 | int diameap_mysql_reconnect(); 53 | 54 | int diameap_set_mysql_param(char * user, char * passwd, char * server, char * database); 55 | 56 | void diameap_mysql_disconnect(); 57 | 58 | /* */ 59 | int diameap_authentication_get_attribs(struct eap_user *user, 60 | struct fd_list * attribute_list); 61 | 62 | /* */ 63 | int diameap_authorization_get_attribs(struct eap_user *user, 64 | struct fd_list * attribute_list); 65 | 66 | 67 | #endif /* DIAMEAP_MYSQL_H_ */ 68 | -------------------------------------------------------------------------------- /cmake/Modules/CMakeUserUseBison.cmake: -------------------------------------------------------------------------------- 1 | # - Look for GNU Bison, the parser generator 2 | # Based off a news post from Andy Cedilnik at Kitware 3 | # Defines the following: 4 | # BISON_EXECUTABLE - path to the bison executable 5 | # BISON_FILE - parse a file with bison 6 | # BISON_PREFIX_OUTPUTS - Set to true to make BISON_FILE produce prefixed 7 | # symbols in the generated output based on filename. 8 | # So for ${filename}.y, you'll get ${filename}parse(), etc. 9 | # instead of yyparse(). 10 | # BISON_GENERATE_DEFINES - Set to true to make BISON_FILE output the matching 11 | # .h file for a .c file. You want this if you're using 12 | # flex. 13 | 14 | IF(NOT DEFINED BISON_PREFIX_OUTPUTS) 15 | SET(BISON_PREFIX_OUTPUTS FALSE) 16 | ENDIF(NOT DEFINED BISON_PREFIX_OUTPUTS) 17 | 18 | IF(NOT DEFINED BISON_GENERATE_DEFINES) 19 | SET(BISON_GENERATE_DEFINES FALSE) 20 | ENDIF(NOT DEFINED BISON_GENERATE_DEFINES) 21 | 22 | IF(NOT BISON_EXECUTABLE) 23 | MESSAGE(STATUS "Looking for bison") 24 | FIND_PROGRAM(BISON_EXECUTABLE bison) 25 | IF(BISON_EXECUTABLE) 26 | MESSAGE(STATUS "Looking for bison -- ${BISON_EXECUTABLE}") 27 | ENDIF(BISON_EXECUTABLE) 28 | MARK_AS_ADVANCED(BISON_EXECUTABLE) 29 | ENDIF(NOT BISON_EXECUTABLE) 30 | 31 | IF(BISON_EXECUTABLE) 32 | MACRO(BISON_FILE FILENAME) 33 | GET_FILENAME_COMPONENT(PATH "${FILENAME}" PATH) 34 | IF("${PATH}" STREQUAL "") 35 | SET(PATH_OPT "") 36 | ELSE("${PATH}" STREQUAL "") 37 | SET(PATH_OPT "/${PATH}") 38 | ENDIF("${PATH}" STREQUAL "") 39 | GET_FILENAME_COMPONENT(HEAD "${FILENAME}" NAME_WE) 40 | IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}") 41 | FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}") 42 | ENDIF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}") 43 | IF(BISON_PREFIX_OUTPUTS) 44 | SET(PREFIX "${HEAD}") 45 | ELSE(BISON_PREFIX_OUTPUTS) 46 | SET(PREFIX "yy") 47 | ENDIF(BISON_PREFIX_OUTPUTS) 48 | SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}/${HEAD}.tab.c") 49 | IF(BISON_GENERATE_DEFINES) 50 | SET(HEADER "${CMAKE_CURRENT_BINARY_DIR}${PATH_OPT}/${HEAD}.tab.h") 51 | ADD_CUSTOM_COMMAND( 52 | OUTPUT "${OUTFILE}" "${HEADER}" 53 | COMMAND "${BISON_EXECUTABLE}" 54 | ARGS "--name-prefix=${PREFIX}" 55 | "--defines" 56 | "--output-file=${OUTFILE}" 57 | "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}" 58 | DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}") 59 | SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" "${HEADER}" PROPERTIES GENERATED TRUE) 60 | SET_SOURCE_FILES_PROPERTIES("${HEADER}" PROPERTIES HEADER_FILE_ONLY TRUE) 61 | ELSE(BISON_GENERATE_DEFINES) 62 | ADD_CUSTOM_COMMAND( 63 | OUTPUT "${OUTFILE}" 64 | COMMAND "${BISON_EXECUTABLE}" 65 | ARGS "--name-prefix=${PREFIX}" 66 | "--output-file=${OUTFILE}" 67 | "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}" 68 | DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}") 69 | SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" PROPERTIES GENERATED TRUE) 70 | ENDIF(BISON_GENERATE_DEFINES) 71 | ENDMACRO(BISON_FILE) 72 | ENDIF(BISON_EXECUTABLE) 73 | -------------------------------------------------------------------------------- /extensions/acl_wl/acl_wl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2019, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | /* Header file for the acl_wl extension. 37 | * 38 | * This extension provides a simple mechanism to allow connections from remote peers 39 | * without actively maintaining a connection to these peers. 40 | * 41 | * See the acl_wl.conf.sample file for the format of the configuration file. 42 | */ 43 | 44 | #include 45 | 46 | extern struct fd_list tree_root; 47 | 48 | /* Parse the configuration file */ 49 | int aw_conf_handle(char * conffile); 50 | 51 | /* Add to the tree (name is \0 terminated) */ 52 | int aw_tree_add(char * name, int flags); 53 | 54 | /* Search in the tree. On return, *result = -1: not found; >=0: found with PI_SEC_* flags */ 55 | int aw_tree_lookup(char * name, int * result); 56 | 57 | /* Cleanup the tree */ 58 | void aw_tree_destroy(void); 59 | 60 | /* For debug */ 61 | void aw_tree_dump(void); 62 | 63 | -------------------------------------------------------------------------------- /extensions/app_diameap/diameap_plugins.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | * Software License Agreement (BSD License) 3 | * Author : Souheil Ben Ayed 4 | * 5 | * Copyright (c) 2009-2010, Souheil Ben Ayed, Teraoka Laboratory of Keio University, and the WIDE Project 6 | * All rights reserved. 7 | * 8 | * Redistribution and use of this software in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by Souheil Ben Ayed . 21 | * 22 | * 4. Neither the name of Souheil Ben Ayed, Teraoka Laboratory of Keio University or the WIDE Project nor the 23 | * names of its contributors may be used to endorse or promote products 24 | * derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' AND ANY 27 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 30 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | *****************************************************************************************************/ 37 | 38 | 39 | #ifndef DIAMEAP_PLUGINS_H_ 40 | #define DIAMEAP_PLUGINS_H_ 41 | 42 | #include 43 | 44 | 45 | 46 | static struct fd_list plugins_list = FD_LIST_INITIALIZER(plugins_list); 47 | 48 | /* Add a plug-in to the list of plugins*/ 49 | int diameap_plugin_add(char * name, eap_type methodtype, u32 vendor, char * filename, 50 | char * conffile); 51 | 52 | /* Dump all plug-ins (plugins_list)*/ 53 | void diameap_plugin_dump(); 54 | 55 | /* Return pointer to a plug-in */ 56 | int diameap_plugin_get(u32 vendor,eap_type type, struct plugin ** getplugin); 57 | 58 | /* Load plug-ins */ 59 | int diameap_plugin_load(void); 60 | 61 | /* Check if a plug-in exists for a given EAP method type */ 62 | boolean diameap_plugin_exist(u32 vendor, eap_type type); 63 | 64 | /* Unload all plug-ins*/ 65 | int diameap_plugin_unload(void); 66 | 67 | #endif /* DIAMEAP_PLUGINS_H_ */ 68 | -------------------------------------------------------------------------------- /libfdproto/portability.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | * Software License Agreement (BSD License) * 3 | * Author: Sebastien Decugis * 4 | * * 5 | * Copyright (c) 2012, WIDE Project and NICT * 6 | * All rights reserved. * 7 | * * 8 | * Redistribution and use of this software in source and binary forms, with or without modification, are * 9 | * permitted provided that the following conditions are met: * 10 | * * 11 | * * Redistributions of source code must retain the above * 12 | * copyright notice, this list of conditions and the * 13 | * following disclaimer. * 14 | * * 15 | * * Redistributions in binary form must reproduce the above * 16 | * copyright notice, this list of conditions and the * 17 | * following disclaimer in the documentation and/or other * 18 | * materials provided with the distribution. * 19 | * * 20 | * * Neither the name of the WIDE Project or NICT nor the * 21 | * names of its contributors may be used to endorse or * 22 | * promote products derived from this software without * 23 | * specific prior written permission of WIDE Project and * 24 | * NICT. * 25 | * * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * 28 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * 29 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * 32 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * 33 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 34 | *********************************************************************************************************/ 35 | 36 | #include "fdproto-internal.h" 37 | 38 | /* Replacement for clock_gettime for the Mac OS */ 39 | #ifndef HAVE_CLOCK_GETTIME 40 | int clock_gettime(int clk_id, struct timespec* ts) 41 | { 42 | struct timeval tv; 43 | gettimeofday (&tv, NULL); 44 | ts->tv_sec = tv.tv_sec; 45 | ts->tv_nsec = tv.tv_usec * 1000; 46 | return 0; 47 | } 48 | #endif /* HAVE_CLOCK_GETTIME */ 49 | 50 | /* Replacement for strndup for the Mac OS */ 51 | #ifndef HAVE_STRNDUP 52 | char * strndup (char *str, size_t len) 53 | { 54 | char * output; 55 | size_t outlen; 56 | 57 | output = memchr(str, 0, len); 58 | if (output == NULL) { 59 | outlen = len; 60 | } else { 61 | outlen = output - str; 62 | } 63 | 64 | CHECK_MALLOC_DO( output = malloc (outlen + 1), return NULL ); 65 | 66 | output[outlen] = '\0'; 67 | memcpy (output, str, outlen); 68 | return output; 69 | } 70 | #endif /* HAVE_STRNDUP */ 71 | --------------------------------------------------------------------------------