Lines Matching refs:im

45 static int check_match(struct net *net, struct em_ipt_match *im, int mdata_len)  in check_match()  argument
55 mtpar.hook_mask = 1 << im->hook; in check_match()
56 mtpar.family = im->match->family; in check_match()
57 mtpar.match = im->match; in check_match()
59 mtpar.matchinfo = (void *)im->match_data; in check_match()
119 struct em_ipt_match *im = NULL; in em_ipt_change() local
139 im = kzalloc(sizeof(*im) + mdata_len, GFP_KERNEL); in em_ipt_change()
140 if (!im) { in em_ipt_change()
145 im->match = match; in em_ipt_change()
146 im->hook = nla_get_u32(tb[TCA_EM_IPT_HOOK]); in em_ipt_change()
147 nla_memcpy(im->match_data, tb[TCA_EM_IPT_MATCH_DATA], mdata_len); in em_ipt_change()
149 ret = check_match(net, im, mdata_len); in em_ipt_change()
153 em->datalen = sizeof(*im) + mdata_len; in em_ipt_change()
154 em->data = (unsigned long)im; in em_ipt_change()
158 kfree(im); in em_ipt_change()
165 struct em_ipt_match *im = (void *)em->data; in em_ipt_destroy() local
167 if (!im) in em_ipt_destroy()
170 if (im->match->destroy) { in em_ipt_destroy()
173 .match = im->match, in em_ipt_destroy()
174 .matchinfo = im->match_data, in em_ipt_destroy()
175 .family = im->match->family in em_ipt_destroy()
177 im->match->destroy(&par); in em_ipt_destroy()
179 module_put(im->match->me); in em_ipt_destroy()
180 kfree((void *)im); in em_ipt_destroy()
186 const struct em_ipt_match *im = (const void *)em->data; in em_ipt_match() local
197 nf_hook_state_init(&state, im->hook, im->match->family, in em_ipt_match()
200 acpar.match = im->match; in em_ipt_match()
201 acpar.matchinfo = im->match_data; in em_ipt_match()
204 ret = im->match->match(skb, &acpar); in em_ipt_match()
212 struct em_ipt_match *im = (void *)em->data; in em_ipt_dump() local
214 if (nla_put_string(skb, TCA_EM_IPT_MATCH_NAME, im->match->name) < 0) in em_ipt_dump()
216 if (nla_put_u32(skb, TCA_EM_IPT_HOOK, im->hook) < 0) in em_ipt_dump()
218 if (nla_put_u8(skb, TCA_EM_IPT_MATCH_REVISION, im->match->revision) < 0) in em_ipt_dump()
220 if (nla_put_u8(skb, TCA_EM_IPT_NFPROTO, im->match->family) < 0) in em_ipt_dump()
223 im->match->usersize ?: im->match->matchsize, in em_ipt_dump()
224 im->match_data) < 0) in em_ipt_dump()