Ignore:
Timestamp:
Jun 6, 2008 2:50:13 PM (16 years ago)
Author:
bennylp
Message:

More ticket #485: major modification in transport_ice to support new ICE stream transport API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/transport_ice.h

    r1735 r1989  
    4949     * 
    5050     * @param tp        PJMEDIA ICE transport. 
    51      * @param status    ICE negotiation result, PJ_SUCCESS on success. 
     51     * @param op        The operation 
     52     * @param status    Operation status. 
    5253     */ 
    5354    void    (*on_ice_complete)(pjmedia_transport *tp, 
     55                               pj_ice_strans_op op, 
    5456                               pj_status_t status); 
    5557 
     
    6365 *                      for logging purposes. 
    6466 * @param comp_cnt      Number of components to be created. 
    65  * @param stun_cfg      Pointer to STUN configuration settings. 
     67 * @param cfg           Pointer to configuration settings. 
    6668 * @param cb            Optional callbacks. 
    6769 * @param p_tp          Pointer to receive the media transport instance. 
     
    7274                                        const char *name, 
    7375                                        unsigned comp_cnt, 
    74                                         pj_stun_config *stun_cfg, 
     76                                        const pj_ice_strans_cfg *cfg, 
    7577                                        const pjmedia_ice_cb *cb, 
    7678                                        pjmedia_transport **p_tp); 
    77  
    78  
    79 /** 
    80  * Start the initialization process of this media transport. This function 
    81  * will gather the transport addresses to be registered to ICE session as 
    82  * candidates. If STUN is configured, this will start the STUN Binding or 
    83  * Allocate request to get the STUN server reflexive or relayed address. 
    84  * This function will return immediately, and application should poll the 
    85  * STUN completion status by calling #pjmedia_ice_get_init_status(). 
    86  * 
    87  * @param tp            The media transport. 
    88  * @param options       Options, see pj_ice_strans_option in PJNATH  
    89  *                      documentation. 
    90  * @param start_addr    Local address where socket will be bound to. This 
    91  *                      address will be used as follows: 
    92  *                      - if the value is NULL, then socket will be bound 
    93  *                        to any available port. 
    94  *                      - if the value is not NULL, then if the port number 
    95  *                        is not zero, it will used as the starting port  
    96  *                        where the socket will be bound to. If bind() to 
    97  *                        this port fails, this function will try to bind 
    98  *                        to port+2, repeatedly until it succeeded. 
    99  *                        If application doesn't want this function to  
    100  *                        retry binding the socket to other port, it can 
    101  *                        specify PJ_ICE_ST_OPT_NO_PORT_RETRY option. 
    102  *                      - if the value is not NULL, then if the address 
    103  *                        is not INADDR_ANY, this function will bind the 
    104  *                        socket to this particular interface only, and 
    105  *                        no other host candidates will be added for this 
    106  *                        socket. 
    107  * @param stun_srv      Address of the STUN server, or NULL if STUN server 
    108  *                      reflexive mapping is not to be used. 
    109  * @param turn_srv      Address of the TURN server, or NULL if TURN relay 
    110  *                      is not to be used. 
    111  * 
    112  * @return              PJ_SUCCESS when the initialization process has started 
    113  *                      successfully, or the appropriate error code. 
    114  */ 
    115 PJ_DECL(pj_status_t) pjmedia_ice_start_init(pjmedia_transport *tp, 
    116                                             unsigned options, 
    117                                             const pj_sockaddr_in *start_addr, 
    118                                             const pj_sockaddr_in *stun_srv, 
    119                                             const pj_sockaddr_in *turn_srv); 
    120  
    121 /** 
    122  * Poll the initialization status of this media transport. 
    123  * 
    124  * @param tp            The media transport. 
    125  * 
    126  * @return              PJ_SUCCESS if all candidates have been resolved 
    127  *                      successfully, PJ_EPENDING if transport resolution 
    128  *                      is still in progress, or other status on failure. 
    129  */ 
    130 PJ_DECL(pj_status_t) pjmedia_ice_get_init_status(pjmedia_transport *tp); 
    131  
    132  
    133 /** 
    134  * Get the ICE stream transport component for the specified component ID. 
    135  * 
    136  * @param tp            The media transport. 
    137  * @param comp_id       The component ID. 
    138  * @param comp          The structure which will be filled with the 
    139  *                      component. 
    140  * 
    141  * @return              PJ_SUCCESS or the appropriate error code. 
    142  */ 
    143 PJ_DECL(pj_status_t) pjmedia_ice_get_comp(pjmedia_transport *tp, 
    144                                           unsigned comp_id, 
    145                                           pj_ice_strans_comp *comp); 
    146  
    147 /** 
    148  * Initialize the ICE session. 
    149  * 
    150  * @param tp            The media transport. 
    151  * @param role          ICE role. 
    152  * @param local_ufrag   Optional local username fragment. 
    153  * @param local_passwd  Optional local password. 
    154  * 
    155  * @return              PJ_SUCCESS, or the appropriate error code. 
    156  
    157  */ 
    158 PJ_DECL(pj_status_t) pjmedia_ice_init_ice(pjmedia_transport *tp, 
    159                                           pj_ice_sess_role role, 
    160                                           const pj_str_t *local_ufrag, 
    161                                           const pj_str_t *local_passwd); 
    162  
    16379 
    16480PJ_END_DECL 
Note: See TracChangeset for help on using the changeset viewer.