Navigation


Changeset 8:3e143f047f78 in freeDiameter for include/freeDiameter/freeDiameter.h


Ignore:
Timestamp:
Sep 18, 2009, 6:54:07 PM (15 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Backup for the week-end

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/freeDiameter.h

    r7 r8  
    4141
    4242
    43 /* The global dictionary */
    44 extern struct dictionary * fd_g_dict;
    45 
     43/* Structure to hold the configuration of the freeDiameter daemon */
     44struct fd_config {
     45        int              eyec;          /* Eye catcher: EYEC_CONFIG */
     46        char            *conf_file;     /* Configuration file to parse, default is DEFAULT_CONF_FILE */
     47       
     48        char            *diam_id;       /* Diameter Identity of the local peer (FQDN -- UTF-8) */
     49        size_t           diam_id_len;   /* length of the previous string */
     50        char            *diam_realm;    /* Diameter realm of the local peer, default to realm part of diam_id */
     51        size_t           diam_realm_len;/* length of the previous string */
     52       
     53        uint16_t         loc_port;      /* the local port for legacy Diameter (default: 3868) in host byte order */
     54        uint16_t         loc_port_tls;  /* the local port for Diameter/TLS (default: 3869) in host byte order */
     55        uint16_t         loc_sctp_str;  /* default max number of streams for SCTP associations (def: 30) */
     56        struct fd_list   loc_endpoints; /* the local endpoints to bind the server to. list of struct fd_endpoint. default is empty (bind all) */
     57        struct {
     58                unsigned no_ip4 : 1;    /* disable IP */
     59                unsigned no_ip6 : 1;    /* disable IPv6 */
     60                unsigned no_tcp : 1;    /* disable use of TCP */
     61                unsigned no_sctp: 1;    /* disable the use of SCTP */
     62                unsigned pr_tcp : 1;    /* prefer TCP over SCTP */
     63                unsigned tls_alg: 1;    /* TLS algorithm for initiated cnx. 0: separate port. 1: inband-security (old) */
     64                unsigned no_fwd : 1;    /* the peer does not relay messages (0xffffff app id) */
     65        }                flags;
     66       
     67        unsigned int     timer_tc;      /* The value in seconds of the default Tc timer */
     68        unsigned int     timer_tw;      /* The value in seconds of the default Tw timer */
     69       
     70        uint32_t         or_state_id;   /* The value to use in Origin-State-Id, default to random value */
     71        struct dictionary *g_dict;      /* pointer to the global dictionary */
     72        struct fifo       *g_fifo_main; /* FIFO queue of events in the daemon main (struct fd_event items) */
     73};
     74
     75#define EYEC_CONFIG     0xC011F16
     76
     77/* The pointer to access the global configuration, initalized in main */
     78extern struct fd_config *fd_g_config;
     79
     80/* Endpoints */
     81struct fd_endpoint {
     82        struct fd_list  chain;  /* link in loc_endpoints list */
     83        sSS             ss;     /* the socket information. */
     84};
     85
     86/* Events */
     87struct fd_event {
     88        int      code; /* codespace depends on the queue */
     89        void    *data;
     90};
     91
     92/* send an event */
     93static __inline__ int fd_event_send(struct fifo *queue, int code, void * data)
     94{
     95        struct fd_event * ev;
     96        CHECK_MALLOC( ev = malloc(sizeof(struct fd_event)) );
     97        ev->code = code;
     98        ev->data = data;
     99        CHECK_FCT( fd_fifo_post(queue, &ev) );
     100        return 0;
     101}
     102/* receive an event */
     103static __inline__ int fd_event_get(struct fifo *queue, int *code, void ** data)
     104{
     105        struct fd_event * ev;
     106        CHECK_FCT( fd_fifo_get(queue, &ev) );
     107        if (code)
     108                *code = ev->code;
     109        if (data)
     110                *data = ev->data;
     111        free(ev);
     112        return 0;
     113}
    46114
    47115/***************************************/
Note: See TracChangeset for help on using the changeset viewer.