FreeBSD/sys/net/bpf.c
/*
 * Wrapper functions for various buffering methods.  If the set of buffer
 * modes expands, we will probably want to introduce a switch data structure
 * similar to protosw, et.
 */
Wrapper functions for various buffering methods.  If the set of buffer
modes expands, we will probably want to introduce a switch data structure
similar to protosw, et.
Wrapper functions for various buffering methods . If the set of buffer modes expands we will probably want to introduce a switch data structure similar to protosw et .
static void
bpf_append_bytes(struct bpf_d *d, caddr_t buf, u_int offset, void *src,
    u_int len)
{
	BPFD_LOCK_ASSERT(d);
	switch (d->bd_bufmode) {
	case BPF_BUFMODE_BUFFER:
		return (bpf_buffer_append_bytes(d, buf, offset, src, len));
	case BPF_BUFMODE_ZBUF:
		d->bd_zcopy++;
		return (bpf_zerocopy_append_bytes(d, buf, offset, src, len));
	default:
		panic("bpf_buf_append_bytes");
	}
}
static void bpf_append_bytes ( struct bpf_d * d , caddr_t buf , u_int offset , void * src , u_int len ) { BPFD_LOCK_ASSERT ( d ) ; switch ( d -> bd_bufmode ) { case BPF_BUFMODE_BUFFER : return ( bpf_buffer_append_bytes ( d , buf , offset , src , len ) ) ; case BPF_BUFMODE_ZBUF : d -> bd_zcopy ++ ; return ( bpf_zerocopy_append_bytes ( d , buf , offset , src , len ) ) ; default : panic ( " " ) ; } }
Wrapper functions for various buffering methods.
Wrapper functions for various buffering methods .