xref: /aosp_15_r20/external/selinux/libsepol/include/sepol/policydb/module.h (revision 2d543d20722ada2425b5bdab9d0d1d29470e7bba)
1*2d543d20SAndroid Build Coastguard Worker /* Author: Karl MacMillan <[email protected]>
2*2d543d20SAndroid Build Coastguard Worker  *
3*2d543d20SAndroid Build Coastguard Worker  * Copyright (C) 2004-2005 Tresys Technology, LLC
4*2d543d20SAndroid Build Coastguard Worker  *
5*2d543d20SAndroid Build Coastguard Worker  *  This library is free software; you can redistribute it and/or
6*2d543d20SAndroid Build Coastguard Worker  *  modify it under the terms of the GNU Lesser General Public
7*2d543d20SAndroid Build Coastguard Worker  *  License as published by the Free Software Foundation; either
8*2d543d20SAndroid Build Coastguard Worker  *  version 2.1 of the License, or (at your option) any later version.
9*2d543d20SAndroid Build Coastguard Worker  *
10*2d543d20SAndroid Build Coastguard Worker  *  This library is distributed in the hope that it will be useful,
11*2d543d20SAndroid Build Coastguard Worker  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12*2d543d20SAndroid Build Coastguard Worker  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13*2d543d20SAndroid Build Coastguard Worker  *  Lesser General Public License for more details.
14*2d543d20SAndroid Build Coastguard Worker  *
15*2d543d20SAndroid Build Coastguard Worker  *  You should have received a copy of the GNU Lesser General Public
16*2d543d20SAndroid Build Coastguard Worker  *  License along with this library; if not, write to the Free Software
17*2d543d20SAndroid Build Coastguard Worker  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18*2d543d20SAndroid Build Coastguard Worker  */
19*2d543d20SAndroid Build Coastguard Worker 
20*2d543d20SAndroid Build Coastguard Worker #ifndef _SEPOL_POLICYDB_MODULE_H_
21*2d543d20SAndroid Build Coastguard Worker #define _SEPOL_POLICYDB_MODULE_H_
22*2d543d20SAndroid Build Coastguard Worker 
23*2d543d20SAndroid Build Coastguard Worker #include <stdlib.h>
24*2d543d20SAndroid Build Coastguard Worker #include <stddef.h>
25*2d543d20SAndroid Build Coastguard Worker 
26*2d543d20SAndroid Build Coastguard Worker #include <sepol/module.h>
27*2d543d20SAndroid Build Coastguard Worker 
28*2d543d20SAndroid Build Coastguard Worker #include <sepol/policydb/policydb.h>
29*2d543d20SAndroid Build Coastguard Worker #include <sepol/policydb/conditional.h>
30*2d543d20SAndroid Build Coastguard Worker 
31*2d543d20SAndroid Build Coastguard Worker #define SEPOL_MODULE_PACKAGE_MAGIC 0xf97cff8f
32*2d543d20SAndroid Build Coastguard Worker 
33*2d543d20SAndroid Build Coastguard Worker #ifdef __cplusplus
34*2d543d20SAndroid Build Coastguard Worker extern "C" {
35*2d543d20SAndroid Build Coastguard Worker #endif
36*2d543d20SAndroid Build Coastguard Worker 
37*2d543d20SAndroid Build Coastguard Worker struct sepol_module_package {
38*2d543d20SAndroid Build Coastguard Worker 	sepol_policydb_t *policy;
39*2d543d20SAndroid Build Coastguard Worker 	uint32_t version;
40*2d543d20SAndroid Build Coastguard Worker 	char *file_contexts;
41*2d543d20SAndroid Build Coastguard Worker 	size_t file_contexts_len;
42*2d543d20SAndroid Build Coastguard Worker 	char *seusers;
43*2d543d20SAndroid Build Coastguard Worker 	size_t seusers_len;
44*2d543d20SAndroid Build Coastguard Worker 	char *user_extra;
45*2d543d20SAndroid Build Coastguard Worker 	size_t user_extra_len;
46*2d543d20SAndroid Build Coastguard Worker 	char *netfilter_contexts;
47*2d543d20SAndroid Build Coastguard Worker 	size_t netfilter_contexts_len;
48*2d543d20SAndroid Build Coastguard Worker };
49*2d543d20SAndroid Build Coastguard Worker 
50*2d543d20SAndroid Build Coastguard Worker extern int sepol_module_package_init(sepol_module_package_t * p);
51*2d543d20SAndroid Build Coastguard Worker 
52*2d543d20SAndroid Build Coastguard Worker #ifdef __cplusplus
53*2d543d20SAndroid Build Coastguard Worker }
54*2d543d20SAndroid Build Coastguard Worker #endif
55*2d543d20SAndroid Build Coastguard Worker 
56*2d543d20SAndroid Build Coastguard Worker #endif
57