16cd6a6acSopenharmony_ci/*
26cd6a6acSopenharmony_ci * Copyright 2011 Tresys Technology, LLC. All rights reserved.
36cd6a6acSopenharmony_ci *
46cd6a6acSopenharmony_ci * Redistribution and use in source and binary forms, with or without
56cd6a6acSopenharmony_ci * modification, are permitted provided that the following conditions are met:
66cd6a6acSopenharmony_ci *
76cd6a6acSopenharmony_ci *    1. Redistributions of source code must retain the above copyright notice,
86cd6a6acSopenharmony_ci *       this list of conditions and the following disclaimer.
96cd6a6acSopenharmony_ci *
106cd6a6acSopenharmony_ci *    2. Redistributions in binary form must reproduce the above copyright notice,
116cd6a6acSopenharmony_ci *       this list of conditions and the following disclaimer in the documentation
126cd6a6acSopenharmony_ci *       and/or other materials provided with the distribution.
136cd6a6acSopenharmony_ci *
146cd6a6acSopenharmony_ci * THIS SOFTWARE IS PROVIDED BY TRESYS TECHNOLOGY, LLC ``AS IS'' AND ANY EXPRESS
156cd6a6acSopenharmony_ci * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
166cd6a6acSopenharmony_ci * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
176cd6a6acSopenharmony_ci * EVENT SHALL TRESYS TECHNOLOGY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
186cd6a6acSopenharmony_ci * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
196cd6a6acSopenharmony_ci * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
206cd6a6acSopenharmony_ci * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
216cd6a6acSopenharmony_ci * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
226cd6a6acSopenharmony_ci * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
236cd6a6acSopenharmony_ci * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
246cd6a6acSopenharmony_ci *
256cd6a6acSopenharmony_ci * The views and conclusions contained in the software and documentation are those
266cd6a6acSopenharmony_ci * of the authors and should not be interpreted as representing official policies,
276cd6a6acSopenharmony_ci * either expressed or implied, of Tresys Technology, LLC.
286cd6a6acSopenharmony_ci */
296cd6a6acSopenharmony_ci
306cd6a6acSopenharmony_ci#ifndef CIL_COPY_H_
316cd6a6acSopenharmony_ci#define CIL_COPY_H_
326cd6a6acSopenharmony_ci
336cd6a6acSopenharmony_ci#include "cil_internal.h"
346cd6a6acSopenharmony_ci#include "cil_tree.h"
356cd6a6acSopenharmony_ci#include "cil_symtab.h"
366cd6a6acSopenharmony_ci
376cd6a6acSopenharmony_civoid cil_copy_list(struct cil_list *orig, struct cil_list **copy);
386cd6a6acSopenharmony_ciint cil_copy_expr(struct cil_db *db, struct cil_list *orig, struct cil_list **new);
396cd6a6acSopenharmony_ci
406cd6a6acSopenharmony_ciint cil_copy_block(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
416cd6a6acSopenharmony_ciint cil_copy_blockabstract(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
426cd6a6acSopenharmony_ciint cil_copy_blockinherit(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
436cd6a6acSopenharmony_ciint cil_copy_perm(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
446cd6a6acSopenharmony_ciint cil_copy_class(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
456cd6a6acSopenharmony_ciint cil_copy_classorder(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
466cd6a6acSopenharmony_ciint cil_copy_classmapping(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
476cd6a6acSopenharmony_ciint cil_copy_permset(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
486cd6a6acSopenharmony_ci
496cd6a6acSopenharmony_civoid cil_copy_classperms(struct cil_classperms *orig, struct cil_classperms **new);
506cd6a6acSopenharmony_civoid cil_copy_classperms_set(struct cil_classperms_set *orig, struct cil_classperms_set **new);
516cd6a6acSopenharmony_civoid cil_copy_classperms_list(struct cil_list *orig, struct cil_list **new);
526cd6a6acSopenharmony_ciint cil_copy_classpermission(__attribute__((unused)) struct cil_db *db, void *data, void **copy, symtab_t *symtab);
536cd6a6acSopenharmony_ciint cil_copy_classpermissionset(__attribute__((unused)) struct cil_db *db, void *data, void **copy,  __attribute__((unused)) symtab_t *symtab);
546cd6a6acSopenharmony_ciint cil_copy_common(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
556cd6a6acSopenharmony_ciint cil_copy_classcommon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
566cd6a6acSopenharmony_ciint cil_copy_sid(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
576cd6a6acSopenharmony_ciint cil_copy_sidcontext(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
586cd6a6acSopenharmony_ciint cil_copy_sidorder(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
596cd6a6acSopenharmony_ciint cil_copy_user(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
606cd6a6acSopenharmony_ciint cil_copy_userattribute(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
616cd6a6acSopenharmony_ciint cil_copy_userattributeset(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
626cd6a6acSopenharmony_ciint cil_copy_userrole(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
636cd6a6acSopenharmony_ciint cil_copy_userlevel(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
646cd6a6acSopenharmony_ciint cil_copy_userrange(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
656cd6a6acSopenharmony_ciint cil_copy_userbounds(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
666cd6a6acSopenharmony_ciint cil_copy_userprefix(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
676cd6a6acSopenharmony_ciint cil_copy_role(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
686cd6a6acSopenharmony_ciint cil_copy_roletype(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
696cd6a6acSopenharmony_ciint cil_copy_rolebounds(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
706cd6a6acSopenharmony_ciint cil_copy_roleattribute(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
716cd6a6acSopenharmony_ciint cil_copy_roleattributeset(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
726cd6a6acSopenharmony_ciint cil_copy_roleallow(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
736cd6a6acSopenharmony_ciint cil_copy_type(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
746cd6a6acSopenharmony_ciint cil_copy_typebounds(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
756cd6a6acSopenharmony_ciint cil_copy_typepermissive(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
766cd6a6acSopenharmony_ciint cil_copy_typeattribute(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
776cd6a6acSopenharmony_ciint cil_copy_typeattributeset(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
786cd6a6acSopenharmony_ciint cil_copy_typealias(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
796cd6a6acSopenharmony_ciint cil_copy_nametypetransition(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
806cd6a6acSopenharmony_ciint cil_copy_rangetransition(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
816cd6a6acSopenharmony_ciint cil_copy_bool(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
826cd6a6acSopenharmony_ciint cil_copy_avrule(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
836cd6a6acSopenharmony_ciint cil_copy_type_rule(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
846cd6a6acSopenharmony_ciint cil_copy_sens(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
856cd6a6acSopenharmony_ciint cil_copy_sensalias(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
866cd6a6acSopenharmony_ciint cil_copy_cat(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
876cd6a6acSopenharmony_ciint cil_copy_catalias(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
886cd6a6acSopenharmony_ciint cil_copy_catset(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
896cd6a6acSopenharmony_ciint cil_copy_senscat(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
906cd6a6acSopenharmony_ciint cil_copy_catorder(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
916cd6a6acSopenharmony_ciint cil_copy_sensitivityorder(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
926cd6a6acSopenharmony_civoid cil_copy_fill_level(struct cil_db *db, struct cil_level *orig, struct cil_level **new);
936cd6a6acSopenharmony_ciint cil_copy_level(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
946cd6a6acSopenharmony_civoid cil_copy_fill_levelrange(struct cil_db *db, struct cil_levelrange *orig, struct cil_levelrange *new);
956cd6a6acSopenharmony_ciint cil_copy_levelrange(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
966cd6a6acSopenharmony_civoid cil_copy_fill_context(struct cil_db *db, struct cil_context *orig, struct cil_context *new);
976cd6a6acSopenharmony_ciint cil_copy_context(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
986cd6a6acSopenharmony_ciint cil_copy_netifcon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
996cd6a6acSopenharmony_ciint cil_copy_genfscon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1006cd6a6acSopenharmony_ciint cil_copy_filecon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1016cd6a6acSopenharmony_ciint cil_copy_nodecon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1026cd6a6acSopenharmony_ciint cil_copy_ibpkeycon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1036cd6a6acSopenharmony_ciint cil_copy_portcon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1046cd6a6acSopenharmony_ciint cil_copy_pirqcon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1056cd6a6acSopenharmony_ciint cil_copy_iomemcon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1066cd6a6acSopenharmony_ciint cil_copy_ioportcon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1076cd6a6acSopenharmony_ciint cil_copy_pcidevicecon(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1086cd6a6acSopenharmony_ciint cil_copy_fsuse(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1096cd6a6acSopenharmony_ciint cil_copy_exrp(struct cil_db *db, struct cil_list *orig, struct cil_list **new);
1106cd6a6acSopenharmony_ciint cil_copy_constrain(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1116cd6a6acSopenharmony_ciint cil_copy_validatetrans(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1126cd6a6acSopenharmony_ciint cil_copy_call(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1136cd6a6acSopenharmony_ciint cil_copy_optional(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1146cd6a6acSopenharmony_civoid cil_copy_fill_ipaddr(struct cil_ipaddr *orig, struct cil_ipaddr *new);
1156cd6a6acSopenharmony_ciint cil_copy_ipaddr(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1166cd6a6acSopenharmony_ciint cil_copy_boolif(struct cil_db *db, void *data, void **copy, symtab_t *symtab);
1176cd6a6acSopenharmony_ci
1186cd6a6acSopenharmony_ciint cil_copy_ast(struct cil_db *db, struct cil_tree_node *orig, struct cil_tree_node *dest);
1196cd6a6acSopenharmony_ci
1206cd6a6acSopenharmony_ci#endif
121