Ignore:
Timestamp:
Mar 21, 2007 9:31:01 AM (14 years ago)
Author:
bennylp
Message:

s/stun_setting/stun_config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c

    r1080 r1091  
    166166    tu->type = type; 
    167167    tu->pf = si->pf; 
    168     tu->cfg = si->cfg; 
     168    tu->cfg = &si->stun_cfg; 
    169169    tu->ioqueue = si->ioqueue; 
    170170    tu->timer_heap = si->timer_heap; 
     
    198198    sess_cb.on_send_msg = &tu_sess_on_send_msg; 
    199199    sess_cb.on_rx_request = &tu_sess_on_rx_request; 
    200     status = pj_stun_session_create(si->cfg, "turns%p", &sess_cb, PJ_FALSE, 
    201                                     &tu->default_session); 
     200    status = pj_stun_session_create(&si->stun_cfg, "turns%p", &sess_cb,  
     201                                    PJ_FALSE, &tu->default_session); 
    202202    if (status != PJ_SUCCESS) { 
    203203        pj_stun_usage_destroy(tu->usage); 
     
    934934 
    935935    /* Process REQUESTED-IP attribute */ 
    936     if (a_rip && a_rip->addr.addr.sa_family != PJ_AF_INET) { 
     936    if (a_rip && a_rip->sockaddr.addr.sa_family != PJ_AF_INET) { 
    937937        client_respond(client, msg, PJ_STUN_SC_INVALID_IP_ADDR, NULL, 
    938938                       src_addr, src_addr_len); 
     
    940940         
    941941    } else if (a_rip) { 
    942         req_addr.sin_addr.s_addr = a_rip->addr.ipv4.sin_addr.s_addr; 
     942        req_addr.sin_addr.s_addr = a_rip->sockaddr.ipv4.sin_addr.s_addr; 
    943943    } 
    944944 
     
    11071107        client->active_peer = NULL; 
    11081108 
    1109     } else if (a_raddr->addr.addr.sa_family != PJ_AF_INET) { 
     1109    } else if (a_raddr->sockaddr.addr.sa_family != PJ_AF_INET) { 
    11101110        /* Bad request (not IPv4) */ 
    11111111        client_respond(client, msg, PJ_STUN_SC_BAD_REQUEST, NULL, 
     
    11261126 
    11271127        /* Add a new peer/permission if we don't have one for this address */ 
    1128         peer = client_get_peer(client, &a_raddr->addr.ipv4, &hval); 
     1128        peer = client_get_peer(client, &a_raddr->sockaddr.ipv4, &hval); 
    11291129        if (peer==NULL) { 
    1130             peer = client_add_peer(client, &a_raddr->addr.ipv4, hval); 
     1130            peer = client_add_peer(client, &a_raddr->sockaddr.ipv4, hval); 
    11311131        } 
    11321132 
     
    11731173        return PJ_SUCCESS; 
    11741174 
    1175     } else if (a_raddr->addr.addr.sa_family != PJ_AF_INET) { 
     1175    } else if (a_raddr->sockaddr.addr.sa_family != PJ_AF_INET) { 
    11761176        /* REMOTE-ADDRESS present but not IPv4, discard packet */ 
    11771177        return PJ_SUCCESS; 
     
    11961196 
    11971197    /* Add to peer table if necessary */ 
    1198     if (client_get_peer(client, &a_raddr->addr.ipv4, &hval)==NULL) 
    1199         client_add_peer(client, &a_raddr->addr.ipv4, hval); 
     1198    if (client_get_peer(client, &a_raddr->sockaddr.ipv4, &hval)==NULL) 
     1199        client_add_peer(client, &a_raddr->sockaddr.ipv4, hval); 
    12001200 
    12011201    /* Send the packet */ 
    12021202    pj_ioqueue_sendto(client->key, &client->pkt_write_key,  
    12031203                      data, &datalen, 0, 
    1204                       &a_raddr->addr.ipv4, sizeof(a_raddr->addr.ipv4)); 
     1204                      &a_raddr->sockaddr.ipv4, sizeof(pj_sockaddr_in)); 
    12051205 
    12061206    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.