Compare commits
14 Commits
2408635be6
...
4506690fe1
Author | SHA1 | Date | |
---|---|---|---|
4506690fe1 | |||
6893cfa4d4 | |||
247bf23d3d | |||
600b81b935 | |||
ae40395ab7 | |||
1955ee6dae | |||
5961ebffa3 | |||
b894c00a7e | |||
6ac1c87b2f | |||
dca5d0e371 | |||
13b0bf2941 | |||
91c310b963 | |||
3df3e28a2d | |||
84d953b7ed |
@ -1,4 +0,0 @@
|
||||
include ../Config.default.mak
|
||||
|
||||
WITH_GNUTLS=1
|
||||
WITH_OPENSSL=0
|
@ -1,50 +0,0 @@
|
||||
#
|
||||
# OpenSSL definitions
|
||||
# Chose either the contrib version or the system installed version
|
||||
#
|
||||
|
||||
#OPENSSL_VERSION=openssl-1.0.1i
|
||||
#OPENSSL_LIBS=../contrib/${OPENSSL_VERSION}/libssl.a ../contrib/${OPENSSL_VERSION}/libcrypto.a -ldl
|
||||
#OPENSSL_CFLAGS=../contrib/${OPENSSL_VERSION}/include/
|
||||
|
||||
|
||||
ARCH != uname -m
|
||||
|
||||
OPENSSL_LIBS=-lssl -lcrypto #-ldl
|
||||
OPENSSL_CFLAGS=
|
||||
|
||||
|
||||
|
||||
# GnuTLS definitions
|
||||
# GNUTLS_VERSION=3.3.9
|
||||
|
||||
USE_CONTRIB_GNUTLS=0
|
||||
|
||||
|
||||
COMPDEFS=-DWITH_CW_LOG
|
||||
COMPDEFS+=-DWITH_CW_LOG_DEBUG
|
||||
|
||||
#
|
||||
# LIBCW settings
|
||||
|
||||
# WITH_GNUTLS
|
||||
# compile in support for GnuTLS
|
||||
#
|
||||
WITH_GNUTLS=1
|
||||
|
||||
#
|
||||
# Compile in openssl support
|
||||
#
|
||||
WITH_OPENSSL=1
|
||||
|
||||
#
|
||||
#
|
||||
LIBDIR=lib
|
||||
|
||||
OPTFLAGS := -g -O0
|
||||
#CFLAGS := -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE=1 -pedantic -std=c99 -Wall
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
#.ifndef ARCH
|
||||
|
||||
ARCH!=uname -m
|
||||
KERNEL!=uname -s
|
||||
|
||||
|
||||
#.endif
|
||||
-include LocalDefs.mak
|
||||
|
||||
|
||||
|
@ -1,51 +0,0 @@
|
||||
ifeq (${USE_CONTRIB_OPENSSL},1)
|
||||
OPENSSL_LIBS=../contrib/${OPENSSL_VERSION}/libssl.a ../contrib/${OPENSSL_VERSION}/libcrypto.a -ldl
|
||||
OPENSSL_CFLAGS=../contrib/${OPENSSL_VERSION}/include/
|
||||
else
|
||||
OPENSSL_LDFLAGS=
|
||||
OPENSSL_CFLAGS=
|
||||
OPENSSL_LIBS=-lssl -lcrypto #-ldl
|
||||
endif
|
||||
|
||||
ifeq ($(USE_CONTRIB_GNUTLS),1)
|
||||
GNUTLS_CFLAGS=-I../contrib/gnutls-${GNUTLS_VERSION}/lib/includes
|
||||
GNUTLS_LIBS=-lgmp -lgnutls -lnettle
|
||||
GNUTLS_LDFLAGS=-L../contrib/gnutls-${GNUTLS_VERSION}/lib/.libs/
|
||||
else
|
||||
GNUTLS_CFLAGS=
|
||||
GNUTLS_LIBS=-lgnutls -lnettle -lgmp
|
||||
GNUTLS_LDFLAGS=
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CC),clang)
|
||||
LDFLAGS += -g -L/usr/local/lib
|
||||
CFLAGS += -fPIC $(OPTFLAGS) -D_REENTRANT -I /usr/local/include -I../
|
||||
LD = clang
|
||||
endif
|
||||
|
||||
ifeq ($(CC),gcc)
|
||||
LDFLAGS += -g -L/usr/local/lib
|
||||
CFLAGS += -fPIC $(OPTFLAGS) -D_REENTRANT -I /usr/local/include -I../
|
||||
LD = gcc
|
||||
endif
|
||||
|
||||
ifeq ($(CC),tcc)
|
||||
LDFLAGS += -g -L/usr/local/lib
|
||||
CFLAGS += -Wall $(OPTFLAGS) -Wunusupported -Wimplicit-function-declaration -I /usr/local/include -I../
|
||||
LD = tcc
|
||||
endif
|
||||
|
||||
ifeq ($(CC),cc)
|
||||
LDFLAGS += -g -L/usr/local/lib
|
||||
CFLAGS += -fPIC $(OPTFLAGS) -D_REENTRANT -I /usr/local/include -I../
|
||||
LD = cc
|
||||
endif
|
||||
|
||||
|
||||
|
||||
CFLAGS += -DWITH_IPV6 -DWITH_RMAC_SUPPORT
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
include ../Config.default.mak
|
||||
#include ../Config.default.mak
|
||||
-include ../Config.mak
|
||||
include ../Defs.mak
|
||||
|
||||
OBJS = \
|
||||
wtplist.o wtpman.o conf.o ac_main.o \
|
||||
@ -12,21 +13,22 @@ OBJS = \
|
||||
shell.o\
|
||||
|
||||
PRG=actube
|
||||
LIBPATH=-L../../lib/$(ARCH)/ -L/usr/local/lib -L/usr/lib
|
||||
|
||||
LIBPATH=-L../../lib/Linux/$(ARCH)/ -L/usr/local/lib -L/usr/lib
|
||||
|
||||
LIBS+=-lmavl
|
||||
LIBS+=-lcw
|
||||
LIBS+=-lrt
|
||||
LIBS+=-lpthread
|
||||
LIBS+=-lconfuse
|
||||
LIBS+=-lsqlite3
|
||||
LIBS+=-lc
|
||||
LIBS+=-lnettle
|
||||
LIBS+=$(OPENSSL_LIBS)
|
||||
|
||||
|
||||
INCL_DIRS=-I../ -I/usr/local/include -I./
|
||||
INCL_DIRS=-I../ -I/usr/local/include -I./ -I/home/tube/v/rsrch/libmavl/
|
||||
#FLAGS=-DWITH_IPV6 -DWITH_OPENSSL -DSYS_ARCH="$(ARCH)" -DSYS_ARCH="XXX"
|
||||
FLAGS=-DWITH_IPV6 -DWITH_OPENSSL -DSYS_ARCH='"$(ARCH)"'
|
||||
FLAGS=-DWITH_IPV6 -DUSE_OPENSSL -DSYS_ARCH='"$(ARCH)"'
|
||||
|
||||
.c.o:
|
||||
@echo " $(CC) "$<
|
||||
|
@ -184,7 +184,7 @@ ssl_key="../../ssl/certs/ac-cisco.key"
|
||||
# SSL certificate that will be sent to the client
|
||||
#
|
||||
# Default:
|
||||
ssl_cert="../../ssl/certs/ac-cisco.pem"
|
||||
ssl_cert="../../ssl/certs/ac-xcisco.pem"
|
||||
|
||||
|
||||
# dtls_verify_peer
|
||||
@ -242,4 +242,4 @@ ssl_cert="../../ssl/certs/ac-cisco.pem"
|
||||
mods = { cisco, capwap, capwap80211 }
|
||||
#, capwap80211 }
|
||||
|
||||
mods_dir = ../../lib
|
||||
mods_dir = ../../lib/Linux/x86_64/
|
||||
|
@ -1,7 +1,8 @@
|
||||
#ifndef __ACTUBE_AC_H
|
||||
#define __ACTUBE_AC_H
|
||||
|
||||
#include "cw/mavl.h"
|
||||
#include "mavl.h"
|
||||
#include "cw/mavltypes.h"
|
||||
|
||||
extern mavl_t actube_global_cfg;
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "wtpman.h"
|
||||
#include "discovery_cache.h"
|
||||
|
||||
#include "cw/mavltypes.h"
|
||||
mavl_t actube_global_cfg;
|
||||
|
||||
|
||||
|
@ -157,6 +157,7 @@ int mycmp (void *e1, void *e2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
void mavl_walk (struct mavlnode * node)
|
||||
{
|
||||
struct mykv * kv;
|
||||
@ -175,6 +176,7 @@ void mavl_walk (struct mavlnode * node)
|
||||
mavl_walk (node->right);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
int stcmp (const void * sa1, const void *sa2)
|
||||
@ -246,7 +248,7 @@ int main (int argc, char *argv[])
|
||||
/* create types tree with default types */
|
||||
types_tree = cw_ktv_create_types_tree();
|
||||
for (ti=CW_KTV_STD_TYPES;*ti;ti++){
|
||||
mavl_add_ptr(types_tree,*ti);
|
||||
mavl_insert_ptr(types_tree,*ti);
|
||||
}
|
||||
|
||||
global_cfg = cw_ktv_create();
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include "conf.h"
|
||||
#include "ac.h"
|
||||
|
||||
#include "cw/mavltypes.h"
|
||||
|
||||
uint8_t conf_macaddress[12];
|
||||
uint8_t conf_macaddress_len = 0;
|
||||
|
||||
@ -393,7 +395,8 @@ int init_bcast_addrs()
|
||||
if (!conf_ipv4)
|
||||
return 1;
|
||||
|
||||
t = mavl_create_str();
|
||||
/*t = mavl_create_ptr(); */
|
||||
t = mavl_create_ptr(mavl_cmpstr,mavl_freeptr);
|
||||
if (t==NULL)
|
||||
return 0;
|
||||
|
||||
|
@ -29,7 +29,7 @@ ac-descriptor/software/vendor :Dword: 4232704
|
||||
ac-descriptor/software/version :Bstr16: .x07036500
|
||||
ac-descriptor/station-limit :Word: 1000
|
||||
ac-descriptor/stations :Word: 0
|
||||
capwap-control-ip-address/address.0 :IPAddress: 192.168.0.29
|
||||
capwap-control-ip-address/address.0 :IPAddress: 192.168.0.14
|
||||
#capwap-control-ip-address/address.0 :IPAddress: 192.168.42.51
|
||||
capwap-control-ip-address/wtps.0 :Word: 2
|
||||
cisco/mwar-type :Byte: 0
|
||||
@ -37,24 +37,28 @@ maximum-message-length :Word: 4096
|
||||
radio/0/wtp-radio-information :Dword: 7
|
||||
result-code :Dword: 0
|
||||
|
||||
cisco/ap-telnet-ssh/ssh :Bool: true
|
||||
cisco/ap-telnet-ssh/telnet :Bool: true
|
||||
|
||||
|
||||
ac-name:Bstr16:"X1"
|
||||
|
||||
#capwap-control-ip-address/address.0:IPAddress:1192.168.0.14
|
||||
capwap-control-ip-address/address.0:IPAddress:192.168.0.29
|
||||
capwap-control-ip-address/address.0:IPAddress:192.168.0.14
|
||||
#capwap-control-ip-address/address.0:IPAddress:192.168.0.131
|
||||
#capwap-control-ip-address/address.1:IPAddress:2a00:c1a0:48c6:4a00:9965:1b6e:aca3:1398
|
||||
capwap-control-ip-address/wtps.0:Word:0
|
||||
#capwap-control-ip-address/wtps.1:Word:11
|
||||
|
||||
#cisco/ssl-keyfile:Str:"../../ssl/certs/ac.key"
|
||||
#cisco/ssl-certfile:Str:"../../ssl/certs/ac.crt"
|
||||
|
||||
#cisco/ssl-keyfile:Str:"../../ssl/certs/ac-cisco.key"
|
||||
#cisco/ssl-certfile:Str:"../../ssl/certs/ac-cisco.pem"
|
||||
#cisco/ssl-keyfile:Str:"../../ssl/certs/int-ca.key"
|
||||
#cisco/ssl-certfile:Str:"../../ssl/certs/int-ca.crt"
|
||||
cisco/ssl-keyfile:Str:"../../ssl/intermediate-ca/int-ca.key"
|
||||
cisco/ssl-certfile:Str:"../../ssl/intermediate-ca/int-ca.crt"
|
||||
#cisco/ssl-keyfile:Str:"../../ssl/intermediate-ca/cisco-ac-int-ca.key"
|
||||
#cisco/ssl-certfile:Str:"../../ssl/intermediate-ca/cisco-ac-int-ca.crt"
|
||||
cisco/ssl-cipher:Str:DEFAULT:!ECDH
|
||||
#cisco/ssl-cipher:Str:+DHE-RSA:+AES-256-CBC:+AES-128-CBC:+SHA1
|
||||
cisco/ssl-dhbits:Word:2048
|
||||
@ -107,7 +111,7 @@ radio.1/cisco/multi-domain-capability/max-tx-power-level :Word: 20
|
||||
radio.1/cisco/multi-domain-capability/number-of-channels :Word: 4
|
||||
radio.1/cisco/multi-domain-capability/reserved :Byte: 1
|
||||
radio.1/cisco/wtp-radio-config/beacon-period :Word: 100
|
||||
radio.1/cisco/wtp-radio-config/bss-id :Bstr16: .x04fe7f499b90
|
||||
radio.1/cisco/wtp-radio-config/bss-id :Bstr16: .x05fe7f499b90
|
||||
radio.1/cisco/wtp-radio-config/cfg-period :Byte: 4
|
||||
radio.1/cisco/wtp-radio-config/cfg-type :Byte: 1
|
||||
radio.1/cisco/wtp-radio-config/cfp-maximum-duration :Word: 60
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "cw/mavl.h"
|
||||
#include "mavl.h"
|
||||
#include "cw/sock.h"
|
||||
#include "cw/timer.h"
|
||||
#include "cw/cw.h"
|
||||
@ -86,7 +86,7 @@ struct dataman *dataman_list_add(struct dataman *dm)
|
||||
{
|
||||
|
||||
cw_dbg(DBG_X,"Adding dataman %p\n",dm);
|
||||
return mavl_add(dataman_list, dm,NULL);
|
||||
return mavl_insert(dataman_list, dm,NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef CW_MAVL_H
|
||||
#define CW_MAVL_H
|
||||
|
||||
#include "cw/mavl.h"
|
||||
#include "mavl.h"
|
||||
|
||||
extern void db_ping();
|
||||
extern void db_ping_wtp(const char *wtpid,const char *acid);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "cw/sock.h"
|
||||
#include "cw/mlist.h"
|
||||
#include "cw/mavl.h"
|
||||
#include "mavl.h"
|
||||
#include "cw/mod.h"
|
||||
|
||||
#include "discovery_cache.h"
|
||||
@ -125,8 +125,8 @@ void discovery_cache_add(struct cw_DiscoveryCache *cache,
|
||||
cache->ctrhi++;
|
||||
}
|
||||
|
||||
mavl_add_ptr(cache->byaddr,cur);
|
||||
mavl_add_ptr(cache->byaddrp,cur);
|
||||
mavl_insert_ptr(cache->byaddr,cur);
|
||||
mavl_insert_ptr(cache->byaddrp,cur);
|
||||
|
||||
cache->qpos++;
|
||||
if (cache->qpos>=cache->len)
|
||||
|
@ -148,6 +148,7 @@ static int wtpman_dtls_setup(void *arg)
|
||||
cw_dbg(DBG_DTLS, "DTLS session established with %s, %s",
|
||||
sock_addr2str_p(&wtpman->conn->addr,sock_buf), dtls_get_cipher(wtpman->conn,cipherstr));
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
10
src/contrib/install_libmavl.sh
Executable file
10
src/contrib/install_libmavl.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
VERSION="1.1.0a"
|
||||
|
||||
wget -O libmavl-${VERSION}.tgz ftp://ftp.planix.org/pub/planix/libmavl-${VERSION}.tgz
|
||||
tar xzvf libmavl-${VERSION}.tgz
|
||||
cd libmavl-${VERSION}
|
||||
cp ../libmavl-LocalDefs.mak .
|
||||
make install
|
||||
|
19
src/contrib/install_openssl111.sh
Normal file
19
src/contrib/install_openssl111.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
VERSION="1.1.1f"
|
||||
#VERSION="1.0.1l"
|
||||
#VERSION="1.0.2"
|
||||
|
||||
if [ ! -e openssl-${VERSION}.tar.gz ]
|
||||
then
|
||||
wget https://www.openssl.org/source/openssl-${VERSION}.tar.gz
|
||||
fi
|
||||
|
||||
tar xzvf openssl-${VERSION}.tar.gz
|
||||
#patch -p0 -i openssl-${VERSION}_cisco.patch
|
||||
cd openssl-${VERSION}
|
||||
./config
|
||||
make -j16
|
||||
|
||||
|
6
src/contrib/libmavl-LocalDefs.mak
Normal file
6
src/contrib/libmavl-LocalDefs.mak
Normal file
@ -0,0 +1,6 @@
|
||||
include ../../Defs.mak
|
||||
|
||||
PREFIX=../../..
|
||||
INSTALL_LIB_DIR := /lib/$(KERNEL)/$(ARCH)
|
||||
INSTALL_INCLUDE_DIR := /include
|
||||
|
@ -1,8 +1,9 @@
|
||||
include ../Defs.mak
|
||||
|
||||
MFDEPS=../Defs.mak ../LocalDefs.mak
|
||||
|
||||
|
||||
CWSRC=\
|
||||
cw_write_header.c\
|
||||
cw_check_missing_mand.c\
|
||||
cw_clock_lap.c\
|
||||
cw_dbg_elem.c\
|
||||
@ -63,6 +64,7 @@ CWSRC=\
|
||||
cw_strlist_get_id.c\
|
||||
cw_strlist_get_str.c\
|
||||
cw_type_bstr16.c\
|
||||
cw_type_bwstr.c\
|
||||
cw_type_byte.c\
|
||||
cw_type_bool.c\
|
||||
cw_type_str.c\
|
||||
@ -166,7 +168,6 @@ MISCSRC=\
|
||||
bstr_create.c\
|
||||
bstr_create_from_str.c\
|
||||
bstr_replace.c\
|
||||
bstrv_create.c\
|
||||
capwap_inline.c\
|
||||
capwap_strings_board.c\
|
||||
capwap_strings_elem80211.c\
|
||||
@ -182,6 +183,7 @@ MISCSRC=\
|
||||
connlist.c\
|
||||
conn_prepare_image_data_request.c\
|
||||
conn_process_packet.c\
|
||||
cw_decode_msg.c \
|
||||
conn_q_add_packet.c\
|
||||
conn_q_get_packet.c\
|
||||
conn_q_wait_packet.c\
|
||||
@ -218,10 +220,10 @@ MAVLSRC=\
|
||||
mavl_get_ptr.c\
|
||||
mavl_insert_ptr.c\
|
||||
mavl_replace.c\
|
||||
mavl_merge.c\
|
||||
mavliter_get_ptr.c\
|
||||
mavl_cmpstr.c\
|
||||
|
||||
mavl_freeptr.c \
|
||||
mavl_merge.c\
|
||||
|
||||
|
||||
DTLSSRC += dtls_openssl.c \
|
||||
@ -255,7 +257,7 @@ SNAME := $(LIBARCHDIR)/libcw.a
|
||||
DNAME := $(LIBARCHDIR)/libcw.so
|
||||
|
||||
CFLAGS+=-fPIC -DUSE_OPENSSL -I../contrib/openssl-1.1.1f/include/ -O0
|
||||
CFLAGS+=-g -I/home/tube/v/rsrch/libmavl
|
||||
CFLAGS+=-g
|
||||
|
||||
all: $(SNAME) $(DNAME)
|
||||
static: $(SNAME)
|
||||
|
@ -203,7 +203,7 @@ struct conn {
|
||||
int dtls_verify_peer;
|
||||
int dtls_mtu;
|
||||
|
||||
uint8_t dtls_buffer[2048];
|
||||
uint8_t dtls_buffer[4096];
|
||||
int dtls_buffer_len;
|
||||
int dtls_buffer_pos;
|
||||
|
||||
|
@ -90,7 +90,7 @@ struct conn * conn_create(int sock, struct sockaddr * addr, int qsize)
|
||||
/* conn->send_data_packet = conn_send_data_packet;*/
|
||||
|
||||
conn->last_seqnum_received=-1;
|
||||
conn->mtu=1500;
|
||||
conn->mtu=500;
|
||||
|
||||
|
||||
conn->cur_packet=0;
|
||||
@ -102,7 +102,7 @@ struct conn * conn_create(int sock, struct sockaddr * addr, int qsize)
|
||||
|
||||
/* conn->write_data = conn->send_data_packet; */
|
||||
|
||||
conn->dtls_mtu = 1500;
|
||||
conn->dtls_mtu = 500;
|
||||
|
||||
return conn;
|
||||
}
|
||||
|
@ -67,7 +67,8 @@ struct conn * conn_create_noq(int sock, struct sockaddr * addr)
|
||||
|
||||
/* misc settings */
|
||||
conn->last_seqnum_received=-1;
|
||||
conn->mtu=1500;
|
||||
conn->mtu=480;
|
||||
conn->dtls_mtu=500;
|
||||
|
||||
|
||||
conn->cur_packet=0;
|
||||
|
@ -333,7 +333,7 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
||||
ui = message->states;
|
||||
|
||||
for (ui=message->states; ui->state; ui++){
|
||||
printf("Comparing %d and %d\n", conn->capwap_state, ui->state);
|
||||
/* printf("Comparing %d and %d\n", conn->capwap_state, ui->state);*/
|
||||
if(ui->state==conn->capwap_state){
|
||||
break;
|
||||
}
|
||||
@ -398,7 +398,14 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
||||
|
||||
|
||||
|
||||
params.conn=conn;
|
||||
/* params.conn=conn;*/
|
||||
|
||||
params.local_cfg=conn->local_cfg;
|
||||
params.remote_cfg=conn->remote_cfg;
|
||||
params.default_cfg=conn->default_cfg;
|
||||
params.global_cfg=conn->global_cfg;
|
||||
params.msgset=conn->msgset;
|
||||
|
||||
params.from=from;
|
||||
params.msgdata=message;
|
||||
params.mand_found=mand_found;
|
||||
|
@ -30,7 +30,7 @@ int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
|
||||
hlen = cw_get_hdr_hlen(rawmsg)*4;
|
||||
|
||||
mtu = conn->mtu;
|
||||
mtu = 440;
|
||||
mtu = 9440;
|
||||
mtu = mtu >> 3;
|
||||
mtu = mtu << 3;
|
||||
|
||||
|
@ -547,6 +547,8 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout);
|
||||
char *cw_strdup(const char *s);
|
||||
int cw_stricmp(char const *a, char const *b);
|
||||
|
||||
int cw_write_header(struct cw_ElemHandler * handler, uint8_t * dst, int len);
|
||||
int cw_header_len(struct cw_ElemHandler * handler);
|
||||
|
||||
/**
|
||||
*@}
|
||||
|
124
src/cw/cw_decode_msg.c
Normal file
124
src/cw/cw_decode_msg.c
Normal file
@ -0,0 +1,124 @@
|
||||
#include "cw.h"
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
#include "msgset.h"
|
||||
|
||||
int cw_decode_element(struct cw_ElemHandlerParams *params, int proto,
|
||||
int vendor, int elem_id, uint8_t * data, int len)
|
||||
{
|
||||
|
||||
struct cw_ElemHandler *handler;
|
||||
struct cw_ElemData *elem_data, elem_data_search;
|
||||
int rc;
|
||||
|
||||
params->elem = NULL;
|
||||
|
||||
/* try to retrieve a handler for this message element */
|
||||
handler =
|
||||
cw_msgset_get_elemhandler(params->msgset, proto, vendor,
|
||||
elem_id);
|
||||
if (!handler) {
|
||||
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"Unrecognized message element: %d, ignoring", elem_id);
|
||||
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
|
||||
}
|
||||
|
||||
/* check if this message element in the current message allowed */
|
||||
elem_data_search.id = elem_id;
|
||||
elem_data_search.proto = proto;
|
||||
elem_data_search.vendor = vendor;
|
||||
elem_data = mavl_get(params->msgdata->elements_tree, &elem_data_search);
|
||||
if (!elem_data) {
|
||||
cw_dbg(DBG_ELEM_ERR, "Element %d - %s, not allowed here",
|
||||
elem_id, handler->name);
|
||||
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
|
||||
}
|
||||
|
||||
/* check the length of the message */
|
||||
if (len < handler->min_len) {
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"%d (%s) message element too short, len=%d, min len=%d",
|
||||
handler->id, handler->name, len, handler->min_len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (elem_data->mand) {
|
||||
mavl_add_str(params->mand_found, handler->key);
|
||||
}
|
||||
|
||||
|
||||
if (len > handler->max_len && handler->max_len) {
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"%d (%s) message element too big, len=%d, max len=%d",
|
||||
handler->id, handler->name, len, handler->max_len);
|
||||
/* TODO XXX truncate the element instead of return */
|
||||
return -1;
|
||||
}
|
||||
|
||||
cw_dbg_elem(DBG_ELEM_IN, NULL, params->msgdata->type, handler,
|
||||
data, len);
|
||||
|
||||
if (handler->get == NULL) {
|
||||
cw_log(LOG_ERR, "No get method defined for %d %s", handler->id,
|
||||
handler->name);
|
||||
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
|
||||
}
|
||||
rc = handler->get(handler, params, data, len);
|
||||
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
int cw_decode_elements(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, int elems_len)
|
||||
{
|
||||
uint8_t *elem;
|
||||
mavl_t mand_found;
|
||||
mlist_t unrecognized;
|
||||
|
||||
mand_found = mavl_create_conststr();
|
||||
unrecognized = mlist_create(NULL,NULL,sizeof(uint8_t*));
|
||||
|
||||
cw_foreach_elem(elem, elems_ptr, elems_len) {
|
||||
int rc;
|
||||
|
||||
int elem_len, elem_id, max_len;
|
||||
uint8_t * elem_data;
|
||||
|
||||
|
||||
elem_len = cw_get_elem_len(elem);
|
||||
elem_data=cw_get_elem_data(elem);
|
||||
elem_id = cw_get_elem_id(elem);
|
||||
|
||||
max_len=elems_len-(elem_data-elems_ptr);
|
||||
if (elem_len > max_len){
|
||||
cw_dbg(DBG_RFC,
|
||||
"Messag element claims size of %d bytes, but only %d bytes are left in the payload, truncating.",
|
||||
elem_len,max_len-4);
|
||||
}
|
||||
|
||||
|
||||
|
||||
params->from=NULL; /*from;*/
|
||||
params->mand_found=mand_found;
|
||||
|
||||
rc = cw_decode_element(params,0,0,elem_id,elem_data,elem_len);
|
||||
|
||||
|
||||
if (cw_result_is_ok(rc))
|
||||
continue;
|
||||
|
||||
if (rc == CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT){
|
||||
mlist_append(unrecognized,&elem);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rc < 0 ){
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -13,11 +13,9 @@ int cw_in_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams *
|
||||
cw_log(LOG_ERR,"Can't handle element: %s, no type defined",handler->name);
|
||||
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
|
||||
}
|
||||
|
||||
result = cw_ktv_add(params->conn->remote_cfg, handler->key,
|
||||
|
||||
result = cw_ktv_add(params->remote_cfg, handler->key,
|
||||
handler->type,NULL, elem_data,elem_len);
|
||||
|
||||
params->elem=result;
|
||||
|
||||
return CAPWAP_RESULT_SUCCESS;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ int cw_in_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandlerP
|
||||
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
|
||||
}
|
||||
|
||||
cw_ktv_read_struct(params->conn->remote_cfg,handler->type,key,elem_data,elem_len);
|
||||
cw_ktv_read_struct(params->remote_cfg,handler->type,key,elem_data,elem_len);
|
||||
|
||||
return CAPWAP_RESULT_SUCCESS;
|
||||
}
|
||||
|
@ -9,6 +9,6 @@ int cw_in_generic_with_index(struct cw_ElemHandler *eh,
|
||||
|
||||
idx = cw_get_byte(data);
|
||||
sprintf(key,"%s.%d",eh->key,idx);
|
||||
cw_ktv_add(params->conn->remote_cfg,key,eh->type,NULL,data+1,len-1);
|
||||
cw_ktv_add(params->remote_cfg,key,eh->type,NULL,data+1,len-1);
|
||||
return 1;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ int cw_in_idx_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerPara
|
||||
idx=cw_get_byte(elem_data);
|
||||
sprintf(key,handler->key,idx);
|
||||
|
||||
result = cw_ktv_add(params->conn->remote_cfg, key,
|
||||
result = cw_ktv_add(params->remote_cfg, key,
|
||||
handler->type, NULL, elem_data+1,elem_len-1);
|
||||
|
||||
params->elem=result;
|
||||
|
@ -19,7 +19,7 @@ int cw_in_idx_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHand
|
||||
idx = cw_get_byte(elem_data);
|
||||
sprintf(key, handler->key, idx);
|
||||
|
||||
cw_ktv_read_struct(params->conn->remote_cfg,handler->type,key,elem_data+1,elem_len-1);
|
||||
cw_ktv_read_struct(params->remote_cfg,handler->type,key,elem_data+1,elem_len-1);
|
||||
|
||||
return CAPWAP_RESULT_SUCCESS;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ int cw_in_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHa
|
||||
radio = cw_get_byte(elem_data);
|
||||
sprintf(key,"radio.%d/%s",radio,handler->key);
|
||||
|
||||
cw_ktv_read_struct(params->conn->remote_cfg,handler->type,key,elem_data+1,elem_len-1);
|
||||
cw_ktv_read_struct(params->remote_cfg,handler->type,key,elem_data+1,elem_len-1);
|
||||
|
||||
/*params->elem=result;*/
|
||||
|
||||
|
@ -10,7 +10,6 @@ cw_KTV_t * cw_ktv_add(mavl_t kvtstore, const char *key, const struct cw_Type *ty
|
||||
{
|
||||
cw_KTV_t mdata, *mresult;
|
||||
int exists;
|
||||
printf("KTV ADD: %s\n",key);
|
||||
|
||||
mdata.key=cw_strdup(key);
|
||||
mdata.valguard=valguard;
|
||||
@ -30,8 +29,6 @@ printf("KTV ADD: %s\n",key);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
printf("MAVLCOUNT: %d - %s\n",kvtstore->count, mdata.key);
|
||||
|
||||
mavl_del(kvtstore,&mdata);
|
||||
mresult = mavl_insert(kvtstore, &mdata, &exists);
|
||||
if (exists){
|
||||
|
@ -19,7 +19,7 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
|
||||
/* search.key=(char*)handler->key;
|
||||
elem = mavl_get(params->conn->local_cfg, &search);
|
||||
*/
|
||||
elem = cw_ktv_get(params->conn->local_cfg,handler->key,NULL);
|
||||
elem = cw_ktv_get(params->local_cfg,handler->key,NULL);
|
||||
|
||||
/* if (elem == NULL && params->conn->default_cfg !=NULL)
|
||||
elem = mavl_get(params->conn->default_cfg, &search);
|
||||
@ -49,7 +49,7 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
|
||||
/* Size for msg elem header depends on
|
||||
vendor specific payload */
|
||||
/* start = handler->vendor ? 10 : 4; */
|
||||
start = params->conn->header_len(handler);
|
||||
start = cw_header_len(handler);
|
||||
|
||||
if (cw_ktv_cast(elem,handler->type)==NULL){
|
||||
cw_log(LOG_ERR,"Can't put element '%s'- can't cast from %s to %s for key: %s", handler->name,
|
||||
@ -67,9 +67,11 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
|
||||
return len + cw_put_elem_vendor_hdr(dst, handler->vendor, handler->id, len);
|
||||
|
||||
l = len + cw_put_elem_hdr(dst, handler->id, len); */
|
||||
l = params->conn->write_header(handler,dst,len);
|
||||
l = cw_write_header(handler,dst,len);
|
||||
|
||||
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,handler,dst,l);
|
||||
/* cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l);*/
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
|
@ -22,10 +22,10 @@ int cw_out_generic_indexed_enum(struct cw_ElemHandler * handler, struct cw_ElemH
|
||||
|
||||
for(i=0; e[i].name!=NULL; i++) {
|
||||
sprintf(key,"%s/%s",handler->key,e[i].name);
|
||||
result = cw_ktv_base_exists(params->conn->local_cfg,key);
|
||||
result = cw_ktv_base_exists(params->local_cfg,key);
|
||||
if (result==NULL)
|
||||
continue;
|
||||
start = params->conn->header_len(handler);
|
||||
start = cw_header_len(handler);
|
||||
len = 0;
|
||||
if (ie->idxpos==0)
|
||||
len = 1;
|
||||
@ -33,7 +33,7 @@ int cw_out_generic_indexed_enum(struct cw_ElemHandler * handler, struct cw_ElemH
|
||||
if (e[i].fun_out==NULL)
|
||||
len += result->type->put(result,ob+start+len);
|
||||
else
|
||||
len += cw_ktv_write_struct(params->conn->local_cfg,
|
||||
len += cw_ktv_write_struct(params->local_cfg,
|
||||
NULL,e[i].type,key,ob+start+len);
|
||||
|
||||
/* thandler.type=e[i].type;
|
||||
@ -44,7 +44,7 @@ int cw_out_generic_indexed_enum(struct cw_ElemHandler * handler, struct cw_ElemH
|
||||
if (ie->idxpos==len)
|
||||
len++;
|
||||
|
||||
ob += params->conn->write_header(handler,ob,len);
|
||||
ob += cw_write_header(handler,ob,len);
|
||||
|
||||
|
||||
|
||||
@ -52,4 +52,4 @@ int cw_out_generic_indexed_enum(struct cw_ElemHandler * handler, struct cw_ElemH
|
||||
|
||||
return ob-dst;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ int cw_out_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandler
|
||||
}
|
||||
|
||||
search.key = (char*)handler->key;
|
||||
result = mavl_get_first(params->conn->local_cfg,&search);
|
||||
result = mavl_get_first(params->local_cfg,&search);
|
||||
if (result == NULL ){
|
||||
if (params->elemdata->mand)
|
||||
cw_log(LOG_ERR,"Can't put mandatory message element %s, no data available",handler->name);
|
||||
@ -30,12 +30,12 @@ int cw_out_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandler
|
||||
return 0;
|
||||
}
|
||||
|
||||
start = params->conn->header_len(handler);
|
||||
start = cw_header_len(handler);
|
||||
|
||||
len = cw_ktv_write_struct(params->conn->local_cfg,
|
||||
params->conn->default_cfg,
|
||||
len = cw_ktv_write_struct(params->local_cfg,
|
||||
params->default_cfg,
|
||||
handler->type,handler->key,dst+start);
|
||||
|
||||
return params->conn->write_header(handler,dst,len);
|
||||
return cw_write_header(handler,dst,len);
|
||||
|
||||
}
|
||||
|
@ -18,18 +18,18 @@ int cw_out_generic_with_index(struct cw_ElemHandler * eh,
|
||||
do {
|
||||
sprintf(key,"%s.%d",eh->key,idx);
|
||||
search.key=key;
|
||||
result = mavl_get_first(params->conn->local_cfg,&search);
|
||||
result = mavl_get_first(params->local_cfg,&search);
|
||||
if (result==NULL)
|
||||
break;
|
||||
if (strncmp(result->key,key,strlen(key))!=0)
|
||||
break;
|
||||
|
||||
start = params->conn->header_len(eh);
|
||||
start = cw_header_len(eh);
|
||||
len = cw_put_byte(ob+start,idx);
|
||||
|
||||
len += result->type->put(result,ob+start+len);
|
||||
|
||||
ob += params->conn->write_header(eh,ob,len);
|
||||
ob += cw_write_header(eh,ob,len);
|
||||
|
||||
idx++;
|
||||
|
||||
|
@ -24,7 +24,7 @@ int cw_out_idx_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHan
|
||||
sprintf(key,handler->key,i);
|
||||
search.key=key;
|
||||
/*elem = mavl_get(params->conn->local_cfg, &search);*/
|
||||
elem = mavl_get_first(params->conn->local_cfg,&search);
|
||||
elem = mavl_get_first(params->local_cfg,&search);
|
||||
if(elem != NULL){
|
||||
printf("Elem key: %s\n",elem->key);
|
||||
}
|
||||
@ -40,12 +40,12 @@ int cw_out_idx_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHan
|
||||
printf("Here we are '%s'! --> %d\n",key,idx);
|
||||
|
||||
len =0;
|
||||
start = mdst + params->conn->header_len(handler);
|
||||
start = mdst + cw_header_len(handler);
|
||||
|
||||
len += cw_put_byte(start+len,idx);
|
||||
len += cw_ktv_write_struct(params->conn->local_cfg,NULL, handler->type,key,start+len);
|
||||
len += cw_ktv_write_struct(params->local_cfg,NULL, handler->type,key,start+len);
|
||||
|
||||
mdst += params->conn->write_header(handler,mdst,len);
|
||||
mdst += cw_write_header(handler,mdst,len);
|
||||
|
||||
|
||||
i=idx+1;
|
||||
|
@ -20,11 +20,11 @@ int cw_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerP
|
||||
idx++;
|
||||
}
|
||||
*/
|
||||
radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);
|
||||
radios = cw_ktv_get_byte(params->local_cfg,"wtp-descriptor/max-radios",0);
|
||||
|
||||
for(i=0;i<radios;i++){
|
||||
l = cw_write_radio_element(handler,params,i,dst+len);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,handler,dst,l);
|
||||
len+=l;
|
||||
}
|
||||
return len;
|
||||
|
@ -14,19 +14,19 @@ int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemH
|
||||
cdst = dst;
|
||||
|
||||
|
||||
offset = params->conn->header_len(handler);
|
||||
offset = cw_header_len(handler);
|
||||
|
||||
i=-1;
|
||||
while(1){
|
||||
char basekey[CW_KTV_MAX_KEY_LEN];
|
||||
cw_KTV_t * result;
|
||||
|
||||
i = cw_ktv_idx_get_next(params->conn->local_cfg,"radio",i+1);
|
||||
i = cw_ktv_idx_get_next(params->local_cfg,"radio",i+1);
|
||||
if (i==-1)
|
||||
break;
|
||||
sprintf(basekey,"radio.%d/%s",i,handler->key);
|
||||
|
||||
result = cw_ktv_base_exists(params->conn->local_cfg,basekey);
|
||||
result = cw_ktv_base_exists(params->local_cfg,basekey);
|
||||
if (result == NULL){
|
||||
continue;
|
||||
}
|
||||
@ -34,10 +34,10 @@ int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemH
|
||||
|
||||
l=0;
|
||||
l+=cw_put_byte(cdst+offset+l,i);
|
||||
l+= cw_ktv_write_struct(params->conn->local_cfg,NULL, handler->type,basekey,cdst+offset+l);
|
||||
l+= cw_ktv_write_struct(params->local_cfg,NULL, handler->type,basekey,cdst+offset+l);
|
||||
|
||||
|
||||
cdst+=params->conn->write_header(handler,cdst,l);
|
||||
cdst+=cw_write_header(handler,cdst,l);
|
||||
}
|
||||
return cdst-dst;
|
||||
}
|
||||
@ -57,21 +57,21 @@ int cw_out_traverse0(struct cw_ElemHandler * handler, struct cw_ElemHandlerParam
|
||||
if (sl==NULL){
|
||||
cw_KTV_t * result;
|
||||
sprintf(key,"%s/%s",current,next);
|
||||
result = cw_ktv_base_exists(params->conn->local_cfg,key);
|
||||
result = cw_ktv_base_exists(params->local_cfg,key);
|
||||
if (result != NULL){
|
||||
int offset;
|
||||
int i,l;
|
||||
offset = params->conn->header_len(handler);
|
||||
offset = cw_header_len(handler);
|
||||
printf("Yea! We can do it: %s\n",result->key);
|
||||
for (i=0;i<stack[0];i++){
|
||||
printf("I=%i\n",stack[i+1]);
|
||||
}
|
||||
l= cw_ktv_write_struct(params->conn->local_cfg,params->conn->default_cfg,
|
||||
l= cw_ktv_write_struct(params->local_cfg,params->default_cfg,
|
||||
handler->type,key,dst+offset);
|
||||
|
||||
printf("Write struct len %i\n",l);
|
||||
|
||||
l=params->conn->write_header(handler,dst,l);
|
||||
l=cw_write_header(handler,dst,l);
|
||||
printf("header wr len %d\n",l);
|
||||
if (handler->patch){
|
||||
handler->patch(dst+offset,stack);
|
||||
@ -91,18 +91,18 @@ int cw_out_traverse0(struct cw_ElemHandler * handler, struct cw_ElemHandlerParam
|
||||
|
||||
|
||||
printf("Here we are %s\n",key);
|
||||
cw_dbg_ktv_dump(params->conn->local_cfg,DBG_INFO,"start"," ", "end" );
|
||||
cw_dbg_ktv_dump(params->local_cfg,DBG_INFO,"start"," ", "end" );
|
||||
i=-1;
|
||||
while(1){
|
||||
char basekey[CW_KTV_MAX_KEY_LEN];
|
||||
cw_KTV_t * result;
|
||||
|
||||
i = cw_ktv_idx_get_next(params->conn->local_cfg,key,i+1);
|
||||
i = cw_ktv_idx_get_next(params->local_cfg,key,i+1);
|
||||
if (i==-1)
|
||||
break;
|
||||
sprintf(basekey,"%s.%d",key,i);
|
||||
printf("Our basekey is %s\n",basekey);
|
||||
result = cw_ktv_base_exists(params->conn->local_cfg,basekey);
|
||||
result = cw_ktv_base_exists(params->local_cfg,basekey);
|
||||
if (result == NULL){
|
||||
continue;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ int cw_process_element(struct cw_ElemHandlerParams *params, int proto, int vendo
|
||||
params->elem=NULL;
|
||||
|
||||
/* try to retrieve a handler for this message element */
|
||||
handler = cw_msgset_get_elemhandler(params->conn->msgset,proto, vendor, elem_id);
|
||||
handler = cw_msgset_get_elemhandler(params->msgset,proto, vendor, elem_id);
|
||||
if (!handler) {
|
||||
|
||||
cw_dbg(DBG_ELEM_ERR, "Unrecognized message element: %d, ignoring",
|
||||
@ -65,13 +65,17 @@ int cw_process_element(struct cw_ElemHandlerParams *params, int proto, int vendo
|
||||
return -1;
|
||||
}
|
||||
|
||||
cw_dbg_elem(DBG_ELEM_IN, params->conn, params->msgdata->type, handler,
|
||||
/*cw_dbg_elem(DBG_ELEM_IN, params->conn, params->msgdata->type, handler,
|
||||
data,len);*/
|
||||
cw_dbg_elem(DBG_ELEM_IN, NULL, params->msgdata->type, handler,
|
||||
data,len);
|
||||
|
||||
if (handler->get == NULL){
|
||||
cw_log(LOG_ERR,"No get method defined for %d %s",handler->id,handler->name);
|
||||
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
|
||||
}
|
||||
|
||||
|
||||
rc = handler->get(handler, params, data, len);
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "log.h"
|
||||
#include "dbg.h"
|
||||
#include "msgset.h"
|
||||
|
||||
#include "mavltypes.h"
|
||||
|
||||
/**
|
||||
* Put a message to a buffer
|
||||
@ -65,7 +65,7 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
||||
msg->preprocess(conn);
|
||||
}
|
||||
|
||||
cw_dbg(DBG_MSG_ASSEMBLY,"*** Assenmbling message of type %d (%s) ***",
|
||||
cw_dbg(DBG_MSG_ASSEMBLY,"*** Assembling message of type %d (%s) ***",
|
||||
msg->type, msg->name);
|
||||
|
||||
dst = msgptr+8;
|
||||
@ -77,7 +77,7 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
||||
|
||||
data = mlistelem_dataptr(elem);
|
||||
handler = cw_msgset_get_elemhandler(conn->msgset,data->proto,data->vendor,data->id);
|
||||
/* printf("Elem: %d %d %d %s\n", data->proto, data->vendor, data->id, handler->name);*/
|
||||
printf("Elem: %d %d %d %s\n", data->proto, data->vendor, data->id, handler->name);
|
||||
if (handler==NULL){
|
||||
cw_log(LOG_ERR,"Can't put message element %d %d %d, no handler defined.",
|
||||
data->proto,data->vendor,data->id);
|
||||
@ -94,7 +94,15 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
||||
continue;
|
||||
}
|
||||
|
||||
params.conn=conn;
|
||||
/* params.conn=conn;*/
|
||||
params.local_cfg=conn->local_cfg;
|
||||
params.remote_cfg=conn->remote_cfg;
|
||||
params.default_cfg=conn->default_cfg;
|
||||
params.global_cfg=conn->global_cfg;
|
||||
params.msgset=conn->msgset;
|
||||
|
||||
|
||||
|
||||
params.elemdata = data;
|
||||
params.elem=NULL;
|
||||
params.msgdata=msg;
|
||||
@ -107,10 +115,10 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
||||
}
|
||||
|
||||
l = handler->put(handler,¶ms,dst+len);
|
||||
|
||||
|
||||
/* if(l>0)
|
||||
cw_dbg_elem(DBG_ELEM_OUT,conn,type,handler,dst+len,l);
|
||||
if (strlen(details)){
|
||||
* if (strlen(details)){
|
||||
cw_dbg(DBG_ELEM_DETAIL," %s",params.debug_details);
|
||||
}
|
||||
*/ len += l;
|
||||
@ -125,6 +133,30 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
||||
cw_set_msg_seqnum(msgptr,s);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
printf ("----------------------------------- redecode -----------------------------\n");
|
||||
uint8_t *elems_ptr;
|
||||
|
||||
int offset = cw_get_hdr_msg_offset(rawout);
|
||||
|
||||
uint8_t *msg_ptr = rawout + offset;
|
||||
int elems_len = cw_get_msg_elems_len(msg_ptr);
|
||||
elems_ptr = cw_get_msg_elems_ptr(msg_ptr);
|
||||
mavl_t * cfg = cw_ktv_create();
|
||||
|
||||
struct cw_ElemHandlerParams params;
|
||||
|
||||
params.remote_cfg=cfg;
|
||||
params.msgset=conn->msgset;
|
||||
params.msgdata=msg;
|
||||
|
||||
|
||||
cw_decode_elements( ¶ms, elems_ptr,elems_len);
|
||||
|
||||
|
||||
}
|
||||
|
||||
return CAPWAP_RESULT_SUCCESS;
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ int cw_read_ac_descriptor(mavl_t store,
|
||||
struct cw_DescriptorSubelemDef *allowed)
|
||||
{
|
||||
|
||||
cw_ktv_read_struct(params->conn->remote_cfg,acstatus,eh->key,data,len);
|
||||
cw_ktv_read_struct(params->remote_cfg,acstatus,eh->key,data,len);
|
||||
|
||||
if (!allowed)
|
||||
allowed=allowed_default;
|
||||
|
@ -21,7 +21,7 @@ int cw_in_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerPa
|
||||
radio=cw_get_byte(elem_data);
|
||||
sprintf(key,"radio.%d/%s",radio,handler->key);
|
||||
|
||||
result = cw_ktv_add(params->conn->remote_cfg, key,
|
||||
result = cw_ktv_add(params->remote_cfg, key,
|
||||
handler->type, NULL, elem_data+1,elem_len-1);
|
||||
|
||||
params->elem=result;
|
||||
|
@ -29,7 +29,7 @@ int cw_read_wtp_descriptor(mavl_t cfg, struct conn *conn,
|
||||
/* Get number of encryption elements */
|
||||
ncrypt = cw_get_byte(data + 2);
|
||||
if (ncrypt == 0) {
|
||||
if (conn->strict_capwap) {
|
||||
if (0 /*conn->strict_capwap*/) {
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"Bad WTP Descriptor, number of encryption elements is 0.");
|
||||
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
|
||||
|
140
src/cw/cw_type_bwstr.c
Normal file
140
src/cw/cw_type_bwstr.c
Normal file
@ -0,0 +1,140 @@
|
||||
/*
|
||||
This file is part of libcapwap.
|
||||
|
||||
libcapwap is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
libcapwap is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "format.h"
|
||||
#include "cw.h"
|
||||
#include "ktv.h"
|
||||
|
||||
|
||||
/*typedef uint16_t* bwstr_type;*/
|
||||
|
||||
|
||||
static uint16_t * bwstr_create(const uint8_t *data, uint16_t len)
|
||||
{
|
||||
uint16_t * str = malloc(2+len*sizeof(uint16_t));
|
||||
if (!str)
|
||||
return 0;
|
||||
*((uint16_t*)str)=len;
|
||||
memcpy(str+2,data,len*2);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void del ( struct cw_KTV * data )
|
||||
{
|
||||
free ( data->val.ptr );
|
||||
}
|
||||
|
||||
static struct cw_KTV *get ( struct cw_KTV * data, const uint8_t * src, int len )
|
||||
{
|
||||
uint16_t * s;
|
||||
s = bwstr_create ( src, len );
|
||||
|
||||
if ( !s )
|
||||
return NULL;
|
||||
|
||||
data->type = &cw_type_bwstr;
|
||||
data->val.ptr = s;
|
||||
return data;
|
||||
}
|
||||
|
||||
static int put ( const struct cw_KTV *data, uint8_t * dst )
|
||||
{
|
||||
uint16_t len;
|
||||
len = bstr16_len(data->val.ptr);
|
||||
|
||||
return lw_put_data ( dst, data->val.ptr+2,len*2 );
|
||||
}
|
||||
|
||||
static int to_str ( const struct cw_KTV *data, char *dst, int max_len )
|
||||
{
|
||||
char *d;
|
||||
uint16_t *s;
|
||||
const char * komma="";
|
||||
uint16_t i;
|
||||
|
||||
s = (uint16_t*)data->val.ptr;
|
||||
d = dst;
|
||||
|
||||
for (i=0;i<s[0];i++){
|
||||
d += sprintf( d, "%s%d",komma,s[i+1]);
|
||||
komma=",";
|
||||
}
|
||||
|
||||
return d - dst;
|
||||
}
|
||||
|
||||
static struct cw_KTV *from_str ( struct cw_KTV * data, const char *src )
|
||||
{
|
||||
uint8_t * s;
|
||||
s = bstr16_create_from_str(src);
|
||||
|
||||
if ( !s )
|
||||
return NULL;
|
||||
|
||||
data->type = &cw_type_bstr16;
|
||||
data->val.ptr = s;
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
static int len (cw_KTV_t * data ){
|
||||
return bstr16_len(data->val.ptr);
|
||||
}
|
||||
|
||||
static void * data(cw_KTV_t * data)
|
||||
{
|
||||
return bstr16_data(data->val.ptr);
|
||||
}
|
||||
|
||||
static const char * get_type_name(cw_KTV_t *data)
|
||||
{
|
||||
return CW_TYPE_BSTR16->name;
|
||||
}
|
||||
|
||||
static int cast(cw_KTV_t * data)
|
||||
{
|
||||
if (strcmp(data->type->name,CW_TYPE_BSTR16->name)==0)
|
||||
return 1;
|
||||
if (strcmp(data->type->name,CW_TYPE_STR->name)==0){
|
||||
char *src = data->val.ptr;
|
||||
CW_TYPE_BSTR16->from_str(data,src);
|
||||
free(src);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const struct cw_Type cw_type_bwstr = {
|
||||
"Bwstr", /* name */
|
||||
del, /* del */
|
||||
put, /* put */
|
||||
get, /* get */
|
||||
to_str, /* to_str */
|
||||
from_str, /* from_str */
|
||||
len, /* len */
|
||||
data, /* data */
|
||||
get_type_name, /* get_type_name */
|
||||
cast /* cast */
|
||||
};
|
||||
|
||||
|
123
src/cw/cw_type_bwstr.h
Normal file
123
src/cw/cw_type_bwstr.h
Normal file
@ -0,0 +1,123 @@
|
||||
/*
|
||||
This file is part of libcapwap.
|
||||
|
||||
libcapwap is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
libcapwap is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "format.h"
|
||||
#include "cw.h"
|
||||
#include "ktv.h"
|
||||
|
||||
|
||||
static void del ( struct cw_KTV * data )
|
||||
{
|
||||
free ( data->val.ptr );
|
||||
}
|
||||
|
||||
static struct cw_KTV *get ( struct cw_KTV * data, const uint8_t * src, int len )
|
||||
{
|
||||
uint8_t * s;
|
||||
s = bstr16_create ( src, len );
|
||||
|
||||
if ( !s )
|
||||
return NULL;
|
||||
|
||||
data->type = &cw_type_bstr16;
|
||||
data->val.ptr = s;
|
||||
return data;
|
||||
}
|
||||
|
||||
static int put ( const struct cw_KTV *data, uint8_t * dst )
|
||||
{
|
||||
return cw_put_bstr16 ( dst, data->val.ptr );
|
||||
}
|
||||
|
||||
static int to_str ( const struct cw_KTV *data, char *dst, int max_len )
|
||||
{
|
||||
char *d;
|
||||
d = dst;
|
||||
|
||||
if ( format_is_utf8 ( bstr16_data ( data->val.ptr ), bstr16_len ( data->val.ptr ) ) ) {
|
||||
d += sprintf ( d, "%.*s", bstr16_len ( data->val.ptr ),
|
||||
bstr16_data ( data->val.ptr ) );
|
||||
|
||||
} else {
|
||||
d += sprintf ( d, ".x" );
|
||||
d += format_hex ( d, bstr16_data ( data->val.ptr ), bstr16_len ( data->val.ptr ) );
|
||||
}
|
||||
|
||||
return d - dst;
|
||||
}
|
||||
|
||||
static struct cw_KTV *from_str ( struct cw_KTV * data, const char *src )
|
||||
{
|
||||
uint8_t * s;
|
||||
s = bstr16_create_from_str(src);
|
||||
|
||||
if ( !s )
|
||||
return NULL;
|
||||
|
||||
data->type = &cw_type_bstr16;
|
||||
data->val.ptr = s;
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
static int len (cw_KTV_t * data ){
|
||||
return bstr16_len(data->val.ptr);
|
||||
}
|
||||
|
||||
static void * data(cw_KTV_t * data)
|
||||
{
|
||||
return bstr16_data(data->val.ptr);
|
||||
}
|
||||
|
||||
static const char * get_type_name(cw_KTV_t *data)
|
||||
{
|
||||
return CW_TYPE_BSTR16->name;
|
||||
}
|
||||
|
||||
static int cast(cw_KTV_t * data)
|
||||
{
|
||||
return 0;
|
||||
|
||||
if (strcmp(data->type->name,CW_TYPE_BSTR16->name)==0)
|
||||
return 1;
|
||||
if (strcmp(data->type->name,CW_TYPE_STR->name)==0){
|
||||
char *src = data->val.ptr;
|
||||
CW_TYPE_BSTR16->from_str(data,src);
|
||||
free(src);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const struct cw_Type cw_type_bwstr = {
|
||||
"BWstr", /* name */
|
||||
del, /* del */
|
||||
put, /* put */
|
||||
get, /* get */
|
||||
to_str, /* to_str */
|
||||
from_str, /* from_str */
|
||||
len, /* len */
|
||||
data, /* data */
|
||||
get_type_name, /* get_type_name */
|
||||
cast /* cast */
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
#include "conn.h"
|
||||
#include "msgset.h"
|
||||
#include "cw.h"
|
||||
|
||||
@ -10,3 +10,9 @@ int cw_write_header(struct cw_ElemHandler * handler, uint8_t * dst, int len)
|
||||
return len + cw_put_elem_hdr(dst, handler->id, len);
|
||||
}
|
||||
|
||||
int cw_header_len(struct cw_ElemHandler * handler)
|
||||
{
|
||||
return handler->vendor ? 10 : 4;
|
||||
}
|
||||
|
||||
|
||||
|
@ -10,15 +10,15 @@ int cw_write_radio_element(struct cw_ElemHandler * handler, struct cw_ElemHandle
|
||||
uint8_t * d;
|
||||
|
||||
len =0;
|
||||
|
||||
sprintf(key,"radio.%d/%s",idx,handler->key);
|
||||
|
||||
/*printf("Looking for key: %s\n",key);*/
|
||||
printf("Looking for readio key: %s\n",key);
|
||||
|
||||
search.key=key;
|
||||
elem = mavl_get(params->conn->local_cfg, &search);
|
||||
elem = mavl_get(params->local_cfg, &search);
|
||||
|
||||
if (elem==NULL){
|
||||
printf("Nothing found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -27,14 +27,17 @@ int cw_write_radio_element(struct cw_ElemHandler * handler, struct cw_ElemHandle
|
||||
d = handler->vendor ? dst+10 : dst+4;
|
||||
|
||||
/* put radio id */
|
||||
|
||||
printf("Putting put byte index: %d\n",idx);
|
||||
|
||||
len += cw_put_byte(d+len,idx);
|
||||
|
||||
len += ((const cw_Type_t*)(handler->type))->put(elem,d+len);
|
||||
/* l = len + cw_put_elem_hdr(dst, handler->id, len);*/
|
||||
|
||||
/* if (handler->vendor)
|
||||
if (handler->vendor)
|
||||
return len + cw_put_elem_vendor_hdr(dst, handler->vendor, handler->id, len);
|
||||
*/
|
||||
|
||||
return len + cw_put_elem_hdr(dst, handler->id, len);
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ int dtls_bio_read(struct conn *conn, char *out, int maxlen)
|
||||
{
|
||||
int ret;
|
||||
if (conn->dtls_buffer_len == 0) {
|
||||
int len = conn->recv_packet(conn, conn->dtls_buffer, 2048);
|
||||
int len = conn->recv_packet(conn, conn->dtls_buffer, 4096);
|
||||
if (len < 4)
|
||||
return 0;
|
||||
conn->dtls_buffer_len = len - 4;
|
||||
@ -77,7 +77,7 @@ int dtls_bio_read(struct conn *conn, char *out, int maxlen)
|
||||
*/
|
||||
int dtls_bio_write(struct conn *conn, const char *data, int len)
|
||||
{
|
||||
uint8_t buffer[2048];
|
||||
uint8_t buffer[4096];
|
||||
int rc;
|
||||
*((uint32_t *) buffer) = htonl(1 << 24);
|
||||
memcpy(buffer + 4, data, len);
|
||||
|
@ -38,7 +38,7 @@ struct dtls_openssl_data{
|
||||
SSL_CTX * ctx;
|
||||
SSL * ssl;
|
||||
BIO * bio;
|
||||
uint8_t buffer[2048];
|
||||
uint8_t buffer[4096];
|
||||
int len;
|
||||
int pos;
|
||||
};
|
||||
|
@ -147,6 +147,7 @@ extern const struct cw_Type cw_type_byte;
|
||||
extern const struct cw_Type cw_type_word;
|
||||
extern const struct cw_Type cw_type_dword;
|
||||
extern const struct cw_Type cw_type_bstr16;
|
||||
extern const struct cw_Type cw_type_bwstr;
|
||||
extern const struct cw_Type cw_type_str;
|
||||
extern const struct cw_Type cw_type_ipaddress;
|
||||
extern const struct cw_Type cw_type_sysptr;
|
||||
@ -156,6 +157,7 @@ extern const struct cw_Type cw_type_bool;
|
||||
#define CW_TYPE_WORD (&cw_type_word)
|
||||
#define CW_TYPE_DWORD (&cw_type_dword)
|
||||
#define CW_TYPE_BSTR16 (&cw_type_bstr16)
|
||||
#define CW_TYPE_BWSTR (&cw_type_bwstr)
|
||||
#define CW_TYPE_IPADDRESS (&cw_type_ipaddress)
|
||||
#define CW_TYPE_SYSPTR (&cw_type_sysptr)
|
||||
#define CW_TYPE_STR (&cw_type_str)
|
||||
|
5
src/cw/mavl_freeptr.c
Normal file
5
src/cw/mavl_freeptr.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include "mavl.h"
|
||||
|
||||
void mavl_freeptr(void *ptr){
|
||||
free( *((void**)ptr) );
|
||||
}
|
10
src/cw/mavl_insert_ptr.c
Normal file
10
src/cw/mavl_insert_ptr.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include "mavl.h"
|
||||
#include "mavltypes.h"
|
||||
|
||||
void *mavl_insert_ptr(mavl_t tree, const void *ptr){
|
||||
void * result;
|
||||
result = mavl_insert(tree,&ptr,NULL);
|
||||
if (result)
|
||||
return *(void**)result;
|
||||
return NULL;
|
||||
}
|
34
src/cw/mavltypes.h
Normal file
34
src/cw/mavltypes.h
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
/**
|
||||
* MAVL AVL Tree type
|
||||
*/
|
||||
typedef struct mavl * mavl_t;
|
||||
typedef struct mavliter mavliter_t;
|
||||
|
||||
void * mavl_get_ptr ( mavl_t tree, void * search );
|
||||
|
||||
|
||||
/**
|
||||
* Create a mavl_t object which stores pointers.
|
||||
* @param cmp a pointer to the compare function
|
||||
* @param del a pointer to a delete function
|
||||
* @return The mavl_t object or NULL if an error has occured.
|
||||
*/
|
||||
#define mavl_create_ptr(cmp,del)\
|
||||
mavl_create(cmp,del,sizeof(void*))
|
||||
|
||||
int mavl_cmpstr (const void *s1, const void *s2);
|
||||
#define mavl_create_conststr() mavl_create_ptr(mavl_cmpstr,NULL)
|
||||
|
||||
#define mavl_add_str(tree,str) mavl_insert_ptr(tree,str)
|
||||
#define mavl_get_str(tree,search) ((char *)(mavl_get_ptr(tree,search)))
|
||||
void * mavl_insert_ptr ( mavl_t tree, const void *ptr );
|
||||
void *mavl_replace(struct mavl *t,const void *data, int * replaced);
|
||||
|
||||
void * mavl_get_ptr(mavl_t tree, void * search);
|
||||
void * mavliter_get_ptr(mavliter_t *i);
|
||||
void mavl_merge(mavl_t target, mavl_t source);
|
||||
|
||||
void mavl_freeptr(void *ptr);
|
||||
#define mavliter_get_str(iter) ((char*)(mavliter_get_ptr(iter)));
|
||||
#define mavl_get_str(tree,search) ((char *)(mavl_get_ptr(tree,search)))
|
@ -295,8 +295,6 @@ int cw_msgset_add(struct cw_MsgSet *set,
|
||||
/* add the message */
|
||||
search.type = msgdef->type;
|
||||
|
||||
printf("Msg type name %s\n",msgdef->name);
|
||||
|
||||
msg = mavl_insert(set->msgdata, &search, &exists);
|
||||
if (msg == NULL) {
|
||||
cw_log(LOG_ERR, "Can't create messae");
|
||||
|
@ -31,13 +31,18 @@ struct cw_ElemData{
|
||||
};
|
||||
|
||||
struct cw_ElemHandlerParams {
|
||||
struct conn * conn;
|
||||
struct cw_MsgData * msgdata;
|
||||
/* struct conn * conn;*/
|
||||
struct cw_MsgData * msgdata;
|
||||
struct cw_ElemData * elemdata;
|
||||
struct sockaddr *from;
|
||||
mavl_t mand_found;
|
||||
cw_KTV_t * elem;
|
||||
char * debug_details;
|
||||
mavl_t remote_cfg;
|
||||
mavl_t local_cfg;
|
||||
mavl_t default_cfg;
|
||||
mavl_t global_cfg;
|
||||
struct cw_MsgSet * msgset;
|
||||
};
|
||||
|
||||
|
||||
|
@ -201,7 +201,7 @@ int netconn_send_capwap_msg(struct netconn * nc, uint8_t *rawmsg, int msglen)
|
||||
|
||||
/* int mtu = nc->mtu; */
|
||||
|
||||
int mtu = 1400;
|
||||
int mtu = 400;
|
||||
|
||||
while (msglen>mtu){
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,1);
|
||||
|
@ -91,7 +91,7 @@ int conn_send_data_msg(struct conn * conn, uint8_t *rawmsg,int len)
|
||||
}
|
||||
|
||||
|
||||
#define MAX_MTU 1500
|
||||
#define MAX_MTU 9500
|
||||
int
|
||||
cw_send_msg( struct conn * conn, uint8_t *msg)
|
||||
{
|
||||
@ -155,7 +155,7 @@ cw_send_msg( struct conn * conn, uint8_t *msg)
|
||||
cw_set_dword(buf+4, conn->fragid<<16 | fragoffset<<3 );
|
||||
|
||||
|
||||
cw_dbg_pkt(DBG_PKT_OUT,conn,buf,packetlen,(struct sockaddr*)&conn->addr);
|
||||
cw_dbg_pkt(DBG_PKT_OUT,conn,buf,msglen+hlen,(struct sockaddr*)&conn->addr);
|
||||
|
||||
return conn->write(conn,buf,msglen + hlen);
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
MF=Mf-$(KERNEL)-$(ARCH).mk
|
||||
|
||||
LIBTARGET=$(OBJDIR)/$(PROG)
|
||||
@ -14,7 +15,7 @@ $(DNAME): $(MF) $(SOURCES)
|
||||
@mkdir -p $(LIBARCHDIR)
|
||||
@$(MAKE) -f $(MF) $(DNAME)
|
||||
|
||||
$(MF): Makefile
|
||||
$(MF): Makefile $(MFDEPS)
|
||||
@rm -f $(MF)
|
||||
@echo "CFLAGS=$(CFLAGS)" >> $(MF)
|
||||
@echo "LDFLAGS=$(LDFLAGS)" >> $(MF)
|
||||
|
@ -1,9 +1,8 @@
|
||||
include ../Config.mak
|
||||
all:
|
||||
$(MAKE) -C capwap
|
||||
$(MAKE) -C capwap80211
|
||||
$(MAKE) -C cisco
|
||||
$(MAKE) -C fortinet
|
||||
# $(MAKE) -C fortinet
|
||||
# $(CC) -c modload_ac.c -I../
|
||||
# $(CC) -c modload_wtp.c -I../
|
||||
|
||||
@ -11,5 +10,5 @@ clean:
|
||||
$(MAKE) -C capwap clean
|
||||
$(MAKE) -C capwap80211 clean
|
||||
$(MAKE) -C cisco clean
|
||||
$(MAKE) -C fortinet clean
|
||||
rm *.o
|
||||
# $(MAKE) -C fortinet clean
|
||||
rm -f *.o
|
||||
|
@ -1,54 +0,0 @@
|
||||
include ../../Config.mak
|
||||
-include ../../Config.local.mak
|
||||
include ../../Macros.mak
|
||||
|
||||
OBJS:=$(patsubst %.o,$(OBJDIR)/%.o,$(OBJS))
|
||||
|
||||
|
||||
#CFLAGS = -fPIC -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 $(COMPDEFS) -DWITH_RMAC_SUPPORT
|
||||
|
||||
CFLAGS+= -I ../../ -I../ -I../../include
|
||||
|
||||
ifeq ($(SSL_LIBRARY),GNUTLS)
|
||||
CFLAGS+=-DWITH_GNUTLS
|
||||
endif
|
||||
|
||||
ifeq ($(SSL_LIBRARY),OPENSSL)
|
||||
CFLAGS+=-DWITH_OPENSSL
|
||||
endif
|
||||
|
||||
|
||||
|
||||
SRCS = $(OBJS:.o=.c)
|
||||
|
||||
all: $(SNAME) $(DNAME) $(MODNAME)
|
||||
|
||||
$(OBJDIR)/%.o:%.c
|
||||
@mkdir -p $(OBJDIR)
|
||||
@echo " $(CC) "$<
|
||||
@$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
$(SNAME) : $(OBJS) $(MODOBJS)
|
||||
@mkdir -p $(LIBARCHDIR)
|
||||
@echo " $(AR) $(SNAME)"
|
||||
@$(AR) rcs $(SNAME) $(OBJS) $(MODOBJS)
|
||||
|
||||
$(DNAME) : $(OBJS) $(MODOBJS)
|
||||
@mkdir -p $(LIBARCHDIR)
|
||||
@echo " $(CC) $(DNAME)"
|
||||
@$(LD) -L$(LIBARCHDIR) $(LDFLAGS) -shared -o $(DNAME) $(OBJS) $(MODOBJS) $(SLIBS) $(LIBS)
|
||||
|
||||
$(MODNAME) : $(DNAME)
|
||||
cp $(DNAME) $(MODNAME)
|
||||
|
||||
# $(CC) -L$(LIBARCHDIR) $(OBJS) $(MODOBJS) $(SLIBS) -v -shared -o ../../../lib/actube/capwap.so
|
||||
|
||||
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(SNAME)
|
||||
rm -f $(DNAME)
|
||||
rm -f $(MODNAME)
|
||||
|
@ -30,6 +30,7 @@ DNAME := $(LIBARCHDIR)/mod_capwap.so
|
||||
|
||||
CFLAGS+=-fPIC
|
||||
CFLAGS+= -I ../../ -I../ -I../../include
|
||||
CFLAGS+=$(INC2)
|
||||
|
||||
all: $(SNAME) $(DNAME)
|
||||
static: $(SNAME)
|
||||
|
@ -549,6 +549,7 @@ static struct cw_ElemDef change_state_event_request_elements[] ={
|
||||
|
||||
static cw_State_t change_state_event_response_states[] = {
|
||||
{CAPWAP_STATE_JOIN,CAPWAP_STATE_JOIN},
|
||||
{CAPWAP_STATE_RUN,CAPWAP_STATE_RUN},
|
||||
{0,0}
|
||||
};
|
||||
static struct cw_ElemDef change_state_event_response_elements[] ={
|
||||
|
@ -16,6 +16,6 @@ int capwap_in_ac_descriptor(struct cw_ElemHandler *eh,
|
||||
};
|
||||
|
||||
|
||||
return cw_read_ac_descriptor(params->conn->remote_cfg,eh,params,data,len,allowed);
|
||||
return cw_read_ac_descriptor(params->remote_cfg,eh,params,data,len,allowed);
|
||||
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
* @file
|
||||
* @brief Implements cw_in_capwap_control_ip_address
|
||||
*/
|
||||
|
||||
#include "cw/conn.h"
|
||||
#include "mod_capwap.h"
|
||||
|
||||
|
||||
@ -32,15 +32,15 @@ int capwap_in_capwap_control_ip_address(struct cw_ElemHandler *eh,
|
||||
int idx;
|
||||
|
||||
sprintf(key,"%s/address",eh->key);
|
||||
idx = cw_ktv_idx_get(params->conn->remote_cfg,key);
|
||||
idx = cw_ktv_idx_get(params->remote_cfg,key);
|
||||
|
||||
/* printf("SKEY is %s , idx: %d\n",key,idx);*/
|
||||
|
||||
sprintf(key,"%s/address.%d",eh->key,idx+1);
|
||||
cw_ktv_add(params->conn->remote_cfg,key,CW_TYPE_IPADDRESS,NULL,data,len-2);
|
||||
cw_ktv_add(params->remote_cfg,key,CW_TYPE_IPADDRESS,NULL,data,len-2);
|
||||
|
||||
sprintf(key,"%s/wtps.%d",eh->key,idx+1);
|
||||
cw_ktv_add(params->conn->remote_cfg,key,CW_TYPE_WORD,NULL,data+len-2,2);
|
||||
cw_ktv_add(params->remote_cfg,key,CW_TYPE_WORD,NULL,data+len-2,2);
|
||||
|
||||
/* if (handler-id == CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS) {
|
||||
struct sockaddr_in addr;
|
||||
|
@ -36,7 +36,7 @@ int capwap_in_mtu_discovery_padding(struct cw_ElemHandler *eh,
|
||||
cw_dbg(DBG_RFC,
|
||||
"MTU discovery padding msg elem contains %d non-0xFF byte(s) out of %d, See RFC 5415.",
|
||||
n, len);
|
||||
if (params->conn->strict_capwap)
|
||||
if (0 /*params->conn->strict_capwap*/)
|
||||
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
|
||||
}
|
||||
return CAPWAP_RESULT_SUCCESS;
|
||||
|
@ -22,14 +22,14 @@ int capwap_in_vendor_specific_payload(struct cw_ElemHandler *handler,
|
||||
vendor_id = cw_get_dword(data);
|
||||
elem_id = cw_get_word(data + 4);
|
||||
|
||||
vhandler = cw_msgset_get_elemhandler(params->conn->msgset,0,vendor_id,elem_id);
|
||||
vhandler = cw_msgset_get_elemhandler(params->msgset,0,vendor_id,elem_id);
|
||||
|
||||
|
||||
if (!vhandler) {
|
||||
cw_dbg(DBG_WARN,
|
||||
"Can't handle Vendor Specific Payload %s/%d, in msg %d (%s) in %s state.",
|
||||
cw_strvendor(vendor_id), elem_id, params->msgdata->type,
|
||||
params->msgdata->name, cw_strstate(params->conn->capwap_state));
|
||||
params->msgdata->name, NULL /*cw_strstate(params->conn->capwap_state)*/);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "cw/conn.h"
|
||||
#include "mod_capwap.h"
|
||||
|
||||
#include "cw/dbg.h"
|
||||
@ -133,7 +134,7 @@ int capwap_in_wtp_board_data(struct cw_ElemHandler *eh, struct cw_ElemHandlerPar
|
||||
|
||||
|
||||
char vendor_key[128];
|
||||
mavl_t cfg = params->conn->remote_cfg;
|
||||
mavl_t cfg = params->remote_cfg;
|
||||
|
||||
|
||||
sprintf(vendor_key,"%s/%s",eh->key,CW_SKEY_VENDOR);
|
||||
|
@ -26,7 +26,8 @@ int capwap_in_wtp_descriptor(struct cw_ElemHandler *eh, struct cw_ElemHandlerPar
|
||||
int len)
|
||||
{
|
||||
int rc;
|
||||
rc =cw_read_wtp_descriptor(params->conn->remote_cfg, params->conn, eh, data, len, NULL);
|
||||
/*rc =cw_read_wtp_descriptor(params->remote_cfg, params->conn, eh, data, len, NULL);*/
|
||||
rc =cw_read_wtp_descriptor(params->remote_cfg, NULL, eh, data, len, NULL);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -58,22 +58,22 @@ int capwap_out_ac_descriptor(struct cw_ElemHandler * eh,
|
||||
uint8_t *d = dst+4;
|
||||
char key[CW_KTV_MAX_KEY_LEN];
|
||||
|
||||
d+=put_ac_status(params->conn->local_cfg,
|
||||
params->conn->global_cfg,
|
||||
d+=put_ac_status(params->local_cfg,
|
||||
params->global_cfg,
|
||||
d, eh->key);
|
||||
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_HARDWARE);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
CAPWAP_SUBELEM_AC_HARDWARE_VERSION, key);
|
||||
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_SOFTWARE);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
CAPWAP_SUBELEM_AC_SOFTWARE_VERSION, key);
|
||||
|
||||
len = d-dst-4;
|
||||
|
||||
l = len + cw_put_elem_hdr(dst,eh->id,len);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,eh,dst,l);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,dst,l);
|
||||
|
||||
return l;
|
||||
|
||||
|
@ -63,9 +63,9 @@ int capwap_out_capwap_control_ip_address(struct cw_ElemHandler * eh,
|
||||
int l;
|
||||
|
||||
sprintf(key,"%s/address.%d",eh->key,i);
|
||||
address = cw_ktv_get(params->conn->local_cfg,key,CW_TYPE_IPADDRESS);
|
||||
address = cw_ktv_get(params->local_cfg,key,CW_TYPE_IPADDRESS);
|
||||
sprintf(key,"%s/wtps.%d",eh->key,i);
|
||||
wtps = cw_ktv_get_word(params->conn->local_cfg,key,0);
|
||||
wtps = cw_ktv_get_word(params->local_cfg,key,0);
|
||||
i++;
|
||||
if (address==NULL){
|
||||
break;
|
||||
@ -93,7 +93,7 @@ int capwap_out_capwap_control_ip_address(struct cw_ElemHandler * eh,
|
||||
l = address->type->put(address,d+4);
|
||||
l+=cw_put_word(dst+4+l,wtps);
|
||||
l+=cw_put_elem_hdr(d,eh->id,l);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,eh,d+4,l-4);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,d+4,l-4);
|
||||
|
||||
d+=l;
|
||||
}while(address != NULL);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "cw/conn.h"
|
||||
#include "mod_capwap.h"
|
||||
#include "cw/cw.h"
|
||||
|
||||
@ -5,7 +6,7 @@ int capwap_out_capwap_local_ip_address(struct cw_ElemHandler * eh,
|
||||
struct cw_ElemHandlerParams * params, uint8_t * dst)
|
||||
{
|
||||
cw_KTV_t * ip;
|
||||
ip = cw_ktv_get(params->conn->local_cfg,eh->key,CW_TYPE_IPADDRESS);
|
||||
ip = cw_ktv_get(params->local_cfg,eh->key,CW_TYPE_IPADDRESS);
|
||||
if (ip==NULL){
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
|
||||
#include "cw/conn.h"
|
||||
#include "cw/log.h"
|
||||
#include "cw/ktv.h"
|
||||
#include "cw/msgset.h"
|
||||
@ -47,7 +48,7 @@ int capwap_out_wtp_board_data(struct cw_ElemHandler * eh,
|
||||
|
||||
d=dst+4;
|
||||
|
||||
cfg = params->conn->local_cfg;
|
||||
cfg = params->local_cfg;
|
||||
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_VENDOR);
|
||||
val = cw_ktv_get(cfg,key,CW_TYPE_DWORD);
|
||||
|
@ -36,7 +36,7 @@ int capwap_out_wtp_descriptor(struct cw_ElemHandler * eh,
|
||||
d = dst+4;
|
||||
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_MAX_RADIOS);
|
||||
val = cw_ktv_get(params->conn->local_cfg,key, CW_TYPE_BYTE);
|
||||
val = cw_ktv_get(params->local_cfg,key, CW_TYPE_BYTE);
|
||||
if (val != NULL)
|
||||
d+=val->type->put(val,d);
|
||||
else{
|
||||
@ -45,7 +45,7 @@ int capwap_out_wtp_descriptor(struct cw_ElemHandler * eh,
|
||||
}
|
||||
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_RADIOS_IN_USE);
|
||||
val = cw_ktv_get(params->conn->local_cfg,key, CW_TYPE_BYTE);
|
||||
val = cw_ktv_get(params->local_cfg,key, CW_TYPE_BYTE);
|
||||
if (val != NULL){
|
||||
d+=val->type->put(val,d);
|
||||
}
|
||||
@ -54,29 +54,30 @@ int capwap_out_wtp_descriptor(struct cw_ElemHandler * eh,
|
||||
}
|
||||
|
||||
/* d+=cw_put_encryption_capabilities_7(d,1); */
|
||||
d+=cw_put_encryption_subelems(d,params->conn->capwap_mode);
|
||||
/* d+=cw_put_encryption_subelems(d,params->conn->capwap_mode);*/
|
||||
d+=cw_put_encryption_subelems(d,0);
|
||||
|
||||
|
||||
/*cw_ktv_dump(params->conn->local_cfg,DBG_INFO,"*** ktv dump ***","","*** end of dump ***");*/
|
||||
|
||||
/* hardware version sub element */
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_HARDWARE);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
CW_SUBELEM_WTP_HARDWARE_VERSION, key);
|
||||
|
||||
/* software version sub element */
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_SOFTWARE);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
CW_SUBELEM_WTP_SOFTWARE_VERSION, key);
|
||||
|
||||
/* bootloader version sub element */
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_BOOTLOADER);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
CW_SUBELEM_WTP_BOOTLOADER_VERSION, key);
|
||||
|
||||
len = d-dst-4;
|
||||
l = len + cw_put_elem_hdr(dst,eh->id,len);
|
||||
|
||||
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,eh,dst,l);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,dst,l);
|
||||
return l;
|
||||
}
|
||||
|
@ -37,16 +37,23 @@
|
||||
#define CISCO_ELEM_RAD_NAME LWAPP_ELEM_WTP_NAME /* 5 */
|
||||
#define CW_CISCO_MWAR LW_ELEM_AC_DESCRIPTOR /* 6 */
|
||||
#define CISCO_ELEM_ADD_WLAN LW_ELEM_80211_ADD_WLAN /* 7 */
|
||||
#define CISCO_ELEM_WTP_RADIO_CONFIGURATION 8
|
||||
#define CISCO_ELEM_WTP_RADIO_CONFIGURATION 8 /* 9 */
|
||||
|
||||
#define CISCO_ELEM_9 9 /* 9 */
|
||||
|
||||
#define CISCO_ELEM_MULTI_DOMAIN_CAPABILITY LW_ELEM_80211_MULTI_DOMAIN_CAPABILITY /* 10 */
|
||||
#define CISCO_ELEM_MAC_OPERATION LW_ELEM_80211_MAC_OPERATION /* 11 */
|
||||
|
||||
#define CISCO_ELEM_TX_POWER LW_ELEM_80211_TX_POWER /* 12 */
|
||||
#define CW_CISCO_TX_POWER_LEVELS LW_ELEM_80211_TX_POWER_LEVELS /* 13 */
|
||||
#define CISCO_ELEM_TX_POWER_LEVELS LW_ELEM_80211_TX_POWER_LEVELS /* 13 */
|
||||
#define CW_CISCO_DIRECT_SEQUENCE_CONTROL LW_ELEM_DIRECT_SEQUENCE_CONTROL /* 14 */
|
||||
#define CW_CISCO_SUPPORTED_RATES LW_ELEM_80211_RATE_SET /* 16 */
|
||||
|
||||
#define CISCO_ELEM_15 15 /* 15 */
|
||||
#define CISCO_ELEM_19 19 /* 19 */
|
||||
#define CISCO_ELEM_22 22 /* 22 */
|
||||
#define CISCO_ELEM_24 24 /* 24 */
|
||||
|
||||
#define CW_CISCO_80211_DELETE_WLAN LW_ELEM_80211_DELETE_WLAN /* 28 */
|
||||
|
||||
#define CW_CISCO_MWAR_NAME LW_ELEM_AC_NAME /* 31 */
|
||||
@ -57,6 +64,9 @@
|
||||
#define CW_CISCO_ANTENNA_PAYLOAD 41
|
||||
|
||||
#define CW_CISCO_CERTIFICATE LW_ELEM_CERTIFICATE /* 44 */
|
||||
|
||||
#define CISCO_ELEM_47 47 /* 47 */
|
||||
|
||||
#define CISCO_ELEM_WTP_BOARD_DATA LW_ELEM_WTP_BOARD_DATA /* 50 */
|
||||
#define CW_CISCO_BCAST_SSID_MODE LW_BCAST_SSID_MODE
|
||||
#define CISCO_ELEM_AP_MODE_AND_TYPE LW_ELEM_80211_WTP_MODE_AND_TYPE /* 54 */
|
||||
@ -65,13 +75,15 @@
|
||||
#define CW_CISCO_AC_IPV4_LIST LW_ELEM_AC_IPV4_LIST /* 59 */
|
||||
|
||||
#define CISCO_ELEM_CAPWAP_TIMERS LW_ELEM_LWAPP_TIMERS /* 68 */
|
||||
#define CISCO_ELEM_81 81 /* 81 */
|
||||
|
||||
#define CISCO_ELEM_AP_STATIC_IP_ADDR 83
|
||||
#define CISCO_ELEM_SIG_PAYLOAD 84
|
||||
#define CISCO_ELEM_SIG_TOGGLE 87
|
||||
#define CISCO_ELEM_AIRSPACE_CAPABILITY 88
|
||||
|
||||
#define CISCO_ELEM_AC_NAME_WITH_INDEX 91
|
||||
#define CW_CISCO_SPAM_DOMAIN_SECRET 96
|
||||
#define CISCO_ELEM_SPAM_DOMAIN_SECRET 96
|
||||
|
||||
#define CISCO_ELEM_SPAM_VENDOR_SPECIFIC 104
|
||||
|
||||
@ -84,8 +96,9 @@
|
||||
#define CISCO_ELEM_RESET_BUTTON_STATE 128
|
||||
|
||||
|
||||
#define CISCO_ELEM_132 132 /* 132 */
|
||||
|
||||
#define CW_CISCO_LWAPP_CHANNEL_POWER 134
|
||||
#define CISCO_ELEM_CHANNEL_POWER 134
|
||||
#define CISCO_ELEM_AP_CORE_DUMP 135
|
||||
#define CISCO_ELEM_AP_PRE_STD_SWITCH_CONFIG 137
|
||||
#define CISCO_ELEM_AP_POWER_INJECTOR_CONFIG 138
|
||||
|
@ -229,7 +229,7 @@ int cisco_in_ap_regulatory_domain(struct cw_ElemHandler *eh,
|
||||
int idx;
|
||||
void * type;
|
||||
|
||||
idx = cw_ktv_idx_get(params->conn->remote_cfg,eh->key);
|
||||
idx = cw_ktv_idx_get(params->remote_cfg,eh->key);
|
||||
|
||||
sprintf(key,"%s.%d",eh->key,idx+1);
|
||||
|
||||
@ -237,7 +237,7 @@ int cisco_in_ap_regulatory_domain(struct cw_ElemHandler *eh,
|
||||
type = cisco_ap_regulatory_domain4;
|
||||
if(len==5)
|
||||
type = cisco_ap_regulatory_domain5;
|
||||
cw_ktv_read_struct(params->conn->remote_cfg,type,key,data,len);
|
||||
cw_ktv_read_struct(params->remote_cfg,type,key,data,len);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -261,7 +261,7 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
|
||||
|
||||
|
||||
type = NULL;
|
||||
result = cw_ktv_get(params->conn->local_cfg,"ac-descriptor/software/version",CW_TYPE_BSTR16);
|
||||
result = cw_ktv_get(params->local_cfg,"ac-descriptor/software/version",CW_TYPE_BSTR16);
|
||||
if (result!=NULL){
|
||||
if(result->type->len(result)==4){
|
||||
uint32_t rv;
|
||||
@ -280,7 +280,7 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
|
||||
do {
|
||||
sprintf(key,"%s.%d",eh->key,idx);
|
||||
search.key=key;
|
||||
result = mavl_get_first(params->conn->local_cfg,&search);
|
||||
result = mavl_get_first(params->local_cfg,&search);
|
||||
if (result==NULL)
|
||||
break;
|
||||
if (strncmp(result->key,key,strlen(key))!=0)
|
||||
@ -288,7 +288,7 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
|
||||
|
||||
if(type == NULL){
|
||||
sprintf(testkey,"%s/%s",key,"band-id");
|
||||
result = cw_ktv_get(params->conn->local_cfg,key,CW_TYPE_BYTE);
|
||||
result = cw_ktv_get(params->local_cfg,key,CW_TYPE_BYTE);
|
||||
if (result==NULL){
|
||||
type = cisco_ap_regulatory_domain4;
|
||||
}
|
||||
@ -297,9 +297,9 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
|
||||
}
|
||||
}
|
||||
|
||||
start = params->conn->header_len(eh);
|
||||
len = cw_ktv_write_struct(params->conn->local_cfg,NULL,type,key,ob+start);
|
||||
ob += params->conn->write_header(eh,ob,len);
|
||||
start = cw_header_len(eh);
|
||||
len = cw_ktv_write_struct(params->local_cfg,NULL,type,key,ob+start);
|
||||
ob += cw_write_header(eh,ob,len);
|
||||
|
||||
idx++;
|
||||
|
||||
@ -327,6 +327,17 @@ static cw_KTVStruct_t cisco_direct_sequence_control70[]={
|
||||
{NULL,NULL,0,0}
|
||||
};
|
||||
|
||||
static cw_KTVStruct_t cisco_antenna_payload70[]={
|
||||
{CW_TYPE_BYTE,"diversity-selection",1,-1},
|
||||
{CW_TYPE_BYTE,"antenna-mode",1,-1},
|
||||
{CW_TYPE_BYTE,"number-of-antennas",1,-1},
|
||||
{CW_TYPE_BYTE,"802-11n-tx-antennas",1,-1},
|
||||
{CW_TYPE_BYTE,"802-11n-rx-antennas",1,-1},
|
||||
{CW_TYPE_BYTE,"unknown",1,-1},
|
||||
{CW_TYPE_BYTE,"antenna-1",1,-1},
|
||||
{CW_TYPE_BYTE,"antenna-2",1,-1},
|
||||
{NULL,NULL,0,0}
|
||||
};
|
||||
|
||||
|
||||
static cw_KTVStruct_t cisco_wtp_radio_config70[]={
|
||||
@ -532,7 +543,7 @@ static int cisco_in_lw_del_wlan(struct cw_ElemHandler *eh,
|
||||
radio_id=cw_get_byte(data);
|
||||
wlan_id=cw_get_word(data+1);
|
||||
sprintf(key,"radio.%d/wlan.%d",radio_id,wlan_id);
|
||||
cw_ktv_del_sub(params->conn->local_cfg,key);
|
||||
cw_ktv_del_sub(params->local_cfg,key);
|
||||
cw_dbg(DBG_INFO,"Del WLAN rid=%d, id=%d",wlan_id);
|
||||
return 0;
|
||||
}
|
||||
@ -1083,7 +1094,7 @@ static struct cw_ElemHandler handlers70[] = {
|
||||
}
|
||||
,
|
||||
|
||||
{ /* WTP Radio Configuration for AC/WPT with version 7.0 */
|
||||
{ /* WTP Direct Sequence Control for AC/WPT with version 7.0 */
|
||||
|
||||
"Direct Sequence Control (v7.0)", /* name */
|
||||
CW_CISCO_DIRECT_SEQUENCE_CONTROL, /* Element ID */
|
||||
@ -1096,6 +1107,19 @@ static struct cw_ElemHandler handlers70[] = {
|
||||
}
|
||||
,
|
||||
|
||||
{ /* WTP Antenna Payload AC/WPT with version 7.0 */
|
||||
|
||||
"Antenna Payload (v7.0)", /* name */
|
||||
CW_CISCO_ANTENNA_PAYLOAD, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
9,9, /* min/max length */
|
||||
cisco_antenna_payload70, /* type */
|
||||
"cisco/antenna-payload", /* Key */
|
||||
cw_in_radio_generic_struct, /* get */
|
||||
cw_out_radio_generic_struct /* put */
|
||||
}
|
||||
,
|
||||
|
||||
{
|
||||
"MWAR Hash Value", /* name */
|
||||
CISCO_LWELEM_MWAR_HASH_VALUE, /* Element ID */
|
||||
@ -1129,6 +1153,145 @@ static struct cw_ElemHandler handlers70[] = {
|
||||
cw_out_radio_generic_struct /* put */
|
||||
},
|
||||
|
||||
{
|
||||
"Tx Power Levels", /* name */
|
||||
CISCO_ELEM_TX_POWER_LEVELS, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,150, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/tx-power-levels", /* Key */
|
||||
cw_in_radio_generic, /* get */
|
||||
cw_out_radio_generic /* put */
|
||||
},
|
||||
|
||||
{
|
||||
"Channel Power", /* name */
|
||||
CISCO_ELEM_CHANNEL_POWER, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/channel-power", /* Key */
|
||||
cw_in_radio_generic, /* get */
|
||||
cw_out_radio_generic /* put */
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"Spam Domain Secret", /* name */
|
||||
CISCO_ELEM_SPAM_DOMAIN_SECRET, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/spam-domain-secret", /* Key */
|
||||
cw_in_generic, /* get */
|
||||
cw_out_generic /* put */
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"Cisco Elem 132", /* name */
|
||||
CISCO_ELEM_132, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/elem132", /* Key */
|
||||
cw_in_generic, /* get */
|
||||
cw_out_generic /* put */
|
||||
},
|
||||
|
||||
{
|
||||
"Cisco Elem 15", /* name */
|
||||
CISCO_ELEM_15, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/elem15", /* Key */
|
||||
cw_in_radio_generic, /* get */
|
||||
cw_out_radio_generic /* put */
|
||||
},
|
||||
|
||||
{
|
||||
"Cisco LWAP Elem 9", /* name */
|
||||
|
||||
CISCO_LWELEM_9, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
|
||||
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/lwelem9", /* Key */
|
||||
cw_in_radio_generic, /* get */
|
||||
cw_out_radio_generic /* put */
|
||||
},
|
||||
|
||||
{
|
||||
"Cisco Elem 24", /* name */
|
||||
CISCO_ELEM_24, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/elem24", /* Key */
|
||||
cw_in_radio_generic, /* get */
|
||||
cw_out_radio_generic /* put */
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
"Cisco Elem 19", /* name */
|
||||
CISCO_ELEM_19, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/elem19", /* Key */
|
||||
cw_in_radio_generic, /* get */
|
||||
cw_out_radio_generic /* put */
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
"Cisco Elem 22", /* name */
|
||||
CISCO_ELEM_22, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/elem22", /* Key */
|
||||
cw_in_radio_generic, /* get */
|
||||
cw_out_radio_generic /* put */
|
||||
},
|
||||
|
||||
{
|
||||
"Cisco Elem 47", /* name */
|
||||
CISCO_ELEM_47, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/elem47", /* Key */
|
||||
cw_in_radio_generic, /* get */
|
||||
cw_out_radio_generic /* put */
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
"Cisco Elem 81", /* name */
|
||||
CISCO_ELEM_81, /* Element ID */
|
||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||
5,1024, /* min/max length */
|
||||
CW_TYPE_BSTR16, /* type */
|
||||
"cisco/elem81", /* Key */
|
||||
cw_in_radio_generic, /* get */
|
||||
cw_out_radio_generic /* put */
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
"AP Quality of Service", /* name */
|
||||
CISCO_ELEM_AP_QOS, /* Element ID */
|
||||
@ -1539,13 +1702,27 @@ static struct cw_ElemDef configuration_status_request_elements[] ={
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_WTP_RADIO_CONFIGURATION, 1, 0},
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CW_CISCO_DIRECT_SEQUENCE_CONTROL, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CW_CISCO_ANTENNA_PAYLOAD, 1, 0},
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AC_NAME_WITH_INDEX, 0, CW_IGNORE},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_CORE_DUMP, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_VENUE_SETTINGS, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_MAC_OPERATION, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER, 0, 0},
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER_LEVELS, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_CHANNEL_POWER, 1, 0},
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_132, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_15, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_19, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_22, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_47, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_81, 0, 0},
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_9, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_24, 0, 0},
|
||||
|
||||
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_USERNAME_PASSWORD, 1, 0},
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_LOGHOST_CONFIG, 1, 0},
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_TELNET_SSH, 1, 0},
|
||||
@ -1573,6 +1750,7 @@ static struct cw_ElemDef configuration_status_response_elements[] ={
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_MULTI_DOMAIN_CAPABILITY, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_WTP_RADIO_CONFIGURATION, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CW_CISCO_DIRECT_SEQUENCE_CONTROL, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CW_CISCO_ANTENNA_PAYLOAD, 1, 0},
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_LED_STATE_CONFIG, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_LOG_FACILITY, 0, 0},
|
||||
@ -1580,7 +1758,14 @@ static struct cw_ElemDef configuration_status_response_elements[] ={
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_QOS, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AIRSPACE_CAPABILITY, 0, 0},
|
||||
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_132, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_15, 1, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_SPAM_DOMAIN_SECRET, 1, 0},
|
||||
|
||||
|
||||
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_MWAR_HASH_VALUE, 1, 0},
|
||||
|
||||
{0,0,0,0}
|
||||
@ -1620,6 +1805,20 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_SIG_TOGGLE, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_MAC_OPERATION, 0, 0},
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER, 0, 0},
|
||||
/* {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER_LEVELS, 1, 0}, */
|
||||
/* {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_CHANNEL_POWER, 1, 0}, */
|
||||
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_24, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_15, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_19, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_22, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_47, 0, 0},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_81, 0, 0},
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_9, 0, 0},
|
||||
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_ADD_WLAN, 0, CW_IGNORE},
|
||||
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_MCAST_MGID_INFO, 0, 0},
|
||||
@ -1642,7 +1841,7 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_ROUGE_DETECTION, 0, 0},
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_RAD_EXTENDED_CONFIG, 0, 0},
|
||||
|
||||
{0,0,0,00}
|
||||
{0,0,0,0,0}
|
||||
|
||||
};
|
||||
|
||||
@ -1665,12 +1864,12 @@ static struct cw_ElemDef wtp_event_response_elements[] ={
|
||||
|
||||
|
||||
static struct cw_ElemDef change_state_event_request_elements[] ={
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_SPAM_VENDOR_SPECIFIC, 0, CW_IGNORE},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_SPAM_VENDOR_SPECIFIC, 1, CW_IGNORE},
|
||||
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_ADD_WLAN, 0, CW_IGNORE},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_OPER_STATE_DETAIL_CAUSE, 0, CW_IGNORE},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_ADD_WLAN, 1, CW_IGNORE},
|
||||
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_OPER_STATE_DETAIL_CAUSE, 1, CW_IGNORE},
|
||||
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_HARDWARE_INFO, 0, 0},
|
||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_HARDWARE_INFO, 1, 0},
|
||||
|
||||
{0,0,0,0,0}
|
||||
};
|
||||
@ -1796,7 +1995,7 @@ static struct cw_MsgDef messages70[] = {
|
||||
{
|
||||
NULL, /* name */
|
||||
CAPWAP_MSG_CHANGE_STATE_EVENT_REQUEST, /* msg type */
|
||||
CW_ROLE_AC, /* role */
|
||||
CW_ROLE_AC, /* role */
|
||||
NULL, /* allowed states */
|
||||
change_state_event_request_elements /* msg elements */
|
||||
},
|
||||
|
@ -15,7 +15,7 @@ int cisco_in_ac_descriptor(struct cw_ElemHandler *eh,
|
||||
{0,0, NULL,0, 0}
|
||||
};
|
||||
|
||||
return cw_read_ac_descriptor(params->conn->remote_cfg,eh,params,data,len,allowed);
|
||||
return cw_read_ac_descriptor(params->remote_cfg,eh,params,data,len,allowed);
|
||||
|
||||
|
||||
/*return cw_read_ac_descriptor(conn->config,data,len,allowed);*/
|
||||
|
@ -13,14 +13,14 @@ int cisco_in_spam_vendor_specific(struct cw_ElemHandler *eh,
|
||||
vendor_id = cw_get_dword(data);
|
||||
elem_id = cw_get_word(data + 4);
|
||||
|
||||
vhandler = cw_msgset_get_elemhandler(params->conn->msgset,CW_PROTO_LWAPP,vendor_id,elem_id);
|
||||
vhandler = cw_msgset_get_elemhandler(params->msgset,CW_PROTO_LWAPP,vendor_id,elem_id);
|
||||
|
||||
|
||||
if (!vhandler) {
|
||||
cw_dbg(DBG_WARN,
|
||||
"Can't handle Vendor Specific LWAPP Payload %s/%d, in msg %d (%s) in %s state.",
|
||||
cw_strvendor(vendor_id), elem_id, params->msgdata->type,
|
||||
params->msgdata->name, cw_strstate(params->conn->capwap_state));
|
||||
params->msgdata->name, NULL /*cw_strstate(params->conn->capwap_state)*/);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ int cisco_in_wtp_descriptor(struct cw_ElemHandler *eh, struct cw_ElemHandlerPara
|
||||
};
|
||||
|
||||
|
||||
return cw_read_wtp_descriptor_7(params->conn->remote_cfg, params->conn, eh, data, len, allowed);
|
||||
return cw_read_wtp_descriptor_7(params->remote_cfg, NULL /*params->conn*/, eh, data, len, allowed);
|
||||
}
|
||||
|
||||
|
||||
|
@ -60,18 +60,18 @@ int cisco_out_ac_descriptor(struct cw_ElemHandler * eh,
|
||||
uint8_t *d = dst+4;
|
||||
char key[CW_KTV_MAX_KEY_LEN];
|
||||
|
||||
d+=put_ac_status(params->conn->local_cfg,
|
||||
params->conn->global_cfg,
|
||||
d+=put_ac_status(params->local_cfg,
|
||||
params->global_cfg,
|
||||
d, eh->key);
|
||||
|
||||
/* it is important to send software version first,
|
||||
* because APs don't check the type */
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_SOFTWARE);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
1, key);
|
||||
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_HARDWARE);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
0, key);
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ int cisco_out_ac_descriptor(struct cw_ElemHandler * eh,
|
||||
len = d-dst-4;
|
||||
|
||||
l = len + cw_put_elem_hdr(dst,eh->id,len);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,eh,dst,l);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,dst,l);
|
||||
|
||||
return l;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
#include "cw/conn.h"
|
||||
#include "cw/msgset.h"
|
||||
#include "cw/cw.h"
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "cw/conn.h"
|
||||
|
||||
#include "mod_cisco.h"
|
||||
#include "cw/cw.h"
|
||||
|
||||
@ -5,7 +7,7 @@ int cisco_out_capwap_local_ip_address(struct cw_ElemHandler * eh,
|
||||
struct cw_ElemHandlerParams * params, uint8_t * dst)
|
||||
{
|
||||
cw_KTV_t * ip;
|
||||
ip = cw_ktv_get(params->conn->local_cfg,eh->key,CW_TYPE_IPADDRESS);
|
||||
ip = cw_ktv_get(params->local_cfg,eh->key,CW_TYPE_IPADDRESS);
|
||||
if (ip==NULL){
|
||||
return 0;
|
||||
}
|
||||
|
@ -13,11 +13,11 @@ int cisco_out_lw_path_mtu(struct cw_ElemHandler * eh,
|
||||
int len,max;
|
||||
|
||||
sprintf(key,"%s/%s",eh->key,"len");
|
||||
len = cw_ktv_get_word(params->conn->local_cfg,key,0);
|
||||
len = cw_ktv_get_word(params->local_cfg,key,0);
|
||||
if (len == 0)
|
||||
return 0;
|
||||
sprintf(key,"%s/%s",eh->key,"max");
|
||||
max = cw_ktv_get_word(params->conn->local_cfg,key,0);
|
||||
max = cw_ktv_get_word(params->local_cfg,key,0);
|
||||
|
||||
lw_set_word(dst+16,max);
|
||||
lw_set_word(dst+16+2,len);
|
||||
|
@ -13,11 +13,11 @@ int cisco_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandl
|
||||
int radios;
|
||||
len =0;
|
||||
|
||||
radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);
|
||||
radios = cw_ktv_get_byte(params->local_cfg,"wtp-descriptor/max-radios",0);
|
||||
|
||||
for(i=0;i<radios+0;i++){
|
||||
l = cw_write_radio_element(handler,params,i,dst+len);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,handler,dst+len,l);
|
||||
len+=l;
|
||||
}
|
||||
return len;
|
||||
|
@ -16,7 +16,7 @@ int cisco_out_wtp_descriptor(struct cw_ElemHandler * eh,
|
||||
d = dst+4;
|
||||
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_MAX_RADIOS);
|
||||
val = cw_ktv_get(params->conn->local_cfg,key, CW_TYPE_BYTE);
|
||||
val = cw_ktv_get(params->local_cfg,key, CW_TYPE_BYTE);
|
||||
if (val != NULL)
|
||||
d+=val->type->put(val,d);
|
||||
else{
|
||||
@ -25,7 +25,7 @@ int cisco_out_wtp_descriptor(struct cw_ElemHandler * eh,
|
||||
}
|
||||
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_RADIOS_IN_USE);
|
||||
val = cw_ktv_get(params->conn->local_cfg,key, CW_TYPE_BYTE);
|
||||
val = cw_ktv_get(params->local_cfg,key, CW_TYPE_BYTE);
|
||||
if (val != NULL){
|
||||
d+=val->type->put(val,d);
|
||||
}
|
||||
@ -38,17 +38,17 @@ int cisco_out_wtp_descriptor(struct cw_ElemHandler * eh,
|
||||
|
||||
/* hardware version sub element */
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_HARDWARE);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
CW_SUBELEM_WTP_HARDWARE_VERSION, key);
|
||||
|
||||
/* software version sub element */
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_SOFTWARE);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
CW_SUBELEM_WTP_SOFTWARE_VERSION, key);
|
||||
|
||||
/* bootloader version sub element */
|
||||
sprintf(key,"%s/%s",eh->key,CW_SKEY_BOOTLOADER);
|
||||
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
|
||||
d+=cw_write_descriptor_subelem (d, params->local_cfg,
|
||||
CW_SUBELEM_WTP_BOOTLOADER_VERSION, key);
|
||||
|
||||
len = d-dst-4;
|
||||
|
@ -28,6 +28,7 @@
|
||||
* Vendor specific message elements defined in LWAPP by Cisco
|
||||
*/
|
||||
|
||||
#define CISCO_LWELEM_9 9
|
||||
#define CISCO_LWELEM_AP_USERNAME_PASSWORD 18
|
||||
#define LW_CISCO_MANAGER_IP_ADDR 19
|
||||
#define CISCO_LWELEM_DISCOVERY_PROTOCOL 20
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define __MOD_CISCO_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "cw/conn.h"
|
||||
#include "cw/msgset.h"
|
||||
|
||||
int cisco_in_wtp_descriptor(struct cw_ElemHandler *eh, struct cw_ElemHandlerParams * params, uint8_t * data,
|
||||
|
@ -1,4 +1,4 @@
|
||||
ac-descriptor/active-wtps :Word: 1
|
||||
ac-descriptor/active-wtps :Word: 2
|
||||
ac-descriptor/dtls-policy :Byte: 0
|
||||
ac-descriptor/hardware/vendor :Dword: 4232704
|
||||
ac-descriptor/hardware/version :Bstr16: .x01000001
|
||||
@ -22,7 +22,7 @@ capwap-control-ip-address/address.2 :IPAddress: 192.168.0.162
|
||||
capwap-control-ip-address/wtps.0 :Word: 0
|
||||
capwap-control-ip-address/wtps.1 :Word: 10
|
||||
capwap-control-ip-address/wtps.2 :Word: 0
|
||||
capwap-local-ip-address :IPAddress: 192.168.0.29
|
||||
capwap-local-ip-address :IPAddress: 192.168.0.14
|
||||
capwap-timers/echo-interval :Byte: 30
|
||||
capwap-timers/max-discovery-interval :Byte: 10
|
||||
capwap-timers/min-discovery-interval :Byte: 0
|
||||
@ -53,18 +53,16 @@ cisco/ap-regulatory-domain.0/code0 :Byte: 0
|
||||
cisco/ap-regulatory-domain.0/code1 :Byte: 1
|
||||
cisco/ap-regulatory-domain.0/set :Bool: true
|
||||
cisco/ap-regulatory-domain.0/slot :Byte: 0
|
||||
|
||||
cisco/ap-regulatory-domain.1/band-id :Byte: 0
|
||||
cisco/ap-regulatory-domain.1/code0 :Byte: 0
|
||||
cisco/ap-regulatory-domain.1/code1 :Byte: 1
|
||||
cisco/ap-regulatory-domain.1/set :Bool: true
|
||||
cisco/ap-regulatory-domain.1/slot :Byte: 0
|
||||
|
||||
cisco/ap-sub-mode :Byte: 0
|
||||
cisco/ap-telnet-ssh/ssh :Bool: false
|
||||
cisco/ap-telnet-ssh/telnet :Bool: false
|
||||
cisco/ap-timesync/timestamp :Dword: 1585926286
|
||||
cisco/ap-timesync/type :Byte: 1
|
||||
cisco/ap-timesync/timestamp :Dword: 1469722147
|
||||
cisco/ap-timesync/type :Byte: 0
|
||||
cisco/ap-username-and-password/802.1x-credentials/option :Word: 2
|
||||
cisco/ap-username-and-password/802.1x-credentials/password :Str:
|
||||
cisco/ap-username-and-password/802.1x-credentials/username :Str:
|
||||
@ -79,6 +77,7 @@ cisco/ap-venue-settings/type :Byte: 1
|
||||
cisco/board-data-options :Dword: 16777217
|
||||
cisco/cisco-discovery-protocol/data :Word: 0
|
||||
cisco/cisco-discovery-protocol/enabled :Bool: false
|
||||
cisco/elem132 :Bstr16: .x0100000000
|
||||
cisco/hash/hash :Bstr16: c4084177cd95ddbba1237bfcb3de6780fdf48214
|
||||
cisco/hash/validate :Bool: true
|
||||
cisco/loghost-config/last-joined-ap :Str:
|
||||
@ -86,21 +85,21 @@ cisco/loghost-config/loghost.0 :IPAddress: 7.7.1.3
|
||||
cisco/loghost-config/loghost.1 :IPAddress: 0.0.0.0
|
||||
cisco/loghost-config/loghost.2 :IPAddress: 0.0.0.0
|
||||
cisco/loghost-config/loghost.3 :IPAddress: 0.0.0.0
|
||||
cisco/mcast-mgid-info :Bstr16: .x002100010000000000000000000000000000000101000000
|
||||
cisco/mcast-mgid-info :Bstr16: .x000000010000000000000000000000000000000101000000
|
||||
cisco/mwar-addr/address :IPAddress: 192.168.0.162
|
||||
cisco/mwar-addr/mwar-type :Byte: 0
|
||||
cisco/mwar-addr/unknown :Word: 0
|
||||
cisco/mwar-hash-value :Bstr16: c4084177cd95ddbba1237bfcb3de6780fdf48214
|
||||
cisco/mwar-type :Byte: 0
|
||||
cisco/mwar-type :Byte: 1
|
||||
cisco/rouge-and-mss/enable :Bool: false
|
||||
cisco/rouge-and-mss/mss :Word: 666
|
||||
cisco/rouge-and-mss/roge-detection :Bool: true
|
||||
cisco/rouge-and-mss/tcp-adjust-mss :Word: 0
|
||||
cisco/rouge-detection/rest :Bstr16: .x000aff800000
|
||||
cisco/rouge-detection/rouge-detection :Bool: false
|
||||
cisco/sig-toogle :Bool: true
|
||||
cisco/sig-toogle :Bool: false
|
||||
cisco/spam-domain-secret :Bstr16: .xe1ffd18a8f15b3b59c0a47a7f17a96e7cb36174f00
|
||||
cisco/ssl-certfile :Str: ../../ssl/certs/wtpc.crt
|
||||
#cisco/ssl-cipher :Str: ALL
|
||||
cisco/ssl-cipher :Str: RSA:AES-128-CBC:SHA1
|
||||
cisco/ssl-keyfile :Str: ../../ssl/certs/wtpc.key
|
||||
cisco/vlan/id :Word: 0
|
||||
@ -128,10 +127,29 @@ radio.0/cisco-multi-domain-capability/max-tx-power-level :Word: 65535
|
||||
radio.0/cisco-multi-domain-capability/number-of-channels :Word: 13
|
||||
radio.0/cisco-multi-domain-capability/reserved :Byte: 1
|
||||
radio.0/cisco/air-space-capability :Byte: 0
|
||||
radio.0/cisco/antenna-payload/802-11n-rx-antennas :Byte: 7
|
||||
radio.0/cisco/antenna-payload/802-11n-tx-antennas :Byte: 0
|
||||
radio.0/cisco/antenna-payload/antenna-1 :Byte: 1
|
||||
radio.0/cisco/antenna-payload/antenna-2 :Byte: 1
|
||||
radio.0/cisco/antenna-payload/antenna-mode :Byte: 3
|
||||
radio.0/cisco/antenna-payload/diversity-selection :Byte: 255
|
||||
radio.0/cisco/antenna-payload/number-of-antennas :Byte: 2
|
||||
radio.0/cisco/antenna-payload/unknown :Byte: 3
|
||||
radio.0/cisco/channel-power :Bstr16: .x08080d0108221c16100a04fefe0208221c16100a04fefe0308221c16100a04fefe0408221c16100a04fefe0508221c16100a04fefe0608221c16100a04fefe0708221c16100a04fefe0808221c16100a04fefe0908221c16100a04fefe0a08221c16100a04fefe0b08221c16100a04fefe0c08221c16100a04fefe0d08221c16100a04fefe
|
||||
radio.0/cisco/direct-sequence-control/cfg-type :Byte: 1
|
||||
radio.0/cisco/direct-sequence-control/current-cca-mode :Byte: 0
|
||||
radio.0/cisco/direct-sequence-control/current-channel :Byte: 1
|
||||
radio.0/cisco/direct-sequence-control/energy-detect-threshold :Dword: -50
|
||||
radio.0/cisco/direct-sequence-control/unknown :Byte: 1
|
||||
radio.0/cisco/elem19 :Bstr16: .xc0a800a10001000bc0a800a103000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000001060b010101
|
||||
radio.0/cisco/elem22 :Bstr16: .x0d00b400320102030405060708090a0b0c0d
|
||||
radio.0/cisco/elem24 :Bstr16: .x003c000c
|
||||
radio.0/cisco/elem81 :Bstr16: .x00000000010101010a001e0a02051cbfffbfff0a00
|
||||
radio.0/cisco/lwelem9 :Bstr16: .x0100000000000000000000000000000000
|
||||
radio.0/cisco/mac-operation/byte75 :Byte: 0
|
||||
radio.0/cisco/mac-operation/fragmentation-threshold :Word: 2346
|
||||
radio.0/cisco/mac-operation/long-retry :Byte: 4
|
||||
radio.0/cisco/mac-operation/reserved :Word: 1
|
||||
radio.0/cisco/mac-operation/reserved :Byte: 0
|
||||
radio.0/cisco/mac-operation/rts-threshold :Word: 2347
|
||||
radio.0/cisco/mac-operation/rx-msdu-lifetime :Dword: 512
|
||||
radio.0/cisco/mac-operation/short-retry :Byte: 7
|
||||
@ -146,27 +164,42 @@ radio.0/cisco/rad-extended-config/c-ccat :Word: 0
|
||||
radio.0/cisco/rad-extended-config/multicast-buffer :Word: 0
|
||||
radio.0/cisco/rad-extended-config/multicast-data-range :Word: 0
|
||||
radio.0/cisco/rad-extended-config/rx-sensop-threshold :Word: 0
|
||||
radio.0/cisco/tx-power/current-tx-power :Word: 10
|
||||
radio.0/cisco/tx-power-levels :Bstr16: .x070011000e000b000800050002ffff0000
|
||||
radio.0/cisco/tx-power/current-tx-power :Word: 1
|
||||
radio.0/cisco/tx-power/reserved :Byte: 1
|
||||
radio.0/cisco/wtp-radio-config/beacon-period :Word: 0
|
||||
radio.0/cisco/wtp-radio-config/beacon-period :Word: 100
|
||||
radio.0/cisco/wtp-radio-config/bss-id :Bstr16: .x0800276edf58
|
||||
radio.0/cisco/wtp-radio-config/cfg-period :Byte: 0
|
||||
radio.0/cisco/wtp-radio-config/cfg-period :Byte: 4
|
||||
radio.0/cisco/wtp-radio-config/cfg-type :Byte: 1
|
||||
radio.0/cisco/wtp-radio-config/cfp-maximum-duration :Word: 0
|
||||
radio.0/cisco/wtp-radio-config/cfp-maximum-duration :Word: 60
|
||||
radio.0/cisco/wtp-radio-config/country-str1 :Str: DE
|
||||
radio.0/cisco/wtp-radio-config/country-str2 :Str: DE
|
||||
radio.0/cisco/wtp-radio-config/country-str2 :Str: DE
|
||||
radio.0/cisco/wtp-radio-config/gpr-period :Byte: 10
|
||||
radio.0/cisco/wtp-radio-config/max-stations :Byte: 200
|
||||
radio.0/cisco/wtp-radio-config/occupancy-limit :Word: 0
|
||||
radio.0/cisco/wtp-radio-config/reg :Dword: 256
|
||||
radio.0/cisco/wtp-radio-config/occupancy-limit :Word: 100
|
||||
radio.0/cisco/wtp-radio-config/reg :Dword: 167772416
|
||||
radio.0/cisco/wtp-radio-config/unknown75 :Byte: 0
|
||||
radio.0/decryption-error-report-period :Word: 120
|
||||
radio.0/operational-state/cause :Byte: Normal
|
||||
radio.0/operational-state/state :Byte: 0
|
||||
radio.0/operational-state/state :Byte: enabled
|
||||
radio.0/rate_set :Bstr16: .x82848b960c1218243048606c
|
||||
radio.0/wlan.0/add-lw-wlan/misc :Bstr16: .x3e9904fac0000100
|
||||
radio.0/wlan.0/add-lw-wlan/misc2 :Word: 4
|
||||
radio.0/wlan.0/add-lw-wlan/ssid :Str: TubeSSID
|
||||
radio.0/wlan.0/add-wlan/broadcast-ssid :Bool: true
|
||||
radio.0/wlan.0/add-wlan/dtim-period :Byte: 1
|
||||
radio.0/wlan.0/add-wlan/encryption-policy :Dword: 4
|
||||
radio.0/wlan.0/add-wlan/profile-name :Str: tubeC
|
||||
radio.0/wlan.0/add-wlan/qos :Byte: 0
|
||||
radio.0/wlan.0/add-wlan/radio-id :Byte: 0
|
||||
radio.0/wlan.0/add-wlan/scan-defer-time :Word: 100
|
||||
radio.0/wlan.0/add-wlan/session-timout :Word: 1800
|
||||
radio.0/wlan.0/add-wlan/ssid :Str:
|
||||
radio.0/wlan.0/add-wlan/wep-encryption :Bool: false
|
||||
radio.0/wlan.0/add-wlan/wep-key :Bstr16: .x61d4be12e22feb1135d1be6d3f
|
||||
radio.0/wlan.0/add-wlan/wep-key-index :Byte: 1
|
||||
radio.0/wlan.0/add-wlan/wlan-capability :Word: 1073
|
||||
radio.0/wlan.0/add-wlan/wlan-id :Byte: 1
|
||||
radio.0/wlan.0/allow-aaa-override :Byte: 0
|
||||
radio.0/wlan.0/broadcast-ssid :Bool: true
|
||||
radio.0/wlan.0/dtim-period :Byte: 1
|
||||
@ -186,10 +219,26 @@ radio.1/cisco-multi-domain-capability/max-tx-power-level :Word: 65535
|
||||
radio.1/cisco-multi-domain-capability/number-of-channels :Word: 16
|
||||
radio.1/cisco-multi-domain-capability/reserved :Byte: 1
|
||||
radio.1/cisco/air-space-capability :Byte: 0
|
||||
radio.1/cisco/antenna-payload/802-11n-rx-antennas :Byte: 7
|
||||
radio.1/cisco/antenna-payload/802-11n-tx-antennas :Byte: 0
|
||||
radio.1/cisco/antenna-payload/antenna-1 :Byte: 1
|
||||
radio.1/cisco/antenna-payload/antenna-2 :Byte: 1
|
||||
radio.1/cisco/antenna-payload/antenna-mode :Byte: 3
|
||||
radio.1/cisco/antenna-payload/diversity-selection :Byte: 255
|
||||
radio.1/cisco/antenna-payload/number-of-antennas :Byte: 2
|
||||
radio.1/cisco/antenna-payload/unknown :Byte: 3
|
||||
radio.1/cisco/channel-power :Bstr16: .x0808102408221c16100a04fefe2808221c16100a04fefe2c08221c16100a04fefe3008221c16100a04fefe3408221c16100a04fefe3808221c16100a04fefe3c08221c16100a04fefe4008221c16100a04fefe6408221c16100a04fefe6808221c16100a04fefe6c08221c16100a04fefe7008221c16100a04fefe7408221c16100a04fefe8408221c16100a04fefe8808221c16100a04fefe8c08221c16100a04fefe
|
||||
radio.1/cisco/elem15 :Bstr16: .x027007ffffffce010001
|
||||
radio.1/cisco/elem19 :Bstr16: .xc0a800a10001000ac0a800a110000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000024282c3034383c4064686c707484888c01010101010101010101010101010101
|
||||
radio.1/cisco/elem22 :Bstr16: .x1000b4003224282c3034383c4064686c707484888c
|
||||
radio.1/cisco/elem24 :Bstr16: .x003c000c
|
||||
radio.1/cisco/elem47 :Bstr16: .x01ccb0000c000f42401999ba1040000003
|
||||
radio.1/cisco/elem81 :Bstr16: .x00000000010101010a001e0a02050fbfffbfff0a00
|
||||
radio.1/cisco/lwelem9 :Bstr16: .x0100000000000000000000000000000000
|
||||
radio.1/cisco/mac-operation/byte75 :Byte: 0
|
||||
radio.1/cisco/mac-operation/fragmentation-threshold :Word: 2346
|
||||
radio.1/cisco/mac-operation/long-retry :Byte: 4
|
||||
radio.1/cisco/mac-operation/reserved :Word: 257
|
||||
radio.1/cisco/mac-operation/reserved :Byte: 1
|
||||
radio.1/cisco/mac-operation/rts-threshold :Word: 2347
|
||||
radio.1/cisco/mac-operation/rx-msdu-lifetime :Dword: 512
|
||||
radio.1/cisco/mac-operation/short-retry :Byte: 7
|
||||
@ -198,56 +247,46 @@ radio.1/cisco/multi-domain-capability/first-channel :Word: 36
|
||||
radio.1/cisco/multi-domain-capability/max-tx-power-level :Word: 20
|
||||
radio.1/cisco/multi-domain-capability/number-of-channels :Word: 4
|
||||
radio.1/cisco/multi-domain-capability/reserved :Byte: 1
|
||||
radio.1/cisco/tx-power/current-tx-power :Word: 10
|
||||
radio.1/cisco/tx-power-levels :Bstr16: .x070011000e000b000800050002ffff0000
|
||||
radio.1/cisco/tx-power/current-tx-power :Word: 6
|
||||
radio.1/cisco/tx-power/reserved :Byte: 1
|
||||
radio.1/cisco/wtp-radio-config/beacon-period :Word: 100
|
||||
radio.1/cisco/wtp-radio-config/bss-id :Bstr16: .x04fe7f499b90
|
||||
radio.1/cisco/wtp-radio-config/cfg-period :Byte: 0
|
||||
radio.1/cisco/wtp-radio-config/cfg-period :Byte: 4
|
||||
radio.1/cisco/wtp-radio-config/cfg-type :Byte: 1
|
||||
radio.1/cisco/wtp-radio-config/cfp-maximum-duration :Word: 0
|
||||
radio.1/cisco/wtp-radio-config/cfp-maximum-duration :Word: 60
|
||||
radio.1/cisco/wtp-radio-config/country-str1 :Str: DE
|
||||
radio.1/cisco/wtp-radio-config/country-str2 :Str: DE
|
||||
radio.1/cisco/wtp-radio-config/country-str2 :Str: DE
|
||||
radio.1/cisco/wtp-radio-config/gpr-period :Byte: 10
|
||||
radio.1/cisco/wtp-radio-config/max-stations :Byte: 200
|
||||
radio.1/cisco/wtp-radio-config/occupancy-limit :Word: 0
|
||||
radio.1/cisco/wtp-radio-config/reg :Dword: 256
|
||||
radio.1/cisco/wtp-radio-config/occupancy-limit :Word: 100
|
||||
radio.1/cisco/wtp-radio-config/reg :Dword: 167772416
|
||||
radio.1/cisco/wtp-radio-config/unknown75 :Byte: 1
|
||||
radio.1/decryption-error-report-period :Word: 120
|
||||
radio.1/operational-state/cause :Byte: Normal
|
||||
radio.1/operational-state/state :Byte: 0
|
||||
radio.1/operational-state/state :Byte: enabled
|
||||
radio.1/rate_set :Bstr16: .x8c129824b048606c
|
||||
radio.1/wlan.0/add-lw-wlan/misc :Bstr16: .x3e9904fac0000100
|
||||
radio.1/wlan.0/add-lw-wlan/misc2 :Word: 4
|
||||
radio.1/wlan.0/add-lw-wlan/ssid :Str: TubeSSID
|
||||
radio.1/wlan.0/add-wlan/broadcast-ssid :Bool: true
|
||||
radio.1/wlan.0/add-wlan/dtim-period :Byte: 1
|
||||
radio.1/wlan.0/add-wlan/encryption-policy :Dword: 4
|
||||
radio.1/wlan.0/add-wlan/profile-name :Str: tubeC
|
||||
radio.1/wlan.0/add-wlan/qos :Byte: 0
|
||||
radio.1/wlan.0/add-wlan/radio-id :Byte: 1
|
||||
radio.1/wlan.0/add-wlan/scan-defer-time :Word: 100
|
||||
radio.1/wlan.0/add-wlan/session-timout :Word: 1800
|
||||
radio.1/wlan.0/add-wlan/ssid :Str:
|
||||
radio.1/wlan.0/add-wlan/wep-encryption :Bool: false
|
||||
radio.1/wlan.0/add-wlan/wep-key :Bstr16: .xf0571b63dc70fdf913e2bd0806
|
||||
radio.1/wlan.0/add-wlan/wep-key-index :Byte: 1
|
||||
radio.1/wlan.0/add-wlan/wlan-capability :Word: 17
|
||||
radio.1/wlan.0/add-wlan/wlan-id :Byte: 1
|
||||
radio.1/wtp-radio-information :Dword: 2
|
||||
#radio.2/cisco/rad-extended-config/beacon-interval :Word: 48128
|
||||
#radio.2/cisco/rad-extended-config/beacon-range :Word: 0
|
||||
#radio.2/cisco/rad-extended-config/c-ccat :Word: 1
|
||||
#radio.2/cisco/rad-extended-config/multicast-buffer :Word: 0
|
||||
#radio.2/cisco/rad-extended-config/multicast-data-range :Word: 0
|
||||
#radio.2/cisco/rad-extended-config/rx-sensop-threshold :Word: 0
|
||||
#radio.3/cisco/rad-extended-config/beacon-interval :Word: 59392
|
||||
#radio.3/cisco/rad-extended-config/beacon-range :Word: 0
|
||||
#radio.3/cisco/rad-extended-config/c-ccat :Word: 1
|
||||
#radio.3/cisco/rad-extended-config/multicast-buffer :Word: 0
|
||||
#radio.3/cisco/rad-extended-config/multicast-data-range :Word: 0
|
||||
#radio.3/cisco/rad-extended-config/rx-sensop-threshold :Word: 0
|
||||
radio.255/admin-state :Byte: reserved
|
||||
radio.255/operational-state/cause :Byte: Normal
|
||||
radio.255/operational-state/state :Byte: 0
|
||||
radio/0/cisco/regulatory-domain/code0 :Byte: 0
|
||||
radio/0/cisco/regulatory-domain/code1 :Byte: 1
|
||||
radio/0/cisco/regulatory-domain/set :Bool: true
|
||||
radio/0/cisco/regulatory-domain/slot :Byte: 0
|
||||
radio/0/wtp-radio-information :Dword: 1
|
||||
radio/1/cisco/regulatory-domain/code0 :Byte: 0
|
||||
radio/1/cisco/regulatory-domain/code1 :Byte: 1
|
||||
radio/1/cisco/regulatory-domain/set :Bool: true
|
||||
radio/1/cisco/regulatory-domain/slot :Byte: 0
|
||||
radio/1/wtp-radio-information :Dword: 1
|
||||
|
||||
|
||||
|
||||
radio.255/operational-state/state :Byte: enabled
|
||||
radio/wlan/encryption-policy :Dword: 16777216
|
||||
radio/wlan/radio-od :Byte: 1
|
||||
radio/wlan/wlan-capability :Word: 17
|
||||
@ -261,7 +300,7 @@ tube.1/main :Byte: 12
|
||||
tube.1/zumsel :Byte: 12
|
||||
wtp-board-data/board-id :Bstr16: .x0000
|
||||
wtp-board-data/mac-address :Bstr16: .x0800276edf58
|
||||
wtp-board-data/model-no :Bstr16: AIR-LAP1131AG-E-K9
|
||||
wtp-board-data/model-no :Bstr16: AIR-LAP1131AG-E-K9
|
||||
wtp-board-data/revision :Bstr16: B0
|
||||
wtp-board-data/serial-no :Bstr16: FCZ1441Q0XZ
|
||||
wtp-board-data/vendor :Dword: 4232704
|
||||
@ -276,7 +315,7 @@ wtp-descriptor/software/version :Bstr16: .x07007400
|
||||
wtp-fallback :Byte: 1
|
||||
wtp-frame-tunnel-mode :Byte: 4
|
||||
wtp-mac-type :Byte: 1
|
||||
wtp-name :Bstr16: tube
|
||||
wtp-name :Bstr16: Supertube
|
||||
wtp-reboot-statistics/ac-initiated-count :Word: 2
|
||||
wtp-reboot-statistics/hw-failure-count :Word: 0
|
||||
wtp-reboot-statistics/last-failure-type :Byte: 0
|
||||
|
@ -38,6 +38,6 @@ int configure(struct conn * conn)
|
||||
cw_dbg_ktv_dump(conn->remote_cfg,DBG_INFO,"Config ***","CFG: ", "End config ***");
|
||||
|
||||
// cw_ktv_set_byte(conn->remote_cfg,"
|
||||
exit(0);
|
||||
/*exit(0);*/
|
||||
return 1;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "cw/dbg.h"
|
||||
#include "cfg.h"
|
||||
|
||||
int update =0;
|
||||
int update =1;
|
||||
|
||||
/*
|
||||
int handle_update_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
@ -167,13 +167,15 @@ int run(struct conn * conn)
|
||||
|
||||
if ( !cw_result_is_ok(rc))
|
||||
break;
|
||||
clean_cfg(conn->remote_cfg);
|
||||
|
||||
printf("Saving Config\n");
|
||||
mavl_merge(conn->local_cfg,conn->remote_cfg);
|
||||
cw_ktv_save(conn->local_cfg,"cisco.ktv");
|
||||
clean_cfg(conn->remote_cfg);
|
||||
|
||||
|
||||
/*cw_dbg(DBG_X,"We hav a message processed");*/
|
||||
|
||||
update=1;
|
||||
do_update(conn);
|
||||
|
||||
|
||||
|
@ -159,7 +159,7 @@ int main (int argc, char **argv)
|
||||
/* conn->mod=mod;*/
|
||||
conn->detected = 1;
|
||||
conn->dtls_verify_peer=0;
|
||||
conn->dtls_mtu = 12000;
|
||||
conn->dtls_mtu = 1200;
|
||||
conn->msgset=msgset;
|
||||
conn->local_cfg = global_cfg;
|
||||
conn->remote_cfg = NULL;
|
||||
@ -196,7 +196,6 @@ exit(0);
|
||||
/*cw_run_discovery(conn, "255.255.255.255","192.168.56.1", &dis);*/
|
||||
/* cw_run_discovery(conn, "255.255.255.255",NULL, &dis);*/
|
||||
cw_run_discovery(conn, "192.168.0.162","192.168.0.14", &dis);
|
||||
|
||||
cw_dbg_ktv_dump(dis.prio_ip, DBG_INFO, "=== IP list ===", "IP", "=== END IP List ===");
|
||||
|
||||
|
||||
@ -225,11 +224,13 @@ exit(0);
|
||||
}
|
||||
|
||||
mavl_del_all(conn->remote_cfg);
|
||||
printf("JOIN\n");
|
||||
join(conn,&dis);
|
||||
clean_cfg(conn->remote_cfg);
|
||||
mavl_merge(conn->local_cfg,conn->remote_cfg);
|
||||
|
||||
mavl_del_all(conn->remote_cfg);
|
||||
printf("JOIN CONF\n");
|
||||
configure(conn);
|
||||
clean_cfg(conn->remote_cfg);
|
||||
mavl_merge(conn->local_cfg,conn->remote_cfg);
|
||||
|
3
ssl/all.sh
Normal file
3
ssl/all.sh
Normal file
@ -0,0 +1,3 @@
|
||||
faketime '2015-12-24 11:15:42' ./mkrootca.sh
|
||||
faketime '2015-12-24 13:15:42' ./mkcerts.sh
|
||||
|
@ -9,7 +9,7 @@ set -x
|
||||
NAME=$1
|
||||
TYPE=$2
|
||||
|
||||
|
||||
DAYS=6000
|
||||
|
||||
DIR=./certs
|
||||
ROOT_CA_DIR=./root-ca
|
||||
@ -65,8 +65,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
CISCOTIME='2013-12-24 08:15:42'
|
||||
|
||||
if [ "$TYPE" = "cisco-ac" ]
|
||||
then
|
||||
SUBJ="/C=US/ST=California/L=San Jose/O=Cisco Virtual Wireless LAN Controller/CN=DEVICE-AC-TUBE/emailAddress=7u83@mail.ru"
|
||||
@ -82,14 +80,14 @@ then
|
||||
openssl req -nodes -new -x509 \
|
||||
-sha1 \
|
||||
-extensions v3_ca \
|
||||
-days 3650 \
|
||||
-newkey rsa:2048 \
|
||||
-days ${DAYS} \
|
||||
-newkey rsa:${KEYSIZE} \
|
||||
-keyout certs/${NAME}.key -out certs/${NAME}.crt \
|
||||
-config openssl.cnf \
|
||||
-x509 \
|
||||
-subj "$SUBJ"
|
||||
|
||||
$OPENSSL x509 -in $DIR/$NAME.crt -out $DIR/$NAME.pem -days=128
|
||||
$OPENSSL x509 -in $DIR/$NAME.crt -out $DIR/$NAME.pem -days=${DAYS}
|
||||
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@ then
|
||||
fi
|
||||
|
||||
|
||||
echo clock set $(date "+%H:%M:%S %d %b %Y")
|
||||
#echo clock set $(date "+%H:%M:%S %d %b %Y")
|
||||
echo debug capwap console cli
|
||||
echo configure terminal
|
||||
echo crypto ca profile enrollment ACTube
|
||||
|
@ -7,6 +7,8 @@ CONFIG=openssl.cnf
|
||||
ROOT_CA_DIR=./root-ca
|
||||
INT_CA_DIR=./intermediate-ca
|
||||
|
||||
DAYS=6000
|
||||
|
||||
|
||||
|
||||
if [ ! -e $ROOT_CA_DIR ]
|
||||
@ -42,11 +44,11 @@ mkrootca()
|
||||
# Create a self-signed root CA
|
||||
openssl req -nodes -new -x509 \
|
||||
-sha1 \
|
||||
-days ${DAYS} \
|
||||
-extensions v3_ca \
|
||||
-days 3650 \
|
||||
-newkey rsa:2048 \
|
||||
-newkey rsa:${KEYSIZE} \
|
||||
-keyout $ROOT_CA_DIR/${PREF}root-ca.key -out $ROOT_CA_DIR/${PREF}root-ca.crt \
|
||||
-config openssl.cnf \
|
||||
-config ${CONFIG} \
|
||||
-x509 \
|
||||
-subj "$ROOT_SUBJ"
|
||||
|
||||
@ -58,7 +60,7 @@ mkrootca()
|
||||
-subj "$INT_SUBJ"
|
||||
|
||||
# Sign intermediate CA cert using previously created root CA
|
||||
openssl ca -config openssl.cnf -batch -keyfile $ROOT_CA_DIR/${PREF}root-ca.key \
|
||||
openssl ca -config ${CONFIG} -batch -keyfile $ROOT_CA_DIR/${PREF}root-ca.key \
|
||||
-cert $ROOT_CA_DIR/${PREF}root-ca.crt \
|
||||
-extensions v3_ca -notext -md sha1 -in $INT_CA_DIR/${PREF}int-ca.csr \
|
||||
-out $INT_CA_DIR/${PREF}int-ca.crt
|
||||
|
@ -70,7 +70,7 @@ cert_opt = ca_default # Certificate field options
|
||||
# crlnumber must also be commented out to leave a V1 CRL.
|
||||
# crl_extensions = crl_ext
|
||||
|
||||
default_days = 365 # how long to certify for
|
||||
default_days = 6000 # how long to certify for
|
||||
default_crl_days= 30 # how long before next CRL
|
||||
default_md = sha256 #md5 # use public key default MD
|
||||
preserve = no # keep passed DN ordering
|
||||
|
@ -70,7 +70,7 @@ cert_opt = ca_default # Certificate field options
|
||||
# crlnumber must also be commented out to leave a V1 CRL.
|
||||
# crl_extensions = crl_ext
|
||||
|
||||
default_days = 365 # how long to certify for
|
||||
default_days = 6000 # how long to certify for
|
||||
default_crl_days= 30 # how long before next CRL
|
||||
default_md = md5 # use public key default MD
|
||||
preserve = no # keep passed DN ordering
|
||||
|
@ -70,7 +70,7 @@ cert_opt = ca_default # Certificate field options
|
||||
# crlnumber must also be commented out to leave a V1 CRL.
|
||||
# crl_extensions = crl_ext
|
||||
|
||||
default_days = 365 # how long to certify for
|
||||
default_days = 6000 # how long to certify for
|
||||
default_crl_days= 30 # how long before next CRL
|
||||
default_md = md5 # use public key default MD
|
||||
preserve = no # keep passed DN ordering
|
||||
|
@ -1,2 +1,2 @@
|
||||
#!/bin/sh
|
||||
indent -l90 -kr -ts8 -i8 -cli8 -cbi0 $1
|
||||
indent -l80 -kr -ts8 -i8 -cli8 -cbi0 $1
|
||||
|
Loading…
Reference in New Issue
Block a user