Navigation


Changeset 12:418d2ce80dc8 in freeDiameter for include/freeDiameter


Ignore:
Timestamp:
Sep 28, 2009 5:29:25 PM (4 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Message:

Added support in configuration file for peers declaration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/freeDiameter.h

    r11 r12  
    125125/* Events codespace for fd_g_config->cnf_main_ev */ 
    126126enum { 
    127         FDEV_TERMINATE = 1000,  /* request to terminate */ 
    128         FDEV_DUMP_DICT,         /* Dump the content of the dictionary */ 
    129         FDEV_DUMP_EXT,          /* Dump state of extensions */ 
    130         FDEV_DUMP_QUEUES,       /* Dump the message queues */ 
    131         FDEV_DUMP_CONFIG,       /* Dump the configuration */ 
    132         FDEV_DUMP_PEERS         /* Dump the list of peers */ 
     127         FDEV_TERMINATE = 1000  /* request to terminate */ 
     128        ,FDEV_DUMP_DICT         /* Dump the content of the dictionary */ 
     129        ,FDEV_DUMP_EXT          /* Dump state of extensions */ 
     130        ,FDEV_DUMP_QUEUES       /* Dump the message queues */ 
     131        ,FDEV_DUMP_CONFIG       /* Dump the configuration */ 
     132        ,FDEV_DUMP_PEERS        /* Dump the list of peers */ 
    133133}; 
    134134 
     
    161161}; 
    162162extern const char *peer_state_str[]; 
     163#define STATE_STR(state) \ 
     164        peer_state_str[ ((unsigned)(state)) <= STATE_REOPEN ? ((unsigned)(state)) : 0 ] 
    163165 
    164166/* Information about a remote peer, used both for query and for creating a new entry */ 
    165167struct peer_info { 
    166168         
    167         /* This information is always there */ 
    168169        char * pi_diamid;       /* UTF-8, \0 terminated. The Diameter Identity of the remote peer */ 
    169170        char * pi_realm;        /* idem, its realm. */ 
    170171         
    171         /* Flags */ 
    172172        struct { 
    173                 #define PI_PROT_DEFAULT 0       /* Use the default algorithm configured for the host */ 
    174                 #define PI_PROT_TCP     1 
    175                 #define PI_PROT_SCTP    2 
    176                 unsigned        proto :2; 
    177                  
    178                 #define PI_SEC_DEFAULT  0       /* The default behavior configured for the host */ 
     173                #define PI_P3_DEFAULT   0       /* Use the default L3 protocol configured for the host */ 
     174                #define PI_P3_IP        1       /* Use only IP to connect to this peer */ 
     175                #define PI_P3_IPv6      2       /* resp, IPv6 */ 
     176                unsigned        pro3 :2; 
     177                 
     178                #define PI_P4_DEFAULT   0       /* Use the default L4 proto configured for the host */ 
     179                #define PI_P4_TCP       1       /* Only use TCP */ 
     180                #define PI_P4_SCTP      2       /* Only use SCTP */ 
     181                unsigned        pro4 :2; 
     182                 
     183                #define PI_ALGPREF_SCTP 0       /* SCTP is initially attempted */ 
     184                #define PI_ALGPREF_TCP  1       /* TCP is initially attempted */ 
     185                unsigned        alg :1; 
     186                 
     187                #define PI_SEC_DEFAULT  0       /* New TLS security (dedicated port protecting also CER/CEA) */ 
    179188                #define PI_SEC_NONE     1       /* Transparent security with this peer (IPsec) */ 
    180                 #define PI_SEC_TLS_NEW  2       /* New TLS security (dedicated port protecting also CER/CEA) */ 
    181                 #define PI_SEC_TLS_OLD  3       /* Old TLS security (inband on default port) */ 
     189                #define PI_SEC_TLS_OLD  2       /* Old TLS security (inband on default port) */ 
    182190                unsigned        sec :2; 
    183191                 
    184                 #define PI_EXP_DEFAULT  0 
    185                 #define PI_EXP_NONE     1       /* the peer entry does not expire */ 
    186                 #define PI_EXP_INACTIVE 2       /* the peer entry expires after pi_lft seconds without activity */ 
    187                 #define PI_EXP_LIFETIME 3       /* the peer SA information is destroyed after lft seconds (example: DNS timeout) */ 
    188                 unsigned        exp :2; 
     192                #define PI_EXP_NONE     0       /* the peer entry does not expire */ 
     193                #define PI_EXP_INACTIVE 1       /* the peer entry expires after pi_lft seconds without activity */ 
     194                unsigned        exp :1; 
    189195                 
    190196                /* Following flags are read-only and received from remote peer */ 
     
    232238 * PARAMETERS: 
    233239 *  info        : Information to create the peer. 
     240 *  orig_dbg    : A string indicating the origin of the peer information, for debug (ex: conf, redirect, ...) 
    234241 *  cb          : optional, a callback to call (once) when the peer connection is established or failed 
    235242 *  cb_data     : opaque data to pass to the callback. 
     
    248255 *    ENOMEM    : Memory allocation for the new object element failed.) 
    249256 */ 
    250 int fd_peer_add ( struct peer_info * info, void (*cb)(struct peer_info *, void *), void * cb_data ); 
     257int fd_peer_add ( struct peer_info * info, char * orig_dbg, void (*cb)(struct peer_info *, void *), void * cb_data ); 
    251258 
    252259/* 
Note: See TracChangeset for help on using the changeset viewer.