xref: /freebsd-src/sys/net/bpf_buffer.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
14d621040SChristian S.J. Peron /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3fe267a55SPedro F. Giffuni  *
44d621040SChristian S.J. Peron  * Copyright (c) 2007 Seccuris Inc.
54d621040SChristian S.J. Peron  * All rights reserved.
64d621040SChristian S.J. Peron  *
7dde153daSEitan Adler  * This software was developed by Robert N. M. Watson under contract to
84d621040SChristian S.J. Peron  * Seccuris Inc.
94d621040SChristian S.J. Peron  *
104d621040SChristian S.J. Peron  * Redistribution and use in source and binary forms, with or without
114d621040SChristian S.J. Peron  * modification, are permitted provided that the following conditions
124d621040SChristian S.J. Peron  * are met:
134d621040SChristian S.J. Peron  * 1. Redistributions of source code must retain the above copyright
144d621040SChristian S.J. Peron  *    notice, this list of conditions and the following disclaimer.
154d621040SChristian S.J. Peron  * 2. Redistributions in binary form must reproduce the above copyright
164d621040SChristian S.J. Peron  *    notice, this list of conditions and the following disclaimer in the
174d621040SChristian S.J. Peron  *    documentation and/or other materials provided with the distribution.
184d621040SChristian S.J. Peron  *
194d621040SChristian S.J. Peron  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
204d621040SChristian S.J. Peron  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
214d621040SChristian S.J. Peron  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
224d621040SChristian S.J. Peron  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
234d621040SChristian S.J. Peron  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
244d621040SChristian S.J. Peron  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
254d621040SChristian S.J. Peron  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
264d621040SChristian S.J. Peron  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
274d621040SChristian S.J. Peron  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
284d621040SChristian S.J. Peron  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
294d621040SChristian S.J. Peron  * SUCH DAMAGE.
304d621040SChristian S.J. Peron  */
314d621040SChristian S.J. Peron 
324d621040SChristian S.J. Peron #ifndef _NET_BPF_BUFFER_H_
334d621040SChristian S.J. Peron #define	_NET_BPF_BUFFER_H_
344d621040SChristian S.J. Peron 
354d621040SChristian S.J. Peron #ifndef _KERNEL
364d621040SChristian S.J. Peron #error "no user-serviceable parts inside"
374d621040SChristian S.J. Peron #endif
384d621040SChristian S.J. Peron 
394d621040SChristian S.J. Peron void	bpf_buffer_append_bytes(struct bpf_d *d, caddr_t buf, u_int offset,
404d621040SChristian S.J. Peron 	    void *src, u_int len);
414d621040SChristian S.J. Peron void	bpf_buffer_append_mbuf(struct bpf_d *d, caddr_t buf, u_int offset,
424d621040SChristian S.J. Peron 	    void *src, u_int len);
434d621040SChristian S.J. Peron void	bpf_buffer_free(struct bpf_d *d);
444d621040SChristian S.J. Peron void	bpf_buffer_init(struct bpf_d *d);
454d621040SChristian S.J. Peron int	bpf_buffer_ioctl_sblen(struct bpf_d *d, u_int *i);
464d621040SChristian S.J. Peron int	bpf_buffer_uiomove(struct bpf_d *d, caddr_t buf, u_int len,
474d621040SChristian S.J. Peron 	    struct uio *uio);
484d621040SChristian S.J. Peron 
494d621040SChristian S.J. Peron #endif /* !_NET_BPF_BUFFER_H_ */
50