1255219Spjd/*-
2255219Spjd * Copyright (c) 2013 FreeBSD Foundation
3255219Spjd * All rights reserved.
4255219Spjd *
5255219Spjd * This software was developed by Pawel Jakub Dawidek under sponsorship from
6255219Spjd * the FreeBSD Foundation.
7255219Spjd *
8255219Spjd * Redistribution and use in source and binary forms, with or without
9255219Spjd * modification, are permitted provided that the following conditions
10255219Spjd * are met:
11255219Spjd * 1. Redistributions of source code must retain the above copyright
12255219Spjd *    notice, this list of conditions and the following disclaimer.
13255219Spjd * 2. Redistributions in binary form must reproduce the above copyright
14255219Spjd *    notice, this list of conditions and the following disclaimer in the
15255219Spjd *    documentation and/or other materials provided with the distribution.
16255219Spjd *
17255219Spjd * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18255219Spjd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19255219Spjd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20255219Spjd * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21255219Spjd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22255219Spjd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23255219Spjd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24255219Spjd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25255219Spjd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26255219Spjd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27255219Spjd * SUCH DAMAGE.
28255219Spjd *
29255219Spjd * $FreeBSD$
30255219Spjd */
31255219Spjd
32255219Spjd#ifndef _SYS_CAPRIGHTS_H_
33255219Spjd#define	_SYS_CAPRIGHTS_H_
34255219Spjd
35255219Spjd/*
36255219Spjd * The top two bits in the first element of the cr_rights[] array contain
37255219Spjd * total number of elements in the array - 2. This means if those two bits are
38255219Spjd * equal to 0, we have 2 array elements.
39255219Spjd * The top two bits in all remaining array elements should be 0.
40255219Spjd * The next five bits contain array index. Only one bit is used and bit position
41255219Spjd * in this five-bits range defines array index. This means there can be at most
42255219Spjd * five array elements.
43255219Spjd */
44255219Spjd#define	CAP_RIGHTS_VERSION_00	0
45255219Spjd/*
46255219Spjd#define	CAP_RIGHTS_VERSION_01	1
47255219Spjd#define	CAP_RIGHTS_VERSION_02	2
48255219Spjd#define	CAP_RIGHTS_VERSION_03	3
49255219Spjd*/
50255219Spjd#define	CAP_RIGHTS_VERSION	CAP_RIGHTS_VERSION_00
51255219Spjd
52255219Spjdstruct cap_rights {
53255219Spjd	uint64_t	cr_rights[CAP_RIGHTS_VERSION + 2];
54255219Spjd};
55255219Spjd
56255219Spjd#ifndef	_CAP_RIGHTS_T_DECLARED
57255219Spjd#define	_CAP_RIGHTS_T_DECLARED
58255219Spjdtypedef	struct cap_rights	cap_rights_t;
59255219Spjd#endif
60255219Spjd
61255219Spjd#endif /* !_SYS_CAPRIGHTS_H_ */
62