1177548Scsjp/*- 2177548Scsjp * Copyright (c) 2007 Seccuris Inc. 3177548Scsjp * All rights reserved. 4177548Scsjp * 5230108Seadler * This software was developed by Robert N. M. Watson under contract to 6177548Scsjp * Seccuris Inc. 7177548Scsjp * 8177548Scsjp * Redistribution and use in source and binary forms, with or without 9177548Scsjp * modification, are permitted provided that the following conditions 10177548Scsjp * are met: 11177548Scsjp * 1. Redistributions of source code must retain the above copyright 12177548Scsjp * notice, this list of conditions and the following disclaimer. 13177548Scsjp * 2. Redistributions in binary form must reproduce the above copyright 14177548Scsjp * notice, this list of conditions and the following disclaimer in the 15177548Scsjp * documentation and/or other materials provided with the distribution. 16177548Scsjp * 17177548Scsjp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18177548Scsjp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19177548Scsjp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20177548Scsjp * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21177548Scsjp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22177548Scsjp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23177548Scsjp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24177548Scsjp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25177548Scsjp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26177548Scsjp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27177548Scsjp * SUCH DAMAGE. 28177548Scsjp * 29177548Scsjp * $FreeBSD$ 30177548Scsjp */ 31177548Scsjp 32177548Scsjp#ifndef _NET_BPF_ZEROCOPY_H_ 33177548Scsjp#define _NET_BPF_ZEROCOPY_H_ 34177548Scsjp 35177548Scsjp#ifndef _KERNEL 36177548Scsjp#error "no user-serviceable parts inside" 37177548Scsjp#endif 38177548Scsjp 39177548Scsjpvoid bpf_zerocopy_append_bytes(struct bpf_d *d, caddr_t buf, u_int offset, 40177548Scsjp void *src, u_int len); 41177548Scsjpvoid bpf_zerocopy_append_mbuf(struct bpf_d *d, caddr_t buf, u_int offset, 42177548Scsjp void *src, u_int len); 43177966Srwatsonvoid bpf_zerocopy_buffull(struct bpf_d *); 44177548Scsjpvoid bpf_zerocopy_bufheld(struct bpf_d *); 45180310Scsjpvoid bpf_zerocopy_buf_reclaimed(struct bpf_d *); 46177548Scsjpint bpf_zerocopy_canfreebuf(struct bpf_d *); 47177966Srwatsonint bpf_zerocopy_canwritebuf(struct bpf_d *); 48177548Scsjpvoid bpf_zerocopy_free(struct bpf_d *d); 49177548Scsjpint bpf_zerocopy_ioctl_getzmax(struct thread *td, struct bpf_d *d, 50177548Scsjp size_t *i); 51177548Scsjpint bpf_zerocopy_ioctl_rotzbuf(struct thread *td, struct bpf_d *d, 52177548Scsjp struct bpf_zbuf *bz); 53177548Scsjpint bpf_zerocopy_ioctl_setzbuf(struct thread *td, struct bpf_d *d, 54177548Scsjp struct bpf_zbuf *bz); 55177548Scsjp 56177548Scsjp#endif /* !_NET_BPF_ZEROCOPY_H_ */ 57