Fixed wrong results in cw_get_hdr_fragoffset and cw_get_hdr_fragid

FossilOrigin-Name: 1bc1c836eae499da08204f9b7740cef0df0a4feaf45514b8a220f8ebca288f42
This commit is contained in:
root 2020-03-29 20:58:00 +00:00
parent 725ecd80f7
commit ab25325e9f
1 changed files with 7 additions and 2 deletions

View File

@ -98,8 +98,13 @@
/* macros to acces transport header values */
#define cw_get_hdr_preamble(th) (th[0])
#define cw_get_hdr_fragid(th) ((ntohl((((uint32_t*)th)[1]) >> 16) & 0xffff))
#define cw_get_hdr_fragoffset(th) ((ntohl((((uint32_t*)th)[1]) >> 3) & 0x1fff))
#define cw_get_hdr_fragid(th)\
(((ntohl(*(((uint32_t*)(th))+1))) >> 16) & 0xffff)
#define cw_get_hdr_fragoffset(th)\
(((ntohl(*(((uint32_t*)(th))+1))) >> 3) & 0x1fff)
#define cw_get_hdr_rid(th) ((ntohl((((uint32_t*)th)[0]) >> 14) & 0x1f))
#define cw_get_hdr_wbid(th) ((ntohl(((uint32_t*)th)[0]) >> 9) & 0x1f)
#define cw_get_hdr_hlen(th) ((ntohl(((uint32_t*)th)[0]) >> 19) & 0x1f)