Lines Matching refs:doi_def
94 struct cipso_v4_doi *doi_def) in netlbl_cipsov4_add_common() argument
100 doi_def->doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]); in netlbl_cipsov4_add_common()
111 doi_def->tags[iter++] = nla_get_u8(nla); in netlbl_cipsov4_add_common()
114 doi_def->tags[iter++] = CIPSO_V4_TAG_INVALID; in netlbl_cipsov4_add_common()
138 struct cipso_v4_doi *doi_def = NULL; in netlbl_cipsov4_add_std() local
154 doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); in netlbl_cipsov4_add_std()
155 if (doi_def == NULL) in netlbl_cipsov4_add_std()
157 doi_def->map.std = kzalloc(sizeof(*doi_def->map.std), GFP_KERNEL); in netlbl_cipsov4_add_std()
158 if (doi_def->map.std == NULL) { in netlbl_cipsov4_add_std()
162 doi_def->type = CIPSO_V4_MAP_TRANS; in netlbl_cipsov4_add_std()
164 ret_val = netlbl_cipsov4_add_common(info, doi_def); in netlbl_cipsov4_add_std()
184 doi_def->map.std->lvl.local_size) in netlbl_cipsov4_add_std()
185 doi_def->map.std->lvl.local_size = in netlbl_cipsov4_add_std()
193 doi_def->map.std->lvl.cipso_size) in netlbl_cipsov4_add_std()
194 doi_def->map.std->lvl.cipso_size = in netlbl_cipsov4_add_std()
199 doi_def->map.std->lvl.local = kcalloc(doi_def->map.std->lvl.local_size, in netlbl_cipsov4_add_std()
202 if (doi_def->map.std->lvl.local == NULL) { in netlbl_cipsov4_add_std()
206 doi_def->map.std->lvl.cipso = kcalloc(doi_def->map.std->lvl.cipso_size, in netlbl_cipsov4_add_std()
209 if (doi_def->map.std->lvl.cipso == NULL) { in netlbl_cipsov4_add_std()
213 for (iter = 0; iter < doi_def->map.std->lvl.local_size; iter++) in netlbl_cipsov4_add_std()
214 doi_def->map.std->lvl.local[iter] = CIPSO_V4_INV_LVL; in netlbl_cipsov4_add_std()
215 for (iter = 0; iter < doi_def->map.std->lvl.cipso_size; iter++) in netlbl_cipsov4_add_std()
216 doi_def->map.std->lvl.cipso[iter] = CIPSO_V4_INV_LVL; in netlbl_cipsov4_add_std()
230 doi_def->map.std->lvl.local[nla_get_u32(lvl_loc)] = in netlbl_cipsov4_add_std()
232 doi_def->map.std->lvl.cipso[nla_get_u32(lvl_rem)] = in netlbl_cipsov4_add_std()
258 doi_def->map.std->cat.local_size) in netlbl_cipsov4_add_std()
259 doi_def->map.std->cat.local_size = in netlbl_cipsov4_add_std()
267 doi_def->map.std->cat.cipso_size) in netlbl_cipsov4_add_std()
268 doi_def->map.std->cat.cipso_size = in netlbl_cipsov4_add_std()
273 doi_def->map.std->cat.local = kcalloc( in netlbl_cipsov4_add_std()
274 doi_def->map.std->cat.local_size, in netlbl_cipsov4_add_std()
277 if (doi_def->map.std->cat.local == NULL) { in netlbl_cipsov4_add_std()
281 doi_def->map.std->cat.cipso = kcalloc( in netlbl_cipsov4_add_std()
282 doi_def->map.std->cat.cipso_size, in netlbl_cipsov4_add_std()
285 if (doi_def->map.std->cat.cipso == NULL) { in netlbl_cipsov4_add_std()
289 for (iter = 0; iter < doi_def->map.std->cat.local_size; iter++) in netlbl_cipsov4_add_std()
290 doi_def->map.std->cat.local[iter] = CIPSO_V4_INV_CAT; in netlbl_cipsov4_add_std()
291 for (iter = 0; iter < doi_def->map.std->cat.cipso_size; iter++) in netlbl_cipsov4_add_std()
292 doi_def->map.std->cat.cipso[iter] = CIPSO_V4_INV_CAT; in netlbl_cipsov4_add_std()
306 doi_def->map.std->cat.local[ in netlbl_cipsov4_add_std()
309 doi_def->map.std->cat.cipso[ in netlbl_cipsov4_add_std()
315 ret_val = cipso_v4_doi_add(doi_def, audit_info); in netlbl_cipsov4_add_std()
321 cipso_v4_doi_free(doi_def); in netlbl_cipsov4_add_std()
340 struct cipso_v4_doi *doi_def = NULL; in netlbl_cipsov4_add_pass() local
345 doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); in netlbl_cipsov4_add_pass()
346 if (doi_def == NULL) in netlbl_cipsov4_add_pass()
348 doi_def->type = CIPSO_V4_MAP_PASS; in netlbl_cipsov4_add_pass()
350 ret_val = netlbl_cipsov4_add_common(info, doi_def); in netlbl_cipsov4_add_pass()
354 ret_val = cipso_v4_doi_add(doi_def, audit_info); in netlbl_cipsov4_add_pass()
360 cipso_v4_doi_free(doi_def); in netlbl_cipsov4_add_pass()
379 struct cipso_v4_doi *doi_def = NULL; in netlbl_cipsov4_add_local() local
384 doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); in netlbl_cipsov4_add_local()
385 if (doi_def == NULL) in netlbl_cipsov4_add_local()
387 doi_def->type = CIPSO_V4_MAP_LOCAL; in netlbl_cipsov4_add_local()
389 ret_val = netlbl_cipsov4_add_common(info, doi_def); in netlbl_cipsov4_add_local()
393 ret_val = cipso_v4_doi_add(doi_def, audit_info); in netlbl_cipsov4_add_local()
399 cipso_v4_doi_free(doi_def); in netlbl_cipsov4_add_local()
467 struct cipso_v4_doi *doi_def; in netlbl_cipsov4_list() local
491 doi_def = cipso_v4_doi_getdef(doi); in netlbl_cipsov4_list()
492 if (doi_def == NULL) { in netlbl_cipsov4_list()
497 ret_val = nla_put_u32(ans_skb, NLBL_CIPSOV4_A_MTYPE, doi_def->type); in netlbl_cipsov4_list()
508 doi_def->tags[iter] != CIPSO_V4_TAG_INVALID; in netlbl_cipsov4_list()
512 doi_def->tags[iter]); in netlbl_cipsov4_list()
518 switch (doi_def->type) { in netlbl_cipsov4_list()
526 iter < doi_def->map.std->lvl.local_size; in netlbl_cipsov4_list()
528 if (doi_def->map.std->lvl.local[iter] == in netlbl_cipsov4_list()
544 doi_def->map.std->lvl.local[iter]); in netlbl_cipsov4_list()
557 iter < doi_def->map.std->cat.local_size; in netlbl_cipsov4_list()
559 if (doi_def->map.std->cat.local[iter] == in netlbl_cipsov4_list()
575 doi_def->map.std->cat.local[iter]); in netlbl_cipsov4_list()
616 static int netlbl_cipsov4_listall_cb(struct cipso_v4_doi *doi_def, void *arg) in netlbl_cipsov4_listall_cb() argument
628 ret_val = nla_put_u32(cb_arg->skb, NLBL_CIPSOV4_A_DOI, doi_def->doi); in netlbl_cipsov4_listall_cb()
633 doi_def->type); in netlbl_cipsov4_listall_cb()