diff --git a/src/cw/capwap.h b/src/cw/capwap.h index e62faaea..8e6fae2e 100644 --- a/src/cw/capwap.h +++ b/src/cw/capwap.h @@ -184,12 +184,21 @@ * @{ */ //namin -#define CW_ELEM_AC_DESCRIPTOR 1 /**< AC Descriptor */ -#define CW_ELEM_AC_IPV4_LIST 2 /**< AC IP V4 List */ -#define CW_ELEM_AC_IPV6_LIST 3 /**< AC IP V6 List */ -#define CW_ELEM_AC_NAME 4 -#define CW_ELEM_AC_NAME_WITH_PRIORITY 5 -#define CW_ELEM_AC_NAME_WITH_INDEX CW_ELEM_AC_NAME_WITH_PRIORITY /**< Draft 7 naming */ + +#define CAPWAP_ELEM_AC_DESCRIPTOR 1 /**< AC Descriptor */ + +#define CW_ELEM_AC_IPV4_LIST 2 /**< AC IP V4 List */ +#define CW_ELEM_AC_IPV6_LIST 3 /**< AC IP V6 List */ +#define CW_ELEM_AC_NAME 4 /**< AC Name */ +#define CW_ELEM_AC_NAME_WITH_PRIORITY 5 + +/** + * In CAPWAP RFC draft 7 the message element 5 was named + * AC Name With Index. So we define it here with this name + * to be compatible. + * @see CW_ELEM_AC_NAME_WITH_PRIORITY */ +#define CW_ELEM_AC_NAME_WITH_INDEX CW_ELEM_AC_NAME_WITH_PRIORITY + #define CW_ELEM_AC_TIMESTAMP 6 /**@{ * one for all diff --git a/src/cw/capwap_strings_elem.c b/src/cw/capwap_strings_elem.c index 5316f357..6f018bbb 100644 --- a/src/cw/capwap_strings_elem.c +++ b/src/cw/capwap_strings_elem.c @@ -2,7 +2,7 @@ struct cw_strlist_elem capwap_strings_elem[] = { - {CW_ELEM_AC_DESCRIPTOR, "AC Descriptor"}, + {CAPWAP_ELEM_AC_DESCRIPTOR, "AC Descriptor"}, {CW_ELEM_AC_IPV4_LIST, "AC IPv4 List"}, {CW_ELEM_AC_IPV6_LIST, "AC IPv6 List"}, {CW_ELEM_AC_NAME, "AC Name"}, diff --git a/src/cw/cw_readelem_ac_descriptor.c b/src/cw/cw_readelem_ac_descriptor.c index 8872ff82..362700f6 100644 --- a/src/cw/cw_readelem_ac_descriptor.c +++ b/src/cw/cw_readelem_ac_descriptor.c @@ -77,7 +77,7 @@ static int read_subelem(struct ac_info* acinfo,int subtype,uint8_t *elem, int le */ int cw_readelem_ac_descriptor(struct ac_info * acinfo,int type, uint8_t *msgelem, int len) { - if (type != CW_ELEM_AC_DESCRIPTOR) + if (type != CAPWAP_ELEM_AC_DESCRIPTOR) return 0; if (len<12) diff --git a/src/mod/capwap/capwap_actions_ac.c b/src/mod/capwap/capwap_actions_ac.c index 0e0d6cc0..128c8196 100644 --- a/src/mod/capwap/capwap_actions_ac.c +++ b/src/mod/capwap/capwap_actions_ac.c @@ -552,7 +552,7 @@ static cw_action_out_t actions_out[]={ { .msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE, .item_id = CW_ITEM_AC_DESCRIPTOR, - .elem_id = CW_ELEM_AC_DESCRIPTOR, + .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, .out = capwap_out_ac_descriptor, .mand = 1 } @@ -618,7 +618,7 @@ static cw_action_out_t actions_out[]={ { .msg_id = CAPWAP_MSG_JOIN_RESPONSE, .item_id = CW_ITEM_AC_DESCRIPTOR, - .elem_id = CW_ELEM_AC_DESCRIPTOR, + .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, .out = capwap_out_ac_descriptor, .mand = 1 } diff --git a/src/mod/capwap/capwap_actions_wtp.c b/src/mod/capwap/capwap_actions_wtp.c index 8caccec8..4b339f3e 100644 --- a/src/mod/capwap/capwap_actions_wtp.c +++ b/src/mod/capwap/capwap_actions_wtp.c @@ -20,7 +20,7 @@ static cw_action_in_t actions_in[] = { { .capwap_state = CW_STATE_DISCOVERY, .msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE, - .elem_id = CW_ELEM_AC_DESCRIPTOR, + .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, .item_id = CW_ITEM_AC_DESCRIPTOR, .start = cw_in_ac_descriptor, .min_len = 12, @@ -124,7 +124,7 @@ static cw_action_in_t actions_in[] = { { .capwap_state = CW_STATE_JOIN, .msg_id = CAPWAP_MSG_JOIN_RESPONSE, - .elem_id = CW_ELEM_AC_DESCRIPTOR, + .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, .item_id = CW_ITEM_AC_DESCRIPTOR, .start = cw_in_ac_descriptor, .min_len = 12, diff --git a/src/mod/cisco/cisco_actions_ac.c b/src/mod/cisco/cisco_actions_ac.c index 101258b0..0a1a2def 100644 --- a/src/mod/cisco/cisco_actions_ac.c +++ b/src/mod/cisco/cisco_actions_ac.c @@ -328,7 +328,7 @@ static cw_action_out_t actions_out[]={ { .msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE, .item_id = CW_ITEM_AC_DESCRIPTOR, - .elem_id = CW_ELEM_AC_DESCRIPTOR, + .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, .out = cisco_out_ac_descriptor, .mand = 1 } @@ -353,7 +353,7 @@ static cw_action_out_t actions_out[]={ { .msg_id = CAPWAP_MSG_JOIN_RESPONSE, .item_id = CW_ITEM_AC_DESCRIPTOR, - .elem_id = CW_ELEM_AC_DESCRIPTOR, + .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, .out = cisco_out_ac_descriptor, .mand = 1 } diff --git a/src/mod/cisco/cisco_actions_wtp.c b/src/mod/cisco/cisco_actions_wtp.c index d234cd83..5c98b767 100644 --- a/src/mod/cisco/cisco_actions_wtp.c +++ b/src/mod/cisco/cisco_actions_wtp.c @@ -48,7 +48,7 @@ static cw_action_in_t actions_in[] = { { .capwap_state = CW_STATE_DISCOVERY, .msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE, - .elem_id = CW_ELEM_AC_DESCRIPTOR, + .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, .item_id = CW_ITEM_AC_DESCRIPTOR, .start = cisco_in_ac_descriptor, .min_len = 12, @@ -82,7 +82,7 @@ static cw_action_in_t actions_in[] = { /* Cisco's AC Descriptor */ .capwap_state = CW_STATE_JOIN, .msg_id = CAPWAP_MSG_JOIN_RESPONSE, - .elem_id = CW_ELEM_AC_DESCRIPTOR, + .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, .item_id = CW_ITEM_AC_DESCRIPTOR, .start = cisco_in_ac_descriptor, .min_len = 12,