diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2023-06-19 17:19:51 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2023-06-19 17:19:51 +0000 |
commit | ca639b0c5f6a4e65b66fe52a73ac00614c6be19f (patch) | |
tree | eb540e2dd5fdf66377b0dc89de5425c52ba4e738 /sbin/iked/imsg_util.c | |
parent | 95292aac0ac0ea5091b8c373577fa9a870c96374 (diff) |
Improve the ibuf API by adding these functions:
Functions extending ibuf_add to work with more specific data types
ibuf_add_buf, ibuf_add_zero, ibuf_add_n8, ibuf_add_n16, ibuf_add_n32,
ibuf_add_n64
Functions replacing ibuf_seek where data at a specific offset is modified
ibuf_set, ibuf_set_n8, ibuf_set_n16, ibuf_set_n32, ibuf_set_n64
Functions to check, get and set the filedescriptor stored on the ibuf
ibuf_fd_avail, ibuf_fd_get, ibuf_fd_set
and ibuf_data() to access the data buffer, to be used together with ibuf_size()
On top of this add an optimized imsg_compose_ibuf() where an ibuf is wrapped
into an imsg in an efficent way.
Finally remove msgbuf_drain since it is not used by anything outside of
the ibuf code. Because of this removal bump the major of libutil.
Remove ibuf_data() in iked since the same function is now provided by libutil.
OK tb@
Diffstat (limited to 'sbin/iked/imsg_util.c')
-rw-r--r-- | sbin/iked/imsg_util.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sbin/iked/imsg_util.c b/sbin/iked/imsg_util.c index cf83b5c9848..eab8eea72bc 100644 --- a/sbin/iked/imsg_util.c +++ b/sbin/iked/imsg_util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg_util.c,v 1.18 2023/06/12 09:02:32 claudio Exp $ */ +/* $OpenBSD: imsg_util.c,v 1.19 2023/06/19 17:19:50 claudio Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> @@ -84,12 +84,6 @@ ibuf_length(struct ibuf *buf) } void * -ibuf_data(struct ibuf *buf) -{ - return (ibuf_seek(buf, 0, 0)); -} - -void * ibuf_getdata(struct ibuf *buf, size_t len) { void *data; |