Lines Matching refs:new

51 	struct cil_list *new;
54 cil_list_init(&new, data->flavor);
59 cil_list_append(new, CIL_STRING, orig_item->data);
64 cil_list_append(new, CIL_LIST, new_sub);
73 cil_list_append(new, CIL_PARAM, pn);
78 cil_list_append(new, orig_item->flavor, orig_item->data);
83 *copy = new;
88 char *new = NULL;
91 new = data;
93 *copy = new;
106 struct cil_block *new;
107 cil_block_init(&new);
108 *copy = new;
119 struct cil_blockabstract *new = NULL;
121 cil_blockabstract_init(&new);
123 new->block_str = orig->block_str;
125 *copy = new;
133 struct cil_blockinherit *new = NULL;
135 cil_blockinherit_init(&new);
137 new->block_str = orig->block_str;
138 new->block = orig->block;
140 *copy = new;
153 struct cil_policycap *new;
154 cil_policycap_init(&new);
155 *copy = new;
171 struct cil_perm *new;
172 cil_perm_init(&new);
173 *copy = new;
181 void cil_copy_classperms(struct cil_classperms *orig, struct cil_classperms **new)
183 cil_classperms_init(new);
184 (*new)->class_str = orig->class_str;
185 cil_copy_list(orig->perm_strs, &((*new)->perm_strs));
188 void cil_copy_classperms_set(struct cil_classperms_set *orig, struct cil_classperms_set **new)
190 cil_classperms_set_init(new);
191 (*new)->set_str = orig->set_str;
194 void cil_copy_classperms_list(struct cil_list *orig, struct cil_list **new)
202 cil_list_init(new, CIL_LIST_ITEM);
207 cil_list_append(*new, CIL_CLASSPERMS, cp);
211 cil_list_append(*new, CIL_CLASSPERMS_SET, cp_set);
219 struct cil_classmapping *new = NULL;
221 cil_classmapping_init(&new);
223 new->map_class_str = orig->map_class_str;
224 new->map_perm_str = orig->map_perm_str;
226 cil_copy_classperms_list(orig->classperms, &new->classperms);
228 *copy = new;
236 struct cil_class *new = NULL;
246 cil_class_init(&new);
248 new->common = NULL;
250 *copy = new;
258 struct cil_classorder *new = NULL;
260 cil_classorder_init(&new);
262 cil_copy_list(orig->class_list_str, &new->class_list_str);
265 *copy = new;
273 struct cil_classpermission *new = NULL;
285 cil_copy_classperms_list(orig->classperms, &new->classperms);
287 *copy = new;
295 struct cil_classpermissionset *new = NULL;
297 new->set_str = orig->set_str;
299 cil_copy_classperms_list(orig->classperms, &new->classperms);
301 *copy = new;
309 struct cil_classcommon *new = NULL;
311 cil_classcommon_init(&new);
313 new->class_str = orig->class_str;
314 new->common_str = orig->common_str;
316 *copy = new;
329 struct cil_sid *new;
330 cil_sid_init(&new);
331 *copy = new;
342 struct cil_sidcontext *new = NULL;
344 cil_sidcontext_init(&new);
347 new->context_str = orig->context_str;
349 cil_context_init(&new->context);
350 cil_copy_fill_context(db, orig->context, new->context);
353 *copy = new;
361 struct cil_sidorder *new = NULL;
363 cil_sidorder_init(&new);
365 cil_copy_list(orig->sid_list_str, &new->sid_list_str);
368 *copy = new;
381 struct cil_user *new;
382 cil_user_init(&new);
383 *copy = new;
394 struct cil_userrole *new = NULL;
396 cil_userrole_init(&new);
398 new->user_str = orig->user_str;
399 new->role_str = orig->role_str;
401 *copy = new;
409 struct cil_userlevel *new = NULL;
411 cil_userlevel_init(&new);
413 new->user_str = orig->user_str;
416 new->level_str = orig->level_str;
418 cil_copy_fill_level(db, orig->level, &new->level);
421 *copy = new;
429 struct cil_userrange *new = NULL;
431 cil_userrange_init(&new);
433 new->user_str = orig->user_str;
436 new->range_str = orig->range_str;
438 cil_levelrange_init(&new->range);
439 cil_copy_fill_levelrange(db, orig->range, new->range);
442 *copy = new;
450 struct cil_userprefix *new = NULL;
452 cil_userprefix_init(&new);
454 new->user_str = orig->user_str;
455 new->prefix_str = orig->prefix_str;
457 *copy = new;
470 struct cil_role *new;
471 cil_role_init(&new);
472 *copy = new;
483 struct cil_roletype *new = NULL;
485 cil_roletype_init(&new);
487 new->role_str = orig->role_str;
488 new->type_str = orig->type_str;
490 *copy = new;
503 struct cil_roleattribute *new;
504 cil_roleattribute_init(&new);
505 *copy = new;
516 struct cil_roleattributeset *new = NULL;
518 cil_roleattributeset_init(&new);
520 new->attr_str = orig->attr_str;
522 cil_copy_expr(db, orig->str_expr, &new->str_expr);
523 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
525 *copy = new;
533 struct cil_roleallow *new = NULL;
535 cil_roleallow_init(&new);
537 new->src_str = orig->src_str;
538 new->tgt_str = orig->tgt_str;
540 *copy = new;
553 struct cil_type *new;
554 cil_type_init(&new);
555 *copy = new;
566 struct cil_typepermissive *new = NULL;
568 cil_typepermissive_init(&new);
570 new->type_str = orig->type_str;
572 *copy = new;
585 struct cil_typeattribute *new;
586 cil_typeattribute_init(&new);
587 *copy = new;
598 struct cil_typeattributeset *new = NULL;
600 cil_typeattributeset_init(&new);
602 new->attr_str = orig->attr_str;
604 cil_copy_expr(db, orig->str_expr, &new->str_expr);
605 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
607 *copy = new;
615 struct cil_alias *new = NULL;
625 cil_alias_init(&new);
627 *copy = new;
635 struct cil_aliasactual *new = NULL;
637 cil_aliasactual_init(&new);
639 new->alias_str = orig->alias_str;
640 new->actual_str = orig->actual_str;
642 *copy = new;
650 struct cil_roletransition *new = NULL;
652 cil_roletransition_init(&new);
654 new->src_str = orig->src_str;
655 new->tgt_str = orig->tgt_str;
656 new->obj_str = orig->obj_str;
657 new->result_str = orig->result_str;
659 *copy = new;
667 struct cil_nametypetransition *new = NULL;
669 cil_nametypetransition_init(&new);
671 new->src_str = orig->src_str;
672 new->tgt_str = orig->tgt_str;
673 new->obj_str = orig->obj_str;
674 new->name_str = orig->name_str;
675 new->result_str = orig->result_str;
678 *copy = new;
686 struct cil_rangetransition *new = NULL;
688 cil_rangetransition_init(&new);
690 new->src_str = orig->src_str;
691 new->exec_str = orig->exec_str;
692 new->obj_str = orig->obj_str;
695 new->range_str = orig->range_str;
697 cil_levelrange_init(&new->range);
698 cil_copy_fill_levelrange(db, orig->range, new->range);
701 *copy = new;
709 struct cil_bool *new = NULL;
719 cil_bool_init(&new);
720 new->value = orig->value;
721 *copy = new;
729 struct cil_tunable *new = NULL;
739 cil_tunable_init(&new);
740 new->value = orig->value;
741 *copy = new;
749 struct cil_avrule *new = NULL;
751 cil_avrule_init(&new);
753 new->rule_kind = orig->rule_kind;
754 new->src_str = orig->src_str;
755 new->tgt_str = orig->tgt_str;
756 cil_copy_classperms_list(orig->classperms, &new->classperms);
758 *copy = new;
766 struct cil_type_rule *new = NULL;
768 cil_type_rule_init(&new);
770 new->rule_kind = orig->rule_kind;
771 new->src_str = orig->src_str;
772 new->tgt_str = orig->tgt_str;
773 new->obj_str = orig->obj_str;
774 new->result_str = orig->result_str;
776 *copy = new;
789 struct cil_sens *new;
790 cil_sens_init(&new);
791 *copy = new;
807 struct cil_cat *new;
808 cil_cat_init(&new);
809 *copy = new;
817 void cil_copy_cats(struct cil_db *db, struct cil_cats *orig, struct cil_cats **new)
819 cil_cats_init(new);
820 cil_copy_expr(db, orig->str_expr, &(*new)->str_expr);
821 cil_copy_expr(db, orig->datum_expr, &(*new)->datum_expr);
827 struct cil_catset *new = NULL;
837 cil_catset_init(&new);
839 cil_copy_cats(db, orig->cats, &new->cats);
841 *copy = new;
849 struct cil_senscat *new = NULL;
851 cil_senscat_init(&new);
853 new->sens_str = orig->sens_str;
855 cil_copy_cats(db, orig->cats, &new->cats);
857 *copy = new;
865 struct cil_catorder *new = NULL;
867 cil_catorder_init(&new);
869 cil_copy_list(orig->cat_list_str, &new->cat_list_str);
872 *copy = new;
880 struct cil_sensorder *new = NULL;
882 cil_sensorder_init(&new);
884 cil_copy_list(orig->sens_list_str, &new->sens_list_str);
887 *copy = new;
892 void cil_copy_fill_level(struct cil_db *db, struct cil_level *orig, struct cil_level **new)
894 cil_level_init(new);
896 (*new)->sens_str = orig->sens_str;
899 cil_copy_cats(db, orig->cats, &(*new)->cats);
906 struct cil_level *new = NULL;
918 cil_copy_fill_level(db, orig, &new);
920 *copy = new;
925 void cil_copy_fill_levelrange(struct cil_db *db, struct cil_levelrange *data, struct cil_levelrange *new)
928 new->low_str = data->low_str;
930 cil_copy_fill_level(db, data->low, &new->low);
934 new->high_str = data->high_str;
936 cil_copy_fill_level(db, data->high, &new->high);
943 struct cil_levelrange *new = NULL;
955 cil_levelrange_init(&new);
956 cil_copy_fill_levelrange(db, orig, new);
958 *copy = new;
963 void cil_copy_fill_context(struct cil_db *db, struct cil_context *data, struct cil_context *new)
965 new->user_str = data->user_str;
966 new->role_str = data->role_str;
967 new->type_str = data->type_str;
970 new->range_str = data->range_str;
972 cil_levelrange_init(&new->range);
973 cil_copy_fill_levelrange(db, data->range, new->range);
980 struct cil_context *new = NULL;
992 cil_context_init(&new);
993 cil_copy_fill_context(db, orig, new);
995 *copy = new;
1003 struct cil_netifcon *new = NULL;
1005 cil_netifcon_init(&new);
1007 new->interface_str = orig->interface_str;
1010 new->if_context_str = orig->if_context_str;
1012 cil_context_init(&new->if_context);
1013 cil_copy_fill_context(db, orig->if_context, new->if_context);
1017 new->packet_context_str = orig->packet_context_str;
1019 cil_context_init(&new->packet_context);
1020 cil_copy_fill_context(db, orig->packet_context, new->packet_context);
1023 *copy = new;
1031 struct cil_genfscon *new = NULL;
1033 cil_genfscon_init(&new);
1035 new->fs_str = orig->fs_str;
1036 new->path_str = orig->path_str;
1039 new->context_str = orig->context_str;
1041 cil_context_init(&new->context);
1042 cil_copy_fill_context(db, orig->context, new->context);
1045 *copy = new;
1053 struct cil_filecon *new = NULL;
1055 cil_filecon_init(&new);
1057 new->path_str = orig->path_str;
1058 new->type = orig->type;
1061 new->context_str = orig->context_str;
1063 cil_context_init(&new->context);
1064 cil_copy_fill_context(db, orig->context, new->context);
1067 *copy = new;
1075 struct cil_nodecon *new = NULL;
1077 cil_nodecon_init(&new);
1080 new->addr_str = orig->addr_str;
1082 cil_ipaddr_init(&new->addr);
1083 cil_copy_fill_ipaddr(orig->addr, new->addr);
1087 new->mask_str = orig->mask_str;
1089 cil_ipaddr_init(&new->mask);
1090 cil_copy_fill_ipaddr(orig->mask, new->mask);
1094 new->context_str = orig->context_str;
1096 cil_context_init(&new->context);
1097 cil_copy_fill_context(db, orig->context, new->context);
1100 *copy = new;
1108 struct cil_portcon *new = NULL;
1110 cil_portcon_init(&new);
1112 new->proto = orig->proto;
1113 new->port_low = orig->port_low;
1114 new->port_high = orig->port_high;
1117 new->context_str = orig->context_str;
1119 cil_context_init(&new->context);
1120 cil_copy_fill_context(db, orig->context, new->context);
1123 *copy = new;
1131 struct cil_pirqcon *new = NULL;
1133 cil_pirqcon_init(&new);
1135 new->pirq = orig->pirq;
1138 new->context_str = orig->context_str;
1140 cil_context_init(&new->context);
1141 cil_copy_fill_context(db, orig->context, new->context);
1144 *copy = new;
1152 struct cil_iomemcon *new = NULL;
1154 cil_iomemcon_init(&new);
1156 new->iomem_low = orig->iomem_low;
1157 new->iomem_high = orig->iomem_high;
1160 new->context_str = orig->context_str;
1162 cil_context_init(&new->context);
1163 cil_copy_fill_context(db, orig->context, new->context);
1166 *copy = new;
1174 struct cil_ioportcon *new = NULL;
1176 cil_ioportcon_init(&new);
1178 new->ioport_low = orig->ioport_low;
1179 new->ioport_high = orig->ioport_high;
1182 new->context_str = orig->context_str;
1184 cil_context_init(&new->context);
1185 cil_copy_fill_context(db, orig->context, new->context);
1188 *copy = new;
1196 struct cil_pcidevicecon *new = NULL;
1198 cil_pcidevicecon_init(&new);
1200 new->dev = orig->dev;
1203 new->context_str = orig->context_str;
1205 cil_context_init(&new->context);
1206 cil_copy_fill_context(db, orig->context, new->context);
1209 *copy = new;
1217 struct cil_devicetreecon *new = NULL;
1219 cil_devicetreecon_init(&new);
1221 new->path = orig->path;
1224 new->context_str = orig->context_str;
1226 cil_context_init(&new->context);
1227 cil_copy_fill_context(db, orig->context, new->context);
1230 *copy = new;
1238 struct cil_fsuse *new = NULL;
1240 cil_fsuse_init(&new);
1242 new->type = orig->type;
1243 new->fs_str = orig->fs_str;
1246 new->context_str = orig->context_str;
1248 cil_context_init(&new->context);
1249 cil_copy_fill_context(db, orig->context, new->context);
1252 *copy = new;
1257 int cil_copy_expr(struct cil_db *db, struct cil_list *orig, struct cil_list **new)
1262 *new = NULL;
1266 cil_list_init(new, orig->flavor);
1273 cil_list_append(*new, CIL_LIST, sub_list);
1277 cil_list_append(*new, CIL_STRING, curr->data);
1280 cil_list_append(*new, curr->flavor, curr->data);
1283 cil_list_append(*new, curr->flavor, curr->data);
1286 cil_list_append(*new, curr->flavor, curr->data);
1290 cil_list_append(*new, curr->flavor, curr->data);
1301 struct cil_constrain *new = NULL;
1303 cil_constrain_init(&new);
1304 cil_copy_classperms_list(orig->classperms, &new->classperms);
1306 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1307 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1309 *copy = new;
1317 struct cil_validatetrans *new = NULL;
1319 cil_validatetrans_init(&new);
1321 new->class_str = orig->class_str;
1323 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1324 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1326 *copy = new;
1334 struct cil_call *new = NULL;
1337 cil_call_init(&new);
1339 new->macro_str = orig->macro_str;
1340 new->macro = orig->macro;
1343 cil_tree_init(&new->args_tree);
1344 rc = cil_copy_ast(db, orig->args_tree->root, new->args_tree->root);
1350 new->copied = orig->copied;
1352 *copy = new;
1357 cil_destroy_call(new);
1369 struct cil_macro *new;
1370 cil_macro_init(&new);
1372 cil_copy_list(orig->params, &new->params);
1375 *copy = new;
1434 struct cil_optional *new;
1435 cil_optional_init(&new);
1436 *copy = new;
1444 void cil_copy_fill_ipaddr(struct cil_ipaddr *data, struct cil_ipaddr *new)
1446 new->family = data->family;
1447 memcpy(&new->ip, &data->ip, sizeof(data->ip));
1453 struct cil_ipaddr *new = NULL;
1463 cil_ipaddr_init(&new);
1464 cil_copy_fill_ipaddr(orig, new);
1466 *copy = new;
1474 struct cil_condblock *new = *copy;
1475 cil_condblock_init(&new);
1476 new->flavor = orig->flavor;
1477 *copy = new;
1485 struct cil_booleanif *new = NULL;
1487 cil_boolif_init(&new);
1489 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1490 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1491 new->preserved_tunable = orig->preserved_tunable;
1493 *copy = new;
1501 struct cil_tunableif *new = NULL;
1503 cil_tunif_init(&new);
1505 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1506 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1508 *copy = new;
1516 struct cil_default *new = NULL;
1518 cil_default_init(&new);
1520 new->flavor = orig->flavor;
1523 cil_copy_list(orig->class_strs, &new->class_strs);
1526 new->object = orig->object;
1528 *copy = new;
1536 struct cil_defaultrange *new = NULL;
1538 cil_defaultrange_init(&new);
1541 cil_copy_list(orig->class_strs, &new->class_strs);
1544 new->object_range = orig->object_range;
1546 *copy = new;
1554 struct cil_handleunknown *new = NULL;
1556 cil_handleunknown_init(&new);
1557 new->handle_unknown = orig->handle_unknown;
1558 *copy = new;
1566 struct cil_mls *new = NULL;
1568 cil_mls_init(&new);
1569 new->value = orig->value;
1570 *copy = new;
1578 struct cil_bounds *new = NULL;
1580 cil_bounds_init(&new);
1582 new->parent_str = orig->parent_str;
1583 new->child_str = orig->child_str;
1585 *copy = new;
1594 struct cil_tree_node *new = NULL;
1874 cil_tree_node_init(&new);
1876 new->parent = parent;
1877 new->line = orig->line;
1878 new->path = orig->path;
1879 new->flavor = orig->flavor;
1880 new->data = data;
1883 rc = cil_symtab_insert(symtab, ((struct cil_symtab_datum*)orig->data)->name, ((struct cil_symtab_datum*)data), new);
1885 namespace = new;
1897 if (param->flavor == new->flavor) {
1898 if (param->str == ((struct cil_symtab_datum*)new->data)->name) {
1899 cil_log(CIL_ERR, "%s %s shadows a macro parameter (%s line:%d)\n", cil_node_to_string(new), ((struct cil_symtab_datum*)orig->data)->name, orig->path, orig->line);
1910 if (new->flavor == CIL_BLOCKINHERIT) {
1911 blockinherit = new->data;
1912 cil_list_append(blockinherit->block->bi_nodes, CIL_NODE, new);
1916 parent->cl_head = new;
1917 parent->cl_tail = new;
1919 parent->cl_tail->next = new;
1920 parent->cl_tail = new;
1924 args->dest = new;
1933 cil_tree_node_destroy(&new);