128 unsigned int match_offset,
unsigned int match_len,
129 const char *rep_buffer,
unsigned int rep_len)
131 struct iphdr *iph = (
struct iphdr *) pktb->network_header;
133 if (!
pktb_mangle(pktb, dataoff, match_offset, match_len, rep_buffer,
138 iph->tot_len = htons(pktb_tail(pktb) - pktb->network_header);
156 struct in_addr src = { iph->saddr };
157 struct in_addr dst = { iph->daddr };
159 char src_str[INET_ADDRSTRLEN];
160 char dst_str[INET_ADDRSTRLEN];
162 ret = snprintf(buf, size,
"SRC=%s DST=%s LEN=%u TOS=0x%X "
163 "PREC=0x%X TTL=%u ID=%u PROTO=%u ",
164 inet_ntop(AF_INET, &src, src_str, INET_ADDRSTRLEN),
165 inet_ntop(AF_INET, &dst, dst_str, INET_ADDRSTRLEN),
166 ntohs(iph->tot_len), IPTOS_TOS(iph->tos),
167 IPTOS_PREC(iph->tos), iph->ttl, ntohs(iph->id),
int nfq_ip_mangle(struct pkt_buff *pktb, unsigned int dataoff, unsigned int match_offset, unsigned int match_len, const char *rep_buffer, unsigned int rep_len)
int pktb_mangle(struct pkt_buff *pktb, int dataoff, unsigned int match_offset, unsigned int match_len, const char *rep_buffer, unsigned int rep_len)