Changeset 658:f198d16fa7f4 in freeDiameter for include
- Timestamp:
- Jan 14, 2011, 3:15:23 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- include/freeDiameter
- Files:
-
- 3 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/CMakeLists.txt
r561 r658 1 1 #CMake configuration for freeDiameter include directory 2 2 3 Project("freeDiameter include directory" C)3 Project("freeDiameter includes directory" C) 4 4 5 5 ######################## … … 68 68 ENDIF (HAVE_CLOCK_GETTIME) 69 69 70 # LFD _LIBS = libraries required by the libfreeDiameter.71 SET(LFD _LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT})70 # LFDPROTO_LIBS = libraries required by the libfdproto. 71 SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT}) 72 72 73 73 … … 98 98 99 99 100 # FD_LIBS = libraries required by the daemon 101 SET(FD_LIBS ${CMAKE_DL_LIBS} ${SCTP_LIBRARIES}) 100 # Require GNU TLS for building the library 101 FIND_PACKAGE(GnuTLS REQUIRED) 102 INCLUDE_DIRECTORIES(${GNUTLS_INCLUDE_DIR}) 103 104 find_path(GCRYPT_INCLUDE_DIR NAMES gcrypt.h) 105 If ( NOT GCRYPT_INCLUDE_DIR ) 106 MESSAGE(SEND_ERROR "Unable to find gcrypt.h, please install libgcrypt-dev or equivalent") 107 Endif ( NOT GCRYPT_INCLUDE_DIR ) 108 MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR) 109 INCLUDE_DIRECTORIES(${GCRYPT_INCLUDE_DIR}) 110 111 # Also we need libgcrypt to... display its version :( 112 find_library(GCRYPT_LIBRARY 113 NAMES gcrypt 114 ) 115 If ( NOT GCRYPT_LIBRARY ) 116 MESSAGE(SEND_ERROR "Unable to find libgcrypt, please install libgcrypt or equivalent") 117 Endif ( NOT GCRYPT_LIBRARY ) 118 119 120 # LFDCORE_LIBS = libraries required by the libfdcore 121 SET(LFDCORE_LIBS ${CMAKE_DL_LIBS} ${SCTP_LIBRARIES} ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES}) 102 122 103 123 ########################## … … 111 131 112 132 # Save some variables for the other directories 113 SET( FD_LIBS ${FD_LIBS}PARENT_SCOPE)114 SET(LFD _LIBS ${LFD_LIBS}PARENT_SCOPE)133 SET(LFDPROTO_LIBS ${LFDPROTO_LIBS} PARENT_SCOPE) 134 SET(LFDCORE_LIBS ${LFDCORE_LIBS} PARENT_SCOPE) 115 135 SET(CMAKE_THREAD_LIBS_INIT ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE) 116 136 … … 119 139 120 140 # The headers from this directory are required to develop new extensions for freeDiameter. 121 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h libf reeDiameter.h freeDiameter.h extension.h141 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/freeDiameter-host.h libfdproto.h libfdcore.h extension.h 122 142 DESTINATION ${INSTALL_HEADERS_SUFFIX} 123 143 COMPONENT freeDiameter-dev) -
include/freeDiameter/extension.h
r8 r658 3 3 * Author: Sebastien Decugis <sdecugis@nict.go.jp> * 4 4 * * 5 * Copyright (c) 20 09, WIDE Project and NICT *5 * Copyright (c) 2011, WIDE Project and NICT * 6 6 * All rights reserved. * 7 7 * * … … 39 39 /* Include definition of freeDiameter API */ 40 40 #include <freeDiameter/freeDiameter-host.h> 41 #include <freeDiameter/ freeDiameter.h>41 #include <freeDiameter/libfdcore.h> 42 42 43 43 /* Macro that define the entry point of the extension */ -
include/freeDiameter/freeDiameter-host.h.in
r648 r658 75 75 #cmakedefine DEFAULT_EXTENSIONS_PATH "@DEFAULT_EXTENSIONS_PATH@" 76 76 77 #ifndef FD_DEFAULT_CONF_FILENAME 78 #define FD_DEFAULT_CONF_FILENAME "freeDiameter.conf" 79 #endif /* FD_DEFAULT_CONF_FILENAME */ 80 77 81 #endif /* FD_IS_CONFIG */ -
include/freeDiameter/libfdcore.h
r648 r658 34 34 *********************************************************************************************************/ 35 35 36 #ifndef _ FREEDIAMETER_H37 #define _ FREEDIAMETER_H38 39 40 #include <freeDiameter/libf reeDiameter.h>36 #ifndef _LIBFDCORE_H 37 #define _LIBFDCORE_H 38 39 40 #include <freeDiameter/libfdproto.h> 41 41 #include <gnutls/gnutls.h> 42 42 #include <gnutls/x509.h> … … 68 68 (__call__); \ 69 69 } 70 71 72 /*============================================================*/ 73 /* INITIALIZATION */ 74 /*============================================================*/ 75 76 77 /* Initialize the libfdcore internals. This also initializes libfdproto */ 78 int fd_core_initialize(void); 79 80 /* Return a string describing the version of the library */ 81 const char *fd_core_version(void); 82 83 /* Parse the freeDiameter.conf configuration file, load the extensions */ 84 int fd_core_parseconf(char * conffile); 85 86 /* Start the server & client threads */ 87 int fd_core_start(void); 88 89 /* Block until the framework has completed its initialization -- useful for extensions */ 90 int fd_core_waitstartcomplete(void); 91 92 /* Initialize shutdown of the framework */ 93 int fd_core_shutdown(void); 94 95 /* Wait for the shutdown to be complete -- this should always be called after fd_core_shutdown */ 96 int fd_core_wait_shutdown_complete(void); 97 98 99 /*============================================================*/ 100 /* CONFIG */ 101 /*============================================================*/ 70 102 71 103 /* Structure to hold the configuration of the freeDiameter daemon */ … … 129 161 130 162 131 /***************************************/ 132 /* Peers information */ 133 /***************************************/ 163 164 /*============================================================*/ 165 /* PEERS */ 166 /*============================================================*/ 134 167 135 168 /* States of a peer */ … … 366 399 */ 367 400 368 /***************************************/ 369 /* Sending a message on the network */ 370 /***************************************/ 401 402 403 /*============================================================*/ 404 /* MESSAGES */ 405 /*============================================================*/ 371 406 372 407 /* … … 444 479 445 480 446 /***************************************/ 447 /* Dispatch module, daemon's part */ 448 /***************************************/ 481 482 483 /*============================================================*/ 484 /* DISPATCH */ 485 /*============================================================*/ 449 486 450 487 /* … … 471 508 472 509 473 /* **************************************/474 /* Routing module*/475 /* **************************************/510 /*============================================================*/ 511 /* ROUTING */ 512 /*============================================================*/ 476 513 477 514 /* This file contains the definitions of types and functions involved in the routing decisions in freeDiameter, … … 661 698 662 699 663 /* **************************************/664 /* Events helpers*/665 /* **************************************/700 /*============================================================*/ 701 /* EVENTS */ 702 /*============================================================*/ 666 703 667 704 struct fd_event { … … 671 708 }; 672 709 673 /* Daemon's codespace: 1000->1999 (1500->1999 defined in f D.h) */710 /* Daemon's codespace: 1000->1999 (1500->1999 defined in fdcore-internal.h) */ 674 711 enum { 675 712 FDEV_TERMINATE = 1000 /* request to terminate */ … … 680 717 ,FDEV_DUMP_CONFIG /* Dump the configuration */ 681 718 ,FDEV_DUMP_PEERS /* Dump the list of peers */ 719 ,FDEV_TRIGGER /* Trigger available for extensions. size is sizeof(int), data is int * */ 682 720 }; 683 721 … … 688 726 const char * fd_ev_str(int event); 689 727 690 691 /* The following function does not really use events, but it may be used 692 by extensions that need to start an action when the framework is fully initialized. 693 This function will block until all initializations are performed in the daemon. 694 It is meant to be used as follow by extensions: 695 - in initialization callback, create a new thread. 696 - this new thread calls this function. 697 - when the function returns, the thread can start working and using all framework features. 698 */ 699 int fd_wait_initialization_complete(void); 700 701 702 /***************************************/ 703 /* Endpoints lists helpers */ 704 /***************************************/ 728 /* for extensions */ 729 int fd_event_trig_regcb(int trigger_val, const char * module, void (*cb)(void)); 730 void fd_event_trig_dump(); 731 732 733 /*============================================================*/ 734 /* ENDPOINTS */ 735 /*============================================================*/ 705 736 706 737 struct fd_endpoint { … … 737 768 void fd_ep_dump( int indent, struct fd_list * eps ); 738 769 739 /***************************************/ 740 /* Applications lists helpers */ 741 /***************************************/ 770 771 /*============================================================*/ 772 /* APPLICATIONS IDs */ 773 /*============================================================*/ 742 774 743 775 struct fd_app { … … 756 788 int fd_app_empty(struct fd_list * list); 757 789 758 #endif /* _ FREEDIAMETER_H */790 #endif /* _LIBFDCORE_H */ -
include/freeDiameter/libfdproto.h
r653 r658 54 54 */ 55 55 56 #ifndef _LIBF REEDIAMETER_H57 #define _LIBF REEDIAMETER_H56 #ifndef _LIBFDPROTO_H 57 #define _LIBFDPROTO_H 58 58 59 59 #ifndef FD_IS_CONFIG … … 83 83 84 84 /* This function must be called first, before any call to another library function */ 85 /* If the parameter is not 0, the support for signals (fd_sig_register) is enabled, otherwise it is disabled */ 86 /* The function must be called while the application is single-threaded to enable support for signals */ 87 int fd_lib_init(int support_signals); 85 int fd_libproto_init(void); /* note if you are using libfdcore, it handles this already */ 88 86 89 87 /* Call this one when the application terminates, to destroy internal threads */ 90 void fd_lib _fini(void);88 void fd_libproto_fini(void); 91 89 92 90 … … 633 631 } 634 632 635 /*============================================================*/636 /* SIGNALS */637 /*============================================================*/638 639 /* Register a new callback to be called on reception of a given signal (it receives the signal as parameter) */640 /* EALREADY will be returned if there is already a callback registered on this signal */641 /* NOTE: the signal handler will be called from a new detached thread */642 int fd_sig_register(int signal, char * modname, void (*callback)(int signal));643 644 /* Remove the handler for a given signal */645 int fd_sig_unregister(int signal);646 647 /* Dump list of handlers */648 void fd_sig_dump(int level, int indent);649 650 /* Name of signals */651 const char * fd_sig_abbrev(int signal);652 653 633 654 634 /*============================================================*/ … … 2812 2792 void fd_fifo_dump(int level, char * name, struct fifo * queue, void (*dump_item)(int level, void * item)); 2813 2793 2814 #endif /* _LIBF REEDIAMETER_H */2794 #endif /* _LIBFDPROTO_H */
Note: See TracChangeset
for help on using the changeset viewer.