Changeset 430:f77fc3a97287 in freeDiameter
- Timestamp:
- Jul 27, 2010, 2:56:21 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_sip/diamsip.h
r427 r430 97 97 int set_real_sipserver_uri(const unsigned char *username, const size_t usernamelen, const unsigned char *sipserver_uri,const size_t sipserverurilen); 98 98 int set_sipserver_uri(const unsigned char *username, const size_t usernamelen, const unsigned char *sipserver_uri,const size_t sipserverurilen); 99 int get_sipserver_uri(const unsigned char *sip_aor, const size_t sipaorlen, unsigned char ** sipserver_uri, size_t *sipserverurilen); 100 int allow_roaming(const unsigned char *username, const size_t usernamelen, const char * network,const size_t networklen); 99 101 100 102 //count functions -
extensions/app_sip/libdiamsip.c
r427 r430 690 690 CHECK_PARAMS(username && usernamelen); 691 691 692 int not_found=2;692 693 693 size_t querylen, usernamepurelen; 694 694 char *query, *username_pure; … … 726 726 CHECK_PARAMS(username && usernamelen); 727 727 728 int not_found=2;728 729 729 size_t querylen, usernamepurelen; 730 730 char *query, *username_pure; … … 765 765 CHECK_PARAMS(username && usernamelen && sipserver_uri && sipserverurilen); 766 766 767 int not_found=2;767 768 768 size_t querylen, usernamepurelen, sipserveruripurelen; 769 769 char *query, *username_pure, *sipserveruri_pure; … … 804 804 CHECK_PARAMS(sipserver_uri && sipserverurilen); 805 805 806 int not_found=2; 806 807 807 size_t querylen, sipserveruripurelen; 808 808 char *query, *sipserveruri_pure; … … 838 838 CHECK_PARAMS(username && usernamelen && sipserver_uri && sipserverurilen); 839 839 840 int not_found=2;840 841 841 size_t querylen, usernamepurelen, sipserveruripurelen; 842 842 char *query, *username_pure, *sipserveruri_pure; … … 874 874 } 875 875 876 int get_sipserver_uri(const unsigned char *sip_aor, const size_t sipaorlen, char ** sipserver_uri, size_t *sipserverurilen)876 int get_sipserver_uri(const unsigned char *sip_aor, const size_t sipaorlen, unsigned char ** sipserver_uri, size_t *sipserverurilen) 877 877 { 878 878 CHECK_PARAMS(sip_aor && sipaorlen && sipserver_uri && sipserverurilen ); … … 927 927 { 928 928 CHECK_MALLOC(*sipserver_uri=malloc(*sipserverurilen+1)); 929 strcpy( *sipserver_uri,row[0]);929 strcpy((char *)*sipserver_uri,row[0]); 930 930 not_found=0; 931 931 break; … … 1000 1000 return counter; 1001 1001 } 1002 /* 1002 /* 1003 1003 void nonce_add_element(char * nonce) 1004 1004 { -
extensions/app_sip/locationinfo.c
r427 r430 115 115 116 116 //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; 119 119 120 120 ret=get_sipserver_uri(avphdr->avp_value->os.data, avphdr->avp_value->os.len, &sipserver_uri, &sipserverurilen); -
extensions/app_sip/locationinfosl.c
r427 r430 42 42 43 43 struct msg *ans, *qry; 44 struct avp *avp , *groupedavp;44 struct avp *avp; 45 45 struct avp_hdr *avphdr; 46 46 union avp_value value; … … 86 86 CHECK_FCT( fd_msg_search_avp ( qry, sip_dict.SIP_AOR, &avp) ); 87 87 CHECK_FCT( fd_msg_avp_hdr( avp, &avphdr ) ); 88 int diameterurilen;88 size_t diameterurilen; 89 89 char * diameter_uri=NULL; 90 90 … … 105 105 { 106 106 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; 108 108 value.os.len=diameterurilen; 109 109 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); -
extensions/app_sip/multimediaauth.c
r427 r430 50 50 int idx=0, number_of_auth_items=0,i=0, ret=0; 51 51 //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; 54 56 55 57 //The nonce we will store and retrieve in session … … 152 154 username=malloc(avphdr->avp_value->os.len*2+1); 153 155 //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); 155 157 156 158 //Now that we know the user exist, we get the list of AOR owned by this user … … 200 202 if(avphdr!=NULL) 201 203 { 202 char *sipuri=NULL;204 unsigned char *sipuri=NULL; 203 205 int sipurilen=0; 204 206 … … 206 208 CHECK_MALLOC(sipuri=malloc(avphdr->avp_value->os.len*2+1)); 207 209 //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); 209 211 210 212 -
extensions/app_sip/serverassignment.c
r427 r430 123 123 { 124 124 //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); 126 126 127 127 if(ret==0) … … 203 203 204 204 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); 206 206 table_supporteddatatype[counter][avphdr->avp_value->os.len+1]='\0'; 207 207 -
extensions/app_sip/userauthorization.c
r427 r430 108 108 109 109 //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); 111 111 112 112 if(ret==0) … … 167 167 DIAMETER_ERROR_ROAMING_NOT_ALLOWED. 168 168 */ 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); 170 170 171 171 if(ret==0) … … 216 216 217 217 //Let's look for the SIP_Server_URI' 218 char *sipserver_uri;218 unsigned char *sipserver_uri; 219 219 size_t sipserverurilen; 220 220 -
extensions/test_sip/locationinfo.c
r427 r430 46 46 47 47 //Fake values START 48 unsignedchar *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";48 char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp"; 49 49 size_t aor_len=strlen(sip_aor); 50 50 char *destination_realm="tera.ics.keio.ac.jp"; … … 112 112 113 113 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; 115 115 value.os.len=aor_len; 116 116 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); -
extensions/test_sip/locationinfosl.c
r427 r430 46 46 47 47 //Fake values START 48 unsignedchar *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";48 char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp"; 49 49 size_t aor_len=strlen(sip_aor); 50 50 char *destination_realm="tera.ics.keio.ac.jp"; … … 114 114 115 115 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; 117 117 value.os.len=aor_len; 118 118 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); -
extensions/test_sip/serverassignment.c
r427 r430 46 46 47 47 //Fake values START 48 unsignedchar *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";48 char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp"; 49 49 size_t aor_len=strlen(sip_aor); 50 unsignedchar *destination_realm="tera.ics.keio.ac.jp";50 char *destination_realm="tera.ics.keio.ac.jp"; 51 51 size_t destination_realmlen=strlen(destination_realm); 52 unsignedchar *destination_host="suika.tera.ics.keio.ac.jp";52 char *destination_host="suika.tera.ics.keio.ac.jp"; 53 53 size_t destination_hostlen=strlen(destination_host); 54 unsignedchar *username="aw-lappy";54 char *username="aw-lappy"; 55 55 size_t usernamelen=strlen(username); 56 unsignedchar *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; 59 59 int data_already_available=0; 60 60 int assignment_type=0; … … 100 100 { 101 101 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; 103 103 value.os.len=destination_hostlen; 104 104 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); … … 108 108 { 109 109 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; 111 111 value.os.len=destination_realmlen; 112 112 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); … … 118 118 119 119 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; 121 121 value.os.len=aor_len; 122 122 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); … … 128 128 129 129 CHECK_FCT( fd_msg_avp_new ( sip_dict.User_Name, 0, &avp ) ); 130 value.os.data= username;130 value.os.data=(unsigned char *)username; 131 131 value.os.len=usernamelen; 132 132 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); -
extensions/test_sip/test_sip.c
r427 r430 101 101 struct disp_when data; 102 102 103 104 //TODO: activate again configuration file 105 CHECK_FCT( ts_conf_init() ); 103 106 /* Initialize configuration 104 107 //CHECK_FCT( ts_conf_init() ); -
extensions/test_sip/userauthorization.c
r427 r430 46 46 47 47 //Fake values START 48 unsignedchar *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp";48 char *sip_aor="sip:aw-lappy@tera.ics.keio.ac.jp"; 49 49 size_t aor_len=strlen(sip_aor); 50 unsignedchar *destination_realm="tera.ics.keio.ac.jp";50 char *destination_realm="tera.ics.keio.ac.jp"; 51 51 size_t destination_realmlen=strlen(destination_realm); 52 unsignedchar *destination_host="suika.tera.ics.keio.ac.jp";52 char *destination_host="suika.tera.ics.keio.ac.jp"; 53 53 size_t destination_hostlen=strlen(destination_host); 54 unsignedchar *username="aw-lappy";54 char *username="aw-lappy"; 55 55 size_t usernamelen=strlen(username); 56 unsignedchar *visitednetwork="Pink";56 char *visitednetwork="Pink"; 57 57 size_t visitednetworklen=strlen(visitednetwork); 58 58 int registrationtype = 2; … … 99 99 { 100 100 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; 102 102 value.os.len=destination_hostlen; 103 103 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); … … 107 107 { 108 108 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; 110 110 value.os.len=destination_realmlen; 111 111 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); … … 117 117 118 118 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; 120 120 value.os.len=aor_len; 121 121 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); … … 127 127 128 128 CHECK_FCT( fd_msg_avp_new ( sip_dict.User_Name, 0, &avp ) ); 129 value.os.data= username;129 value.os.data=(unsigned char *)username; 130 130 value.os.len=usernamelen; 131 131 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) ); … … 137 137 138 138 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; 140 140 value.os.len=visitednetworklen; 141 141 CHECK_FCT( fd_msg_avp_setvalue( avp, &value ) );
Note: See TracChangeset
for help on using the changeset viewer.