diff --git a/src/cw/capwap.h b/src/cw/capwap.h index a552efdf..85374bfd 100644 --- a/src/cw/capwap.h +++ b/src/cw/capwap.h @@ -69,17 +69,6 @@ /**@}*/ -/* transport header flags */ -#define CWTH_FLAGS_R1 0x01 /* bit 0 reserved 1 */ -#define CWTH_FLAGS_R2 0x02 /* bit 1 reserved 2 */ -#define CWTH_FLAGS_R3 0x04 /* bit 2 reserved 3 */ -#define CWTH_FLAGS_K 0x08 /* bit 3 Keep alive flag */ -#define CWTH_FLAGS_M 0x10 /* bit 4 MAC Adress field present */ -#define CWTH_FLAGS_W 0x20 /* bit 5 wireless info present */ -#define CWTH_FLAGS_L 0x40 /* bit 6 last fragment */ -#define CWTH_FLAGS_F 0x80 /* bit 7 fragment */ -#define CWTH_FLAGS_T 0x100 /* bit 8 type of payload frame */ - /** * CAPWAP header flags. diff --git a/src/cw/cw.h b/src/cw/cw.h index 1c64ea36..8eff340e 100644 --- a/src/cw/cw.h +++ b/src/cw/cw.h @@ -91,16 +91,16 @@ #define cw_get_hdr_rmac_size(th) cw_get_hdr_rmac_len(th) #define cw_get_hdr_rmac_data(th) (th+9) -#define cw_get_hdr_flag_r1(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_R1 ) ? 1:0) -#define cw_get_hdr_flag_r2(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_R2 ) ? 1:0) -#define cw_get_hdr_flag_r3(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_R3 ) ? 1:0) +#define cw_get_hdr_flag_r1(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_R1 ) ? 1:0) +#define cw_get_hdr_flag_r2(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_R2 ) ? 1:0) +#define cw_get_hdr_flag_r3(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_R3 ) ? 1:0) -#define cw_get_hdr_flag_k(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_K ) ? 1:0) -#define cw_get_hdr_flag_m(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_M ) ? 1:0) -#define cw_get_hdr_flag_w(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_W ) ? 1:0) -#define cw_get_hdr_flag_l(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_L ) ? 1:0) -#define cw_get_hdr_flag_f(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_F ) ? 1:0) -#define cw_get_hdr_flag_t(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_T ) ? 1:0) +#define cw_get_hdr_flag_k(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_K ) ? 1:0) +#define cw_get_hdr_flag_m(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_M ) ? 1:0) +#define cw_get_hdr_flag_w(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_W ) ? 1:0) +#define cw_get_hdr_flag_l(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_L ) ? 1:0) +#define cw_get_hdr_flag_f(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_F ) ? 1:0) +#define cw_get_hdr_flag_t(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_T ) ? 1:0) #define cw_get_hdr_msg_offset(th) (4*cw_get_hdr_hlen(th)) #define cw_get_hdr_msg_elems_offset(th) (cw_get_hdr_msg_offset(th)+8) diff --git a/src/cw/fragman.c b/src/cw/fragman.c index 69d84a0a..aad32bea 100644 --- a/src/cw/fragman.c +++ b/src/cw/fragman.c @@ -168,7 +168,7 @@ uint8_t * fragman_add(frag_t * frags, uint8_t *packet, int hlen, int payloadlen) f->bytesreceived+=payloadlen; } - if (val0 & CWTH_FLAGS_L){ + if (val0 & CW_FLAG_HDR_L){ f->bytesneeded=dst+payloadlen; } diff --git a/src/wtp/wtp_main.c b/src/wtp/wtp_main.c index b77ac8e8..d587ec0f 100644 --- a/src/wtp/wtp_main.c +++ b/src/wtp/wtp_main.c @@ -139,10 +139,10 @@ int main() // cw_register_actions_cipwap_wtp(&capwap_actions); // cw_register_actions_capwap_80211_wtp(&capwap_actions); // -//#define CWMOD "cisco" -//#define CWBIND "cisco" -#define CWMOD "capwap" -#define CWBIND "capwap80211" +#define CWMOD "cisco" +#define CWBIND "cisco" +//#define CWMOD "capwap" +//#define CWBIND "capwap80211" struct mod_wtp *mod = modload_wtp(CWMOD); @@ -190,7 +190,7 @@ int main() // conn->capwap_mode = CW_MODE_CAPWAP; //conn->capwap_mode = CW_MODE_CISCO; - the_conn->strict_capwap = 1; + the_conn->strict_capwap = 0; conn->config = mbag_create();