linux/security/selinux/ss/context.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * A security context is a set of security attributes
 * associated with each subject and object controlled
 * by the security policy.  Security contexts are
  * externally represented as variable-length strings
 * that can be interpreted by a user or application
 * with an understanding of the security policy.
 * Internally, the security server uses a simple
 * structure.  This structure is private to the
 * security server and can be changed without affecting
 * clients of the security server.
 *
 * Author : Stephen Smalley, <[email protected]>
 */

#ifndef _SS_CONTEXT_H_
#define _SS_CONTEXT_H_

#include "ebitmap.h"
#include "mls_types.h"
#include "security.h"

/*
 * A security context consists of an authenticated user
 * identity, a role, a type and a MLS range.
 */
struct context {};

static inline void mls_context_init(struct context *c)
{}

static inline int mls_context_cpy(struct context *dst,
				  const struct context *src)
{}

/*
 * Sets both levels in the MLS range of 'dst' to the low level of 'src'.
 */
static inline int mls_context_cpy_low(struct context *dst,
				      const struct context *src)
{}

/*
 * Sets both levels in the MLS range of 'dst' to the high level of 'src'.
 */
static inline int mls_context_cpy_high(struct context *dst,
				       const struct context *src)
{}

static inline int mls_context_glblub(struct context *dst,
				     const struct context *c1,
				     const struct context *c2)
{}

static inline int mls_context_cmp(const struct context *c1,
				  const struct context *c2)
{}

static inline void mls_context_destroy(struct context *c)
{}

static inline void context_init(struct context *c)
{}

static inline int context_cpy(struct context *dst, const struct context *src)
{}

static inline void context_destroy(struct context *c)
{}

static inline int context_cmp(const struct context *c1,
			      const struct context *c2)
{}

u32 context_compute_hash(const struct context *c);

#endif /* _SS_CONTEXT_H_ */