From 0b5c03e9239893b12c87744ad74f717aa1b4c26c Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sat, 28 Mar 2015 07:59:50 +0000 Subject: [PATCH] Added lw_get_* macros for dword, byte and word. FossilOrigin-Name: c09e6ec03e77ac3fd835171fb90b1ed78c7bb887f522b9c2f737c663df4c7804 --- src/capwap/lwapp.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/capwap/lwapp.h b/src/capwap/lwapp.h index 99eccda4..14d72a37 100644 --- a/src/capwap/lwapp.h +++ b/src/capwap/lwapp.h @@ -143,6 +143,16 @@ (*((uint32_t*)(dst)) = htonl(dw),4) +#define lw_get_byte(src)\ + (*(uint8_t*)(src)) + +#define lw_get_word(src) \ + (ntohs( *(uint16_t*(src)))) + +#define lw_get_dword(src) \ + (ntohl( *(uint32_t*(src)))) + + /* the following functions are defined as static inline and not as macro to avoid any side effects */