Ignore:
Timestamp:
Feb 24, 2010 5:43:34 AM (14 years ago)
Author:
nanang
Message:

Ticket #1032:

  • Initial version of server domain name verification:
    • Updated SSL certificate info, especially identities info
    • Updated verification mechanism as in the specifications in ticket desc.
    • Added server domain name info in pjsip_tx_data.
    • Added alternative API for acquiring transport and creating transport of transport factory to include pjsip_tx_data param.
    • Server identity match criteria:
      • full host name match
      • wild card not accepted
      • if identity is URI, it must be SIP/SIPS URI
  • Initial version of transport state notifications:
    • Added new API to set transport state callback in PJSIP and PJSUA.
    • Defined states: connected/disconnected, accepted/rejected, verification errors.
  • Minors:
    • Updated SSL socket test: dump verification result, test of requiring client cert, and few minors.
    • Updated test cert to include subjectAltName extensions.
    • Added SSL certificate dump function.
    • Updated max number of socket async operations in Symbian sample apps (RSocketServ::Connect()) to 32 (was default 8).
File:
1 edited

Legend:

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

    r3077 r3106  
    541541    struct 
    542542    { 
     543        /** Server name.  
     544         */ 
     545        pj_str_t                 name; 
     546 
    543547        /** Server addresses resolved.  
    544548         */ 
     
    688692     */ 
    689693    long                    type; 
     694 
     695    /** 
     696     * Hash of host name. 
     697     */ 
     698    pj_uint32_t             hname; 
    690699 
    691700    /** 
     
    919928 
    920929    /** 
    921      * Create new outbound connection. 
     930     * Create new outbound connection suitable for sending SIP message 
     931     * to specified remote address. 
    922932     * Note that the factory is responsible for both creating the 
    923933     * transport and registering it to the transport manager. 
     
    929939                                    int addr_len, 
    930940                                    pjsip_transport **transport); 
     941 
     942    /** 
     943     * Create new outbound connection suitable for sending SIP message 
     944     * to specified remote address by also considering outgoing SIP  
     945     * message data. 
     946     * Note that the factory is responsible for both creating the 
     947     * transport and registering it to the transport manager. 
     948     */ 
     949    pj_status_t (*create_transport2)(pjsip_tpfactory *factory, 
     950                                     pjsip_tpmgr *mgr, 
     951                                     pjsip_endpoint *endpt, 
     952                                     const pj_sockaddr *rem_addr, 
     953                                     int addr_len, 
     954                                     pjsip_tx_data *tdata, 
     955                                     pjsip_transport **transport); 
    931956 
    932957    /** 
     
    10991124                                                   const pjsip_tpselector *sel, 
    11001125                                                   pjsip_transport **tp); 
     1126 
     1127/** 
     1128 * Find suitable transport for sending SIP message to specified remote  
     1129 * destination by also considering the outgoing SIP message. If no suitable  
     1130 * transport is found, a new one will be created. 
     1131 * 
     1132 * This is an internal function since normally application doesn't have access 
     1133 * to transport manager. Application should use pjsip_endpt_acquire_transport() 
     1134 * instead. 
     1135 * 
     1136 * @param mgr       The transport manager instance. 
     1137 * @param type      The type of transport to be acquired. 
     1138 * @param remote    The remote address to send message to. 
     1139 * @param addr_len  Length of the remote address. 
     1140 * @param sel       Optional pointer to transport selector instance which is 
     1141 *                  used to find explicit transport, if required. 
     1142 * @param tdata     Optional pointer to data to be sent. 
     1143 * @param tp        Pointer to receive the transport instance, if one is found. 
     1144 * 
     1145 * @return          PJ_SUCCESS on success, or the appropriate error code. 
     1146 */ 
     1147PJ_DECL(pj_status_t) pjsip_tpmgr_acquire_transport2(pjsip_tpmgr *mgr, 
     1148                                                    pjsip_transport_type_e type, 
     1149                                                    const pj_sockaddr_t *remote, 
     1150                                                    int addr_len, 
     1151                                                    const pjsip_tpselector *sel, 
     1152                                                    pjsip_tx_data *tdata, 
     1153                                                    pjsip_transport **tp); 
    11011154 
    11021155/** 
     
    11881241                                          pjsip_tp_send_callback cb); 
    11891242 
     1243 
     1244/** 
     1245 * Enumeration of transport state types. 
     1246 */ 
     1247typedef 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. 
     1269 */ 
     1270typedef struct pjsip_transport_state_info { 
     1271    /** 
     1272     * The last error code related to the transport state. 
     1273     */ 
     1274    pj_status_t          status; 
     1275     
     1276    /** 
     1277     * Optional extended info, the content is specific for each transport type. 
     1278     */ 
     1279    void                *ext_info; 
     1280} pjsip_transport_state_info; 
     1281 
     1282 
     1283/** 
     1284 * Type of callback to receive transport state notifications, such as 
     1285 * transport connected, disconnected or TLS verification error. 
     1286 * 
     1287 * @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. 
     1291 * @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 */ 
     1299typedef pj_bool_t (*pjsip_tp_state_callback)( 
     1300                                    pjsip_transport *tp, 
     1301                                    pj_uint32_t state, 
     1302                                    const pjsip_transport_state_info *info); 
     1303 
     1304 
     1305/** 
     1306 * Setting callback of transport state notification. The caller will be 
     1307 * notified whenever the state of transport is changed. The type of 
     1308 * events are defined in #pjsip_transport_state_type. 
     1309 *  
     1310 * @param mgr       Transport manager. 
     1311 * @param cb        Callback to be called to notify caller about transport  
     1312 *                  status changing. 
     1313 * 
     1314 * @return          PJ_SUCCESS on success, or the appropriate error code. 
     1315 */ 
     1316PJ_DECL(pj_status_t) pjsip_tpmgr_set_status_cb(pjsip_tpmgr *mgr, 
     1317                                               pjsip_tp_state_callback *cb); 
     1318 
     1319 
     1320/** 
     1321 * Getting the callback of transport state notification. 
     1322 *  
     1323 * @param mgr       Transport manager. 
     1324 * 
     1325 * @return          The transport state callback or NULL if it is not set. 
     1326 */ 
     1327PJ_DECL(pjsip_tp_state_callback*) pjsip_tpmgr_get_status_cb( 
     1328                                               const pjsip_tpmgr *mgr); 
     1329 
     1330 
    11901331/** 
    11911332 * @} 
Note: See TracChangeset for help on using the changeset viewer.