--- libelwix/inc/elwix/apack.h 2015/06/25 17:53:49 1.10 +++ libelwix/inc/elwix/apack.h 2022/09/26 19:39:23 1.11 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: apack.h,v 1.10 2015/06/25 17:53:49 misho Exp $ +* $Id: apack.h,v 1.11 2022/09/26 19:39:23 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2015 +Copyright 2004 - 2022 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -68,6 +68,7 @@ typedef struct tagRawPacket { #define RPACK_OFF(x) (assert((x)), (x)->r_next - (x)->r_buf) #define RPACK_REMAIN(x) (assert((x)), (x)->r_len - ((x)->r_next - (x)->r_buf)) #define RPACK_ISEND(x) (assert((x)), (size_t) ((x)->r_next - (x)->r_buf) >= (x)->r_len) +#define RPACK_WHEREAMI(x, nx) (assert((x)), (size_t) (((uint8_t*)(nx)) - (x)->r_buf)) #define RPACK_SET_16(x, n) do { assert((x)); \ *((uint8_t *) (x) + 1) = *((const uint8_t *) (n) + 1); \