Changeset 304:ad3c46016584 in freeDiameter
- Timestamp:
- May 14, 2010, 5:26:53 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r301 r304 48 48 SUBDIRS(freeDiameter) 49 49 50 # Do we build the extensions? 51 OPTION(IGNORE_ALL_EXTENSIONS "Ignore the extensions completly?") 52 IF(NOT IGNORE_ALL_EXTENSIONS) 53 SUBDIRS(extensions) 54 ENDIF(NOT IGNORE_ALL_EXTENSIONS) 50 # Extensions (there is no point in freeDiameter without any extension) 51 SUBDIRS(extensions) 55 52 56 # The documentation to install 53 54 #### 55 ## INSTALL section ## 56 57 57 INSTALL(FILES README LICENSE doc/freediameter.conf.sample 58 58 DESTINATION doc -
INSTALL
r300 r304 3 3 4 4 Building in a separate directory is recommended: 5 mkdir build 6 cd build 7 cmake ../ 8 make 5 # mkdir build 6 # cd build 7 # cmake ../ 8 # make 9 10 Note: instead of passing options on the command line, you can use a CMake front-end (for example ccmake or cmake-gui) 11 or edit the CCmakeCache.txt file directly. If your cmake installation is recent, you can also do: 12 # mkdir build 13 # cd build 14 # cmake ../ 15 # make edit_cache 16 # make 17 9 18 10 19 You can enable the unary tests by doing: 11 cmake -DSKIP_TESTS:BOOL=OFF ../ 12 make 13 make tests 14 15 Note: instead of passing options on the command line, you can use a CMake front-end (for example ccmake or cmake-gui) 16 or edit the CCmakeCache.txt file directly. 20 # cmake -DSKIP_TESTS:BOOL=OFF ../ 21 # make 22 # make tests 17 23 18 24 Note that there are dependencies on external tools that may not be enforced by the configure script. -
INSTALL.Ubuntu
r298 r304 53 53 # make test 54 54 55 56 -
cmake/Modules/CMakeUserUseBison.cmake
r0 r304 26 26 MESSAGE(STATUS "Looking for bison -- ${BISON_EXECUTABLE}") 27 27 ENDIF(BISON_EXECUTABLE) 28 MARK_AS_ADVANCED(BISON_EXECUTABLE) 28 29 ENDIF(NOT BISON_EXECUTABLE) 29 30 -
cmake/Modules/CMakeUserUseFlex.cmake
r0 r304 16 16 MESSAGE(STATUS "Looking for flex -- ${FLEX_EXECUTABLE}") 17 17 ENDIF(FLEX_EXECUTABLE) 18 MARK_AS_ADVANCED(FLEX_EXECUTABLE) 18 19 ENDIF(NOT FLEX_EXECUTABLE) 19 20 -
cmake/Modules/FindGnuTLS.cmake
r284 r304 35 35 # Lastly make it so that the GNUTLS_LIBRARY and GNUTLS_INCLUDE_DIR variables 36 36 # only show up under the advanced options in the gui cmake applications. 37 MARK_AS_ADVANCED( GNUTLS_LIBRAR IES GNUTLS_INCLUDE_DIRS)37 MARK_AS_ADVANCED( GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR ) -
cmake/Modules/FindPostgreSQL.cmake
r284 r304 34 34 # Lastly make it so that the POSTGRESQL_LIBRARY and POSTGRESQL_INCLUDE_DIR variables 35 35 # only show up under the advanced options in the gui cmake applications. 36 MARK_AS_ADVANCED( POSTGRESQL_LIBRAR IESPOSTGRESQL_INCLUDE_DIR )36 MARK_AS_ADVANCED( POSTGRESQL_LIBRARY POSTGRESQL_INCLUDE_DIR ) -
extensions/CMakeLists.txt
r283 r304 20 20 MESSAGE(SEND_ERROR "Unable to find gcrypt.h, please install libgcrypt-dev or equivalent") 21 21 Endif ( NOT GCRYPT_INCLUDE_DIR ) 22 MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR) 22 23 INCLUDE_DIRECTORIES(${GCRYPT_INCLUDE_DIR}) 23 24 … … 77 78 # Debug & test extensions 78 79 79 OPTION(BUILD_SAMPLE "Build sample.fdx? (Simple extension to demonstrate extension mechanism, for developpers only)" OFF)80 IF (BUILD_SAMPLE)81 SUBDIRS(_sample)82 ENDIF (BUILD_SAMPLE)83 84 80 OPTION(BUILD_DBG_MONITOR "Build dbg_monitor.fdx? (display periodical debug information on the console)" OFF) 85 81 IF (BUILD_DBG_MONITOR) … … 92 88 ENDIF (BUILD_DBG_RT) 93 89 94 OPTION(BUILD_TEST_ACCT "Build test_acct.fdx? (Receive Accounting-Requests and display the data, but no storage)" OFF)95 IF (BUILD_TEST_ACCT)96 SUBDIRS(test_acct)97 ENDIF (BUILD_TEST_ACCT)98 99 90 OPTION(BUILD_TEST_APP "Build test_app.fdx? (Testing application to send dummy message to another peer, for testing purpose only)" OFF) 100 91 IF (BUILD_TEST_APP) … … 102 93 ENDIF (BUILD_TEST_APP) 103 94 104 OPTION(BUILD_TEST_RT_ANY "Build test_rt_any.fdx? (Routing extension randomly sending message to any peer available, for testing purpose only)" OFF) 105 IF (BUILD_TEST_RT_ANY) 106 SUBDIRS(test_rt_any) 107 ENDIF (BUILD_TEST_RT_ANY) 95 # The following extension have very little use except for specific tests, so we disable them except in Debug configurations. 96 IF (CMAKE_BUILD_TYPE MATCHES "Debug") 97 OPTION(BUILD_SAMPLE "Build sample.fdx? (Simple extension to demonstrate extension mechanism, for developpers only)" OFF) 98 IF (BUILD_SAMPLE) 99 SUBDIRS(_sample) 100 ENDIF (BUILD_SAMPLE) 101 102 OPTION(BUILD_TEST_ACCT "Build test_acct.fdx? (Receive Accounting-Requests and display the data, but no storage)" OFF) 103 IF (BUILD_TEST_ACCT) 104 SUBDIRS(test_acct) 105 ENDIF (BUILD_TEST_ACCT) 106 107 OPTION(BUILD_TEST_RT_ANY "Build test_rt_any.fdx? (Routing extension randomly sending message to any peer available, for testing purpose only)" OFF) 108 IF (BUILD_TEST_RT_ANY) 109 SUBDIRS(test_rt_any) 110 ENDIF (BUILD_TEST_RT_ANY) 111 ENDIF (CMAKE_BUILD_TYPE MATCHES "Debug") 112 -
extensions/_sample/CMakeLists.txt
r170 r304 3 3 4 4 # Overwrite the debug level for the extension code if configured 5 OPTION(DEBUG_LEVEL__SAMPLE "Overwrite debug level for the extension _sample if defined " OFF)5 OPTION(DEBUG_LEVEL__SAMPLE "Overwrite debug level for the extension _sample if defined (valid values: FULL, ANNOYING, CALL...)" OFF) 6 6 IF (DEBUG_LEVEL__SAMPLE) 7 7 ADD_DEFINITIONS(-DTRACE_LEVEL=${DEBUG_LEVEL__SAMPLE}) 8 8 ENDIF (DEBUG_LEVEL__SAMPLE) 9 IF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 10 MARK_AS_ADVANCED(DEBUG_LEVEL__SAMPLE) 11 ENDIF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 9 12 10 13 # Compile as a module 11 14 FD_ADD_EXTENSION(dbg_sample sample.c fini.c) 15 16 17 #### 18 ## INSTALL section ## 19 20 INSTALL(TARGETS dbg_sample 21 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 22 COMPONENT freeDiameter-debug-tools) -
extensions/acl_wl/CMakeLists.txt
r170 r304 18 18 19 19 # Overwrite the debug level for the extension code if configured 20 OPTION(DEBUG_LEVEL_ACL_WL "Overwrite debug level for the extension acl_wl if defined " OFF)20 OPTION(DEBUG_LEVEL_ACL_WL "Overwrite debug level for the extension acl_wl if defined (valid values: FULL, ANNOYING, CALL...)" OFF) 21 21 IF (DEBUG_LEVEL_ACL_WL) 22 22 ADD_DEFINITIONS(-DTRACE_LEVEL=${DEBUG_LEVEL_ACL_WL}) 23 23 ENDIF (DEBUG_LEVEL_ACL_WL) 24 IF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 25 MARK_AS_ADVANCED(DEBUG_LEVEL_ACL_WL) 26 ENDIF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 24 27 25 28 # Compile as a module 26 29 FD_ADD_EXTENSION(acl_wl ${ACL_WL_SRC}) 30 31 32 #### 33 ## INSTALL section ## 34 35 # We install with the daemon component because it is a base feature. 36 INSTALL(TARGETS acl_wl 37 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 38 COMPONENT freeDiameter-daemon) -
extensions/app_acct/CMakeLists.txt
r289 r304 29 29 FD_ADD_EXTENSION(app_acct ${APP_ACCT_SRC} ${APP_ACCT_SRC_GEN}) 30 30 TARGET_LINK_LIBRARIES(app_acct ${POSTGRESQL_LIBRARIES}) 31 32 33 #### 34 ## INSTALL section ## 35 36 INSTALL(TARGETS app_acct 37 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 38 COMPONENT freeDiameter-accounting-server) 39 -
extensions/app_radgw/CMakeLists.txt
r268 r304 4 4 5 5 # Overwrite the debug level for the extension code if configured 6 OPTION(DEBUG_LEVEL_APP_RADGW "Overwrite debug level for the extension app_radgw if defined " OFF)6 OPTION(DEBUG_LEVEL_APP_RADGW "Overwrite debug level for the extension app_radgw if defined (valid values: FULL, ANNOYING, CALL...)" OFF) 7 7 IF (DEBUG_LEVEL_APP_RADGW) 8 8 ADD_DEFINITIONS(-DTRACE_LEVEL=${DEBUG_LEVEL_APP_RADGW}) 9 9 ENDIF (DEBUG_LEVEL_APP_RADGW) 10 IF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 11 MARK_AS_ADVANCED(DEBUG_LEVEL_APP_RADGW) 12 ENDIF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 10 13 11 14 … … 65 68 SET_TARGET_PROPERTIES(${PLGNAME} PROPERTIES SUFFIX ".rgwx" ) 66 69 TARGET_LINK_LIBRARIES(${PLGNAME} rgw_common) 70 INSTALL(TARGETS ${PLGNAME} 71 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 72 COMPONENT freeDiameter-radius-gateway) 67 73 ENDMACRO(RGWX_ADD_PLUGIN) 68 74 … … 103 109 RGWX_ADD_PLUGIN(echodrop ${RG_COMMON_HEADER} rgwx_echodrop.h rgwx_echodrop.c lex.rgwx_echodrop.c rgwx_echodrop.tab.c rgwx_echodrop.tab.h ) 104 110 ENDIF (BUILD_RGWX_ECHODROP) 111 112 113 #### 114 ## INSTALL section ## 115 116 INSTALL(TARGETS app_radgw 117 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 118 COMPONENT freeDiameter-radius-gateway) 119 120 # Note that all compiled plugins are added by the RGWX_ADD_PLUGIN macro in the component freeDiameter-radius-gateway as well. -
extensions/app_radgw/rgw_conf.y
r258 r304 53 53 #include "rgw_conf.tab.h" /* bison is not smart enough to define the YYLTYPE before including this code, so... */ 54 54 55 #include <sys/stat.h>56 55 #include <sys/socket.h> 57 56 #include <arpa/inet.h> … … 97 96 else 98 97 fd_log_debug("%s:%d.%d : %s\n", conffile, ploc->first_line, ploc->first_column, s); 99 }100 101 /* This function checks a string value is a valid filename */102 static int is_valid_file( char * candidate )103 {104 int ret;105 struct stat buffer;106 107 ret = stat(candidate, &buffer);108 if (ret != 0) {109 fd_log_debug("Error on file '%s': %s.\n", candidate, strerror(errno));110 return 0;111 }112 113 /* Ok this candidate is valid */114 return 1;115 98 } 116 99 … … 161 144 %token <ss> IP 162 145 163 %type <string> FI LENAME146 %type <string> FINDFILEEXT 164 147 165 148 /* simple tokens */ … … 197 180 198 181 /* -------------------------------------- */ 199 FILENAME: QSTRING 200 { 201 /* Verify this is a valid file */ 202 if (!is_valid_file($1)) { 203 yyerror (&yylloc, conffile, "Error on file name, aborting..."); 204 YYERROR; 205 } 206 $$ = $1; 182 FINDFILEEXT: QSTRING 183 { 184 char * fname = $1; 185 FILE * fd; 186 187 /* First, check if the file exists */ 188 fd = fopen(fname, "r"); 189 if ((fd == NULL) && (*fname != '/')) { 190 char * bkp = fname; 191 CHECK_MALLOC_DO( fname = malloc( strlen(bkp) + strlen(DEFAULT_EXTENSIONS_PATH) + 2 ), 192 { yyerror (&yylloc, conffile, "Not enough memory"); YYERROR; } ); 193 sprintf(fname, DEFAULT_EXTENSIONS_PATH "/%s", bkp); 194 free(bkp); 195 fd = fopen(fname, "r"); 196 } 197 if (fd == NULL) { 198 int ret = errno; 199 TRACE_DEBUG(INFO, "Unable to open file %s for reading: %s\n", fname, strerror(ret)); 200 yyerror (&yylloc, conffile, "Error adding plugin"); 201 YYERROR; 202 } 203 fclose(fd); 204 205 $$ = fname; 207 206 } 208 207 ; … … 214 213 free(plgconffile); plgconffile = NULL; 215 214 } 216 PLG_PREFIX '=' FI LENAMEplg_attributes ';'215 PLG_PREFIX '=' FINDFILEEXT plg_attributes ';' 217 216 { 218 217 /* Add this extension in the list */ -
extensions/dbg_monitor/CMakeLists.txt
r120 r304 2 2 PROJECT("Monitor extension" C) 3 3 FD_ADD_EXTENSION(dbg_monitor dbg_monitor.c) 4 5 6 #### 7 ## INSTALL section ## 8 9 INSTALL(TARGETS dbg_monitor 10 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 11 COMPONENT freeDiameter-debug-tools) 12 -
extensions/dbg_rt/CMakeLists.txt
r120 r304 4 4 # Compile as a module 5 5 FD_ADD_EXTENSION(dbg_rt dbg_rt.c) 6 7 8 #### 9 ## INSTALL section ## 10 11 INSTALL(TARGETS dbg_rt 12 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 13 COMPONENT freeDiameter-debug-tools) -
extensions/dict_eap/CMakeLists.txt
r10 r304 4 4 # Compile as a module 5 5 FD_ADD_EXTENSION(dict_eap dict_eap.c) 6 7 8 #### 9 ## INSTALL section ## 10 11 INSTALL(TARGETS dict_eap 12 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 13 COMPONENT freeDiameter-dictionary-RFC4072) -
extensions/dict_nasreq/CMakeLists.txt
r10 r304 4 4 # Compile as a module 5 5 FD_ADD_EXTENSION(dict_nasreq dict_nasreq.c) 6 7 8 #### 9 ## INSTALL section ## 10 11 INSTALL(TARGETS dict_nasreq 12 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 13 COMPONENT freeDiameter-dictionary-RFC4005) -
extensions/rt_default/CMakeLists.txt
r170 r304 32 32 33 33 # Overwrite the debug level for the extension code if configured, example: cmake -DDEBUG_LEVEL_RT_DEFAULT:STATIC=CALL ... 34 OPTION(DEBUG_LEVEL_RT_DEFAULT "Overwrite debug level for the extension rt_default if defined " OFF)34 OPTION(DEBUG_LEVEL_RT_DEFAULT "Overwrite debug level for the extension rt_default if defined (valid values: FULL, ANNOYING, CALL...)" OFF) 35 35 IF (DEBUG_LEVEL_RT_DEFAULT) 36 36 ADD_DEFINITIONS(-DTRACE_LEVEL=${DEBUG_LEVEL_RT_DEFAULT}) 37 37 ENDIF (DEBUG_LEVEL_RT_DEFAULT) 38 IF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 39 MARK_AS_ADVANCED(DEBUG_LEVEL_RT_DEFAULT) 40 ENDIF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 38 41 39 42 # Compile these files as a freeDiameter extension 40 43 FD_ADD_EXTENSION(rt_default ${RT_DEFAULT_SRC}) 44 45 46 #### 47 ## INSTALL section ## 48 49 # We install with the daemon component because it is a base feature. 50 INSTALL(TARGETS rt_default 51 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 52 COMPONENT freeDiameter-daemon) 53 -
extensions/test_acct/CMakeLists.txt
r279 r304 3 3 4 4 FD_ADD_EXTENSION(test_acct test_acct.c) 5 6 7 #### 8 ## INSTALL section ## 9 10 INSTALL(TARGETS test_acct 11 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 12 COMPONENT freeDiameter-debug-tools) 13 -
extensions/test_app/CMakeLists.txt
r235 r304 21 21 # Compile as a module 22 22 FD_ADD_EXTENSION(test_app ${APP_TEST_SRC}) 23 24 25 #### 26 ## INSTALL section ## 27 28 INSTALL(TARGETS test_app 29 LIBRARY DESTINATION ${DEFAULT_EXTENSIONS_PATH} 30 COMPONENT freeDiameter-debug-tools) 31 -
extensions/test_rt_any/CMakeLists.txt
r120 r304 4 4 # Compile as a module 5 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 ${DEFAULT_EXTENSIONS_PATH} 13 COMPONENT freeDiameter-debug-tools) -
freeDiameter/CMakeLists.txt
r300 r304 52 52 MESSAGE(SEND_ERROR "Unable to find gcrypt.h, please install libgcrypt-dev or equivalent") 53 53 Endif ( NOT GCRYPT_INCLUDE_DIR ) 54 MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR) 54 55 INCLUDE_DIRECTORIES(${GCRYPT_INCLUDE_DIR}) 55 56 … … 64 65 TARGET_LINK_LIBRARIES(freeDiameterd libfreeDiameter ${FD_LIBS}) 65 66 66 # The daemon is to be installed as part of the freeDiameter-daemon component.67 INSTALL(TARGETS freeDiameterd68 RUNTIME DESTINATION bin69 COMPONENT freeDiameter-daemon)70 71 67 # Save the list of files, if needed 72 68 SET(FD_COMMON_SRC ${FD_COMMON_SRC} PARENT_SCOPE) … … 74 70 75 71 # The unary tests directory 76 OPTION(SKIP_TESTS "Skip compilation of the tests?" O FF)72 OPTION(SKIP_TESTS "Skip compilation of the tests?" ON) 77 73 IF ( NOT SKIP_TESTS ) 78 74 SUBDIRS(tests) 79 75 ENDIF ( NOT SKIP_TESTS ) 76 IF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 77 MARK_AS_ADVANCED(SKIP_TESTS) 78 ENDIF (NOT CMAKE_BUILD_TYPE MATCHES "Debug") 79 80 81 #### 82 ## INSTALL section ## 83 84 INSTALL(TARGETS freeDiameterd 85 RUNTIME DESTINATION bin 86 COMPONENT freeDiameter-daemon) -
freeDiameter/config.c
r258 r304 35 35 36 36 #include "fD.h" 37 #include <sys/stat.h> 37 38 38 39 /* Configuration management */ … … 51 52 52 53 fd_g_config->cnf_eyec = EYEC_CONFIG; 53 fd_g_config->cnf_file = DEFAULT_CONF_FILE;54 54 55 55 fd_g_config->cnf_timer_tc = 30; … … 145 145 extern FILE * fddin; 146 146 147 TRACE_DEBUG (FULL, "Parsing configuration file: %s", fd_g_config->cnf_file); 147 /* Attempt to find the configuration file */ 148 if (!fd_g_config->cnf_file) 149 fd_g_config->cnf_file = FD_DEFAULT_CONF_FILENAME; 148 150 149 151 fddin = fopen(fd_g_config->cnf_file, "r"); 152 if ((fddin == NULL) && (*fd_g_config->cnf_file != '/')) { 153 /* We got a relative path, attempt to add the default directory prefix */ 154 char * bkp = fd_g_config->cnf_file; 155 CHECK_MALLOC( fd_g_config->cnf_file = malloc(strlen(bkp) + strlen(DEFAULT_CONF_PATH) + 2) ); /* we will not free it, but not important */ 156 sprintf( fd_g_config->cnf_file, DEFAULT_CONF_PATH "/%s", bkp ); 157 fddin = fopen(fd_g_config->cnf_file, "r"); 158 } 150 159 if (fddin == NULL) { 151 160 int ret = errno; … … 155 164 156 165 /* call yacc parser */ 166 TRACE_DEBUG (FULL, "Parsing configuration file: %s", fd_g_config->cnf_file); 157 167 CHECK_FCT( fddparse(fd_g_config) ); 158 168 -
freeDiameter/fD.h
r285 r304 42 42 #include <freeDiameter/freeDiameter.h> 43 43 44 #ifndef FD_DEFAULT_CONF_FILENAME 45 #define FD_DEFAULT_CONF_FILENAME "freeDiameter.conf" 46 #endif /* FD_DEFAULT_CONF_FILENAME */ 47 44 48 #ifdef DISABLE_SCTP 45 49 #undef IPPROTO_SCTP -
freeDiameter/fdd.y
r258 r304 309 309 loadext: LOADEXT '=' QSTRING extconf ';' 310 310 { 311 CHECK_FCT_DO( fd_ext_add( $3, $4 ), 311 char * fname; 312 char * cfname; 313 FILE * fd; 314 315 /* Try and open the extension file */ 316 fname = $3; 317 fd = fopen(fname, "r"); 318 if ((fd == NULL) && (*fname != '/')) { 319 char * bkp = fname; 320 CHECK_MALLOC_DO( fname = malloc( strlen(bkp) + strlen(DEFAULT_EXTENSIONS_PATH) + 2 ), 321 { yyerror (&yylloc, conf, "Not enough memory"); YYERROR; } ); 322 sprintf(fname, DEFAULT_EXTENSIONS_PATH "/%s", bkp); 323 free(bkp); 324 fd = fopen(fname, "r"); 325 } 326 if (fd == NULL) { 327 int ret = errno; 328 TRACE_DEBUG(INFO, "Unable to open extension file %s for reading: %s\n", fname, strerror(ret)); 329 yyerror (&yylloc, conf, "Error adding extension"); 330 YYERROR; 331 } 332 fclose(fd); 333 334 /* Try and open the configuration file (optional) */ 335 cfname = $4; 336 if (cfname) { 337 fd = fopen(cfname, "r"); 338 if ((fd == NULL) && (*cfname != '/')) { 339 char * test; 340 CHECK_MALLOC_DO( test = malloc( strlen(cfname) + strlen(DEFAULT_CONF_PATH) + 2 ), 341 { yyerror (&yylloc, conf, "Not enough memory"); YYERROR; } ); 342 sprintf(test, DEFAULT_CONF_PATH "/%s", cfname); 343 fd = fopen(test, "r"); 344 if (fd) { 345 free(cfname); 346 cfname=test; 347 } else { 348 /* This is not an error, we allow an extension to wait for something else than a real conf file. */ 349 free(test); 350 } 351 } 352 if (fd) 353 fclose(fd); 354 } 355 356 CHECK_FCT_DO( fd_ext_add( fname, cfname ), 312 357 { yyerror (&yylloc, conf, "Error adding extension"); YYERROR; } ); 313 358 } -
freeDiameter/main.c
r285 r304 310 310 " -V, --version Print version and exit\n" 311 311 " -c, --config=filename Read configuration from this file instead of the \n" 312 " default location ( %s).\n", DEFAULT_CONF_FILE);312 " default location (" DEFAULT_CONF_PATH "/" FD_DEFAULT_CONF_FILENAME ").\n"); 313 313 printf( "\nDebug:\n" 314 314 " These options are mostly useful for developers\n" -
freeDiameter/tests/CMakeLists.txt
r288 r304 110 110 ADD_TEST(${TEST} ${EXECUTABLE_OUTPUT_PATH}/${TEST}) 111 111 ENDFOREACH( TEST ) 112 113 114 #### 115 ## INSTALL section ## 116 117 # we do not install the tests -
include/freeDiameter/CMakeLists.txt
r236 r304 6 6 # Configurable parameters 7 7 8 # Name of the default configuration file 9 OPTION(DEFAULT_CONF_FILE "Default path to configuration file?" OFF) 8 # The default directory for configuration files 9 SET(DEFAULT_CONF_PATH ${CMAKE_INSTALL_PREFIX}/etc/freeDiameter CACHE PATH "Default location of freeDiameter configuration files") 10 11 # The default directory for extension files 12 SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/lib/fdx CACHE PATH "Default location of freeDiameter extensions") 10 13 11 14 # Disable SCTP support completly ? … … 14 17 OPTION(DEBUG_SCTP "Verbose SCTP (for debug)?" OFF) 15 18 OPTION(SCTP_USE_MAPPED_ADDRESSES "Use v6-mapped v4 addresses in SCTP (workaround some SCTP limitations)?" OFF) 19 ELSE (NOT DISABLE_SCTP) 20 MESSAGE(STATUS "Disabled SCTP support.") 16 21 ENDIF (NOT DISABLE_SCTP) 17 22 … … 19 24 OPTION(ERRORS_ON_TODO "(development) Generate compilation errors on TODO items ?" OFF) 20 25 26 MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO) 21 27 22 28 ######################## … … 90 96 CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) 91 97 92 # The default configuration file name93 IF (NOT DEFAULT_CONF_FILE)94 SET(DEFAULT_CONF_FILE "freeDiameter.conf")95 ENDIF (NOT DEFAULT_CONF_FILE)96 98 ########################## 97 99 … … 99 101 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeDiameter-host.h.in ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h) 100 102 101 # Save the FD_LIBS for parent scope103 # Save some variables for the other directories 102 104 SET(FD_LIBS ${FD_LIBS} PARENT_SCOPE) 105 SET(DEFAULT_CONF_PATH ${DEFAULT_CONF_PATH} PARENT_SCOPE) 106 SET(DEFAULT_EXTENSIONS_PATH ${DEFAULT_EXTENSIONS_PATH} PARENT_SCOPE) 107 108 109 #### 110 ## INSTALL section ## 111 112 # The headers from this directory are required to develop new extensions for freeDiameter. 113 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h libfreeDiameter.h freeDiameter.h extension.h 114 DESTINATION include/freeDiameter 115 COMPONENT freeDiameter-dev) 116 -
include/freeDiameter/freeDiameter-host.h.in
r51 r304 70 70 #cmakedefine FD_PROJECT_COPYRIGHT "@FD_PROJECT_COPYRIGHT@" 71 71 72 #cmakedefine DEFAULT_CONF_ FILE "@DEFAULT_CONF_FILE@"73 72 #cmakedefine DEFAULT_CONF_PATH "@DEFAULT_CONF_PATH@" 73 #cmakedefine DEFAULT_EXTENSIONS_PATH "@DEFAULT_EXTENSIONS_PATH@" 74 74 75 75 #endif /* FD_IS_CONFIG */ -
include/freeDiameter/libfreeDiameter.h
r302 r304 224 224 } 225 225 #else /* DEBUG */ 226 /* Do not print thread, function, ... only the message itself in this case. */ 227 #define TRACE_DEBUG(level,format,args... ) { \ 228 if ( TRACE_BOOL(level) ) { \ 229 fd_log_debug(format "\n", ## args); \ 230 } \ 226 /* Do not print thread, function, ... only the message itself in this case, unless the debug level is set > FULL. */ 227 #define TRACE_DEBUG(level,format,args... ) { \ 228 if ( TRACE_BOOL(level) ) { \ 229 if (fd_g_debug_lvl > FULL) { \ 230 char __buf[25]; \ 231 char * __thn = ((char *)pthread_getspecific(fd_log_thname) ?: "unnamed"); \ 232 fd_log_debug("\t | tid:%-20s\t%s\tin %s@%s:%d\n" \ 233 "\t%s|%*s" format "\n", \ 234 __thn, fd_log_time(NULL, __buf, sizeof(__buf)), __PRETTY_FUNCTION__, __FILE__, __LINE__,\ 235 (level < FULL)?"@":" ",level, "", ## args); \ 236 } else { \ 237 fd_log_debug(format "\n", ## args); \ 238 } \ 239 } \ 231 240 } 232 241 #endif /* DEBUG */ -
libfreeDiameter/CMakeLists.txt
r300 r304 26 26 TARGET_LINK_LIBRARIES(libfreeDiameter ${FD_LIBS}) 27 27 28 # The library is to be installed as part of the freeDiameter-common component. 28 # Save the list of files for testcases in the daemon's directory 29 SET(LFD_SRC ${LFD_SRC} PARENT_SCOPE) 30 31 32 #### 33 ## INSTALL section ## 34 29 35 INSTALL(TARGETS libfreeDiameter 30 36 LIBRARY DESTINATION lib 31 37 COMPONENT freeDiameter-common) 32 38 33 # Save the list of files for testcases in the daemon's directory34 SET(LFD_SRC ${LFD_SRC} PARENT_SCOPE)35
Note: See TracChangeset
for help on using the changeset viewer.