Ignore:
Timestamp:
Feb 25, 2010 11:58:19 AM (12 years ago)
Author:
nanang
Message:

More ticket #1032:

  • Updated transport state notification callback to return void.
  • Updated transport state enum to only contain connected and disconnected, no more bitmask value.
  • Added direction field to SIP transport.
  • Removed remote hostname hash from transport key.
  • Updated cert info dump to return -1 when buffer is insufficient.
  • Added new error code PJSIP_TLS_ECERTVERIF.
  • Updated get_cert_name() in ssl_sock_symbian.c to use heap buffer instead of stack.
  • Minors, e.g: added prefix PJ in cipher types, docs.
File:
1 edited

Legend:

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

    r3106 r3110  
    694694 
    695695    /** 
    696      * Hash of host name. 
    697      */ 
    698     pj_uint32_t             hname; 
    699  
    700     /** 
    701696     * Destination address. 
    702697     */ 
     
    704699 
    705700} pjsip_transport_key; 
     701 
     702 
     703/** 
     704 * Enumeration of transport direction types. 
     705 */ 
     706typedef enum pjsip_transport_dir 
     707{ 
     708    PJSIP_TP_DIR_NONE,              /**< Direction not set, normally used by 
     709                                         connectionless transports such as  
     710                                         UDP transport.                     */ 
     711    PJSIP_TP_DIR_OUTGOING,          /**< Outgoing connection or client mode, 
     712                                         this is only for connection-oriented  
     713                                         transports.                        */ 
     714    PJSIP_TP_DIR_INCOMING,          /**< Incoming connection or server mode, 
     715                                         this is only for connection-oriented 
     716                                         transports.                        */ 
     717} pjsip_transport_dir; 
     718 
    706719 
    707720/** 
     
    732745    pjsip_host_port         local_name;     /**< Published name (eg. STUN). */ 
    733746    pjsip_host_port         remote_name;    /**< Remote address name.       */ 
     747    pjsip_transport_dir     dir;            /**< Connection direction.      */ 
    734748     
    735749    pjsip_endpoint         *endpt;          /**< Endpoint instance.         */ 
     
    11311145 * 
    11321146 * This is an internal function since normally application doesn't have access 
    1133  * to transport manager. Application should use pjsip_endpt_acquire_transport() 
     1147 * to transport manager. Application should use pjsip_endpt_acquire_transport2() 
    11341148 * instead. 
    11351149 * 
     
    12451259 * Enumeration of transport state types. 
    12461260 */ 
    1247 typedef enum pjsip_transport_state_type { 
    1248  
    1249     /** Transport connected.    */ 
    1250     PJSIP_TP_STATE_CONNECTED        = (1 << 0), 
    1251  
    1252     /** Transport accepted.     */ 
    1253     PJSIP_TP_STATE_ACCEPTED         = (1 << 1), 
    1254  
    1255     /** Transport disconnected. */ 
    1256     PJSIP_TP_STATE_DISCONNECTED     = (1 << 2), 
    1257  
    1258     /** Incoming connection rejected.   */ 
    1259     PJSIP_TP_STATE_REJECTED         = (1 << 3), 
    1260  
    1261     /** TLS verification error. */ 
    1262     PJSIP_TP_STATE_TLS_VERIF_ERROR  = (1 << 8) 
    1263  
    1264 } pjsip_transport_state_type; 
    1265  
    1266  
    1267 /** 
    1268  * Structure of transport state info. 
     1261typedef enum pjsip_transport_state 
     1262{ 
     1263    PJSIP_TP_STATE_CONNECTED,       /**< Transport connected, applicable only 
     1264                                         to connection-oriented transports 
     1265                                         such as TCP and TLS.               */ 
     1266    PJSIP_TP_STATE_DISCONNECTED     /**< Transport disconnected, applicable 
     1267                                         only to connection-oriented  
     1268                                         transports such as TCP and TLS.    */ 
     1269} pjsip_transport_state; 
     1270 
     1271 
     1272/** 
     1273 * Structure of transport state info passed by #pjsip_tp_state_callback. 
    12691274 */ 
    12701275typedef struct pjsip_transport_state_info { 
     
    12731278     */ 
    12741279    pj_status_t          status; 
    1275      
     1280 
    12761281    /** 
    12771282     * Optional extended info, the content is specific for each transport type. 
     
    12831288/** 
    12841289 * Type of callback to receive transport state notifications, such as 
    1285  * transport connected, disconnected or TLS verification error. 
     1290 * transport connected/disconnected. Application may shutdown the transport 
     1291 * in this callback. 
    12861292 * 
    12871293 * @param tp            The transport instance. 
    1288  * @param state         The transport state, this may contain single or  
    1289  *                      combination of transport state types defined in 
    1290  *                      #pjsip_transport_state_type. 
     1294 * @param state         The transport state. 
    12911295 * @param info          The transport state info. 
    1292  * 
    1293  * @return              When TLS verification fails and peer verification in 
    1294  *                      #pjsip_tls_setting is not set, application may return 
    1295  *                      PJ_TRUE to ignore the verification result and continue 
    1296  *                      using the transport. On other cases, this return value 
    1297  *                      is currently not used and will be ignored. 
    1298  */ 
    1299 typedef pj_bool_t (*pjsip_tp_state_callback)( 
     1296 */ 
     1297typedef void (*pjsip_tp_state_callback)( 
    13001298                                    pjsip_transport *tp, 
    1301                                     pj_uint32_t state, 
     1299                                    pjsip_transport_state state, 
    13021300                                    const pjsip_transport_state_info *info); 
    13031301 
     
    13061304 * Setting callback of transport state notification. The caller will be 
    13071305 * notified whenever the state of transport is changed. The type of 
    1308  * events are defined in #pjsip_transport_state_type. 
     1306 * events are defined in #pjsip_transport_state. 
    13091307 *  
    13101308 * @param mgr       Transport manager. 
Note: See TracChangeset for help on using the changeset viewer.