Commit 4767c880 authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Backup for the week-end

parent 542b5148
......@@ -3,6 +3,14 @@
# Name of the project, and language
PROJECT("freeDiameter" C)
# Informations to display in daemon's help
SET(FD_PROJECT_NAME freeDiameter)
SET(FD_PROJECT_BINARY freeDiameterd)
SET(FD_PROJECT_VERSION_MAJOR 0)
SET(FD_PROJECT_VERSION_MINOR 1)
SET(FD_PROJECT_VERSION_REV 0)
SET(FD_PROJECT_COPYRIGHT "Copyright (c) 2008-2009, WIDE Project (www.wide.ad.jp) and NICT (www.nict.go.jp)")
# Some subfolders may have tests
ENABLE_TESTING()
......@@ -15,11 +23,6 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# All source code should be POSIX 200112L compatible, but some other extensions might be used, so:
ADD_DEFINITIONS(-D_GNU_SOURCE)
# Location for the include files
INCLUDE_DIRECTORIES(include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
SUBDIRS(include/freeDiameter)
# some subfolders use yacc and lex parsers
SET(BISON_GENERATE_DEFINES TRUE)
SET(BISON_PREFIX_OUTPUTS TRUE)
......@@ -32,6 +35,11 @@ ENDIF( NOT BISON_EXECUTABLE OR NOT FLEX_EXECUTABLE )
# Check that flex is at least 2.5.20 to support bison-bridge
# how to do the check with cmake???
# Location for the include files
INCLUDE_DIRECTORIES(include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
SUBDIRS(include/freeDiameter)
# Location for the source code
SUBDIRS(libfreeDiameter)
SUBDIRS(freeDiameter)
......
# - Try to find GNU TLS library and headers
# Once done, this will define
#
# GNUTLS_FOUND - system has GNU TLS
# GNUTLS_INCLUDE_DIRS - the GNU TLS include directories
# GNUTLS_LIBRARIES - link these to use GNU TLS
include(LibFindMacros)
# Use pkg-config to get hints about paths
libfind_pkg_check_modules(GNUTLS_PKGCONF gnutls)
# Include dir
find_path(GNUTLS_INCLUDE_DIR
NAMES gnutls/gnutls.h
PATHS ${GNUTLS_PKGCONF_INCLUDE_DIRS}
)
# Finally the library itself
find_library(GNUTLS_LIBRARY
NAMES gnutls
PATHS ${GNUTLS_PKGCONF_LIBRARY_DIRS}
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(GNUTLS_PROCESS_INCLUDES GNUTLS_INCLUDE_DIR)
set(GNUTLS_PROCESS_LIBS GNUTLS_LIBRARY)
libfind_process(GNUTLS)
......@@ -5,25 +5,42 @@
# SCTP_INCLUDE_DIRS - the SCTP include directories
# SCTP_LIBRARIES - link these to use SCTP
include(LibFindMacros)
# Use pkg-config to get hints about paths (Note: not yet supported?)
# libfind_pkg_check_modules(SCTP_PKGCONF sctp)
if (SCTP_INCLUDE_DIRS)
set(SCTP_FIND_QUIETLY TRUE)
endif (SCTP_INCLUDE_DIRS)
# Include dir
find_path(SCTP_INCLUDE_DIR
NAMES netinet/sctp.h
PATHS ${SCTP_PKGCONF_INCLUDE_DIRS}
)
# Finally the library itself
# Library
find_library(SCTP_LIBRARY
NAMES sctp
PATHS ${SCTP_PKGCONF_LIBRARY_DIRS}
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(SCTP_PROCESS_INCLUDES SCTP_INCLUDE_DIR)
set(SCTP_PROCESS_LIBS SCTP_LIBRARY)
libfind_process(SCTP)
#set(SCTP_PROCESS_INCLUDES SCTP_INCLUDE_DIR)
#set(SCTP_PROCESS_LIBS SCTP_LIBRARY)
#libfind_process(SCTP)
# handle the QUIETLY and REQUIRED arguments and set SCTP_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCTP DEFAULT_MSG SCTP_LIBRARY SCTP_INCLUDE_DIR)
# If we successfully found the sctp library then add the library to the
# SCTP_LIBRARIES cmake variable otherwise set SCTP_LIBRARIES to nothing.
IF(SCTP_FOUND)
SET( SCTP_LIBRARIES ${SCTP_LIBRARY} )
ELSE(SCTP_FOUND)
SET( SCTP_LIBRARIES )
ENDIF(SCTP_FOUND)
# Lastly make it so that the SCTP_LIBRARY and SCTP_INCLUDE_DIR variables
# only show up under the advanced options in the gui cmake applications.
MARK_AS_ADVANCED( SCTP_LIBRARY SCTP_INCLUDE_DIR )
# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
# used for the current package. For this to work, the first parameter must be the
# prefix of the current package, then the prefix of the new package etc, which are
# passed to find_package.
macro (libfind_package PREFIX)
set (LIBFIND_PACKAGE_ARGS ${ARGN})
if (${PREFIX}_FIND_QUIETLY)
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
endif (${PREFIX}_FIND_QUIETLY)
if (${PREFIX}_FIND_REQUIRED)
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
endif (${PREFIX}_FIND_REQUIRED)
find_package(${LIBFIND_PACKAGE_ARGS})
endmacro (libfind_package)
# Damn CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
# where they added pkg_check_modules. Consequently I need to support both in my scripts
# to avoid those deprecated warnings. Here's a helper that does just that.
# Works identically to pkg_check_modules, except that no checks are needed prior to use.
macro (libfind_pkg_check_modules PREFIX PKGNAME)
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(${PREFIX} ${PKGNAME})
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
endmacro (libfind_pkg_check_modules)
# Do the final processing once the paths have been detected.
# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
# all the variables, each of which contain one include directory.
# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
# Also handles errors in case library detection was required, etc.
macro (libfind_process PREFIX)
# Skip processing if already processed during this run
if (NOT ${PREFIX}_FOUND)
# Start with the assumption that the library was found
set (${PREFIX}_FOUND TRUE)
# Process all includes and set _FOUND to false if any are missing
foreach (i ${${PREFIX}_PROCESS_INCLUDES})
if (${i})
set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
mark_as_advanced(${i})
else (${i})
set (${PREFIX}_FOUND FALSE)
endif (${i})
endforeach (i)
# Process all libraries and set _FOUND to false if any are missing
foreach (i ${${PREFIX}_PROCESS_LIBS})
if (${i})
set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
mark_as_advanced(${i})
else (${i})
set (${PREFIX}_FOUND FALSE)
endif (${i})
endforeach (i)
# Print message and/or exit on fatal error
if (${PREFIX}_FOUND)
if (NOT ${PREFIX}_FIND_QUIETLY)
message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
endif (NOT ${PREFIX}_FIND_QUIETLY)
else (${PREFIX}_FOUND)
if (${PREFIX}_FIND_REQUIRED)
foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
message("${i}=${${i}}")
endforeach (i)
message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
endif (${PREFIX}_FIND_REQUIRED)
endif (${PREFIX}_FOUND)
endif (NOT ${PREFIX}_FOUND)
endmacro (libfind_process)
macro(libfind_library PREFIX basename)
set(TMP "")
if(MSVC80)
set(TMP -vc80)
endif(MSVC80)
if(MSVC90)
set(TMP -vc90)
endif(MSVC90)
set(${PREFIX}_LIBNAMES ${basename}${TMP})
if(${ARGC} GREATER 2)
set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
endif(${ARGC} GREATER 2)
find_library(${PREFIX}_LIBRARY
NAMES ${${PREFIX}_LIBNAMES}
PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
)
endmacro(libfind_library)
# This is a sample configuration file for freeDiameter daemon.
##############################################################
## Peer identity and realm
# The Diameter Identity of this daemon.
# This must be a valid FQDN that resolves to the local host.
# Default: hostname's FQDN
#LocalIdentity = "aaa.koganei.wide.ad.jp";
# The Diameter Realm of this daemon.
# Default: the domain part of LocalIdentity.
#LocalRealm = "wide.ad.jp";
##############################################################
## Transport protocol configuration
# The port this peer is listening on for incoming connections (TCP and SCTP).
# Default: 3868
#LocalPort = 3868;
# The port this peer is listening on for incoming TLS connections (TCP and SCTP).
# See TLS_old_method for more information.
# Default: 3869
#LocalSecPort = 3869;
# Use RFC3588 method for TLS protection, where TLS is negociated after CER/CEA
# on the same port. This only affects outgoing connections. It can be overwritten
# on per peer basis.
# Default: use RFC3588bis method with separate port for TLS.
#TLS_old_method;
# Disable use of TCP protocol (only SCTP)
# Default : TCP enabled
#No_TCP;
# Disable use of SCTP protocol (only TCP)
# Default : SCTP enabled
#No_SCTP;
# This option has no effect if freeDiameter is compiled with DISABLE_SCTP option,
# in which case the value is forced to "SCTP disabled".
# Prefer TCP over SCTP for establishing new connections.
# It may be overwritten per peer in peer configuration blocs.
# Default : SCTP is prefered.
#Prefer_TCP;
# Default number of streams per SCTP associations.
# It can be overwritten per peer basis.
# Default : 30 streams
#SCTP_streams = 30;
##############################################################
## Endpoints configuration
# Disable use of IP addresses (only IPv6)
# Default : IP enabled
#No_IP;
# Disable use of IPv6 addresses (only IP)
# Default : IPv6 enabled
#No_IPv6;
# Specify local addresses where the server must listen
# Default : listen on all addresses available.
#ListenOn = "202.249.37.5";
#ListenOn = "2001:200:903:2::202:1";
##############################################################
## Timers configuration
# The Tc timer of this peer.
# It is the delay before a new attempt is made to reconnect a disconnected peer.
# The value is expressed in seconds. The recommended value is 30 seconds.
# Default: 30
#TcTimer = 30;
# The Tw timer of this peer.
# It is the delay before a watchdog message is sent, as described in RFC 3539.
# The value is expressed in seconds. The default value is 30 seconds. Value must
# be greater or equal to 6 seconds. See details in the RFC.
# Default: 30
#TwTimer = 30;
##############################################################
## Applications configuration
# Disable the relaying of Diameter messages?
# For messages not handled locally, the default behavior is to forward the
# message to another peer if any is available, according to the routing
# algorithms. In addition the "0xffffff" application is advertised in CER/CEA
# exchanges.
# Default: Relaying is enabled.
#NoRelay;
# Other applications are configured by extensions.
##############################################################
## Extensions configuration
# The freeDiameter daemon merely provides support for
# Diameter Base Protocol. The specific application behaviors,
# as well as advanced functions of the daemon, are provided
# by loadable extensions (plug-ins).
# These extensions may in addition receive the name of a
# configuration file, the format of which is extension-specific.
# Format:
#LoadExtension = "/path/to/extension" [ : "/optional/configuration/file" ] ;
# Exemples:
#LoadExtension = "extensions/sample.so";
#LoadExtension = "extensions/sample.so":"conf/sample.conf";
##############################################################
# -------- Test configuration ---------
LocalIdentity = "aaa.koganei.wide.ad.jp";
LocalRealm = "wide.ad.jp";
LocalPort = 3866;
LocalSecPort = 3867;
TLS_old_method;
No_IP;
Prefer_TCP;
SCTP_streams = 50;
ListenOn = "202.249.37.5";
ListenOn = "2001:200:903:2::202:1";
TcTimer = 60;
TwTimer = 6;
NoRelay;
LoadExtension = "extensions/sample.so";
LoadExtension = "extensions/sample.so":"conf/sample.conf";
PROJECT("freeDiameter extensions" C)
# We want all resulting objects in the same folder
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
# And named fdext_XXX instead of libXXX.so
#-- faire une macro ici!
SET(FD_EXT_PREFIX "fdext_" PARENT_SCOPE)
SET(FD_EXT_SUFFIX "" PARENT_SCOPE)
###########################
# Extensions section
####
# Diameter applications dictionary
# OPTION(BUILD_DICT_NASREQ "Build NASREQ (RFC4005) Dictionary definitions?" ON)
# IF (BUILD_DICT_NASREQ)
# SUBDIRS(dict_nasreq)
# ENDIF (BUILD_DICT_NASREQ)
# OPTION(BUILD_DICT_EAP "Build Diameter EAP (RFC4072) Dictionary definitions?" ON)
# IF (BUILD_DICT_EAP)
# SUBDIRS(dict_eap)
# ENDIF (BUILD_DICT_EAP)
####
# Radius / Diameter gateway extension(s)
# OPTION(BUILD_RADIUS_GW "Build radius_gw? (one-way RADIUS/Diameter gateway - RADIUS NAS <-> Diameter server)" ON)
# IF (BUILD_RADIUS_GW)
# SUBDIRS(radius_gw)
# ENDIF (BUILD_RADIUS_GW)
####
# Routing extensions
# OPTION(BUILD_RT_DEFAULT "Build rt_default? (Routing extension using Destination-Host, Destination-Realm, and static configuration)" ON)
# IF (BUILD_RT_DEFAULT)
# SUBDIRS(rt_default)
# ENDIF (BUILD_RT_DEFAULT)
####
# Peers security extensions
# OPTION(BUILD_PS_DEFAULT "Build ps_default? (white-list of peers)" ON)
# IF (BUILD_PS_DEFAULT)
# # -- enable once API is updated: SUBDIRS(ps_default)
# ENDIF (BUILD_PS_DEFAULT)
####
# Debug / development extensions
OPTION(BUILD_SAMPLE "Build sample? (Simple extension to demonstrate extension mechanism, for developpers only)" OFF)
IF (BUILD_SAMPLE)
SUBDIRS(_sample)
ENDIF (BUILD_SAMPLE)
# OPTION(BUILD_RT_ANY "Build rt_any? (Routing extension sending message to any peer available, for testing purpose only)" OFF)
# IF (BUILD_RT_ANY)
# SUBDIRS(rt_any)
# ENDIF (BUILD_RT_ANY)
# OPTION(BUILD_RT_DEBUG "Build rt_debug? (Routing extension tracing routing list, for debug purpose only)" OFF)
# IF (BUILD_RT_DEBUG)
# SUBDIRS(rt_debug)
# ENDIF (BUILD_RT_DEBUG)
# OPTION(BUILD_APP_TEST "Build app_test? (Testing application to send dummy message to another peer, for testing purpose only)" OFF)
# IF (BUILD_APP_TEST)
# SUBDIRS(app_test)
# ENDIF (BUILD_APP_TEST)
# The sample extension
PROJECT("Sample extension" C)
# Compile as a module
ADD_LIBRARY(sample MODULE sample.c fini.c)
# Comply to naming scheme
SET_TARGET_PROPERTIES(sample PROPERTIES PREFIX "${FD_EXT_PREFIX}" )
SET_TARGET_PROPERTIES(sample PROPERTIES SUFFIX "${FD_EXT_SUFFIX}" )
/*********************************************************************************************************
* Software License Agreement (BSD License) *
* Author: Sebastien Decugis <sdecugis@nict.go.jp> *
* *
* Copyright (c) 2008, WIDE Project and NICT *
* All rights reserved. *
* *
* Redistribution and use of this software in source and binary forms, with or without modification, are *
* permitted provided that the following conditions are met: *
* *
* * Redistributions of source code must retain the above *
* copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above *
* copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other *
* materials provided with the distribution. *
* *
* * Neither the name of the WIDE Project or NICT nor the *
* names of its contributors may be used to endorse or *
* promote products derived from this software without *
* specific prior written permission of WIDE Project and *
* NICT. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF *
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*********************************************************************************************************/
/* Sample extension exit point */
#include <freeDiameter/extension.h>
void fd_ext_fini(void)
{
log_debug("Extension is terminated... Bye!\n");
return ;
}
/*********************************************************************************************************
* Software License Agreement (BSD License) *
* Author: Sebastien Decugis <sdecugis@nict.go.jp> *
* *
* Copyright (c) 2009, WIDE Project and NICT *
* All rights reserved. *
* *
* Redistribution and use of this software in source and binary forms, with or without modification, are *
* permitted provided that the following conditions are met: *
* *
* * Redistributions of source code must retain the above *
* copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above *
* copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other *
* materials provided with the distribution. *
* *
* * Neither the name of the WIDE Project or NICT nor the *
* names of its contributors may be used to endorse or *
* promote products derived from this software without *
* specific prior written permission of WIDE Project and *
* NICT. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF *
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
*********************************************************************************************************/
/* Sample extension to test extensions mechanism in freeDiameter */
#include <freeDiameter/extension.h>
static int sample_main(char * conffile);
/* Define the entry point. A convenience macro is provided */
EXTENSION_ENTRY("sample", sample_main);
/* The extension-specific initialization code */
static int sample_main(char * conffile)
{
TRACE_ENTRY("%p", conffile);
fprintf(stdout, "I am extension " __FILE__ " running on host %s\n", fd_g_config->diam_id);
if (conffile) {
fprintf(stdout, "I should parse my configuration file there: %s\n", conffile);
} else {
fprintf(stdout, "I received no configuration file to parse\n");
}
/* Use the dictionary for test */
log_debug("Let's create that 'Example-AVP'...\n");
{
struct dict_object * origin_host_avp = NULL;
struct dict_object * session_id_avp = NULL;
struct dict_object * example_avp_avp = NULL;
struct dict_rule_data rule_data = { NULL, RULE_REQUIRED, 0, -1, 1 };
struct dict_avp_data example_avp_data = { 999999, 0, "Example-AVP", AVP_FLAG_VENDOR , 0, AVP_TYPE_GROUPED };
CHECK_FCT( fd_dict_search ( fd_g_config->g_dict, DICT_AVP, AVP_BY_NAME, "Origin-Host", &origin_host_avp, ENOENT));
CHECK_FCT( fd_dict_search ( fd_g_config->g_dict, DICT_AVP, AVP_BY_NAME, "Session-Id", &session_id_avp, ENOENT));
CHECK_FCT( fd_dict_new ( fd_g_config->g_dict, DICT_AVP, &example_avp_data , NULL, &example_avp_avp ));
rule_data.rule_avp = origin_host_avp;
rule_data.rule_min = 1;
rule_data.rule_max = 1;
CHECK_FCT( fd_dict_new ( fd_g_config->g_dict, DICT_RULE, &rule_data, example_avp_avp, NULL ));
rule_data.rule_avp = session_id_avp;
rule_data.rule_min = 1;
rule_data.rule_max = -1;
CHECK_FCT( fd_dict_new ( fd_g_config->g_dict, DICT_RULE, &rule_data, example_avp_avp, NULL ));
}
log_debug("'Example-AVP' created without error\n");
return 0;
}
# The subproject name
Project("freeDiameterd" C)
SET(PROJECT_VERSION 0.1)
SET(PROJECT_COPYRIGHT "Copyright (c) 2008-2009, WIDE Project (www.wide.ad.jp) and NICT (www.nict.go.jp)")
# Configuration parser
BISON_FILE(fdd.y)
FLEX_FILE(fdd.l)
SET_SOURCE_FILES_PROPERTIES(lex.fdd.c fdd.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}")
# List of source files
SET(FD_COMMON_SRC
fD.h
config.c
extensions.c
dict_base_proto.c
)
SET(FD_COMMON_GEN_SRC
lex.fdd.c
fdd.tab.c
fdd.tab.h
)
# Building the executable
ADD_EXECUTABLE(freeDiameterd ${FD_COMMON_SRC} main.c)
ADD_EXECUTABLE(freeDiameterd ${FD_COMMON_SRC} ${FD_COMMON_GEN_SRC} main.c)
# The link command
LINK_DIRECTORIES(${CURRENT_BINARY_DIR}/../libfreeDiameter)
......@@ -19,6 +30,7 @@ TARGET_LINK_LIBRARIES(freeDiameterd libfreeDiameter ${FD_LIBS})
# Save the list of files, if needed
SET(FD_COMMON_SRC ${FD_COMMON_SRC} PARENT_SCOPE)
SET(FD_COMMON_GEN_SRC ${FD_COMMON_GEN_SRC} PARENT_SCOPE)
# The unary tests directory
OPTION(SKIP_TESTS "Skip compilation of the tests?" OFF)
......
/*********************************************************************************************************
* Software License Agreement (BSD License) *
* Author: Sebastien Decugis <sdecugis@nict.go.jp> *
* *
* Copyright (c) 2009, WIDE Project and NICT *
* All rights reserved. *
* *
* Redistribution and use of this software in source and binary forms, with or without modification, are *
* permitted provided that the following conditions are met: *
* *
* * Redistributions of source code must retain the above *
* copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above *