Changeset 879 for pjproject/trunk/pjsip/include/pjsip/sip_transport.h
- Timestamp:
- Jan 12, 2007 6:37:35 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_transport.h
r742 r879 55 55 * 56 56 *****************************************************************************/ 57 58 /* 59 * Forward declaration for transport factory (since it is referenced by 60 * the transport factory itself). 61 */ 62 typedef struct pjsip_tpfactory pjsip_tpfactory; 63 57 64 58 65 /** … … 157 164 158 165 166 167 /***************************************************************************** 168 * 169 * TRANSPORT SELECTOR. 170 * 171 *****************************************************************************/ 172 173 /** 174 * This structure describes the type of data in pjsip_tpselector. 175 */ 176 typedef enum pjsip_tpselector_type 177 { 178 /** Transport is not specified. */ 179 PJSIP_TPSELECTOR_NONE, 180 181 /** Use the specific transport to send request. */ 182 PJSIP_TPSELECTOR_TRANSPORT, 183 184 /** Use the specific listener to send request. */ 185 PJSIP_TPSELECTOR_LISTENER, 186 187 } pjsip_tpselector_type; 188 189 190 /** 191 * This structure describes the transport/listener preference to be used 192 * when sending outgoing requests. 193 * 194 * Normally transport will be selected automatically according to rules about 195 * sending requests. But some applications (such as proxies or B2BUAs) may 196 * want to explicitly use specific transport to send requests, for example 197 * when they want to make sure that outgoing request should go from a specific 198 * network interface. 199 * 200 * The pjsip_tpselector structure is used for that purpose, i.e. to allow 201 * application specificly request that a particular transport/listener 202 * should be used to send request. This structure is used when calling 203 * pjsip_tsx_set_transport() and pjsip_dlg_set_transport(). 204 */ 205 typedef struct pjsip_tpselector 206 { 207 /** The type of data in the union */ 208 pjsip_tpselector_type type; 209 210 /** Union representing the transport/listener criteria to be used. */ 211 union { 212 pjsip_transport *transport; 213 pjsip_tpfactory *listener; 214 } u; 215 216 } pjsip_tpselector; 217 218 219 /** 220 * Add transport/listener reference in the selector to prevent the specified 221 * transport/listener from being destroyed while application still has 222 * reference to it. 223 * 224 * @param sel The transport selector. 225 */ 226 PJ_DECL(void) pjsip_tpselector_add_ref(pjsip_tpselector *sel); 227 228 229 /** 230 * Decrement transport/listener reference in the selector. 231 * @param sel The transport selector 232 */ 233 PJ_DECL(void) pjsip_tpselector_dec_ref(pjsip_tpselector *sel); 234 235 159 236 /***************************************************************************** 160 237 * … … 432 509 int dst_port; /**< Destination port. */ 433 510 } tp_info; 511 512 /** 513 * Transport selector, to specify which transport to be used. 514 * The value here must be set with pjsip_tx_data_set_transport(), 515 * to allow reference counter to be set properly. 516 */ 517 pjsip_tpselector tp_sel; 518 434 519 }; 435 520 … … 499 584 */ 500 585 PJ_DECL(char*) pjsip_tx_data_get_info( pjsip_tx_data *tdata ); 586 587 /** 588 * Set the explicit transport to be used when sending this transmit data. 589 * Application should not need to call this function, but rather use 590 * pjsip_tsx_set_transport() and pjsip_dlg_set_transport() instead (which 591 * will call this function). 592 * 593 * @param tdata The transmit buffer. 594 * @param sel Transport selector. 595 * 596 * @return PJ_SUCCESS on success. 597 */ 598 PJ_DECL(pj_status_t) pjsip_tx_data_set_transport(pjsip_tx_data *tdata, 599 const pjsip_tpselector *sel); 501 600 502 601 … … 707 806 *****************************************************************************/ 708 807 709 /*710 * Forward declaration for transport factory (since it is referenced by711 * the transport factory itself).712 */713 typedef struct pjsip_tpfactory pjsip_tpfactory;714 715 808 716 809 /** … … 860 953 * Find transport to be used to send message to remote destination. If no 861 954 * suitable transport is found, a new one will be created. 955 * 956 * This is an internal function since normally application doesn't have access 957 * to transport manager. Application should use pjsip_endpt_acquire_transport() 958 * instead. 959 * 960 * @param mgr The transport manager instance. 961 * @param type The type of transport to be acquired. 962 * @param remote The remote address to send message to. 963 * @param addr_len Length of the remote address. 964 * @param sel Optional pointer to transport selector instance which is 965 * used to find explicit transport, if required. 966 * @param tp Pointer to receive the transport instance, if one is found. 967 * 968 * @return PJ_SUCCESS on success, or the appropriate error code. 862 969 */ 863 970 PJ_DECL(pj_status_t) pjsip_tpmgr_acquire_transport(pjsip_tpmgr *mgr, … … 865 972 const pj_sockaddr_t *remote, 866 973 int addr_len, 974 const pjsip_tpselector *sel, 867 975 pjsip_transport **tp); 868 976
Note: See TracChangeset
for help on using the changeset viewer.