.. | .. |
---|
22 | 22 | #ifndef _SS_MLS_H_ |
---|
23 | 23 | #define _SS_MLS_H_ |
---|
24 | 24 | |
---|
| 25 | +#include <linux/jhash.h> |
---|
| 26 | + |
---|
25 | 27 | #include "context.h" |
---|
| 28 | +#include "ebitmap.h" |
---|
26 | 29 | #include "policydb.h" |
---|
27 | 30 | |
---|
28 | 31 | int mls_compute_context_len(struct policydb *p, struct context *context); |
---|
.. | .. |
---|
101 | 104 | } |
---|
102 | 105 | #endif |
---|
103 | 106 | |
---|
| 107 | +static inline u32 mls_range_hash(const struct mls_range *r, u32 hash) |
---|
| 108 | +{ |
---|
| 109 | + hash = jhash_2words(r->level[0].sens, r->level[1].sens, hash); |
---|
| 110 | + hash = ebitmap_hash(&r->level[0].cat, hash); |
---|
| 111 | + hash = ebitmap_hash(&r->level[1].cat, hash); |
---|
| 112 | + return hash; |
---|
| 113 | +} |
---|
| 114 | + |
---|
104 | 115 | #endif /* _SS_MLS_H */ |
---|
105 | 116 | |
---|