1 /* Author: Stephen Smalley, <sds@tycho.nsa.gov> 2 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> 3 * 4 * Support for enhanced MLS infrastructure. 5 * 6 * Copyright (C) 2004-2005 Trusted Computer Solutions, Inc. 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2.1 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 */ 22 23 #ifndef _SEPOL_MLS_INTERNAL_H_ 24 #define _SEPOL_MLS_INTERNAL_H_ 25 26 #include "policydb_internal.h" 27 #include <sepol/policydb/context.h> 28 #include <sepol/policydb/policydb.h> 29 #include "handle.h" 30 31 extern int mls_from_string(sepol_handle_t * handle, 32 const policydb_t * policydb, 33 const char *str, context_struct_t * mls); 34 35 extern int mls_to_string(sepol_handle_t * handle, 36 const policydb_t * policydb, 37 const context_struct_t * mls, char **str); 38 39 /* Deprecated */ 40 extern int mls_compute_context_len(const policydb_t * policydb, 41 const context_struct_t * context); 42 43 /* Deprecated */ 44 extern void mls_sid_to_context(const policydb_t * policydb, 45 const context_struct_t * context, 46 char **scontext); 47 48 /* Deprecated */ 49 extern int mls_context_to_sid(const policydb_t * policydb, 50 char oldc, 51 char **scontext, context_struct_t * context); 52 53 extern int mls_context_isvalid(const policydb_t * p, 54 const context_struct_t * c); 55 56 extern int mls_convert_context(policydb_t * oldp, 57 policydb_t * newp, context_struct_t * context); 58 59 extern int mls_compute_sid(policydb_t * policydb, 60 const context_struct_t * scontext, 61 const context_struct_t * tcontext, 62 sepol_security_class_t tclass, 63 uint32_t specified, context_struct_t * newcontext); 64 65 extern int mls_setup_user_range(context_struct_t * fromcon, user_datum_t * user, 66 context_struct_t * usercon, int mls); 67 68 #endif 69