Ignore:
Timestamp:
Mar 19, 2008 11:00:30 PM (16 years ago)
Author:
bennylp
Message:

Related to ticket #485: huge changeset to update STUN relating to managing authentication. See the ticket for the details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/include/pjnath/stun_session.h

    r1862 r1877  
    4646/** Forward declaration for pj_stun_tx_data */ 
    4747typedef struct pj_stun_tx_data pj_stun_tx_data; 
     48 
     49/** Forward declaration for pj_stun_rx_data */ 
     50typedef struct pj_stun_rx_data pj_stun_rx_data; 
    4851 
    4952/** Forward declaration for pj_stun_session */ 
     
    8689     * @param pkt           Pointer to the original STUN packet. 
    8790     * @param pkt_len       Length of the STUN packet. 
    88      * @param msg           The parsed STUN request. 
     91     * @param rdata         Data containing incoming request message. 
    8992     * @param src_addr      Source address of the packet. 
    9093     * @param src_addr_len  Length of the source address. 
     
    97100                                 const pj_uint8_t *pkt, 
    98101                                 unsigned pkt_len, 
    99                                  const pj_stun_msg *msg, 
     102                                 const pj_stun_rx_data *rdata, 
    100103                                 const pj_sockaddr_t *src_addr, 
    101104                                 unsigned src_addr_len); 
     
    145148 
    146149/** 
     150 * This structure describes incoming request message. 
     151 */ 
     152struct pj_stun_rx_data 
     153{ 
     154    /** 
     155     * The parsed request message. 
     156     */ 
     157    pj_stun_msg             *msg; 
     158 
     159    /** 
     160     * Credential information that is found and used to authenticate  
     161     * incoming request. Application may use this information when  
     162     * generating  authentication for the outgoing response. 
     163     */ 
     164    pj_stun_req_cred_info   info; 
     165}; 
     166 
     167 
     168/** 
    147169 * This structure describe the outgoing STUN transmit data to carry the 
    148170 * message to be sent. 
     
    162184    pj_uint8_t           msg_key[12];   /**< Message/transaction key.       */ 
    163185 
    164     pj_str_t             auth_key;      /**< Auth key.                      */ 
     186    pj_stun_req_cred_info auth_info;    /**< Credential info                */ 
    165187 
    166188    void                *pkt;           /**< The STUN packet.               */ 
     
    260282 * 
    261283 * @param sess      The STUN session instance. 
     284 * @param auth_type Type of authentication. 
    262285 * @param cred      The credential to be used by this session. If NULL 
    263286 *                  is specified, authentication will be disabled. 
     
    265288 * @return          PJ_SUCCESS on success, or the appropriate error code. 
    266289 */ 
    267 PJ_DECL(void) pj_stun_session_set_credential(pj_stun_session *sess, 
    268                                              const pj_stun_auth_cred *cred); 
     290PJ_DECL(pj_status_t) pj_stun_session_set_credential(pj_stun_session *sess, 
     291                                                pj_stun_auth_type auth_type, 
     292                                                const pj_stun_auth_cred *cred); 
    269293 
    270294/** 
     
    329353 */ 
    330354PJ_DECL(pj_status_t) pj_stun_session_create_res(pj_stun_session *sess, 
    331                                                 const pj_stun_msg *req, 
     355                                                const pj_stun_rx_data *rdata, 
    332356                                                unsigned err_code, 
    333357                                                const pj_str_t *err_msg, 
     
    363387 * 
    364388 * @param sess      The STUN session instance. 
    365  * @param req       The STUN request message to be responded. 
     389 * @param rdata     The STUN request message to be responded. 
    366390 * @param err_code  Error code to be set in the response, if error response 
    367391 *                  is to be created, according to pj_stun_status enumeration. 
     
    383407 */ 
    384408PJ_DECL(pj_status_t) pj_stun_session_respond(pj_stun_session *sess,  
    385                                              const pj_stun_msg *req, 
     409                                             const pj_stun_rx_data *rdata, 
    386410                                             unsigned code,  
    387411                                             const char *err_msg, 
Note: See TracChangeset for help on using the changeset viewer.