Navigation


Changeset 21:bef197f6826f in freeDiameter for freeDiameter/fD.h


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

Backup before week-end, cnxctx and server in progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/fD.h

    r20 r21  
    173173};
    174174
    175 /* The connection context structure */
    176 struct cnxctx {
    177         int             cc_socket;      /* The socket object of the connection -- <=0 if no socket is created */
    178        
    179         struct fifo   **cc_events;      /* Location of the events list to send connection events */
    180        
    181         int             cc_proto;       /* IPPROTO_TCP or IPPROTO_SCTP */
    182         int             cc_tls;         /* Is TLS already started ? */
    183        
    184         uint16_t        cc_port;        /* Remote port of the connection, when we are client */
    185         struct fd_list  cc_ep_remote;   /* The remote address(es) of the connection */
    186         struct fd_list  cc_ep_local;    /* The local address(es) of the connection */
    187        
    188         /* If cc_proto == SCTP */
    189         struct  {
    190                 int             str_out;/* Out streams */
    191                 int             str_in; /* In streams */
    192                 int             pairs;  /* max number of pairs ( = min(in, out)) */
    193                 int             next;   /* # of stream the next message will be sent to */
    194         }               cc_sctp_para;
    195        
    196         /* If cc_tls == true */
    197         struct {
    198                 int                              mode;          /* GNUTLS_CLIENT / GNUTLS_SERVER */
    199                 gnutls_session_t                 session;       /* Session object (stream #0 in case of SCTP) */
    200         }               cc_tls_para;
    201        
    202         /* If both conditions */
    203         struct {
    204                 gnutls_session_t                *res_sessions;  /* Sessions of other pairs of streams, resumed from the first */
    205                 /* Buffers, threads, ... */
    206         }               cc_sctp_tls_para;
    207 };
    208175
    209176/* Functions */
     
    233200/* Connection contexts */
    234201struct cnxctx * fd_cnx_init(int sock, int proto);
     202int fd_cnx_start_clear(struct cnxctx * conn);
    235203int fd_cnx_handshake(struct cnxctx * conn, int mode);
     204int fd_cnx_getcred(struct cnxctx * conn, const gnutls_datum_t **cert_list, unsigned int *cert_list_size);
     205int fd_cnx_getendpoints(struct cnxctx * conn, struct fd_list * senti);
     206char * fd_cnx_getremoteid(struct cnxctx * conn);
     207int fd_cnx_receive(struct cnxctx * conn, struct timespec * timeout, unsigned char **buf, size_t * len);
     208int fd_cnx_send(struct cnxctx * conn, unsigned char * buf, size_t len);
     209void fd_cnx_destroy(struct cnxctx * conn);
    236210
    237211/* SCTP */
Note: See TracChangeset for help on using the changeset viewer.