Capwpa 802.11 radio infos send and accept...

FossilOrigin-Name: 67290a384fba6794570a7f578dcef211456831d1e5255ea959ca57336a7b0129
This commit is contained in:
7u83@mail.ru 2016-03-09 08:09:28 +00:00
parent 51ea7bc45e
commit e5203b81a2
12 changed files with 71 additions and 15 deletions

View File

@ -298,6 +298,8 @@ cw_action_out_t *cw_actionlist_out_add(cw_actionlist_out_t t, struct cw_action_o
} }
*/ */
//printf("Add %d %d\n",a->msg_id,a->elem_id);
struct outelem * o = cw_actionlist_out_get_outelem(t,a->msg_id); struct outelem * o = cw_actionlist_out_get_outelem(t,a->msg_id);

View File

@ -1,12 +1,6 @@
#ifndef __CAPWAP80211_H #ifndef __CAPWAP80211_H
#define __CAPWAP80211_H #define __CAPWAP80211_H
//#include "capwap.h"
//#include <stdint.h>
//#include "bstr.h"
//#include "action.h"
#include "strlist.h" #include "strlist.h"
/** /**
@ -54,8 +48,12 @@ enum radioelems {
CW_ELEM80211_ODFM_CONTROL = 1033, CW_ELEM80211_ODFM_CONTROL = 1033,
/** IEEE 802.11 Supported WLAN Rates */ /** IEEE 802.11 Supported WLAN Rates */
CW_ELEM80211_RATE_SET = 1034, CW_ELEM80211_RATE_SET = 1034,
/** IEEE 802.11 RSNA Error Report From Station */
CW_ELEM80211_RSNA_ERROR_REPORT_FROM_STATION=1035,
/** IEEE 802.11 Station */
CW_ELEM80211_STATION=1036,
/* IEEE 802.11 RSNA Error Report From Station 1035 /*
IEEE 802.11 Station 1036 IEEE 802.11 Station 1036
IEEE 802.11 Station QoS Profile 1037 IEEE 802.11 Station QoS Profile 1037
IEEE 802.11 Station Session Key 1038 IEEE 802.11 Station Session Key 1038
@ -108,7 +106,9 @@ struct cw_wlan {
*/ */
//int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst); #include "action.h"
int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
//extern int cw_register_actions_capwap_80211_wtp(struct cw_actiondef *def); //extern int cw_register_actions_capwap_80211_wtp(struct cw_actiondef *def);

View File

@ -29,6 +29,7 @@ int cw_put_elem_radio_administrative_state(uint8_t *dst,int radio_id,mbag_t radi
int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst) int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
{ {
int l=0; int l=0;
MAVLITER_DEFINE(it,conn->radios); MAVLITER_DEFINE(it,conn->radios);
mavliter_foreach(&it){ mavliter_foreach(&it){

View File

@ -1,11 +1,11 @@
include ../Config.mak
all: all:
$(MAKE) -C capwap $(MAKE) -C capwap
$(MAKE) -C capwap80211 $(MAKE) -C capwap80211
$(MAKE) -C cipwap $(MAKE) -C cipwap
$(MAKE) -C cisco $(MAKE) -C cisco
cc -c modload_ac.c -I../ $(CC) -c modload_ac.c -I../
cc -c modload_wtp.c -I../ $(CC) -c modload_wtp.c -I../
clean: clean:
$(MAKE) -C capwap clean $(MAKE) -C capwap clean

View File

@ -1,7 +1,9 @@
OBJS=\ OBJS=\
mod_capwap80211_ac.o \ mod_capwap80211_ac.o \
capwap80211_actions_ac.o mod_capwap80211_wtp.o \
capwap80211_actions_ac.o \
capwap80211_actions_wtp.o
NAME=libcapwap80211.a NAME=libcapwap80211.a

View File

@ -20,7 +20,7 @@ static cw_action_in_t actions_ac_in[] = {
* Discovery Resquest * Discovery Resquest
*/ */
/* Element Discovery Type */ /* 802.11 Radio Inmformation - Discovery Request */
{ {
.capwap_state = CW_STATE_DISCOVERY, .capwap_state = CW_STATE_DISCOVERY,
.msg_id = CW_MSG_DISCOVERY_REQUEST, .msg_id = CW_MSG_DISCOVERY_REQUEST,
@ -34,6 +34,24 @@ static cw_action_in_t actions_ac_in[] = {
, ,
/* --------------------------------------------------------
* Join Resquest
*/
/* 802.11 Radio Inmformation - Join Request */
{
.capwap_state = CW_STATE_JOIN,
.msg_id = CW_MSG_JOIN_REQUEST,
.elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION,
.item_id = "radio_information",
.start = cw_in_radio_generic,
.mand = 1,
.min_len = 5,
.max_len = 5
}
,
// {0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_REQUEST, // {0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_REQUEST,
// CW_ACTION_IN_80211_WTP_RADIO_INFORMATION, 1} // CW_ACTION_IN_80211_WTP_RADIO_INFORMATION, 1}

View File

@ -2,9 +2,10 @@
#define __MOD_CAPWAP80211_H #define __MOD_CAPWAP80211_H
struct mod_ac *mod_capwap80211_ac(); struct mod_ac *mod_capwap80211_ac();
struct mod_wtp *mod_capwap2011_wtp(); struct mod_wtp *mod_capwap80211_wtp();
extern int capwap80211_register_actions_ac(struct cw_actiondef *def); extern int capwap80211_register_actions_ac(struct cw_actiondef *def);
extern int capwap80211_register_actions_wtp(struct cw_actiondef *def);
#endif #endif

View File

@ -4,3 +4,14 @@
struct mod_ac * modload_ac(const char *name); struct mod_ac * modload_ac(const char *name);
struct mod_wtp * modload_wtp(const char *name); struct mod_wtp * modload_wtp(const char *name);
#include "cipwap/mod_cipwap.h"
#include "capwap/mod_capwap.h"
#include "cisco/mod_cisco.h"
#include "capwap80211/mod_capwap80211.h"
#define MODS_AC { mod_capwap_ac,mod_cipwap_ac, mod_cisco_ac, mod_capwap80211_ac, NULL }
#define MODS_WTP { mod_capwap_wtp,mod_capwap80211_wtp, NULL }

View File

@ -1,3 +1,6 @@
#include "modload.h"
/*
#include "../cw/mod.h" #include "../cw/mod.h"
@ -8,6 +11,8 @@
#define MODS_AC { mod_capwap_ac,mod_cipwap_ac, mod_cisco_ac, mod_capwap80211_ac, NULL } #define MODS_AC { mod_capwap_ac,mod_cipwap_ac, mod_cisco_ac, mod_capwap80211_ac, NULL }
*/
struct mod_ac *(*mods_ac[])() = MODS_AC; struct mod_ac *(*mods_ac[])() = MODS_AC;

View File

@ -1,3 +1,4 @@
/*
#include "../cw/mod.h" #include "../cw/mod.h"
@ -7,6 +8,9 @@
#define MODS_WTP { mod_capwap_wtp, NULL } #define MODS_WTP { mod_capwap_wtp, NULL }
*/
#include "modload.h"
struct mod_wtp *(*mods_wtp[])() = MODS_WTP; struct mod_wtp *(*mods_wtp[])() = MODS_WTP;

View File

@ -26,6 +26,7 @@ LDFLAGS += -L../contrib/jsmn -L../../src/lib/$(ARCH)
LIBS+=-lcapwap LIBS+=-lcapwap
LIBS+=-lcapwap80211
LIBS+=-lcisco LIBS+=-lcisco
LIBS+=-lcw LIBS+=-lcw
LIBS+=-lnl-3 LIBS+=-lnl-3

View File

@ -103,8 +103,19 @@ int main()
printf("Can't load mod capwap\n"); printf("Can't load mod capwap\n");
exit(0); exit(0);
} }
conn->detected = 1;
mod->register_actions(&capwap_actions); mod->register_actions(&capwap_actions);
mod = modload_wtp("capwap80211");
if (!mod) {
printf("Can't load mod capwap80211\n");
exit(0);
}
printf("add capwap80211\n");
int rc = mod->register_actions(&capwap_actions);
printf("Out reg = %d\n",rc);
conn->detected = 1;