|
|
| version 1.6.2.1, 2014/02/11 13:25:09 | version 1.6.2.2, 2014/02/13 14:58:55 |
|---|---|
| Line 504 rpack_ruint64(rpack_t * __restrict rp, uint64_t * __re | Line 504 rpack_ruint64(rpack_t * __restrict rp, uint64_t * __re |
| rp->r_next += sizeof(uint64_t); | rp->r_next += sizeof(uint64_t); |
| return u; | return u; |
| } | } |
| /* | |
| * rpack_next() - Get and set current position | |
| * | |
| * @rp = raw packet | |
| * @after_len = !=0 move current position after length | |
| * return: NULL error or current position | |
| */ | |
| uint8_t * | |
| rpack_next(rpack_t * __restrict rp, size_t after_len) | |
| { | |
| uint8_t *next = NULL; | |
| if (!RPACK_SANITY(rp)) | |
| return NULL; | |
| /* No space left */ | |
| if (after_len + rp->r_next - rp->r_buf > rp->r_len) | |
| return NULL; | |
| next = rp->r_next; | |
| rp->r_next += after_len; | |
| return next; | |
| } |