Added two macros and a prototype.

FossilOrigin-Name: 0bb79c5fb5dfddf37aa16c7fa9ec4f46f46b369c027d3180fc422918d09ea66c
This commit is contained in:
7u83@mail.ru 2016-03-13 17:47:16 +00:00
parent fbce3df032
commit bd45eaf447
1 changed files with 16 additions and 1 deletions

View File

@ -182,6 +182,21 @@ static inline void cw_set_hdr_rid(uint8_t * th, int rid)
#define cw_set_msg_flags(msgptr,f) (cw_put_byte( (msgptr)+7,f))
/**
* Check if a message id is from request msg
* @param msg_id id to check
* @return 1 if it msg id is a request msg id, otherwise 0
*/
#define cw_is_request(msg) (msg_id & 1)
/**
* Check if message id is from a response msg
* @see #cw_is_request
*/
#define cw_is_response(msg_id) (!is_response(msg_id))
static inline uint8_t *cw_get_hdr_msg_elems_ptr(uint8_t * m)
{
return cw_get_msg_elems_ptr(m + cw_get_hdr_msg_offset(m));
@ -228,7 +243,6 @@ static inline int cw_set_hdr_rmac(uint8_t * th, bstr_t rmac)
/**
* Get length of a CAPWAP message elemet
* @param e pointer to element (uint8_t*)
@ -310,6 +324,7 @@ static inline int cw_put_elem_vendor_hdr(uint8_t * dst, uint32_t vendorid,
int cw_put_image_data(uint8_t * dst, FILE * infile);
extern int cw_put_mbag_item(uint8_t * dst, struct mbag_item *item);
/**