8 #include <linux/module.h>
11 #include <linux/udp.h>
12 #include <linux/netfilter.h>
29 static unsigned int ports_c;
38 static int tftp_help(
struct sk_buff *skb,
68 &tuple->
src.u3, &tuple->
dst.u3,
72 nf_ct_dump_tuple(&exp->
tuple);
76 ret = nf_nat_tftp(skb, ctinfo, exp);
77 else if (nf_ct_expect_related(exp) != 0)
101 static void nf_conntrack_tftp_fini(
void)
105 for (i = 0; i < ports_c; i++) {
106 for (j = 0; j < 2; j++)
111 static int __init nf_conntrack_tftp_init(
void)
118 for (i = 0; i < ports_c; i++) {
119 memset(&tftp[i], 0,
sizeof(tftp[i]));
121 tftp[
i][0].tuple.src.l3num =
AF_INET;
123 for (j = 0; j < 2; j++) {
125 tftp[
i][
j].tuple.src.u.udp.port =
htons(ports[i]);
126 tftp[
i][
j].expect_policy = &tftp_exp_policy;
128 tftp[
i][
j].help = tftp_help;
138 " helper for pf: %u port: %u\n",
139 tftp[i][j].tuple.
src.l3num, ports[i]);
140 nf_conntrack_tftp_fini();