cv_get_str implemented
FossilOrigin-Name: 8da939c22b7f08734f45b0abe2e5b979fc609ed51596fd6d0665e13f33f210e1
This commit is contained in:
parent
7db75cdb83
commit
22630f5d81
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CodeLite_Workspace Name="actube" Database="">
|
||||
<Project Name="ac" Path="ac.project" Active="Yes"/>
|
||||
<Project Name="ac" Path="ac.project" Active="No"/>
|
||||
<Project Name="wtp" Path="wtp.project" Active="No"/>
|
||||
<Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/>
|
||||
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
|
||||
<Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/>
|
||||
<Project Name="libcw" Path="libcw.project" Active="No"/>
|
||||
<Project Name="libcw" Path="libcw.project" Active="Yes"/>
|
||||
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/>
|
||||
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
|
||||
<BuildMatrix>
|
||||
|
@ -269,6 +269,8 @@
|
||||
<File Name="src/cw/cw_randint.c"/>
|
||||
<File Name="src/cw/cw_ktv_get_sysptr.c"/>
|
||||
<File Name="src/cw/cw_ktv_get_dword.c"/>
|
||||
<File Name="src/cw/cw_type_str.c"/>
|
||||
<File Name="src/cw/cw_ktv_get_str.c"/>
|
||||
</VirtualDirectory>
|
||||
</VirtualDirectory>
|
||||
<Description/>
|
||||
|
@ -72,6 +72,7 @@ CWSRC=\
|
||||
cw_ktv_get_word.c\
|
||||
cw_ktv_get_dword.c\
|
||||
cw_ktv_get_sysptr.c\
|
||||
cw_ktv_get_str.c\
|
||||
cw_ktv_idx_get.c\
|
||||
cw_ktv_mavlcmp.c\
|
||||
cw_ktv_mavlcmp_type_by_name.c\
|
||||
|
11
src/cw/cw_ktv_get_str.c
Normal file
11
src/cw/cw_ktv_get_str.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include "ktv.h"
|
||||
|
||||
char * cw_ktv_get_syst(mavl_t ktv,const char *key, void * def)
|
||||
{
|
||||
cw_KTV_t * k;
|
||||
k = cw_ktv_get(ktv,key,CW_TYPE_STR);
|
||||
if (k != NULL){
|
||||
return k->val.ptr;
|
||||
}
|
||||
return def;
|
||||
}
|
@ -39,19 +39,17 @@ static struct cw_KTV *get ( struct cw_KTV * data, const uint8_t * src, int len )
|
||||
s[len]=0;
|
||||
|
||||
data->type = &cw_type_str;
|
||||
data->val.str = s;
|
||||
data->val.str = (char*)s;
|
||||
return data;
|
||||
}
|
||||
|
||||
static int put ( const struct cw_KTV *data, uint8_t * dst )
|
||||
{
|
||||
return cw_put_str ( dst, data->val.str );
|
||||
return cw_put_str ( dst, (uint8_t*)data->val.str );
|
||||
}
|
||||
|
||||
static int to_str ( const struct cw_KTV *data, char *dst, int max_len )
|
||||
{
|
||||
int l;
|
||||
|
||||
strncpy(dst,data->val.str,max_len-1);
|
||||
dst[max_len]=0;
|
||||
return strlen(data->val.str)+1;
|
||||
@ -59,7 +57,7 @@ static int to_str ( const struct cw_KTV *data, char *dst, int max_len )
|
||||
|
||||
static struct cw_KTV *from_str ( struct cw_KTV * data, const char *src )
|
||||
{
|
||||
uint8_t * s;
|
||||
char * s;
|
||||
s = cw_strdup(src);
|
||||
|
||||
if ( !s )
|
||||
|
@ -95,6 +95,10 @@ acinfo.result_code=99;
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int run_join_d(struct conn * conn, struct sockaddr *sa)
|
||||
{
|
||||
char addrstr[SOCK_ADDR_BUFSIZE];
|
||||
@ -127,7 +131,7 @@ int run_join_d(struct conn * conn, struct sockaddr *sa)
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
cw_dbg(DBG_DTLS, "Establishing DTLS session with %s", sock_addr2str(sa, addrstr));
|
||||
|
||||
int dtls_conf_ok=0;
|
||||
@ -170,7 +174,7 @@ int run_join_d(struct conn * conn, struct sockaddr *sa)
|
||||
sock_addr2str(sa,addrstr));
|
||||
|
||||
|
||||
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "cw/dbg.h"
|
||||
#include "cw/log.h"
|
||||
#include "cw/msgset.h"
|
||||
#include "cw/cw.h"
|
||||
|
||||
|
||||
#include "wtp.h"
|
||||
@ -153,7 +154,7 @@ int main (int argc, char **argv)
|
||||
conn->msgset=msgset;
|
||||
conn->local_cfg = global_cfg;
|
||||
conn->remote_cfg = NULL;
|
||||
conn->receiver = CW_RECEIVER_WTP;
|
||||
conn->receiver = CW_ROLE_WTP;
|
||||
conn->wbid=1;
|
||||
|
||||
struct cw_DiscoveryResult dis;
|
||||
|
Loading…
Reference in New Issue
Block a user