Navigation


Changeset 14:14cf6daf716d in freeDiameter for freeDiameter/fD.h


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

Some progress on peers module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/fD.h

    r13 r14  
    4242#include <freeDiameter/freeDiameter.h>
    4343
     44/* Timeout for establishing a connection */
     45#ifndef CNX_TIMEOUT
     46#define  CNX_TIMEOUT    10      /* in seconds */
     47#endif /* CNX_TIMEOUT */
     48
     49/* Timeout for receiving a CER after incoming connection is established */
     50#ifndef INCNX_TIMEOUT
     51#define  INCNX_TIMEOUT   20     /* in seconds */
     52#endif /* INCNX_TIMEOUT */
     53
     54/* Timeout for receiving a CEA after CER is sent */
     55#ifndef CEA_TIMEOUT
     56#define  CEA_TIMEOUT    10      /* in seconds */
     57#endif /* CEA_TIMEOUT */
     58
     59/* The timeout value to wait for answer to a DPR */
     60#ifndef DPR_TIMEOUT
     61#define DPR_TIMEOUT     15      /* in seconds */
     62#endif /* DPR_TIMEOUT */
     63
    4464/* Configuration */
    4565int fd_conf_init();
     
    4969
    5070/* Extensions */
    51 int fd_ext_init();
    5271int fd_ext_add( char * filename, char * conffile );
    5372int fd_ext_load();
     
    82101        char            *p_dbgorig;
    83102       
    84         /* Mutex that protect this peer structure */
    85         pthread_mutex_t  p_mtx;
    86        
    87         /* Reference counter -- freed only when this reaches 0 */
    88         unsigned         p_refcount;
    89        
    90103        /* Chaining in peers sublists */
     104        struct fd_list   p_actives;     /* list of peers in the STATE_OPEN state -- faster routing creation */
    91105        struct fd_list   p_expiry;      /* list of expiring peers, ordered by their timeout value */
    92         struct fd_list   p_actives;     /* list of peers in the STATE_OPEN state -- faster routing creation */
    93        
    94         /* The next hop-by-hop id value for the link */
    95         uint32_t         p_hbh;
     106        struct timespec  p_exp_timer;   /* Timestamp where the peer will expire; updated each time activity is seen on the peer (except DW) */
    96107       
    97108        /* Some flags influencing the peer state machine */
     
    109120       
    110121        /* The events queue, peer state machine thread, timer for states timeouts */
    111         struct fifo     *p_events;
     122        struct fifo     *p_events;      /* The mutex of this FIFO list protects also the state and timer information */
    112123        pthread_t        p_psm;
    113124        struct timespec  p_psm_timer;
     
    121132        pthread_t        p_outthr;
    122133       
     134        /* The next hop-by-hop id value for the link, only read & modified by p_outthr */
     135        uint32_t         p_hbh;
     136       
    123137        /* Sent requests (for fallback), list of struct sentreq ordered by hbh */
    124138        struct fd_list   p_sentreq;
    125139       
    126         /* connection context: socket & other metadata */
     140        /* connection context: socket, callbacks and so on */
    127141        struct cnxctx   *p_cnxctx;
    128142       
     
    145159        /* A message was received in the peer */
    146160        ,FDEVP_MSG_INCOMING
     161       
     162        /* The PSM state is expired */
     163        ,FDEVP_PSM_TIMEOUT
    147164};
     165const char * fd_pev_str(int event);
    148166
    149167/* Structure to store a sent request */
     
    154172
    155173/* Functions */
    156 int fd_peer_init();
    157174int fd_peer_fini();
    158175void fd_peer_dump_list(int details);
    159176/* fd_peer_add declared in freeDiameter.h */
    160 int fd_peer_rc_decr(struct fd_peer **ptr, int locked);
    161177
    162178/* Peer expiry */
    163179int fd_p_expi_init(void);
    164180int fd_p_expi_fini(void);
    165 int fd_p_expi_update(struct fd_peer * peer, int locked );
    166 int fd_p_expi_unlink(struct fd_peer * peer, int locked );
     181int fd_p_expi_update(struct fd_peer * peer );
    167182
    168183/* Peer state machine */
Note: See TracChangeset for help on using the changeset viewer.