diff --git a/ac.project b/ac.project
index 873b1a98..603fab39 100644
--- a/ac.project
+++ b/ac.project
@@ -21,7 +21,6 @@
-
diff --git a/mod_capwap.project b/mod_capwap.project
index ff3269b8..3d95263b 100644
--- a/mod_capwap.project
+++ b/mod_capwap.project
@@ -17,6 +17,7 @@
+
diff --git a/src/cw/capwap.h b/src/cw/capwap.h
index 4a7fafb7..07ba9e48 100644
--- a/src/cw/capwap.h
+++ b/src/cw/capwap.h
@@ -242,7 +242,11 @@
#define CW_ELEM_RETURNED_MESSAGE_ELEMENT 34
#define CW_ELEM_SESSION_ID 35
#define CW_ELEM_STATISTICS_TIMER 36
-#define CW_ELEM_VENDOR_SPECIFIC_PAYLOAD 37
+/**
+ * The Vendor Specific Payload allows tronasport of
+ * vebdor defined data.*/
+#define CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD 37
+
#define CAPWAP_ELEM_WTP_BOARD_DATA 38
/**
* The WTP Descriptor message element conteins information
diff --git a/src/cw/capwap_strings_elem.c b/src/cw/capwap_strings_elem.c
index 81395291..1525585a 100644
--- a/src/cw/capwap_strings_elem.c
+++ b/src/cw/capwap_strings_elem.c
@@ -43,7 +43,7 @@ struct cw_strlist_elem capwap_strings_elem[] = {
{CW_ELEM_RETURNED_MESSAGE_ELEMENT, "Returned Message Element"},
{CW_ELEM_SESSION_ID, "Session ID"},
{CW_ELEM_STATISTICS_TIMER, "Statistics Timer"},
- {CW_ELEM_VENDOR_SPECIFIC_PAYLOAD, "Vendor Specific Payload"},
+ {CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, "Vendor Specific Payload"},
{CAPWAP_ELEM_WTP_BOARD_DATA, "WTP Board Data"},
{CAPWAP_ELEM_WTP_DESCRIPTOR, "WTP Descriptor"},
{CW_ELEM_WTP_FALLBACK, "WTP Fallback"},
diff --git a/src/cw/cw.h b/src/cw/cw.h
index d63ec945..ea13437c 100644
--- a/src/cw/cw.h
+++ b/src/cw/cw.h
@@ -104,36 +104,34 @@
-typedef struct{
- int proto;
- int vendor;
- int id;
- int mand;
-}cw_messagedef_t;
+
+
typedef struct {
- int type;
- int * states;
- cw_messagedef_t * elements;
const char * name;
-}cw_message_t;
-
-typedef struct {
int proto;
int vendor;
int id;
-
int min_len;
int max_len;
- const char * name;
-}cw_message_element_t;
+}cw_msgelemdef_t;
typedef struct {
mavl_t messages;
mavl_t all_elems;
}cw_message_set_t;
+typedef struct{
+ cw_msgelemdef_t * elem;
+ int mand;
+}cw_msgelemprops_t;
+typedef struct {
+ int type;
+ int * states;
+ cw_msgelemprops_t * elements;
+ const char * name;
+}cw_msgdef_t;
/**
* Get length wireless specific data
@@ -390,7 +388,7 @@ static inline int cw_put_elem_vendor_hdr(uint8_t * dst, uint32_t vendorid,
uint16_t elemid, uint16_t len)
{
- cw_put_elem_hdr(dst, CW_ELEM_VENDOR_SPECIFIC_PAYLOAD, len + 6);
+ cw_put_elem_hdr(dst, CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, len + 6);
cw_put_dword(dst + 4, vendorid);
cw_put_word(dst + 8, elemid);
return 10;
diff --git a/src/cw/cw_addelem_vendor_specific_payload.c b/src/cw/cw_addelem_vendor_specific_payload.c
index a21d8546..a6ea93e8 100644
--- a/src/cw/cw_addelem_vendor_specific_payload.c
+++ b/src/cw/cw_addelem_vendor_specific_payload.c
@@ -42,7 +42,7 @@ int cw_addelem_vendor_specific_payload(uint8_t * dst, uint32_t vendor_id,
d += cw_put_data(d, data, len);
int l = d - dst;
- cw_put_elem_hdr(dst, CW_ELEM_VENDOR_SPECIFIC_PAYLOAD, l - 4);
+ cw_put_elem_hdr(dst, CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, l - 4);
return l;
}
diff --git a/src/cw/cw_put_msg.c b/src/cw/cw_put_msg.c
index fcff00ff..3dd2b8df 100644
--- a/src/cw/cw_put_msg.c
+++ b/src/cw/cw_put_msg.c
@@ -53,7 +53,7 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
uint8_t *dst = msgptr+8;
- mlist_t *m = cw_actionlist_out_get(conn->actions->out,cw_get_msg_type(msgptr));
+ mlist_t m = cw_actionlist_out_get(conn->actions->out,cw_get_msg_type(msgptr));
if (!m){
cw_log(LOG_ERR,"Error: Can't create message of type %d (%s) - no definition found.",
@@ -69,7 +69,7 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
int len = 0;
- for (e=m->list; e; e=e->next) {
+ for (e=m->first; e; e=e->next) {
cw_action_out_t *ae=(cw_action_out_t*)e->data;
//printf("Put %d %i %s\n",ae->msg_id,ae->elem_id,ae->item_id);
diff --git a/src/cw/dbg.c b/src/cw/dbg.c
index a4141faf..b675f48f 100644
--- a/src/cw/dbg.c
+++ b/src/cw/dbg.c
@@ -549,7 +549,7 @@ void cw_dbg_elem_colored(int level, struct conn *conn, int msg, int msgelem,
char vendor_details[265];
*vendor_details = 0;
- if (msgelem == CW_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
+ if (msgelem == CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
uint32_t vendor_id = ntohl(*((uint32_t *) msgbuf));
int type = ntohs(*((uint16_t *) (msgbuf + 4)));
cw_format_vendor(vendor_details, vendor_id, type, msgbuf);
diff --git a/src/cw/message_set.c b/src/cw/message_set.c
index a30906b4..8fb20a37 100644
--- a/src/cw/message_set.c
+++ b/src/cw/message_set.c
@@ -1,6 +1,7 @@
#include "cw.h"
#include "mavl.h"
+#include "cw/dbg.h"
#include "message_set.h"
@@ -12,9 +13,9 @@ typedef struct {
mlist_t elements_list;
}message2_t;
-static inline int cmp_cw_message_element(const void *elem1, const void *elem2){
- cw_message_element_t * e1 = (cw_message_element_t*)elem1;
- cw_message_element_t * e2 = (cw_message_element_t*)elem2;
+static inline int cmp_cw_msgelemprops(const void *elem1, const void *elem2){
+ cw_msgelemdef_t * e1 = ((cw_msgelemprops_t*)elem1)->elem;
+ cw_msgelemdef_t * e2 = ((cw_msgelemprops_t*)elem2)->elem;
int r;
r = e1->id - e2->id;
if (r!=0)
@@ -58,7 +59,7 @@ cw_message_set_t * cw_message_set_create(){
memset(set,0,sizeof(cw_message_set_t));
/* create mavl for all_elems */
- set->all_elems = mavl_create(cmp_cw_message_element,NULL);
+ set->all_elems = mavl_create(cmp_cw_msgelemprops,NULL);
if (set->all_elems==NULL){
cw_message_set_destroy(set);
return NULL;
@@ -76,25 +77,85 @@ cw_message_set_t * cw_message_set_create(){
}
+static void update_message(message2_t * msg, cw_msgdef_t * src, cw_message_set_t * set){
-void cw_message_set_add(cw_message_set_t * set,
- cw_message_t messages[],
- cw_message_element_t elements[]){
+ cw_msgelemprops_t *md;
- cw_message_element_t * e;
- for (e=elements; e->id!=0; e++){
- mavl_replace(set->all_elems, e);
- }
- cw_message_t * m;
- for (m=messages; m->type !=0; m++){
- printf("MESS: %d %s",m->type, m->name);
+
+ for (md = src->elements; md->elem!=0; md++){
+ cw_dbg(DBG_INFO," add element %d - %s, %d",md->elem->id, md->elem->name, md->mand);
+ mavl_add(msg->elements_tree,md);
+ mavl_add(set->all_elems,md);
+ mlist_append(msg->elements_list,md);
+ mlist_replace(msg->elements_list,NULL,md);
}
}
-cw_message_element_t * cw_message_set_find_element(
+
+
+void cw_message_set_add(cw_message_set_t * set,
+ cw_msgdef_t messages[]){
+
+ cw_msgdef_t * m;
+ for (m=messages; m->type !=0; m++){
+ message2_t search, *next;
+
+ search.type = m->type;
+
+ cw_dbg(DBG_INFO,"Add message: Type:%d - %s",m->type,m->name);
+
+ next = mavl_find(set->messages,&search);
+
+ /** message not already in memory,
+ * create a new one */
+ if (next == NULL){
+ next = malloc (sizeof(message2_t));
+ if (next == NULL)
+ return;
+ next->elements_tree = mavl_create(cmp_cw_msgelemprops,NULL);
+ if (next->elements_tree==NULL){
+ free(next);
+ return;
+ }
+ next->elements_list = mlist_create(cmp_cw_msgelemprops);
+ if (next->elements_list == NULL){
+ mavl_destroy(next->elements_tree);
+ free(next);
+ return;
+ }
+ next->type=m->type;
+ mavl_add(set->messages,next);
+
+ }
+ /* massage is alreaddy in there */
+ if (m->name)
+ next->name=m->name;
+ if (m->states)
+ next->states=m->states;
+
+ update_message(next,m, set);
+
+ }
+
+}
+
+cw_msgelemdef_t * cw_message_set_find_element(
cw_message_set_t * set,
- cw_message_element_t * element){
+ cw_msgelemdef_t * element){
return mavl_find(set->all_elems,element);
+}
+
+
+mlist_t cw_msgset_get_msg(cw_message_set_t * set, int type){
+ message2_t search;
+ search.type = type;
+ message2_t * result = mavl_find(set->messages,&search);
+ if (!result){
+ printf ("no result\n");
+ return NULL;
+
+ }
+ return result->elements_list;
}
\ No newline at end of file
diff --git a/src/cw/message_set.h b/src/cw/message_set.h
index 7651d84a..39ef9174 100644
--- a/src/cw/message_set.h
+++ b/src/cw/message_set.h
@@ -6,6 +6,6 @@
extern void cw_message_set_destroy(cw_message_set_t * set);
extern cw_message_set_t * cw_message_set_create();
extern void cw_message_set_add(cw_message_set_t * set,
- cw_message_t messages[],
- cw_message_element_t elements[]);
+ cw_msgdef_t messages[]);
+mlist_t cw_msgset_get_msg(cw_message_set_t * set, int type);
#endif
\ No newline at end of file
diff --git a/src/cw/mlist.c b/src/cw/mlist.c
index 7b10b905..9bf73ee9 100644
--- a/src/cw/mlist.c
+++ b/src/cw/mlist.c
@@ -1,22 +1,22 @@
#include
#include
-
#include "mlist.h"
-mlist_t *mlist_create(int (*cmp) (void *v1, void *v2))
+mlist_t mlist_create(int (*cmp) (const void *v1, const void *v2))
{
- mlist_t *l = malloc(sizeof(mlist_t));
+ struct mlist * l = malloc(sizeof(struct mlist));
if (!l)
return NULL;
- memset(l, 0, sizeof(mlist_t));
+ memset(l, 0, sizeof(struct mlist));
l->cmp = cmp;
return l;
}
-struct mlist_elem *mlist_append(mlist_t * l, void *data)
+struct mlist_elem * mlist_append(mlist_t l, void *data)
{
- struct mlist_elem **n = &l->list;
+
+ struct mlist_elem **n = &l->first;
while (*n != NULL)
n = &(*n)->next;
*n = malloc(sizeof(struct mlist_elem));
@@ -29,13 +29,13 @@ struct mlist_elem *mlist_append(mlist_t * l, void *data)
return *n;
}
-struct mlist_elem *mlist_find(mlist_t * l, struct mlist_elem *start, void *data)
+struct mlist_elem *mlist_find(mlist_t l, struct mlist_elem *start, void *data)
{
struct mlist_elem *e;
if (start)
e = start;
else
- e = l->list;
+ e = l->first;
while (e) {
if (l->cmp(e->data, data) == 0)
@@ -47,13 +47,13 @@ struct mlist_elem *mlist_find(mlist_t * l, struct mlist_elem *start, void *data)
}
-struct mlist_elem *mlist_replace(mlist_t *l, struct mlist_elem *start, void *data)
+struct mlist_elem * mlist_replace(mlist_t l, struct mlist_elem *start, void *data)
{
struct mlist_elem *e;
if (start)
e = start;
else
- e = l->list;
+ e = l->first;
struct mlist_elem * f = mlist_find(l,e,data);
if (!f)
diff --git a/src/cw/mlist.h b/src/cw/mlist.h
index 6c4ab97a..7d1fe196 100644
--- a/src/cw/mlist.h
+++ b/src/cw/mlist.h
@@ -46,22 +46,23 @@ struct mlist_elem {
struct mlist {
void *data;
- int (*cmp) (void *d1, void *d2);
- struct mlist_elem *list;
+ int (*cmp) (const void *d1, const void *d2);
+ struct mlist_elem *first;
};
-typedef struct mlist mlist_t;
+typedef struct mlist * mlist_t;
/**
* defgroup MLIST_FUNCTIONS
* @{
*/
-extern mlist_t *mlist_create(int (*cmp) (void *v1, void *v2));
-extern struct mlist_elem *mlist_append(mlist_t * l, void *data);
-extern struct mlist_elem *mlist_find(mlist_t * l, struct mlist_elem *start, void *data);
-extern struct mlist_elem *mlist_replace(mlist_t *l, struct mlist_elem *start, void *data);
+extern mlist_t mlist_create(int (*cmp) (const void *v1, const void *v2));
+extern struct mlist_elem *mlist_append(mlist_t l, void *data);
+extern struct mlist_elem *mlist_find(mlist_t l, struct mlist_elem *start, void *data);
+extern struct mlist_elem *mlist_replace(mlist_t l, struct mlist_elem *start, void *data);
+#define mlist_add mlist_append
/**
* @}
*/
@@ -70,7 +71,7 @@ extern struct mlist_elem *mlist_replace(mlist_t *l, struct mlist_elem *start, vo
#define mlist_foreach(i,l)\
- for (i=l->data; i; i=i->next)
+ for (i=l->first; i; i=i->next)
diff --git a/src/mod/capwap/capwap_actions_ac.c b/src/mod/capwap/capwap_actions_ac.c
index 3dec405d..0212421a 100644
--- a/src/mod/capwap/capwap_actions_ac.c
+++ b/src/mod/capwap/capwap_actions_ac.c
@@ -29,7 +29,7 @@
#include "mod_capwap.h"
-static cw_message_element_t _DISCOVERY_TYPE = {
+static cw_msgelemdef_t _DISCOVERY_TYPE = {
.name = "Discovery Type",
.id = CAPWAP_ELEM_DISCOVERY_TYPE,
//.start = cw_in_generic2,
@@ -37,21 +37,21 @@ static cw_message_element_t _DISCOVERY_TYPE = {
.min_len = 1,
.max_len = 1
};
-static cw_message_element_t _WTP_BOARD_DATA = {
+static cw_msgelemdef_t _WTP_BOARD_DATA = {
.name = "WTP Board Data",
.id = CAPWAP_ELEM_WTP_BOARD_DATA,
// .start = cw_in_wtp_board_data,
// .item_id = CW_ITEM_WTP_BOARD_DATA,
};
-static cw_message_element_t _WTP_DESCRIPTOR = {
+static cw_msgelemdef_t _WTP_DESCRIPTOR = {
.id = CAPWAP_ELEM_WTP_DESCRIPTOR,
.name = "WTP Descriptor",
//.start = capwap_in_wtp_descriptor,
//.item_id = "wtp_descriptor",
};
-static cw_message_element_t _WTP_FRAME_TUNNEL_MODE = {
+static cw_msgelemdef_t _WTP_FRAME_TUNNEL_MODE = {
.id = CAPWAP_ELEM_WTP_FRAME_TUNNEL_MODE,
.name = "WTP Frame Tunnel Mode",
// .start = cw_in_generic2,
@@ -60,7 +60,7 @@ static cw_message_element_t _WTP_FRAME_TUNNEL_MODE = {
.max_len = 1
};
-static cw_message_element_t _WTP_MAC_TYPE = {
+static cw_msgelemdef_t _WTP_MAC_TYPE = {
.id = CAPWAP_ELEM_WTP_MAC_TYPE,
.name = "WTP Mac Type",
// .start = cw_in_generic2,
@@ -70,13 +70,13 @@ static cw_message_element_t _WTP_MAC_TYPE = {
};
/* MTU Discovery Padding */
-static cw_message_element_t _MTU_DISCOVERY_PADDING = {
+static cw_msgelemdef_t _MTU_DISCOVERY_PADDING = {
.id = CW_ELEM_MTU_DISCOVERY_PADDING,
.name = "MTU Discovery Padding"
// .start = cw_in_mtu_discovery_padding,
};
-static cw_message_element_t _VENDOR_SPECIFIC_PAYLOAD = {
+static cw_msgelemdef_t _VENDOR_SPECIFIC_PAYLOAD = {
.name = "Vendor Specific Payload",
.id = CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD,
@@ -85,7 +85,7 @@ static cw_message_element_t _VENDOR_SPECIFIC_PAYLOAD = {
};
/* AC Descriptor - Discovery Response */
-static cw_message_element_t _AC_DESCRIPTOR = {
+static cw_msgelemdef_t _AC_DESCRIPTOR = {
.name = "AC Descriptor",
.id = CAPWAP_ELEM_AC_DESCRIPTOR,
//.item_id = CW_ITEM_AC_DESCRIPTOR,
@@ -96,14 +96,14 @@ static cw_message_element_t _AC_DESCRIPTOR = {
-static cw_message_t messages[] = {
+static cw_msgdef_t messages[] = {
/* Discovery Request Message*/
{
.name = "Discovery Request",
.type = CAPWAP_MSG_DISCOVERY_REQUEST,
.states = (int[]){CAPWAP_STATE_DISCOVERY,0},
- .elements = (cw_messagedef_t []){
+ .elements = (cw_msgelemprops_t []){
{&_DISCOVERY_TYPE,1},
{&_WTP_BOARD_DATA,1},
{&_WTP_DESCRIPTOR,1},
@@ -119,7 +119,7 @@ static cw_message_t messages[] = {
.name = "Discovery Response",
.type = CAPWAP_MSG_DISCOVERY_RESPONSE,
.states = (int[]){CAPWAP_STATE_DISCOVERY,0},
- .elements = (cw_messagedef_t[]){
+ .elements = (cw_msgelemprops_t[]){
{&_AC_DESCRIPTOR,1},
{0,0},
}
@@ -137,22 +137,40 @@ void test_sets(){
cw_message_set_add(set,messages);
- cw_message_element_t el, *result;
+ cw_msgelemdef_t el;
memset(&el,0,sizeof(el));
el.id=CAPWAP_ELEM_DISCOVERY_TYPE;
- result = mavl_find(set->all_elems,&el);
+ cw_msgelemprops_t search, *result;;
+ search.elem = ⪙
+
+
+ result = mavl_find(set->all_elems,&search);
if (result!=NULL){
- printf("Found: %d %s\n",
- result->id,
- result->name
+ printf("Found: %d %s %d\n",
+ result->elem->id,
+ result->elem->name,
+ result->mand
);
}
else{
printf("not found\n");
}
+
+ mlist_t m;
+ m = cw_msgset_get_msg(set,CAPWAP_MSG_DISCOVERY_REQUEST);
+ printf("Hey: %p\n",m);
+ struct mlist_elem * i;
+ mlist_foreach(i,m){
+ cw_msgelemprops_t * le = i->data;
+ printf("Element: %d %s\n",le->elem->id, le->elem->name, le->mand);
+ }
+
+
+
+
}
diff --git a/src/mod/capwap/capwap_actions_wtp.c b/src/mod/capwap/capwap_actions_wtp.c
index c1ea0f7d..be560418 100644
--- a/src/mod/capwap/capwap_actions_wtp.c
+++ b/src/mod/capwap/capwap_actions_wtp.c
@@ -73,7 +73,7 @@ static cw_action_in_t actions_in[] = {
{
.capwap_state = CAPWAP_STATE_DISCOVERY,
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
- .elem_id = CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
+ .elem_id = CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD,
.start = cw_in_vendor_specific_payload
}
,
@@ -299,7 +299,7 @@ static cw_action_in_t actions_in[] = {
{
.capwap_state = CW_STATE_CONFIGURE,
.msg_id = CW_MSG_CONFIGURATION_STATUS_RESPONSE,
- .elem_id = CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
+ .elem_id = CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD,
.start = cw_in_vendor_specific_payload
}
,
@@ -370,7 +370,7 @@ static cw_action_in_t actions_in[] = {
{
.capwap_state = CW_STATE_RUN,
.msg_id = CW_MSG_ECHO_RESPONSE,
- .elem_id = CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
+ .elem_id = CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD,
.start = cw_in_vendor_specific_payload
}
,
@@ -435,7 +435,7 @@ static cw_action_in_t actions_in[] = {
{
.capwap_state = CW_STATE_RUN,
.msg_id = CW_MSG_CONFIGURATION_UPDATE_REQUEST,
- .elem_id = CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
+ .elem_id = CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD,
.start = cw_in_vendor_specific_payload
}
,
diff --git a/src/mod/cisco/mod_cisco_ac.c b/src/mod/cisco/mod_cisco_ac.c
index 798117de..54608193 100644
--- a/src/mod/cisco/mod_cisco_ac.c
+++ b/src/mod/cisco/mod_cisco_ac.c
@@ -140,7 +140,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
* specific payload Cisco identifier */
cw_foreach_elem(elem, elems_ptr, elems_len) {
int id = cw_get_elem_id(elem);
- if (id == CW_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
+ if (id == CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
uint32_t vendor_id = cw_get_dword(cw_get_elem_data(elem));
if (vendor_id == CW_VENDOR_ID_CISCO) {
// conn->actions = &actions;
diff --git a/src/mod/cisco/mod_cisco_wtp.c b/src/mod/cisco/mod_cisco_wtp.c
index 7965af8d..aded4bf1 100644
--- a/src/mod/cisco/mod_cisco_wtp.c
+++ b/src/mod/cisco/mod_cisco_wtp.c
@@ -127,7 +127,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
* specific payload Cisco identifier */
cw_foreach_elem(elem, elems_ptr, elems_len) {
int id = cw_get_elem_id(elem);
- if (id == CW_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
+ if (id == CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
uint32_t vendor_id = cw_get_dword(cw_get_elem_data(elem));
if (vendor_id == CW_VENDOR_ID_CISCO) {
// conn->actions = &actions;
diff --git a/src/mod/fortinet/fortinet_actions_ac.c b/src/mod/fortinet/fortinet_actions_ac.c
index 3f0c6e3e..3519efbe 100644
--- a/src/mod/fortinet/fortinet_actions_ac.c
+++ b/src/mod/fortinet/fortinet_actions_ac.c
@@ -39,7 +39,7 @@ static cw_action_in_t actions_in[] = {
/* Message Discovery Request */
{
- .capwap_state = CW_STATE_DISCOVERY,
+ .capwap_state = CAPWAP_STATE_DISCOVERY,
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
.end = cw_in_check_disc_req
}
@@ -47,7 +47,7 @@ static cw_action_in_t actions_in[] = {
#if 0
/* Element WTP Descriptor */
{
- .capwap_state = CW_STATE_DISCOVERY,
+ .capwap_state = CAPWAP_STATE_DISCOVERY,
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
.start = cisco_in_wtp_descriptor,
@@ -58,7 +58,7 @@ static cw_action_in_t actions_in[] = {
/* Element Cisco RAD Name */
{
- .capwap_state = CW_STATE_DISCOVERY,
+ .capwap_state = CAPWAP_STATE_DISCOVERY,
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_RAD_NAME,
@@ -249,7 +249,7 @@ static cw_action_in_t actions80211_in[] = {
/* Cisco doe't sned this message element in discovery request,
so make it non-mandatory */
- .capwap_state = CW_STATE_DISCOVERY,
+ .capwap_state = CAPWAP_STATE_DISCOVERY,
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
.elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION,
.item_id = "radio_information",
diff --git a/src/mod/fortinet/mod_fortinet_ac.c b/src/mod/fortinet/mod_fortinet_ac.c
index ce9ad47e..0d96ed1b 100644
--- a/src/mod/fortinet/mod_fortinet_ac.c
+++ b/src/mod/fortinet/mod_fortinet_ac.c
@@ -81,7 +81,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
* specific payload Fortinet identifier */
cw_foreach_elem(elem, elems_ptr, elems_len) {
int id = cw_get_elem_id(elem);
- if (id == CW_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
+ if (id == CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
uint32_t vendor_id = cw_get_dword(cw_get_elem_data(elem));
if (vendor_id == CW_VENDOR_ID_FORTINET) {
// conn->actions = &actions;
diff --git a/src/mod/fortinet/mod_fortinet_wtp.c b/src/mod/fortinet/mod_fortinet_wtp.c
index 6eb6d793..a5316b09 100644
--- a/src/mod/fortinet/mod_fortinet_wtp.c
+++ b/src/mod/fortinet/mod_fortinet_wtp.c
@@ -126,7 +126,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
* specific payload Fortinet identifier */
cw_foreach_elem(elem, elems_ptr, elems_len) {
int id = cw_get_elem_id(elem);
- if (id == CW_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
+ if (id == CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
uint32_t vendor_id = cw_get_dword(cw_get_elem_data(elem));
if (vendor_id == CW_VENDOR_ID_FORTINET) {
// conn->actions = &actions;