Navigation


Changeset 12:418d2ce80dc8 in freeDiameter for freeDiameter/fD.h


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

Added support in configuration file for peers declaration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/fD.h

    r11 r12  
    7272struct fd_peer { /* The "real" definition of the peer structure */
    7373       
    74         struct peer_hdr p_hdr; /* contains all public data */
     74        /* The public data */
     75        struct peer_hdr  p_hdr;
    7576       
    76         int             p_eyec; /* Eye catcher, EYEC_PEER */
     77        /* Eye catcher, EYEC_PEER */
     78        int              p_eyec;
    7779        #define EYEC_PEER       0x373C9336
    7880       
    79         /* threads, message queues, socket & callbacks */
     81        /* Origin of this peer object, for debug */
     82        char            *p_dbgorig;
     83       
     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       
     90        /* Chaining in peers sublists */
     91        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;
     96       
     97        /* Some flags influencing the peer state machine */
     98        struct {
     99                unsigned pf_responder   : 1;    /* The local peer is responder on the connection */
     100               
     101                unsigned pf_dw_pending  : 1;    /* A DWR message was sent and not answered yet */
     102               
     103                unsigned pf_cnx_pb      : 1;    /* The peer was disconnected because of watchdogs; must exchange 3 watchdogs before putting back to normal */
     104                unsigned pf_reopen_cnt  : 2;    /* remaining DW to be exchanged after re-established connection */
     105               
     106                /* to be completed */
     107               
     108        }                p_flags;
     109       
     110        /* The events queue, peer state machine thread, timer for states timeouts */
     111        struct fifo     *p_events;
     112        pthread_t        p_psm;
     113        struct timespec  p_psm_timer;
     114       
     115        /* Received message queue, and thread managing reception of messages */
     116        struct fifo     *p_recv;
     117        pthread_t        p_inthr;
     118       
     119        /* Outgoing message queue, and thread managing sending the messages */
     120        struct fifo     *p_tosend;
     121        pthread_t        p_outthr;
     122       
     123        /* Sent requests (for fallback), list of struct sentreq ordered by hbh */
     124        struct fd_list   p_sentreq;
     125       
     126        /* connection context: socket & other metadata */
     127        struct cnxctx   *p_cnxctx;
    80128       
    81129};
     130#define CHECK_PEER( _p ) \
     131        (((_p) != NULL) && (((struct fd_peer *)(_p))->p_eyec == EYEC_PEER))
    82132
     133/* Events codespace for struct fd_peer->p_events */
     134enum {
     135        /* request to terminate this peer : disconnect, requeue all messages */
     136         FDEVP_TERMINATE = 2000
     137       
     138        /* Dump all info about this peer in the debug log */
     139        ,FDEVP_DUMP_ALL
     140       
     141        /* A message was received in the peer */
     142        ,FDEVP_MSG_INCOMING
     143};
     144
     145/* Structure to store a sent request */
     146struct sentreq {
     147        struct fd_list  chain;  /* the "o" field points directly to the hop-by-hop of the request (uint32_t *)  */
     148        struct msg      *req;   /* A request that was sent and not yet answered. */
     149};
     150
     151/* Functions */
    83152int fd_peer_init();
    84 void fd_peer_dump(int details);
     153void fd_peer_dump_list(int details);
    85154int fd_peer_start();
    86155int fd_peer_waitstart();
    87156
     157
     158
    88159#endif /* _FD_H */
Note: See TracChangeset for help on using the changeset viewer.