|
Packit Service |
102278 |
/* Author: Joshua Brindle <jbrindle@tresys.com>
|
|
Packit Service |
102278 |
* Jason Tang <jtang@tresys.com>
|
|
Packit Service |
102278 |
*
|
|
Packit Service |
102278 |
* Copyright (C) 2005 Tresys Technology, LLC
|
|
Packit Service |
102278 |
* Copyright (C) 2005 Red Hat Inc.
|
|
Packit Service |
102278 |
*
|
|
Packit Service |
102278 |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
102278 |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
102278 |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
102278 |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
102278 |
*
|
|
Packit Service |
102278 |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
102278 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
102278 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
102278 |
* Lesser General Public License for more details.
|
|
Packit Service |
102278 |
*
|
|
Packit Service |
102278 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
102278 |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
102278 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit Service |
102278 |
*/
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#ifndef _SEMANAGE_POLICY_INTERNAL_H_
|
|
Packit Service |
102278 |
#define _SEMANAGE_POLICY_INTERNAL_H_
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#include "modules.h"
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Circular dependency */
|
|
Packit Service |
102278 |
struct semanage_handle;
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Backend dependent portion */
|
|
Packit Service |
102278 |
struct semanage_policy_table {
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Returns the current policy serial/commit number
|
|
Packit Service |
102278 |
* A negative number is returned in case of failre */
|
|
Packit Service |
102278 |
int (*get_serial) (struct semanage_handle *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Destroy a connection */
|
|
Packit Service |
102278 |
void (*destroy) (struct semanage_handle *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Disconnect from policy */
|
|
Packit Service |
102278 |
int (*disconnect) (struct semanage_handle *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Begin a policy transaction */
|
|
Packit Service |
102278 |
int (*begin_trans) (struct semanage_handle *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Commit a policy transaction */
|
|
Packit Service |
102278 |
int (*commit) (struct semanage_handle *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Install a policy module */
|
|
Packit Service |
102278 |
int (*install) (struct semanage_handle *, char *, size_t, const char *, const char *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Install a policy module */
|
|
Packit Service |
102278 |
int (*install_file) (struct semanage_handle *, const char *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Extract a policy module */
|
|
Packit Service |
102278 |
int (*extract) (struct semanage_handle *,
|
|
Packit Service |
102278 |
semanage_module_key_t *,
|
|
Packit Service |
102278 |
int extract_cil,
|
|
Packit Service |
102278 |
void **,
|
|
Packit Service |
102278 |
size_t *,
|
|
Packit Service |
102278 |
semanage_module_info_t **);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Remove a policy module */
|
|
Packit Service |
102278 |
int (*remove) (struct semanage_handle *, char *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* List policy modules */
|
|
Packit Service |
102278 |
int (*list) (struct semanage_handle *, semanage_module_info_t **,
|
|
Packit Service |
102278 |
int *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Get module enabled status */
|
|
Packit Service |
102278 |
int (*get_enabled) (struct semanage_handle *sh,
|
|
Packit Service |
102278 |
const semanage_module_key_t *key,
|
|
Packit Service |
102278 |
int *enabled);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Set module enabled status */
|
|
Packit Service |
102278 |
int (*set_enabled) (struct semanage_handle *sh,
|
|
Packit Service |
102278 |
const semanage_module_key_t *key,
|
|
Packit Service |
102278 |
int enabled);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Get a module info */
|
|
Packit Service |
102278 |
int (*get_module_info) (struct semanage_handle *,
|
|
Packit Service |
102278 |
const semanage_module_key_t *,
|
|
Packit Service |
102278 |
semanage_module_info_t **);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* List all policy modules */
|
|
Packit Service |
102278 |
int (*list_all) (struct semanage_handle *,
|
|
Packit Service |
102278 |
semanage_module_info_t **,
|
|
Packit Service |
102278 |
int *);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Install via module info */
|
|
Packit Service |
102278 |
int (*install_info) (struct semanage_handle *,
|
|
Packit Service |
102278 |
const semanage_module_info_t *,
|
|
Packit Service |
102278 |
char *,
|
|
Packit Service |
102278 |
size_t);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Remove via module key */
|
|
Packit Service |
102278 |
int (*remove_key) (struct semanage_handle *,
|
|
Packit Service |
102278 |
const semanage_module_key_t *);
|
|
Packit Service |
102278 |
};
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
/* Should be backend independent */
|
|
Packit Service |
102278 |
extern int semanage_base_merge_components(struct semanage_handle *handle);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
extern int semanage_commit_components(struct semanage_handle *handle);
|
|
Packit Service |
102278 |
|
|
Packit Service |
102278 |
#endif
|