From ca639b0c5f6a4e65b66fe52a73ac00614c6be19f Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Mon, 19 Jun 2023 17:19:51 +0000 Subject: 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@ --- sbin/iked/imsg_util.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'sbin/iked/imsg_util.c') 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 @@ -83,12 +83,6 @@ ibuf_length(struct ibuf *buf) return (ibuf_size(buf)); } -void * -ibuf_data(struct ibuf *buf) -{ - return (ibuf_seek(buf, 0, 0)); -} - void * ibuf_getdata(struct ibuf *buf, size_t len) { -- cgit v1.2.3