mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-04 08:22:16 +00:00
nhrpd: Add zbuf routine to peek at contents
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
This commit is contained in:
parent
263e82b308
commit
d5dc926f18
12
nhrpd/zbuf.c
12
nhrpd/zbuf.c
@ -230,3 +230,15 @@ void zbuf_copy(struct zbuf *zdst, struct zbuf *zsrc, size_t len)
|
|||||||
return;
|
return;
|
||||||
memcpy(dst, src, len);
|
memcpy(dst, src, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void zbuf_copy_peek(struct zbuf *zdst, struct zbuf *zsrc, size_t len)
|
||||||
|
{
|
||||||
|
const void *src;
|
||||||
|
void *dst;
|
||||||
|
|
||||||
|
dst = zbuf_pushn(zdst, len);
|
||||||
|
src = zbuf_pulln(zsrc, 0);
|
||||||
|
if (!dst || !src)
|
||||||
|
return;
|
||||||
|
memcpy(dst, src, len);
|
||||||
|
}
|
||||||
|
@ -190,6 +190,7 @@ static inline void zbuf_put_be32(struct zbuf *zb, uint32_t val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void zbuf_copy(struct zbuf *zb, struct zbuf *src, size_t len);
|
void zbuf_copy(struct zbuf *zb, struct zbuf *src, size_t len);
|
||||||
|
void zbuf_copy_peek(struct zbuf *zdst, struct zbuf *zsrc, size_t len);
|
||||||
|
|
||||||
void zbufq_init(struct zbuf_queue *);
|
void zbufq_init(struct zbuf_queue *);
|
||||||
void zbufq_reset(struct zbuf_queue *);
|
void zbufq_reset(struct zbuf_queue *);
|
||||||
|
Loading…
Reference in New Issue
Block a user