Work in progress for capwap local ip address
FossilOrigin-Name: d90a1c526fa046859bd8a0dc656c37d9afe8e2bb6e380c497a5895e9efa0b8dd
This commit is contained in:
parent
4ee4d64d76
commit
6fc631d3a4
@ -3,9 +3,9 @@
|
||||
<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_capwap" Path="mod_capwap.project" Active="Yes"/>
|
||||
<Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/>
|
||||
<Project Name="libcw" Path="libcw.project" Active="Yes"/>
|
||||
<Project Name="libcw" Path="libcw.project" Active="No"/>
|
||||
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/>
|
||||
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
|
||||
<BuildMatrix>
|
||||
|
@ -299,6 +299,7 @@
|
||||
<File Name="src/cw/ansi_colors.h"/>
|
||||
<File Name="src/cw/cw_clock_lap.c"/>
|
||||
<File Name="src/cw/cw_type_ipaddress.c"/>
|
||||
<File Name="src/cw/cw_ktv_idx_get.c"/>
|
||||
</VirtualDirectory>
|
||||
</VirtualDirectory>
|
||||
<Description/>
|
||||
|
@ -21,6 +21,7 @@
|
||||
<File Name="src/mod/capwap/capwap_in_mtu_discovery_padding.c"/>
|
||||
<File Name="src/mod/capwap/capwap_out_wtp_board_data.c"/>
|
||||
<File Name="src/mod/capwap/capwap_out_wtp_descriptor.c"/>
|
||||
<File Name="src/mod/capwap/capwap_out_capwap_control_ip_address.c"/>
|
||||
</VirtualDirectory>
|
||||
</VirtualDirectory>
|
||||
</VirtualDirectory>
|
||||
|
@ -229,15 +229,10 @@ int main (int argc, char *argv[])
|
||||
actube_global_cfg = global_cfg;
|
||||
|
||||
cw_dbg_opt_level=0xffffffff;
|
||||
cw_dbg(DBG_INFO,"Hello world\n");
|
||||
cw_dbg(DBG_INFO,"Hello world");
|
||||
|
||||
|
||||
cw_dbg_ktv_dump(global_cfg,DBG_INFO,NULL,"CFG:",NULL);
|
||||
printf("Dumped\n");
|
||||
exit(0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cw_log_name = "AC-Tube";
|
||||
|
||||
|
@ -74,7 +74,7 @@ static int read_key (FILE *f, char *key, int max_len, struct parser * p)
|
||||
|
||||
n=0;
|
||||
while(c!=EOF && n<max_len){
|
||||
if (!isalnum(c) && !strchr("_/-()@#|{}[]",c)/*strchr(": \t\n\a",c)*/){
|
||||
if (!isalnum(c) && !strchr("._/-()@#|{}[]",c)/*strchr(": \t\n\a",c)*/){
|
||||
unget_char(c,f,p);
|
||||
break;
|
||||
}
|
||||
|
@ -1,79 +0,0 @@
|
||||
|
||||
#include "log.h"
|
||||
|
||||
#include "cw.h"
|
||||
#include "aciplist.h"
|
||||
#include "sock.h"
|
||||
|
||||
|
||||
static int put_ip(uint8_t *dst /*void *priv*/, cw_acip_t * acip /*void *data*/)
|
||||
{
|
||||
// uint8_t ** dptr = (uint8_t **)priv;
|
||||
// cw_acip_t *acip=(cw_acip_t*)data;
|
||||
|
||||
// uint8_t * dst = *dptr;
|
||||
|
||||
uint8_t *d = dst+4;
|
||||
|
||||
d+=cw_put_sockaddr(d,&acip->ip);
|
||||
d+=cw_put_word(d,acip->index);
|
||||
|
||||
int fam = sock_addrfamily(&acip->ip);
|
||||
int elem_id=-1;
|
||||
switch (fam) {
|
||||
case AF_INET:
|
||||
elem_id = CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS;
|
||||
break;
|
||||
case AF_INET6:
|
||||
elem_id = CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS;
|
||||
break;
|
||||
default:
|
||||
cw_log(LOG_ERR,"Unknown adress family %d",fam);
|
||||
break;
|
||||
}
|
||||
|
||||
if (elem_id ==-1)
|
||||
return 0;
|
||||
|
||||
d+=cw_put_elem_hdr(dst,elem_id,d-dst-4);
|
||||
// return 0;
|
||||
// *dptr = d-4;
|
||||
|
||||
|
||||
return d-4-dst;
|
||||
|
||||
// return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
int cw_out_capwap_control_ip_addr_list(struct conn *conn,struct cw_action_out *a,uint8_t *dst)
|
||||
{
|
||||
struct mbag_item * item = mbag_get(conn->local,a->item_id);
|
||||
|
||||
if ( !item ) {
|
||||
cw_log(LOG_ERR, "Can't send CAPWAP Local IPv4/IPv6 Address, not found");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
cw_aciplist_t aciplist = (cw_aciplist_t) mbag_item_get_data_ptr(item);
|
||||
|
||||
|
||||
uint8_t *d = dst;
|
||||
|
||||
MAVLITER_DEFINE(i,aciplist);
|
||||
mavliter_foreach(&i){
|
||||
struct cw_acip * acip = mavliter_get(&i);
|
||||
|
||||
d+=put_ip(d,acip);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// cw_aciplist_foreach(aciplist, put_ip, &d);
|
||||
|
||||
mbag_item_release_data_ptr(item,aciplist);
|
||||
return d-dst;
|
||||
}
|
||||
|
||||
*/
|
@ -113,6 +113,9 @@ int cw_ktv_read_file(FILE * file, mavl_t ktv, mavl_t types);
|
||||
cw_KTV_t * cw_ktv_get(mavl_t ktv, const char *key, const cw_Type_t * type);
|
||||
uint8_t cw_ktv_get_byte(mavl_t ktv,const char *key, uint8_t def);
|
||||
uint16_t cw_ktv_get_word(mavl_t ktv,const char *key, uint16_t def);
|
||||
|
||||
cw_KTV_t * cw_ktv_idx_get(mavl_t ktv, const char *key, int idx, const cw_Type_t * type);
|
||||
|
||||
|
||||
extern const cw_Type_t * cw_ktv_std_types[];
|
||||
#define CW_KTV_STD_TYPES cw_ktv_std_types
|
||||
|
@ -14,7 +14,8 @@ OBJS=\
|
||||
capwap_out_ac_ip_list.o \
|
||||
capwap_in_session_id.o \
|
||||
capwap_in_vendor_specific_payload.o \
|
||||
capwap_in_mtu_discovery_padding.o
|
||||
capwap_in_mtu_discovery_padding.o \
|
||||
capwap_out_capwap_control_ip_address.o
|
||||
|
||||
|
||||
LIBDIR := ../../../lib
|
||||
|
@ -132,6 +132,29 @@ static struct cw_ElemHandler handlers[] = {
|
||||
}
|
||||
,
|
||||
|
||||
{
|
||||
"CAPWAP Control IPv4 Address", /* name */
|
||||
CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, /* Element ID */
|
||||
0,0, /* Vendor / Proto */
|
||||
0,0, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"capwap-control-ip-address", /* Key */
|
||||
NULL, /* get */
|
||||
capwap_out_capwap_control_ip_address /* put */
|
||||
},
|
||||
|
||||
{
|
||||
"CAPWAP Control IPv6 Address", /* name */
|
||||
CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, /* Element ID */
|
||||
0,0, /* Vendor / Proto */
|
||||
0,0, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"capwap-control-ip-address", /* Key */
|
||||
NULL, /* get */
|
||||
capwap_out_capwap_control_ip_address /* put */
|
||||
}
|
||||
|
||||
,
|
||||
|
||||
{0,0,0,0,0,0,0,0}
|
||||
|
||||
@ -156,8 +179,8 @@ static int discovery_response_states[] = {CAPWAP_STATE_DISCOVERY,0};
|
||||
static struct cw_ElemDef discovery_response_elements[] ={
|
||||
{0,0,CAPWAP_ELEM_AC_DESCRIPTOR, 1, 0},
|
||||
{0,0,CAPWAP_ELEM_AC_NAME, 1, 0},
|
||||
{0,0,CAPWAP_ELEM_AC_IPV4_LIST, 1, 0},
|
||||
{0,0,CAPWAP_ELEM_AC_IPV6_LIST, 1, 0},
|
||||
{0,0,CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, 1, 0},
|
||||
{0,0,CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, 1, 0},
|
||||
{0,0,CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, 0, CW_IGNORE},
|
||||
{0,0,0,0,0}
|
||||
|
||||
|
@ -20,7 +20,8 @@ int capwap_out_wtp_descriptor(struct cw_ElemHandler * eh,
|
||||
int capwap_out_ac_descriptor(struct cw_ElemHandler * eh,
|
||||
struct cw_ElemHandlerParams * params, uint8_t * dst);
|
||||
|
||||
|
||||
int capwap_out_capwap_control_ip_address(struct cw_ElemHandler * eh,
|
||||
struct cw_ElemHandlerParams * params, uint8_t * dst);
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user