+ if (t->instructions & PNAT_INSTR_COPY_BYTE) {
+ /* Copy byte from somewhere in packet to elsewhere */
+
+ if (t->to_offset >= plen || t->from_offset > plen) {
+ return PNAT_ERROR_TOOSHORT;
+ }
+ u8 *p = (u8 *)ip;
+ p[t->to_offset] = p[t->from_offset];
+ ip->checksum = ip4_header_checksum(ip);
+ // TODO: L4 checksum
+ }
+ if (t->instructions & PNAT_INSTR_CLEAR_BYTE) {
+ /* Clear byte at offset */
+ u8 *p = (u8 *)ip;
+ p[t->clear_offset] = 0;
+ ip->checksum = ip4_header_checksum(ip);
+ // TODO: L4 checksum
+ }
+