Navigation


Changeset 430:f77fc3a97287 in freeDiameter


Ignore:
Timestamp:
Jul 27, 2010, 2:56:21 PM (14 years ago)
Author:
Alexandre Westfahl <awestfahl@freediameter.net>
Branch:
default
Phase:
public
Message:

Corrected compilation warnings on app_sip and test_sip

Location:
extensions
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_sip/diamsip.h

    r427 r430  
    9797int set_real_sipserver_uri(const unsigned char  *username, const size_t usernamelen, const unsigned char *sipserver_uri,const size_t sipserverurilen);
    9898int set_sipserver_uri(const unsigned char  *username, const size_t usernamelen, const unsigned char *sipserver_uri,const size_t sipserverurilen);
     99int get_sipserver_uri(const unsigned char *sip_aor, const size_t sipaorlen, unsigned char ** sipserver_uri, size_t *sipserverurilen);
     100int allow_roaming(const unsigned char  *username, const size_t usernamelen, const char * network,const size_t networklen);
    99101
    100102//count functions
  • extensions/app_sip/libdiamsip.c

    r427 r430  
    690690        CHECK_PARAMS(username && usernamelen);
    691691       
    692         int not_found=2;
     692       
    693693        size_t querylen, usernamepurelen;
    694694        char *query, *username_pure;
     
    726726        CHECK_PARAMS(username && usernamelen);
    727727       
    728         int not_found=2;
     728       
    729729        size_t querylen, usernamepurelen;
    730730        char *query, *username_pure;
     
    765765        CHECK_PARAMS(username && usernamelen && sipserver_uri && sipserverurilen);
    766766       
    767         int not_found=2;
     767       
    768768        size_t querylen, usernamepurelen, sipserveruripurelen;
    769769        char *query, *username_pure, *sipserveruri_pure;
     
    804804        CHECK_PARAMS(sipserver_uri && sipserverurilen);
    805805       
    806         int not_found=2;
     806
    807807        size_t querylen, sipserveruripurelen;
    808808        char *query, *sipserveruri_pure;
     
    838838        CHECK_PARAMS(username && usernamelen && sipserver_uri && sipserverurilen);
    839839       
    840         int not_found=2;
     840       
    841841        size_t querylen, usernamepurelen, sipserveruripurelen;
    842842        char *query, *username_pure, *sipserveruri_pure;
     
    874874}
    875875
    876 int get_sipserver_uri(const unsigned char *sip_aor, const size_t sipaorlen, char ** sipserver_uri, size_t *sipserverurilen)
     876int get_sipserver_uri(const unsigned char *sip_aor, const size_t sipaorlen, unsigned char ** sipserver_uri, size_t *sipserverurilen)
    877877{
    878878        CHECK_PARAMS(sip_aor && sipaorlen && sipserver_uri && sipserverurilen );
     
    927927                                {
    928928                                        CHECK_MALLOC(*sipserver_uri=malloc(*sipserverurilen+1));
    929                                         strcpy(*sipserver_uri,row[0]);
     929                                        strcpy((char *)*sipserver_uri,row[0]);
    930930                                        not_found=0;
    931931                                        break;
     
    10001000        return counter;
    10011001}
    1002 /*
     1002/* 
    10031003void nonce_add_element(char * nonce)
    10041004{
  • extensions/app_sip/locationinfo.c

    r427 r430  
    115115               
    116116                //If we arrive here, the user is known
    117                 int sipserverurilen;
    118                 char * sipserver_uri=NULL;
     117                size_t sipserverurilen;
     118                unsigned char * sipserver_uri=NULL;
    119119               
    120120                ret=get_sipserver_uri(avphdr->avp_value->os.data, avphdr->avp_value->os.len, &sipserver_uri, &sipserverurilen);
  • extensions/app_sip/locationinfosl.c

    r427 r430  
    4242       
    4343        struct msg *ans, *qry;
    44         struct avp *avp, *groupedavp;
     44        struct avp *avp;
    4545        struct avp_hdr *avphdr;
    4646        union avp_value value;
     
    8686                CHECK_FCT( fd_msg_search_avp ( qry, sip_dict.SIP_AOR, &avp) );
    8787                CHECK_FCT( fd_msg_avp_hdr( avp, &avphdr )  );
    88                 int diameterurilen;
     88                size_t diameterurilen;
    8989                char * diameter_uri=NULL;
    9090               
     
    105105                  {
    106106                    CHECK_FCT( fd_msg_avp_new ( sip_dict.Redirect_Host, 0, &avp ) );
    107                     value.os.data=diameter_uri;
     107                    value.os.data=(unsigned char *)diameter_uri;
    108108                    value.os.len=diameterurilen;
    109109                    CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
  • extensions/app_sip/multimediaauth.c

    r427 r430  
    5050        int idx=0, number_of_auth_items=0,i=0, ret=0;
    5151        //Flags and variables for Database
    52         int sipurinotstored=0, authenticationpending=0, querylen=0, usernamelen=0;
    53         char *query=NULL,*username=NULL;
     52        int sipurinotstored=0, authenticationpending=0;
     53        size_t querylen=0, usernamelen=0;
     54        char *query=NULL;
     55        unsigned char *username=NULL;
    5456       
    5557        //The nonce we will store and retrieve in session
     
    152154                                username=malloc(avphdr->avp_value->os.len*2+1);
    153155                                //We purify username not to have forbidden characters
    154                                 usernamelen=mysql_real_escape_string(conn, username, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
     156                                usernamelen=mysql_real_escape_string(conn, (char *)username, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
    155157                               
    156158                                //Now that we know the user exist, we get the list of AOR owned by this user
     
    200202                        if(avphdr!=NULL)
    201203                        {
    202                                 char *sipuri=NULL;
     204                                unsigned char *sipuri=NULL;
    203205                                int sipurilen=0;
    204206
     
    206208                                CHECK_MALLOC(sipuri=malloc(avphdr->avp_value->os.len*2+1));
    207209                                //We purify SIP-URI not to have forbidden characters
    208                                 sipurilen=mysql_real_escape_string(conn, sipuri, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
     210                                sipurilen=mysql_real_escape_string(conn, (char *)sipuri, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
    209211                               
    210212                               
  • extensions/app_sip/serverassignment.c

    r427 r430  
    123123                                {
    124124                                        //We must check that this user can use this SIP-AOR
    125                                         ret=check_sipaor(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, sipaorhdr->avp_value->os.data,sipaorhdr->avp_value->os.len);
     125                                        ret=check_sipaor(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len,(const char *) sipaorhdr->avp_value->os.data,sipaorhdr->avp_value->os.len);
    126126                                       
    127127                                        if(ret==0)
     
    203203                                       
    204204                                        CHECK_MALLOC(table_supporteddatatype[counter]=malloc(avphdr->avp_value->os.len+1));
    205                                         strncpy(table_supporteddatatype[counter],avphdr->avp_value->os.data,avphdr->avp_value->os.len);
     205                                        strncpy(table_supporteddatatype[counter],(const char *)avphdr->avp_value->os.data,avphdr->avp_value->os.len);
    206206                                        table_supporteddatatype[counter][avphdr->avp_value->os.len+1]='\0';
    207207                                       
  • extensions/app_sip/userauthorization.c

    r427 r430  
    108108                               
    109109                                //We must check that this user can use this SIP-AOR
    110                                 ret=check_sipaor(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, sipaorhdr->avp_value->os.data,sipaorhdr->avp_value->os.len);
     110                                ret=check_sipaor(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, (const char *)sipaorhdr->avp_value->os.data,sipaorhdr->avp_value->os.len);
    111111                               
    112112                                if(ret==0)
     
    167167                                        DIAMETER_ERROR_ROAMING_NOT_ALLOWED.
    168168                                        */
    169                                         ret=allow_roaming(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, visitednethdr->avp_value->os.data,visitednethdr->avp_value->os.len);
     169                                        ret=allow_roaming(usernamehdr->avp_value->os.data, usernamehdr->avp_value->os.len, (const char *)visitednethdr->avp_value->os.data,visitednethdr->avp_value->os.len);
    170170                                       
    171171                                        if(ret==0)
     
    216216               
    217217                //Let's look for the SIP_Server_URI'
    218                 char *sipserver_uri;
     218                unsigned char *sipserver_uri;
    219219                size_t sipserverurilen;
    220220               
  • extensions/test_sip/locationinfo.c

    r427 r430  
    4646       
    4747        //Fake values START
    48         unsigned char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
     48        char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
    4949        size_t aor_len=strlen(sip_aor);
    5050        char *destination_realm="tera.ics.keio.ac.jp";
     
    112112               
    113113                CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_AOR, 0, &avp ) );
    114                 value.os.data=sip_aor;
     114                value.os.data=(unsigned char *)sip_aor;
    115115                value.os.len=aor_len;
    116116                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
  • extensions/test_sip/locationinfosl.c

    r427 r430  
    4646       
    4747        //Fake values START
    48         unsigned char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
     48        char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
    4949        size_t aor_len=strlen(sip_aor);
    5050        char *destination_realm="tera.ics.keio.ac.jp";
     
    114114               
    115115                CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_AOR, 0, &avp ) );
    116                 value.os.data=sip_aor;
     116                value.os.data=(unsigned char *)sip_aor;
    117117                value.os.len=aor_len;
    118118                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
  • extensions/test_sip/serverassignment.c

    r427 r430  
    4646       
    4747        //Fake values START
    48         unsigned char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
     48        char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
    4949        size_t aor_len=strlen(sip_aor);
    50         unsigned char *destination_realm="tera.ics.keio.ac.jp";
     50        char *destination_realm="tera.ics.keio.ac.jp";
    5151        size_t destination_realmlen=strlen(destination_realm);
    52         unsigned char *destination_host="suika.tera.ics.keio.ac.jp";
     52        char *destination_host="suika.tera.ics.keio.ac.jp";
    5353        size_t destination_hostlen=strlen(destination_host);
    54         unsigned char *username="aw-lappy";
     54        char *username="aw-lappy";
    5555        size_t usernamelen=strlen(username);
    56         unsigned char *visitednetwork="Pink";
    57         size_t visitednetworklen=strlen(visitednetwork);
    58         int registrationtype = 2;
     56        // char *visitednetwork="Pink";
     57        //size_t visitednetworklen=strlen(visitednetwork);
     58        //int registrationtype = 2;
    5959        int data_already_available=0;
    6060        int assignment_type=0;
     
    100100        {
    101101                CHECK_FCT( fd_msg_avp_new ( sip_dict.Destination_Host, 0, &avp ) );
    102                 value.os.data=destination_host;
     102                value.os.data=(unsigned char *)destination_host;
    103103                value.os.len=destination_hostlen;
    104104                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
     
    108108        {
    109109                CHECK_FCT( fd_msg_avp_new ( sip_dict.Destination_Realm, 0, &avp ) );
    110                 value.os.data=destination_realm;
     110                value.os.data=(unsigned char *)destination_realm;
    111111                value.os.len=destination_realmlen;
    112112                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
     
    118118               
    119119                CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_AOR, 0, &avp ) );
    120                 value.os.data=sip_aor;
     120                value.os.data=(unsigned char *)sip_aor;
    121121                value.os.len=aor_len;
    122122                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
     
    128128               
    129129                CHECK_FCT( fd_msg_avp_new ( sip_dict.User_Name, 0, &avp ) );
    130                 value.os.data=username;
     130                value.os.data=(unsigned char *)username;
    131131                value.os.len=usernamelen;
    132132                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
  • extensions/test_sip/test_sip.c

    r427 r430  
    101101        struct disp_when data;
    102102       
     103       
     104        //TODO: activate again configuration file
     105        CHECK_FCT( ts_conf_init() );
    103106        /* Initialize configuration
    104107        //CHECK_FCT( ts_conf_init() );
  • extensions/test_sip/userauthorization.c

    r427 r430  
    4646       
    4747        //Fake values START
    48         unsigned char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
     48        char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";
    4949        size_t aor_len=strlen(sip_aor);
    50         unsigned char *destination_realm="tera.ics.keio.ac.jp";
     50        char *destination_realm="tera.ics.keio.ac.jp";
    5151        size_t destination_realmlen=strlen(destination_realm);
    52         unsigned char *destination_host="suika.tera.ics.keio.ac.jp";
     52        char *destination_host="suika.tera.ics.keio.ac.jp";
    5353        size_t destination_hostlen=strlen(destination_host);
    54         unsigned char *username="aw-lappy";
     54        char *username="aw-lappy";
    5555        size_t usernamelen=strlen(username);
    56         unsigned char *visitednetwork="Pink";
     56        char *visitednetwork="Pink";
    5757        size_t visitednetworklen=strlen(visitednetwork);
    5858        int registrationtype = 2;
     
    9999        {
    100100                CHECK_FCT( fd_msg_avp_new ( sip_dict.Destination_Host, 0, &avp ) );
    101                 value.os.data=destination_host;
     101                value.os.data=(unsigned char *)destination_host;
    102102                value.os.len=destination_hostlen;
    103103                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
     
    107107        {
    108108                CHECK_FCT( fd_msg_avp_new ( sip_dict.Destination_Realm, 0, &avp ) );
    109                 value.os.data=destination_realm;
     109                value.os.data=(unsigned char *)destination_realm;
    110110                value.os.len=destination_realmlen;
    111111                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
     
    117117               
    118118                CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_AOR, 0, &avp ) );
    119                 value.os.data=sip_aor;
     119                value.os.data=(unsigned char *)sip_aor;
    120120                value.os.len=aor_len;
    121121                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
     
    127127               
    128128                CHECK_FCT( fd_msg_avp_new ( sip_dict.User_Name, 0, &avp ) );
    129                 value.os.data=username;
     129                value.os.data=(unsigned char *)username;
    130130                value.os.len=usernamelen;
    131131                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
     
    137137               
    138138                CHECK_FCT( fd_msg_avp_new ( sip_dict.SIP_Visited_Network_Id, 0, &avp ) );
    139                 value.os.data=visitednetwork;
     139                value.os.data=(unsigned char *)visitednetwork;
    140140                value.os.len=visitednetworklen;
    141141                CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
Note: See TracChangeset for help on using the changeset viewer.