Lines Matching refs:new

53 	struct cil_list *new;
56 cil_list_init(&new, data->flavor);
61 cil_list_append(new, CIL_STRING, orig_item->data);
66 cil_list_append(new, CIL_LIST, new_sub);
75 cil_list_append(new, CIL_PARAM, pn);
80 cil_list_append(new, orig_item->flavor, orig_item->data);
85 *copy = new;
90 char *new = NULL;
93 new = data;
95 *copy = new;
117 struct cil_block *new;
118 cil_block_init(&new);
119 *copy = new;
128 struct cil_blockabstract *new = NULL;
130 cil_blockabstract_init(&new);
132 new->block_str = orig->block_str;
134 *copy = new;
142 struct cil_blockinherit *new = NULL;
144 cil_blockinherit_init(&new);
146 new->block_str = orig->block_str;
147 new->block = orig->block;
149 *copy = new;
162 struct cil_policycap *new;
163 cil_policycap_init(&new);
164 *copy = new;
180 struct cil_perm *new;
181 cil_perm_init(&new);
182 *copy = new;
190 void cil_copy_classperms(struct cil_classperms *orig, struct cil_classperms **new)
192 cil_classperms_init(new);
193 (*new)->class_str = orig->class_str;
194 cil_copy_list(orig->perm_strs, &((*new)->perm_strs));
197 void cil_copy_classperms_set(struct cil_classperms_set *orig, struct cil_classperms_set **new)
199 cil_classperms_set_init(new);
200 (*new)->set_str = orig->set_str;
203 void cil_copy_classperms_list(struct cil_list *orig, struct cil_list **new)
211 cil_list_init(new, CIL_LIST_ITEM);
216 cil_list_append(*new, CIL_CLASSPERMS, cp);
220 cil_list_append(*new, CIL_CLASSPERMS_SET, cp_set);
228 struct cil_classmapping *new = NULL;
230 cil_classmapping_init(&new);
232 new->map_class_str = orig->map_class_str;
233 new->map_perm_str = orig->map_perm_str;
235 cil_copy_classperms_list(orig->classperms, &new->classperms);
237 *copy = new;
245 struct cil_class *new = NULL;
255 cil_class_init(&new);
257 new->common = NULL;
259 *copy = new;
267 struct cil_classorder *new = NULL;
269 cil_classorder_init(&new);
271 cil_copy_list(orig->class_list_str, &new->class_list_str);
274 *copy = new;
282 struct cil_classpermission *new = NULL;
294 cil_classpermission_init(&new);
296 cil_copy_classperms_list(orig->classperms, &new->classperms);
298 *copy = new;
306 struct cil_classpermissionset *new = NULL;
308 cil_classpermissionset_init(&new);
310 new->set_str = orig->set_str;
312 cil_copy_classperms_list(orig->classperms, &new->classperms);
314 *copy = new;
322 struct cil_classcommon *new = NULL;
324 cil_classcommon_init(&new);
326 new->class_str = orig->class_str;
327 new->common_str = orig->common_str;
329 *copy = new;
342 struct cil_sid *new;
343 cil_sid_init(&new);
344 *copy = new;
355 struct cil_sidcontext *new = NULL;
357 cil_sidcontext_init(&new);
360 new->context_str = orig->context_str;
362 cil_context_init(&new->context);
363 cil_copy_fill_context(db, orig->context, new->context);
366 *copy = new;
374 struct cil_sidorder *new = NULL;
376 cil_sidorder_init(&new);
378 cil_copy_list(orig->sid_list_str, &new->sid_list_str);
381 *copy = new;
394 struct cil_user *new;
395 cil_user_init(&new);
396 *copy = new;
407 struct cil_userattribute *new = NULL;
413 cil_userattribute_init(&new);
414 *copy = new;
425 struct cil_userattributeset *new = NULL;
427 cil_userattributeset_init(&new);
429 new->attr_str = orig->attr_str;
431 cil_copy_expr(db, orig->str_expr, &new->str_expr);
432 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
434 *copy = new;
442 struct cil_userrole *new = NULL;
444 cil_userrole_init(&new);
446 new->user_str = orig->user_str;
447 new->role_str = orig->role_str;
449 *copy = new;
457 struct cil_userlevel *new = NULL;
459 cil_userlevel_init(&new);
461 new->user_str = orig->user_str;
464 new->level_str = orig->level_str;
466 cil_copy_fill_level(db, orig->level, &new->level);
469 *copy = new;
477 struct cil_userrange *new = NULL;
479 cil_userrange_init(&new);
481 new->user_str = orig->user_str;
484 new->range_str = orig->range_str;
486 cil_levelrange_init(&new->range);
487 cil_copy_fill_levelrange(db, orig->range, new->range);
490 *copy = new;
498 struct cil_userprefix *new = NULL;
500 cil_userprefix_init(&new);
502 new->user_str = orig->user_str;
503 new->prefix_str = orig->prefix_str;
505 *copy = new;
518 struct cil_role *new;
519 cil_role_init(&new);
520 *copy = new;
531 struct cil_roletype *new = NULL;
533 cil_roletype_init(&new);
535 new->role_str = orig->role_str;
536 new->type_str = orig->type_str;
538 *copy = new;
551 struct cil_roleattribute *new;
552 cil_roleattribute_init(&new);
553 *copy = new;
564 struct cil_roleattributeset *new = NULL;
566 cil_roleattributeset_init(&new);
568 new->attr_str = orig->attr_str;
570 cil_copy_expr(db, orig->str_expr, &new->str_expr);
571 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
573 *copy = new;
581 struct cil_roleallow *new = NULL;
583 cil_roleallow_init(&new);
585 new->src_str = orig->src_str;
586 new->tgt_str = orig->tgt_str;
588 *copy = new;
595 struct cil_type *new;
597 cil_type_init(&new);
598 *copy = new;
606 struct cil_typepermissive *new = NULL;
608 cil_typepermissive_init(&new);
610 new->type_str = orig->type_str;
612 *copy = new;
619 struct cil_typeattribute *new;
621 cil_typeattribute_init(&new);
622 *copy = new;
630 struct cil_typeattributeset *new = NULL;
632 cil_typeattributeset_init(&new);
634 new->attr_str = orig->attr_str;
636 cil_copy_expr(db, orig->str_expr, &new->str_expr);
637 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
639 *copy = new;
647 struct cil_expandtypeattribute *new = NULL;
649 cil_expandtypeattribute_init(&new);
652 cil_copy_list(orig->attr_strs, &new->attr_strs);
656 cil_copy_list(orig->attr_datums, &new->attr_datums);
659 new->expand = orig->expand;
661 *copy = new;
669 struct cil_alias *new = NULL;
679 cil_alias_init(&new);
681 *copy = new;
689 struct cil_aliasactual *new = NULL;
691 cil_aliasactual_init(&new);
693 new->alias_str = orig->alias_str;
694 new->actual_str = orig->actual_str;
696 *copy = new;
704 struct cil_roletransition *new = NULL;
706 cil_roletransition_init(&new);
708 new->src_str = orig->src_str;
709 new->tgt_str = orig->tgt_str;
710 new->obj_str = orig->obj_str;
711 new->result_str = orig->result_str;
713 *copy = new;
721 struct cil_nametypetransition *new = NULL;
723 cil_nametypetransition_init(&new);
725 new->src_str = orig->src_str;
726 new->tgt_str = orig->tgt_str;
727 new->obj_str = orig->obj_str;
728 new->name_str = orig->name_str;
729 new->result_str = orig->result_str;
732 *copy = new;
740 struct cil_rangetransition *new = NULL;
742 cil_rangetransition_init(&new);
744 new->src_str = orig->src_str;
745 new->exec_str = orig->exec_str;
746 new->obj_str = orig->obj_str;
749 new->range_str = orig->range_str;
751 cil_levelrange_init(&new->range);
752 cil_copy_fill_levelrange(db, orig->range, new->range);
755 *copy = new;
763 struct cil_bool *new = NULL;
773 cil_bool_init(&new);
774 new->value = orig->value;
775 *copy = new;
783 struct cil_tunable *new = NULL;
793 cil_tunable_init(&new);
794 new->value = orig->value;
795 *copy = new;
800 static void cil_copy_fill_permissionx(struct cil_db *db, struct cil_permissionx *orig, struct cil_permissionx *new)
802 new->kind = orig->kind;
803 new->obj_str = orig->obj_str;
804 cil_copy_expr(db, orig->expr_str, &new->expr_str);
810 struct cil_avrule *new = NULL;
812 cil_avrule_init(&new);
814 new->is_extended = orig->is_extended;
815 new->rule_kind = orig->rule_kind;
816 new->src_str = orig->src_str;
817 new->tgt_str = orig->tgt_str;
819 if (!new->is_extended) {
820 cil_copy_classperms_list(orig->perms.classperms, &new->perms.classperms);
823 new->perms.x.permx_str = orig->perms.x.permx_str;
825 cil_permissionx_init(&new->perms.x.permx);
826 cil_copy_fill_permissionx(db, orig->perms.x.permx, new->perms.x.permx);
830 *copy = new;
838 struct cil_permissionx *new = NULL;
849 cil_permissionx_init(&new);
850 cil_copy_fill_permissionx(db, orig, new);
852 *copy = new;
860 struct cil_type_rule *new = NULL;
862 cil_type_rule_init(&new);
864 new->rule_kind = orig->rule_kind;
865 new->src_str = orig->src_str;
866 new->tgt_str = orig->tgt_str;
867 new->obj_str = orig->obj_str;
868 new->result_str = orig->result_str;
870 *copy = new;
883 struct cil_sens *new;
884 cil_sens_init(&new);
885 *copy = new;
901 struct cil_cat *new;
902 cil_cat_init(&new);
903 *copy = new;
911 static void cil_copy_cats(struct cil_db *db, struct cil_cats *orig, struct cil_cats **new)
913 cil_cats_init(new);
914 cil_copy_expr(db, orig->str_expr, &(*new)->str_expr);
915 cil_copy_expr(db, orig->datum_expr, &(*new)->datum_expr);
921 struct cil_catset *new = NULL;
931 cil_catset_init(&new);
933 cil_copy_cats(db, orig->cats, &new->cats);
935 *copy = new;
943 struct cil_senscat *new = NULL;
945 cil_senscat_init(&new);
947 new->sens_str = orig->sens_str;
949 cil_copy_cats(db, orig->cats, &new->cats);
951 *copy = new;
959 struct cil_catorder *new = NULL;
961 cil_catorder_init(&new);
963 cil_copy_list(orig->cat_list_str, &new->cat_list_str);
966 *copy = new;
974 struct cil_sensorder *new = NULL;
976 cil_sensorder_init(&new);
978 cil_copy_list(orig->sens_list_str, &new->sens_list_str);
981 *copy = new;
986 void cil_copy_fill_level(struct cil_db *db, struct cil_level *orig, struct cil_level **new)
988 cil_level_init(new);
990 (*new)->sens_str = orig->sens_str;
993 cil_copy_cats(db, orig->cats, &(*new)->cats);
1000 struct cil_level *new = NULL;
1012 cil_copy_fill_level(db, orig, &new);
1014 *copy = new;
1019 void cil_copy_fill_levelrange(struct cil_db *db, struct cil_levelrange *data, struct cil_levelrange *new)
1022 new->low_str = data->low_str;
1024 cil_copy_fill_level(db, data->low, &new->low);
1028 new->high_str = data->high_str;
1030 cil_copy_fill_level(db, data->high, &new->high);
1037 struct cil_levelrange *new = NULL;
1049 cil_levelrange_init(&new);
1050 cil_copy_fill_levelrange(db, orig, new);
1052 *copy = new;
1057 void cil_copy_fill_context(struct cil_db *db, struct cil_context *data, struct cil_context *new)
1059 new->user_str = data->user_str;
1060 new->role_str = data->role_str;
1061 new->type_str = data->type_str;
1064 new->range_str = data->range_str;
1066 cil_levelrange_init(&new->range);
1067 cil_copy_fill_levelrange(db, data->range, new->range);
1074 struct cil_context *new = NULL;
1086 cil_context_init(&new);
1087 cil_copy_fill_context(db, orig, new);
1089 *copy = new;
1097 struct cil_netifcon *new = NULL;
1099 cil_netifcon_init(&new);
1101 new->interface_str = orig->interface_str;
1104 new->if_context_str = orig->if_context_str;
1106 cil_context_init(&new->if_context);
1107 cil_copy_fill_context(db, orig->if_context, new->if_context);
1111 new->packet_context_str = orig->packet_context_str;
1113 cil_context_init(&new->packet_context);
1114 cil_copy_fill_context(db, orig->packet_context, new->packet_context);
1117 *copy = new;
1125 struct cil_genfscon *new = NULL;
1127 cil_genfscon_init(&new);
1129 new->fs_str = orig->fs_str;
1130 new->path_str = orig->path_str;
1133 new->context_str = orig->context_str;
1135 cil_context_init(&new->context);
1136 cil_copy_fill_context(db, orig->context, new->context);
1139 *copy = new;
1147 struct cil_filecon *new = NULL;
1149 cil_filecon_init(&new);
1151 new->path_str = orig->path_str;
1152 new->type = orig->type;
1155 new->context_str = orig->context_str;
1157 cil_context_init(&new->context);
1158 cil_copy_fill_context(db, orig->context, new->context);
1161 *copy = new;
1169 struct cil_nodecon *new = NULL;
1171 cil_nodecon_init(&new);
1174 new->addr_str = orig->addr_str;
1176 cil_ipaddr_init(&new->addr);
1177 cil_copy_fill_ipaddr(orig->addr, new->addr);
1181 new->mask_str = orig->mask_str;
1183 cil_ipaddr_init(&new->mask);
1184 cil_copy_fill_ipaddr(orig->mask, new->mask);
1188 new->context_str = orig->context_str;
1190 cil_context_init(&new->context);
1191 cil_copy_fill_context(db, orig->context, new->context);
1194 *copy = new;
1202 struct cil_ibpkeycon *new = NULL;
1204 cil_ibpkeycon_init(&new);
1206 new->subnet_prefix_str = orig->subnet_prefix_str;
1207 new->pkey_low = orig->pkey_low;
1208 new->pkey_high = orig->pkey_high;
1211 new->context_str = orig->context_str;
1213 cil_context_init(&new->context);
1214 cil_copy_fill_context(db, orig->context, new->context);
1217 *copy = new;
1225 struct cil_ibendportcon *new = NULL;
1227 cil_ibendportcon_init(&new);
1229 new->dev_name_str = orig->dev_name_str;
1230 new->port = orig->port;
1233 new->context_str = orig->context_str;
1235 cil_context_init(&new->context);
1236 cil_copy_fill_context(db, orig->context, new->context);
1239 *copy = new;
1247 struct cil_portcon *new = NULL;
1249 cil_portcon_init(&new);
1251 new->proto = orig->proto;
1252 new->port_low = orig->port_low;
1253 new->port_high = orig->port_high;
1256 new->context_str = orig->context_str;
1258 cil_context_init(&new->context);
1259 cil_copy_fill_context(db, orig->context, new->context);
1262 *copy = new;
1270 struct cil_pirqcon *new = NULL;
1272 cil_pirqcon_init(&new);
1274 new->pirq = orig->pirq;
1277 new->context_str = orig->context_str;
1279 cil_context_init(&new->context);
1280 cil_copy_fill_context(db, orig->context, new->context);
1283 *copy = new;
1291 struct cil_iomemcon *new = NULL;
1293 cil_iomemcon_init(&new);
1295 new->iomem_low = orig->iomem_low;
1296 new->iomem_high = orig->iomem_high;
1299 new->context_str = orig->context_str;
1301 cil_context_init(&new->context);
1302 cil_copy_fill_context(db, orig->context, new->context);
1305 *copy = new;
1313 struct cil_ioportcon *new = NULL;
1315 cil_ioportcon_init(&new);
1317 new->ioport_low = orig->ioport_low;
1318 new->ioport_high = orig->ioport_high;
1321 new->context_str = orig->context_str;
1323 cil_context_init(&new->context);
1324 cil_copy_fill_context(db, orig->context, new->context);
1327 *copy = new;
1335 struct cil_pcidevicecon *new = NULL;
1337 cil_pcidevicecon_init(&new);
1339 new->dev = orig->dev;
1342 new->context_str = orig->context_str;
1344 cil_context_init(&new->context);
1345 cil_copy_fill_context(db, orig->context, new->context);
1348 *copy = new;
1356 struct cil_devicetreecon *new = NULL;
1358 cil_devicetreecon_init(&new);
1360 new->path = orig->path;
1363 new->context_str = orig->context_str;
1365 cil_context_init(&new->context);
1366 cil_copy_fill_context(db, orig->context, new->context);
1369 *copy = new;
1377 struct cil_fsuse *new = NULL;
1379 cil_fsuse_init(&new);
1381 new->type = orig->type;
1382 new->fs_str = orig->fs_str;
1385 new->context_str = orig->context_str;
1387 cil_context_init(&new->context);
1388 cil_copy_fill_context(db, orig->context, new->context);
1391 *copy = new;
1396 int cil_copy_expr(struct cil_db *db, struct cil_list *orig, struct cil_list **new)
1401 *new = NULL;
1405 cil_list_init(new, orig->flavor);
1412 cil_list_append(*new, CIL_LIST, sub_list);
1416 cil_list_append(*new, CIL_STRING, curr->data);
1419 cil_list_append(*new, curr->flavor, curr->data);
1422 cil_list_append(*new, curr->flavor, curr->data);
1425 cil_list_append(*new, curr->flavor, curr->data);
1429 cil_list_append(*new, curr->flavor, curr->data);
1440 struct cil_constrain *new = NULL;
1442 cil_constrain_init(&new);
1443 cil_copy_classperms_list(orig->classperms, &new->classperms);
1445 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1446 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1448 *copy = new;
1456 struct cil_validatetrans *new = NULL;
1458 cil_validatetrans_init(&new);
1460 new->class_str = orig->class_str;
1462 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1463 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1465 *copy = new;
1473 struct cil_call *new = NULL;
1476 cil_call_init(&new);
1478 new->macro_str = orig->macro_str;
1479 new->macro = orig->macro;
1482 cil_tree_init(&new->args_tree);
1483 rc = cil_copy_ast(db, orig->args_tree->root, new->args_tree->root);
1489 new->copied = orig->copied;
1491 *copy = new;
1496 cil_destroy_call(new);
1517 struct cil_macro *new;
1518 cil_macro_init(&new);
1520 cil_copy_list(orig->params, &new->params);
1522 *copy = new;
1530 struct cil_optional *new;
1532 cil_optional_init(&new);
1533 *copy = new;
1538 void cil_copy_fill_ipaddr(struct cil_ipaddr *data, struct cil_ipaddr *new)
1540 new->family = data->family;
1541 memcpy(&new->ip, &data->ip, sizeof(data->ip));
1547 struct cil_ipaddr *new = NULL;
1557 cil_ipaddr_init(&new);
1558 cil_copy_fill_ipaddr(orig, new);
1560 *copy = new;
1568 struct cil_condblock *new = *copy;
1569 cil_condblock_init(&new);
1570 new->flavor = orig->flavor;
1571 *copy = new;
1579 struct cil_booleanif *new = NULL;
1581 cil_boolif_init(&new);
1583 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1584 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1585 new->preserved_tunable = orig->preserved_tunable;
1587 *copy = new;
1595 struct cil_tunableif *new = NULL;
1597 cil_tunif_init(&new);
1599 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1600 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1602 *copy = new;
1610 struct cil_default *new = NULL;
1612 cil_default_init(&new);
1614 new->flavor = orig->flavor;
1617 cil_copy_list(orig->class_strs, &new->class_strs);
1620 new->object = orig->object;
1622 *copy = new;
1630 struct cil_defaultrange *new = NULL;
1632 cil_defaultrange_init(&new);
1635 cil_copy_list(orig->class_strs, &new->class_strs);
1638 new->object_range = orig->object_range;
1640 *copy = new;
1648 struct cil_handleunknown *new = NULL;
1650 cil_handleunknown_init(&new);
1651 new->handle_unknown = orig->handle_unknown;
1652 *copy = new;
1660 struct cil_mls *new = NULL;
1662 cil_mls_init(&new);
1663 new->value = orig->value;
1664 *copy = new;
1672 struct cil_bounds *new = NULL;
1674 cil_bounds_init(&new);
1676 new->parent_str = orig->parent_str;
1677 new->child_str = orig->child_str;
1679 *copy = new;
1687 struct cil_src_info *new = NULL;
1689 cil_src_info_init(&new);
1691 new->kind = orig->kind;
1692 new->hll_line = orig->hll_line;
1693 new->path = orig->path;
1695 *copy = new;
1704 struct cil_tree_node *new = NULL;
2021 cil_tree_node_init(&new);
2023 new->parent = parent;
2024 new->line = orig->line;
2025 new->hll_offset = orig->hll_offset;
2026 new->flavor = orig->flavor;
2027 new->data = data;
2036 cil_list_append(DATUM(new->data)->nodes, CIL_NODE, new);
2042 new->flavor = FLAVOR(data);
2047 rc = cil_add_decl_to_symtab(db, symtab, DATUM(orig->data)->name, DATUM(data), new);
2059 namespace = new;
2072 if (new->flavor == CIL_BLOCKINHERIT) {
2073 blockinherit = new->data;
2080 cil_list_append(blockinherit->block->bi_nodes, CIL_NODE, new);
2085 parent->cl_head = new;
2086 parent->cl_tail = new;
2088 parent->cl_tail->next = new;
2089 parent->cl_tail = new;
2093 args->dest = new;
2103 cil_tree_node_destroy(&new);