Navigation


Changeset 33:e6fcdf12b9a0 in freeDiameter for freeDiameter/fD.h


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

Added a lot of TODOs :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/fD.h

    r31 r33  
    4242#include <freeDiameter/freeDiameter.h>
    4343
     44#ifdef DISABLE_SCTP
     45#undef IPPROTO_SCTP
     46#define IPPROTO_SCTP    (2 = 4) /* some compilation error to spot the references */
     47#endif /* DISABLE_SCTP */
     48
    4449/* Timeout for establishing a connection */
    4550#ifndef CNX_TIMEOUT
     
    102107       
    103108        /* Chaining in peers sublists */
    104         struct fd_list   p_actives;     /* list of peers in the STATE_OPEN state -- faster routing creation */
     109        struct fd_list   p_actives;     /* list of peers in the STATE_OPEN state -- used by routing */
    105110        struct fd_list   p_expiry;      /* list of expiring peers, ordered by their timeout value */
    106111        struct timespec  p_exp_timer;   /* Timestamp where the peer will expire; updated each time activity is seen on the peer (except DW) */
     
    124129        struct timespec  p_psm_timer;
    125130       
    126         /* Received message queue, and thread managing reception of messages */
    127         struct fifo     *p_recv;
    128         pthread_t        p_inthr;
    129        
    130131        /* Outgoing message queue, and thread managing sending the messages */
    131132        struct fifo     *p_tosend;
     
    138139        struct fd_list   p_sentreq;
    139140       
    140         /* connection context: socket, callbacks and so on */
     141        /* connection context: socket and related information */
    141142        struct cnxctx   *p_cnxctx;
    142143       
    143         /* Callback on initial connection success / failure */
     144        /* Callback for peer validation after the handshake */
     145        int             (*p_cb2)(struct peer_info *);
     146       
     147        /* Callback on initial connection success / failure after the peer was added */
    144148        void            (*p_cb)(struct peer_info *, void *);
    145149        void            *p_cb_data;
     
    173177       
    174178};
     179#define CHECK_PEVENT( _e ) \
     180        (((int)(_e) >= FDEVP_DUMP_ALL) && ((int)(_e) <= FDEVP_PSM_TIMEOUT))
     181/* The following macro is actually called in p_psm.c -- another solution would be to declare it static inline */
     182#define DECLARE_PEV_STR()                               \
     183const char * fd_pev_str(int event)                      \
     184{                                                       \
     185        switch (event) {                                \
     186                case_str(FDEVP_DUMP_ALL);               \
     187                case_str(FDEVP_TERMINATE);              \
     188                case_str(FDEVP_CNX_MSG_RECV);           \
     189                case_str(FDEVP_CNX_ERROR);              \
     190                case_str(FDEVP_CNX_EP_CHANGE);          \
     191                case_str(FDEVP_CNX_INCOMING);           \
     192                case_str(FDEVP_PSM_TIMEOUT);            \
     193        }                                               \
     194        TRACE_DEBUG(FULL, "Unknown event : %d", event); \
     195        return "Unknown event";                         \
     196}
    175197const char * fd_pev_str(int event);
    176 #define CHECK_EVENT( _e ) \
    177         (((int)(_e) >= FDEVP_DUMP_ALL) && ((int)(_e) <= FDEVP_PSM_TIMEOUT))
    178198
    179199/* The data structure for FDEVP_CNX_INCOMING events */
     
    211231int  fd_psm_terminate(struct fd_peer * peer );
    212232void fd_psm_abord(struct fd_peer * peer );
     233
     234/* Peer out */
     235int fd_out_send(struct msg ** msg, struct cnxctx * cnx, struct fd_peer * peer);
     236int fd_out_start(struct fd_peer * peer);
     237int fd_out_stop(struct fd_peer * peer);
     238
     239/* Active peers -- routing process should only ever take the read lock, the write lock is managed by PSMs */
     240extern struct fd_list fd_g_activ_peers;
     241extern pthread_rwlock_t fd_g_activ_peers_rw; /* protect the list */
     242
    213243
    214244/* Server sockets */
Note: See TracChangeset for help on using the changeset viewer.