Getting wtp connected to cisco ac.

FossilOrigin-Name: 57a7a02bdc61b2803a63b3047e2f383440422a5b2cc73714d058d4942930eab0
This commit is contained in:
7u83@mail.ru 2016-03-12 02:57:43 +00:00
parent 64ae384018
commit dcf2b5da4a
9 changed files with 26 additions and 10 deletions

View File

@ -152,6 +152,7 @@ static inline int lw_put_elem_hdr(uint8_t *dst,uint8_t type,uint16_t len)
extern uint16_t lw_checksum(uint8_t *d,int len); extern uint16_t lw_checksum(uint8_t *d,int len);
extern int lw_put_sockaddr(uint8_t *dst, struct sockaddr_storage *addr);
/** /**

View File

@ -262,7 +262,6 @@ static inline int lw_put_elem_hdr(uint8_t *dst,uint8_t type,uint16_t len)
/**@}*/ /**@}*/
extern int lw_put_sockaddr(uint8_t *dst, struct sockaddr_storage *addr);
extern int lw_put_cisco_path_mtu(uint8_t *dst, uint16_t max, uint16_t padding); extern int lw_put_cisco_path_mtu(uint8_t *dst, uint16_t max, uint16_t padding);

View File

@ -3,8 +3,6 @@
#include "cw/capwap_items.h" #include "cw/capwap_items.h"
#include "cw/cw.h" #include "cw/cw.h"
#include "cw/capwap.h"
static int cw_put_encryption_subelems(uint8_t *dst,int capwap_mode) static int cw_put_encryption_subelems(uint8_t *dst,int capwap_mode)
{ {
int n=2; int n=2;
@ -32,8 +30,8 @@ int capwap_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a, uint8_
uint8_t *d = dst+4; uint8_t *d = dst+4;
int n =conn->radios->count; //int n =conn->radios->count;
printf("radio count %d\n",n); //printf("radio count %d\n",n);
d+=cw_put_byte(d,conn->radios->count); //max radios d+=cw_put_byte(d,conn->radios->count); //max radios
d+=cw_put_byte(d,2); //radios in use d+=cw_put_byte(d,2); //radios in use

View File

@ -1,10 +1,13 @@
OBJS=\ OBJS=\
mod_cisco_ac.o \ mod_cisco_ac.o \
mod_cisco_wtp.o \
cisco_actions_ac.o \ cisco_actions_ac.o \
cisco_actions_wtp.o \
cisco_out_ap_timesync.o \ cisco_out_ap_timesync.o \
cisco_in_wtp_descriptor.o \ cisco_in_wtp_descriptor.o \
cisco_out_ac_descriptor.o cisco_out_ac_descriptor.o \
cisco_out_wtp_descriptor.o
NAME=libcisco.a NAME=libcisco.a

View File

@ -8,6 +8,8 @@ extern int cisco_out_ap_timesync(struct conn *conn,struct cw_action_out * a,uint
extern int cisco_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data, extern int cisco_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from); int len, struct sockaddr *from);
extern int cisco_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *dst) ; extern int cisco_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *dst) ;
extern int cisco_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
#endif #endif

View File

@ -17,7 +17,6 @@
*/ */
#include "cw/capwap.h"
#include "cw/cipwap.h" #include "cw/cipwap.h"
#include "cw/action.h" #include "cw/action.h"
@ -30,6 +29,7 @@
#include "mod_cisco.h" #include "mod_cisco.h"
#include "cisco.h" #include "cisco.h"
static cw_action_in_t actions_in[] = { static cw_action_in_t actions_in[] = {
@ -43,7 +43,16 @@ static cw_action_in_t actions_in[] = {
static cw_action_out_t actions_out[]={ static cw_action_out_t actions_out[]={
/* WTP Descriptor */
{
.msg_id = CW_MSG_DISCOVERY_REQUEST,
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
.item_id = CW_ITEM_WTP_DESCRIPTOR,
.out = cisco_out_wtp_descriptor,
.mand = 1
}
,
{0,0} {0,0}

View File

@ -2,6 +2,7 @@
#define __MOD_CISCO_H #define __MOD_CISCO_H
struct mod_ac * mod_cisco_ac(); struct mod_ac * mod_cisco_ac();
struct mod_ac * mod_cisco_wtp();
#endif #endif

View File

@ -12,6 +12,6 @@ struct mod_wtp * modload_wtp(const char *name);
#include "capwap80211/mod_capwap80211.h" #include "capwap80211/mod_capwap80211.h"
#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 }
#define MODS_WTP { mod_capwap_wtp,mod_capwap80211_wtp, NULL } #define MODS_WTP { mod_capwap_wtp,mod_cisco_wtp, mod_capwap80211_wtp, NULL }

View File

@ -138,14 +138,17 @@ int main()
// cw_register_actions_cipwap_wtp(&capwap_actions); // cw_register_actions_cipwap_wtp(&capwap_actions);
// cw_register_actions_capwap_80211_wtp(&capwap_actions); // cw_register_actions_capwap_80211_wtp(&capwap_actions);
//
#define CWMOD "cisco"
#define CWBIND "cisco"
struct mod_wtp *mod = modload_wtp("capwap"); struct mod_wtp *mod = modload_wtp(CWMOD);
if (!mod) { if (!mod) {
printf("Can't load mod capwap\n"); printf("Can't load mod capwap\n");
exit(0); exit(0);
} }
mod->register_actions(&capwap_actions,MOD_MODE_CAPWAP); mod->register_actions(&capwap_actions,MOD_MODE_CAPWAP);
mod = modload_wtp("capwap80211"); mod = modload_wtp(CWBIND);
if (!mod) { if (!mod) {
printf("Can't load mod capwap80211\n"); printf("Can't load mod capwap80211\n");
exit(0); exit(0);