| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * An access vector table (avtab) is a hash table |
|---|
| 3 | 4 | * of access vectors and transition types indexed |
|---|
| .. | .. |
|---|
| 13 | 14 | * Added conditional policy language extensions |
|---|
| 14 | 15 | * |
|---|
| 15 | 16 | * Copyright (C) 2003 Tresys Technology, LLC |
|---|
| 16 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 17 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 18 | | - * the Free Software Foundation, version 2. |
|---|
| 19 | 17 | * |
|---|
| 20 | 18 | * Updated: Yuichi Nakamura <ynakam@hitachisoft.jp> |
|---|
| 21 | 19 | * Tuned number of hash slots for avtab to reduce memory usage |
|---|
| .. | .. |
|---|
| 24 | 22 | #define _SS_AVTAB_H_ |
|---|
| 25 | 23 | |
|---|
| 26 | 24 | #include "security.h" |
|---|
| 27 | | -#include <linux/flex_array.h> |
|---|
| 28 | 25 | |
|---|
| 29 | 26 | struct avtab_key { |
|---|
| 30 | 27 | u16 source_type; /* source type */ |
|---|
| .. | .. |
|---|
| 84 | 81 | }; |
|---|
| 85 | 82 | |
|---|
| 86 | 83 | struct avtab { |
|---|
| 87 | | - struct flex_array *htable; |
|---|
| 84 | + struct avtab_node **htable; |
|---|
| 88 | 85 | u32 nel; /* number of elements */ |
|---|
| 89 | 86 | u32 nslot; /* number of hash slots */ |
|---|
| 90 | 87 | u32 mask; /* mask to compute hash func */ |
|---|
| 91 | | - |
|---|
| 92 | 88 | }; |
|---|
| 93 | 89 | |
|---|
| 94 | | -int avtab_init(struct avtab *); |
|---|
| 90 | +void avtab_init(struct avtab *h); |
|---|
| 95 | 91 | int avtab_alloc(struct avtab *, u32); |
|---|
| 92 | +int avtab_alloc_dup(struct avtab *new, const struct avtab *orig); |
|---|
| 96 | 93 | struct avtab_datum *avtab_search(struct avtab *h, struct avtab_key *k); |
|---|
| 97 | 94 | void avtab_destroy(struct avtab *h); |
|---|
| 98 | 95 | void avtab_hash_eval(struct avtab *h, char *tag); |
|---|