* 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. */
| 822 | * The packet data in 'm' must be in a contiguous buffer in a single mbuf. |
| 823 | */ |
| 824 | static void |
| 825 | ng_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 | |
| 839 | static void |
| 840 | ng_source_mod_counter(sc_p sc, struct ng_source_embed_cnt_info *cnt, |
no outgoing calls
no test coverage detected