MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bpf_append_bytes

Function bpf_append_bytes

freebsd/net/bpf.c:363–381  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

361 * similar to protosw, et.
362 */
363static void
364bpf_append_bytes(struct bpf_d *d, caddr_t buf, u_int offset, void *src,
365 u_int len)
366{
367
368 BPFD_LOCK_ASSERT(d);
369
370 switch (d->bd_bufmode) {
371 case BPF_BUFMODE_BUFFER:
372 return (bpf_buffer_append_bytes(d, buf, offset, src, len));
373
374 case BPF_BUFMODE_ZBUF:
375 counter_u64_add(d->bd_zcopy, 1);
376 return (bpf_zerocopy_append_bytes(d, buf, offset, src, len));
377
378 default:
379 panic("bpf_buf_append_bytes");
380 }
381}
382
383static void
384bpf_append_mbuf(struct bpf_d *d, caddr_t buf, u_int offset, void *src,

Callers 1

catchpacketFunction · 0.85

Calls 4

bpf_buffer_append_bytesFunction · 0.85
counter_u64_addFunction · 0.50
panicFunction · 0.50

Tested by

no test coverage detected