From ac96149287a03823bcff9b4bbf942044182a301f Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sat, 28 Mar 2015 08:11:44 +0000 Subject: [PATCH] cw_get-* macros added for byte, dword, elem_len ... FossilOrigin-Name: 2bb30fa166475bc488179469889951d3da093f428c0f346af7b67d38e74945cd --- src/capwap/capwap.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/capwap/capwap.h b/src/capwap/capwap.h index bdb85231..b56648c0 100644 --- a/src/capwap/capwap.h +++ b/src/capwap/capwap.h @@ -493,6 +493,16 @@ extern int cw_send_echo_response(struct conn *conn, int seqnum, struct radioinfo extern int cw_handle_echo_request(void *d); extern void cw_send_image_file(struct conn *conn, FILE * infile); +/* Use some macros from LWAPP */ + +#define cw_put_byte lw_put_byte +#define cw_put_word lw_put_word +#define cw_put_dword lw_put_dword +#define cw_put_data lw_put_data + +#define cw_get_byte lw_get_byte +#define cw_get_word lw_get_word +#define cw_get_dword lw_get_dword /* macro to isolate bits from a dword */ @@ -521,12 +531,19 @@ extern void cw_send_image_file(struct conn *conn, FILE * infile); #define cw_get_hdr_flag_t(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_T ) ? 1:0) -/* Use some macros from LWAPP */ +/** + * Get length of a CAPWAP message elemet + * @param e pointer to element (uint8_t*) + * @return length of element + */ +#define cw_get_elem_type(e) cw_get_word(e) -#define cw_put_byte lw_put_byte -#define cw_put_word lw_put_word -#define cw_put_dword lw_put_dword -#define cw_put_data lw_put_data +/** + * Get type of a CAPWAP message element + * @pram e pointer to element (uint8_t*) + * @return type of element + */ +#define cw_get_elem_len(e) cw_get_word(e+2) /**