···11+#define _GNU_SOURCE22+#include "main.h"33+#include <assert.h>44+55+/* stub implementation: useful for measuring overhead */66+void alloc_ring(void)77+{88+}99+1010+/* guest side */1111+int add_inbuf(unsigned len, void *buf, void *datap)1212+{1313+ return 0;1414+}1515+1616+/*1717+ * skb_array API provides no way for producer to find out whether a given1818+ * buffer was consumed. Our tests merely require that a successful get_buf1919+ * implies that add_inbuf succeed in the past, and that add_inbuf will succeed,2020+ * fake it accordingly.2121+ */2222+void *get_buf(unsigned *lenp, void **bufp)2323+{2424+ return "Buffer";2525+}2626+2727+void poll_used(void)2828+{2929+}3030+3131+void disable_call()3232+{3333+ assert(0);3434+}3535+3636+bool enable_call()3737+{3838+ assert(0);3939+}4040+4141+void kick_available(void)4242+{4343+ assert(0);4444+}4545+4646+/* host side */4747+void disable_kick()4848+{4949+ assert(0);5050+}5151+5252+bool enable_kick()5353+{5454+ assert(0);5555+}5656+5757+void poll_avail(void)5858+{5959+}6060+6161+bool use_buf(unsigned *lenp, void **bufp)6262+{6363+ return true;6464+}6565+6666+void call_used(void)6767+{6868+ assert(0);6969+}