Lines Matching refs:im
42 static int check_match(struct net *net, struct em_ipt_match *im, int mdata_len) in check_match() argument
52 mtpar.hook_mask = 1 << im->hook; in check_match()
53 mtpar.family = im->match->family; in check_match()
54 mtpar.match = im->match; in check_match()
56 mtpar.matchinfo = (void *)im->match_data; in check_match()
130 struct em_ipt_match *im = NULL; in em_ipt_change() local
160 im = kzalloc(sizeof(*im) + mdata_len, GFP_KERNEL); in em_ipt_change()
161 if (!im) { in em_ipt_change()
166 im->match = match; in em_ipt_change()
167 im->hook = nla_get_u32(tb[TCA_EM_IPT_HOOK]); in em_ipt_change()
168 im->nfproto = nfproto; in em_ipt_change()
169 nla_memcpy(im->match_data, tb[TCA_EM_IPT_MATCH_DATA], mdata_len); in em_ipt_change()
171 ret = check_match(net, im, mdata_len); in em_ipt_change()
175 em->datalen = sizeof(*im) + mdata_len; in em_ipt_change()
176 em->data = (unsigned long)im; in em_ipt_change()
180 kfree(im); in em_ipt_change()
187 struct em_ipt_match *im = (void *)em->data; in em_ipt_destroy() local
189 if (!im) in em_ipt_destroy()
192 if (im->match->destroy) { in em_ipt_destroy()
195 .match = im->match, in em_ipt_destroy()
196 .matchinfo = im->match_data, in em_ipt_destroy()
197 .family = im->match->family in em_ipt_destroy()
199 im->match->destroy(&par); in em_ipt_destroy()
201 module_put(im->match->me); in em_ipt_destroy()
202 kfree(im); in em_ipt_destroy()
208 const struct em_ipt_match *im = (const void *)em->data; in em_ipt_match() local
211 u8 nfproto = im->match->family; in em_ipt_match()
237 nf_hook_state_init(&state, im->hook, nfproto, in em_ipt_match()
240 acpar.match = im->match; in em_ipt_match()
241 acpar.matchinfo = im->match_data; in em_ipt_match()
244 ret = im->match->match(skb, &acpar); in em_ipt_match()
252 struct em_ipt_match *im = (void *)em->data; in em_ipt_dump() local
254 if (nla_put_string(skb, TCA_EM_IPT_MATCH_NAME, im->match->name) < 0) in em_ipt_dump()
256 if (nla_put_u32(skb, TCA_EM_IPT_HOOK, im->hook) < 0) in em_ipt_dump()
258 if (nla_put_u8(skb, TCA_EM_IPT_MATCH_REVISION, im->match->revision) < 0) in em_ipt_dump()
260 if (nla_put_u8(skb, TCA_EM_IPT_NFPROTO, im->nfproto) < 0) in em_ipt_dump()
263 im->match->usersize ?: im->match->matchsize, in em_ipt_dump()
264 im->match_data) < 0) in em_ipt_dump()