Ignore:
Timestamp:
Nov 19, 2005 1:20:08 PM (18 years ago)
Author:
bennylp
Message:

Added UDP transport implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_transport.h

    r54 r57  
    117117 *****************************************************************************/ 
    118118 
     119/**  
     120 * A customized ioqueue async operation key which is used by transport 
     121 * to locate rdata when a pending read operation completes. 
     122 */ 
     123typedef struct pjsip_rx_data_op_key 
     124{ 
     125    pj_ioqueue_op_key_t         op_key; 
     126    pjsip_rx_data              *rdata; 
     127} pjsip_rx_data_op_key; 
     128 
     129 
    119130/** 
    120131 * Incoming message buffer. 
     
    140151 
    141152        /** Ioqueue key. */ 
    142         pj_ioqueue_op_key_t      op_key; 
     153        pjsip_rx_data_op_key     op_key; 
    143154 
    144155    } tp_info; 
     
    250261 *****************************************************************************/ 
    251262 
     263/** Customized ioqueue async operation key, used by transport to keep 
     264 *  callback parameters. 
     265 */ 
     266typedef struct pjsip_tx_data_op_key 
     267{ 
     268    pj_ioqueue_op_key_t     key; 
     269    pjsip_tx_data          *tdata; 
     270    void                   *token; 
     271    void                  (*callback)(pjsip_transport*,void*,pj_ssize_t); 
     272} pjsip_tx_data_op_key; 
     273 
     274 
    252275/** 
    253276 * Data structure for sending outgoing message. Application normally creates 
     
    266289struct pjsip_tx_data 
    267290{ 
     291    /** This is for transmission queue; it's managed by transports. */ 
    268292    PJ_DECL_LIST_MEMBER(struct pjsip_tx_data); 
    269293 
     
    285309 
    286310    /** Ioqueue asynchronous operation key. */ 
    287     pj_ioqueue_op_key_t op_key; 
     311    pjsip_tx_data_op_key op_key; 
    288312 
    289313    /** Lock object. */ 
     
    304328    pj_atomic_t         *ref_cnt; 
    305329 
    306     /** Being sent? */ 
     330    /** Being processed by transport? */ 
    307331    int                  is_pending; 
    308332 
    309     /** Transport internal. */ 
     333    /** Transport manager internal. */ 
    310334    void                *token; 
    311335    void               (*cb)(void*, pjsip_tx_data*, pj_status_t); 
     
    392416    pj_sockaddr_in          rem_addr;       /**< Remote addr (zero for UDP) */ 
    393417 
     418    pjsip_endpoint         *endpt;          /**< Endpoint instance.         */ 
    394419    pjsip_tpmgr            *tpmgr;          /**< Transport manager.         */ 
    395420    pj_timer_entry          idle_timer;     /**< Timer when ref cnt is zero.*/ 
     
    421446     */ 
    422447    pj_status_t (*send_msg)(pjsip_transport *transport,  
    423                             const void *packet,  
    424                             pj_size_t length, 
    425                             pj_ioqueue_op_key_t *op_key, 
     448                            pjsip_tx_data *tdata, 
    426449                            const pj_sockaddr_in *rem_addr, 
    427450                            void *token, 
    428451                            void (*callback)(pjsip_transport *transport, 
    429452                                             void *token,  
    430                                              pj_status_t status)); 
     453                                             pj_ssize_t sent_bytes)); 
    431454 
    432455    /** 
     
    509532                                    pjsip_tpmgr *mgr, 
    510533                                    pjsip_endpoint *endpt, 
    511                                     pj_ioqueue_t *ioqueue, 
    512534                                    const pj_sockaddr_in *rem_addr, 
    513535                                    pjsip_transport **transport); 
     
    556578PJ_DECL(pj_status_t) pjsip_tpmgr_create( pj_pool_t *pool, 
    557579                                         pjsip_endpoint * endpt, 
    558                                          pj_ioqueue_t *ioqueue, 
    559                                          pj_timer_heap_t *timer_heap, 
    560580                                         void (*cb)(pjsip_endpoint*, 
    561581                                                    pj_status_t, 
     
    602622                                           void (*cb)(void *token,  
    603623                                                      pjsip_tx_data *tdata, 
    604                                                       pj_status_t)); 
     624                                                      pj_ssize_t bytes_sent)); 
    605625 
    606626 
Note: See TracChangeset for help on using the changeset viewer.