Lines Matching refs:doi_def

80 				     struct cipso_v4_doi *doi_def)  in netlbl_cipsov4_add_common()  argument
86 doi_def->doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]); in netlbl_cipsov4_add_common()
98 doi_def->tags[iter++] = nla_get_u8(nla); in netlbl_cipsov4_add_common()
101 doi_def->tags[iter++] = CIPSO_V4_TAG_INVALID; in netlbl_cipsov4_add_common()
125 struct cipso_v4_doi *doi_def = NULL; in netlbl_cipsov4_add_std() local
142 doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); in netlbl_cipsov4_add_std()
143 if (doi_def == NULL) in netlbl_cipsov4_add_std()
145 doi_def->map.std = kzalloc(sizeof(*doi_def->map.std), GFP_KERNEL); in netlbl_cipsov4_add_std()
146 if (doi_def->map.std == NULL) { in netlbl_cipsov4_add_std()
147 kfree(doi_def); in netlbl_cipsov4_add_std()
150 doi_def->type = CIPSO_V4_MAP_TRANS; in netlbl_cipsov4_add_std()
152 ret_val = netlbl_cipsov4_add_common(info, doi_def); in netlbl_cipsov4_add_std()
173 doi_def->map.std->lvl.local_size) in netlbl_cipsov4_add_std()
174 doi_def->map.std->lvl.local_size = in netlbl_cipsov4_add_std()
182 doi_def->map.std->lvl.cipso_size) in netlbl_cipsov4_add_std()
183 doi_def->map.std->lvl.cipso_size = in netlbl_cipsov4_add_std()
188 doi_def->map.std->lvl.local = kcalloc(doi_def->map.std->lvl.local_size, in netlbl_cipsov4_add_std()
191 if (doi_def->map.std->lvl.local == NULL) { in netlbl_cipsov4_add_std()
195 doi_def->map.std->lvl.cipso = kcalloc(doi_def->map.std->lvl.cipso_size, in netlbl_cipsov4_add_std()
198 if (doi_def->map.std->lvl.cipso == NULL) { in netlbl_cipsov4_add_std()
202 for (iter = 0; iter < doi_def->map.std->lvl.local_size; iter++) in netlbl_cipsov4_add_std()
203 doi_def->map.std->lvl.local[iter] = CIPSO_V4_INV_LVL; in netlbl_cipsov4_add_std()
204 for (iter = 0; iter < doi_def->map.std->lvl.cipso_size; iter++) in netlbl_cipsov4_add_std()
205 doi_def->map.std->lvl.cipso[iter] = CIPSO_V4_INV_LVL; in netlbl_cipsov4_add_std()
219 doi_def->map.std->lvl.local[nla_get_u32(lvl_loc)] = in netlbl_cipsov4_add_std()
221 doi_def->map.std->lvl.cipso[nla_get_u32(lvl_rem)] = in netlbl_cipsov4_add_std()
248 doi_def->map.std->cat.local_size) in netlbl_cipsov4_add_std()
249 doi_def->map.std->cat.local_size = in netlbl_cipsov4_add_std()
257 doi_def->map.std->cat.cipso_size) in netlbl_cipsov4_add_std()
258 doi_def->map.std->cat.cipso_size = in netlbl_cipsov4_add_std()
263 doi_def->map.std->cat.local = kcalloc( in netlbl_cipsov4_add_std()
264 doi_def->map.std->cat.local_size, in netlbl_cipsov4_add_std()
267 if (doi_def->map.std->cat.local == NULL) { in netlbl_cipsov4_add_std()
271 doi_def->map.std->cat.cipso = kcalloc( in netlbl_cipsov4_add_std()
272 doi_def->map.std->cat.cipso_size, in netlbl_cipsov4_add_std()
275 if (doi_def->map.std->cat.cipso == NULL) { in netlbl_cipsov4_add_std()
279 for (iter = 0; iter < doi_def->map.std->cat.local_size; iter++) in netlbl_cipsov4_add_std()
280 doi_def->map.std->cat.local[iter] = CIPSO_V4_INV_CAT; in netlbl_cipsov4_add_std()
281 for (iter = 0; iter < doi_def->map.std->cat.cipso_size; iter++) in netlbl_cipsov4_add_std()
282 doi_def->map.std->cat.cipso[iter] = CIPSO_V4_INV_CAT; in netlbl_cipsov4_add_std()
296 doi_def->map.std->cat.local[ in netlbl_cipsov4_add_std()
299 doi_def->map.std->cat.cipso[ in netlbl_cipsov4_add_std()
305 ret_val = cipso_v4_doi_add(doi_def, audit_info); in netlbl_cipsov4_add_std()
311 cipso_v4_doi_free(doi_def); in netlbl_cipsov4_add_std()
330 struct cipso_v4_doi *doi_def = NULL; in netlbl_cipsov4_add_pass() local
335 doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); in netlbl_cipsov4_add_pass()
336 if (doi_def == NULL) in netlbl_cipsov4_add_pass()
338 doi_def->type = CIPSO_V4_MAP_PASS; in netlbl_cipsov4_add_pass()
340 ret_val = netlbl_cipsov4_add_common(info, doi_def); in netlbl_cipsov4_add_pass()
344 ret_val = cipso_v4_doi_add(doi_def, audit_info); in netlbl_cipsov4_add_pass()
350 cipso_v4_doi_free(doi_def); in netlbl_cipsov4_add_pass()
369 struct cipso_v4_doi *doi_def = NULL; in netlbl_cipsov4_add_local() local
374 doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); in netlbl_cipsov4_add_local()
375 if (doi_def == NULL) in netlbl_cipsov4_add_local()
377 doi_def->type = CIPSO_V4_MAP_LOCAL; in netlbl_cipsov4_add_local()
379 ret_val = netlbl_cipsov4_add_common(info, doi_def); in netlbl_cipsov4_add_local()
383 ret_val = cipso_v4_doi_add(doi_def, audit_info); in netlbl_cipsov4_add_local()
389 cipso_v4_doi_free(doi_def); in netlbl_cipsov4_add_local()
457 struct cipso_v4_doi *doi_def; in netlbl_cipsov4_list() local
481 doi_def = cipso_v4_doi_getdef(doi); in netlbl_cipsov4_list()
482 if (doi_def == NULL) { in netlbl_cipsov4_list()
487 ret_val = nla_put_u32(ans_skb, NLBL_CIPSOV4_A_MTYPE, doi_def->type); in netlbl_cipsov4_list()
498 doi_def->tags[iter] != CIPSO_V4_TAG_INVALID; in netlbl_cipsov4_list()
502 doi_def->tags[iter]); in netlbl_cipsov4_list()
508 switch (doi_def->type) { in netlbl_cipsov4_list()
517 iter < doi_def->map.std->lvl.local_size; in netlbl_cipsov4_list()
519 if (doi_def->map.std->lvl.local[iter] == in netlbl_cipsov4_list()
536 doi_def->map.std->lvl.local[iter]); in netlbl_cipsov4_list()
550 iter < doi_def->map.std->cat.local_size; in netlbl_cipsov4_list()
552 if (doi_def->map.std->cat.local[iter] == in netlbl_cipsov4_list()
569 doi_def->map.std->cat.local[iter]); in netlbl_cipsov4_list()
578 cipso_v4_doi_putdef(doi_def); in netlbl_cipsov4_list()
587 cipso_v4_doi_putdef(doi_def); in netlbl_cipsov4_list()
594 cipso_v4_doi_putdef(doi_def); in netlbl_cipsov4_list()
613 static int netlbl_cipsov4_listall_cb(struct cipso_v4_doi *doi_def, void *arg) in netlbl_cipsov4_listall_cb() argument
625 ret_val = nla_put_u32(cb_arg->skb, NLBL_CIPSOV4_A_DOI, doi_def->doi); in netlbl_cipsov4_listall_cb()
630 doi_def->type); in netlbl_cipsov4_listall_cb()