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

Function ng_source_packet_mod

freebsd/netgraph/ng_source.c:824–837  ·  view source on GitHub ↗

* Modify packet in 'm' by changing 'len' bytes starting at 'offset' * to data in 'cp'. * * The packet data in 'm' must be in a contiguous buffer in a single mbuf. */

Source from the content-addressed store, hash-verified

822 * The packet data in 'm' must be in a contiguous buffer in a single mbuf.
823 */
824static void
825ng_source_packet_mod(sc_p sc, struct mbuf *m, int offset, int len, caddr_t cp,
826 int flags)
827{
828 if (len == 0)
829 return;
830
831 /* Can't modify beyond end of packet. */
832 /* TODO: Pad packet for this case. */
833 if (offset + len > m->m_len)
834 return;
835
836 bcopy(cp, mtod_off(m, offset, caddr_t), len);
837}
838
839static void
840ng_source_mod_counter(sc_p sc, struct ng_source_embed_cnt_info *cnt,

Callers 2

ng_source_mod_counterFunction · 0.85
ng_source_dup_modFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected