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