Cisco works with capwap
FossilOrigin-Name: 9bc1ee1fec8e7ebc2e64ca2fd70e2d47f47e6cf218b8207572f6742b4d3b9dbe
This commit is contained in:
parent
d53346d250
commit
3ee8c18911
@ -35,6 +35,7 @@
|
||||
<File Name="src/mod/cisco/cisco_out_ap_timesync.c"/>
|
||||
<File Name="src/mod/cisco/mod_cisco_wtp.c"/>
|
||||
<File Name="src/mod/cisco/cisco80211.c"/>
|
||||
<File Name="src/mod/cisco/mod_cisco.h"/>
|
||||
</VirtualDirectory>
|
||||
</VirtualDirectory>
|
||||
</VirtualDirectory>
|
||||
|
@ -275,19 +275,11 @@ printf("We have loaded the message set\n");
|
||||
struct cw_MsgData search;
|
||||
search.type = cw_get_msg_id(msg_ptr);
|
||||
struct cw_MsgData * message;
|
||||
/* Search for message combination */
|
||||
message = mavl_get(conn->msgset->messages,&search);
|
||||
|
||||
printf("Got Message %d (%s)\n", message->type, message->name);
|
||||
exit(0);
|
||||
/*
|
||||
as.capwap_state = conn->capwap_state;
|
||||
as.msg_id = cw_get_msg_id(msg_ptr);
|
||||
as.vendor_id = 0;
|
||||
as.elem_id = 0;
|
||||
as.proto = 0;
|
||||
*/
|
||||
|
||||
/* Search for state/message combination */
|
||||
|
||||
// afm = cw_actionlist_in_get(conn->actions->in, &as);
|
||||
|
||||
if (!afm) {
|
||||
|
@ -132,7 +132,7 @@ static cw_msgdef_t messages[] = {
|
||||
|
||||
|
||||
|
||||
struct cw_MsgSet * capwap_register_msg_set(struct cw_MsgSet * set, int mode){
|
||||
struct cw_MsgSet * cisco_register_msg_set(struct cw_MsgSet * set, int mode){
|
||||
if (mode != CW_MOD_MODE_CAPWAP)
|
||||
return NULL;
|
||||
cw_msgset_add(set,messages);
|
||||
|
@ -51,5 +51,5 @@ int cisco_out_wtp_operational_state(struct conn *conn, struct cw_action_out *a,
|
||||
int cisco_out_radio_operational_state(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
||||
int cisco_in_radio_operational_state(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
int len, struct sockaddr *from);
|
||||
|
||||
struct cw_MsgSet * cisco_register_msg_set(struct cw_MsgSet * set, int mode);
|
||||
#endif
|
||||
|
@ -41,6 +41,62 @@
|
||||
#include "include/cipwap_items.h"
|
||||
|
||||
|
||||
|
||||
static cw_elem_handler_t _DISCOVERY_TYPE = {
|
||||
.id = CAPWAP_ELEM_DISCOVERY_TYPE,
|
||||
.name = "WTP Frame Tunnel Mode",
|
||||
// .start = cw_in_generic2,
|
||||
// .item_id = CW_ITEM_WTP_FRAME_TUNNEL_MODE,
|
||||
.min_len = 1,
|
||||
.max_len = 1
|
||||
};
|
||||
|
||||
|
||||
static cw_msgdef_t messages[] = {
|
||||
|
||||
/* Discovery Request Message*/
|
||||
{
|
||||
.name = "Discovery Request Cisco",
|
||||
.type = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.states = (int[]){CAPWAP_STATE_DISCOVERY,0},
|
||||
.elements = (cw_msgelemprops_t []){
|
||||
{&_DISCOVERY_TYPE,1},
|
||||
{0,0},
|
||||
}
|
||||
},
|
||||
/* Discovery Request Response */
|
||||
{
|
||||
.name = "Discovery Response",
|
||||
.type = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.states = (int[]){CAPWAP_STATE_DISCOVERY,0},
|
||||
.elements = (cw_msgelemprops_t[]){
|
||||
{0,0},
|
||||
}
|
||||
},
|
||||
{0,0,0,0}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static cw_action_in_t actions_in[] = {
|
||||
|
||||
|
||||
@ -493,6 +549,15 @@ static cw_action_out_t actions_out[]={
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct cw_MsgSet * cisco_register_msg_set(struct cw_MsgSet * set, int mode){
|
||||
if (mode != CW_MOD_MODE_CAPWAP)
|
||||
return NULL;
|
||||
cw_msgset_add(set,messages);
|
||||
return set;
|
||||
}
|
||||
|
||||
|
||||
static cw_action_in_t actions80211_in[] = {
|
||||
/* --------------------------------------------------------
|
||||
* Discovery Resquest
|
||||
|
@ -4,5 +4,6 @@
|
||||
struct cw_Mod * mod_cisco_ac();
|
||||
struct cw_Mod * mod_cisco_wtp();
|
||||
|
||||
struct cw_MsgSet * cisco_register_msg_set(struct cw_MsgSet * set, int mode);
|
||||
|
||||
#endif
|
||||
|
@ -21,21 +21,21 @@ extern int cisco_register_actions_ac(struct cw_actiondef *def);
|
||||
mbag_t cisco_config = NULL;
|
||||
|
||||
|
||||
static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
static struct cw_MsgSet * register_messages(struct cw_MsgSet *set, int mode)
|
||||
{
|
||||
switch (mode) {
|
||||
case CW_MOD_MODE_CAPWAP:
|
||||
{
|
||||
|
||||
struct cw_Mod *cmod = NULL; //modload_ac("cipwap");
|
||||
struct cw_Mod *cmod = cw_mod_load("capwap");// NULL; //modload_ac("cipwap");
|
||||
if (!cmod) {
|
||||
cw_log(LOG_ERR,
|
||||
"Can't initialize mod_cisco, failed to load base mod mod_cipwap");
|
||||
"Can't initialize mod_cisco, failed to load base module mod_cipwap");
|
||||
return 1;
|
||||
}
|
||||
cmod->register_actions(actions, CW_MOD_MODE_CAPWAP);
|
||||
int rc = cisco_register_actions_ac(actions);
|
||||
cw_dbg(DBG_INFO, "Initialized mod_cisco with %d actions", rc);
|
||||
cmod->register_messages(set, CW_MOD_MODE_CAPWAP);
|
||||
cisco_register_msg_set(set,CW_MOD_MODE_CAPWAP);
|
||||
cw_dbg(DBG_INFO, "Initialized mod_cisco with %d messafe", 7);
|
||||
return 0;
|
||||
}
|
||||
case MOD_MODE_BINDINGS:
|
||||
@ -46,9 +46,9 @@ static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
"Can't initialize mod_cisco, failed to load base mod mod_capwap80211");
|
||||
return 1;
|
||||
}
|
||||
cmod->register_actions(actions, MOD_MODE_BINDINGS);
|
||||
int rc = cisco_register_actions80211_ac(actions);
|
||||
cw_dbg(DBG_INFO, "Initialized mod_cisco 80211 with %d actions", rc);
|
||||
cmod->register_messages(set, MOD_MODE_BINDINGS);
|
||||
int rc = cisco_register_actions80211_ac(set);
|
||||
cw_dbg(DBG_INFO, "Initialized mod_cisco 80211 with %d actions", 12);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ static struct cw_Mod capwap_ac = {
|
||||
.init = init,
|
||||
.detect = detect,
|
||||
// .register_actions = register_actions,
|
||||
|
||||
.register_messages = register_messages
|
||||
};
|
||||
|
||||
struct cw_Mod *mod_cisco_ac()
|
||||
|
Loading…
Reference in New Issue
Block a user