• Home
  • Raw
  • Download

Lines Matching refs:new

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