1# $FreeBSD$
2# Generated by h2py from stdin
3
4# Included from sys/ioccom.h
5IOCPARM_SHIFT = 13
6IOCPARM_MASK = ((1 << IOCPARM_SHIFT) - 1)
7def IOCPARM_LEN(x): return (((x) >> 16) & IOCPARM_MASK)
8
9def IOCBASECMD(x): return ((x) & ~(IOCPARM_MASK << 16))
10
11def IOCGROUP(x): return (((x) >> 8) & 0xff)
12
13IOCPARM_MAX = (1 << IOCPARM_SHIFT)
14IOC_VOID = 0x20000000
15IOC_OUT = 0x40000000
16IOC_IN = 0x80000000
17IOC_INOUT = (IOC_IN|IOC_OUT)
18IOC_DIRMASK = (IOC_VOID|IOC_OUT|IOC_IN)
19
20# Included from sys/cdefs.h
21def __has_feature(x): return 0
22
23def __has_include(x): return 0
24
25def __has_builtin(x): return 0
26
27__GNUCLIKE_ASM = 3
28__GNUCLIKE_ASM = 2
29__GNUCLIKE___TYPEOF = 1
30__GNUCLIKE___OFFSETOF = 1
31__GNUCLIKE___SECTION = 1
32__GNUCLIKE_CTOR_SECTION_HANDLING = 1
33__GNUCLIKE_BUILTIN_CONSTANT_P = 1
34__GNUCLIKE_BUILTIN_VARARGS = 1
35__GNUCLIKE_BUILTIN_STDARG = 1
36__GNUCLIKE_BUILTIN_VAALIST = 1
37__GNUC_VA_LIST_COMPATIBILITY = 1
38__GNUCLIKE_BUILTIN_NEXT_ARG = 1
39__GNUCLIKE_BUILTIN_MEMCPY = 1
40__CC_SUPPORTS_INLINE = 1
41__CC_SUPPORTS___INLINE = 1
42__CC_SUPPORTS___INLINE__ = 1
43__CC_SUPPORTS___FUNC__ = 1
44__CC_SUPPORTS_WARNING = 1
45__CC_SUPPORTS_VARADIC_XXX = 1
46__CC_SUPPORTS_DYNAMIC_ARRAY_INIT = 1
47def __P(protos): return protos
48
49def __STRING(x): return #x
50
51def __XSTRING(x): return __STRING(x)
52
53def __P(protos): return ()
54
55def __STRING(x): return "x"
56
57def __aligned(x): return __attribute__((__aligned__(x)))
58
59def __section(x): return __attribute__((__section__(x)))
60
61def __aligned(x): return __attribute__((__aligned__(x)))
62
63def __section(x): return __attribute__((__section__(x)))
64
65def _Alignas(x): return alignas(x)
66
67def _Alignas(x): return __aligned(x)
68
69def _Alignof(x): return alignof(x)
70
71def _Alignof(x): return __alignof(x)
72
73def __nonnull(x): return __attribute__((__nonnull__(x)))
74
75def __predict_true(exp): return __builtin_expect((exp), 1)
76
77def __predict_false(exp): return __builtin_expect((exp), 0)
78
79def __predict_true(exp): return (exp)
80
81def __predict_false(exp): return (exp)
82
83def __format_arg(fmtarg): return __attribute__((__format_arg__ (fmtarg)))
84
85def __GLOBL(sym): return __GLOBL1(sym)
86
87def __FBSDID(s): return __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
88
89def __RCSID(s): return __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
90
91def __RCSID_SOURCE(s): return __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
92
93def __SCCSID(s): return __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
94
95def __COPYRIGHT(s): return __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
96
97_POSIX_C_SOURCE = 199009
98_POSIX_C_SOURCE = 199209
99__XSI_VISIBLE = 700
100_POSIX_C_SOURCE = 200809
101__XSI_VISIBLE = 600
102_POSIX_C_SOURCE = 200112
103__XSI_VISIBLE = 500
104_POSIX_C_SOURCE = 199506
105_POSIX_C_SOURCE = 198808
106__POSIX_VISIBLE = 200809
107__ISO_C_VISIBLE = 1999
108__POSIX_VISIBLE = 200112
109__ISO_C_VISIBLE = 1999
110__POSIX_VISIBLE = 199506
111__ISO_C_VISIBLE = 1990
112__POSIX_VISIBLE = 199309
113__ISO_C_VISIBLE = 1990
114__POSIX_VISIBLE = 199209
115__ISO_C_VISIBLE = 1990
116__POSIX_VISIBLE = 199009
117__ISO_C_VISIBLE = 1990
118__POSIX_VISIBLE = 198808
119__ISO_C_VISIBLE = 0
120__POSIX_VISIBLE = 0
121__XSI_VISIBLE = 0
122__BSD_VISIBLE = 0
123__ISO_C_VISIBLE = 1990
124__POSIX_VISIBLE = 0
125__XSI_VISIBLE = 0
126__BSD_VISIBLE = 0
127__ISO_C_VISIBLE = 1999
128__POSIX_VISIBLE = 0
129__XSI_VISIBLE = 0
130__BSD_VISIBLE = 0
131__ISO_C_VISIBLE = 2011
132__POSIX_VISIBLE = 200809
133__XSI_VISIBLE = 700
134__BSD_VISIBLE = 1
135__ISO_C_VISIBLE = 2011
136__NO_TLS = 1
137CRYPTO_DRIVERS_INITIAL = 4
138CRYPTO_SW_SESSIONS = 32
139NULL_HASH_LEN = 16
140MD5_HASH_LEN = 16
141SHA1_HASH_LEN = 20
142RIPEMD160_HASH_LEN = 20
143SHA2_256_HASH_LEN = 32
144SHA2_384_HASH_LEN = 48
145SHA2_512_HASH_LEN = 64
146MD5_KPDK_HASH_LEN = 16
147SHA1_KPDK_HASH_LEN = 20
148HASH_MAX_LEN = SHA2_512_HASH_LEN
149NULL_HMAC_BLOCK_LEN = 64
150MD5_HMAC_BLOCK_LEN = 64
151SHA1_HMAC_BLOCK_LEN = 64
152RIPEMD160_HMAC_BLOCK_LEN = 64
153SHA2_256_HMAC_BLOCK_LEN = 64
154SHA2_384_HMAC_BLOCK_LEN = 128
155SHA2_512_HMAC_BLOCK_LEN = 128
156HMAC_MAX_BLOCK_LEN = SHA2_512_HMAC_BLOCK_LEN
157HMAC_IPAD_VAL = 0x36
158HMAC_OPAD_VAL = 0x5C
159NULL_BLOCK_LEN = 4
160DES_BLOCK_LEN = 8
161DES3_BLOCK_LEN = 8
162BLOWFISH_BLOCK_LEN = 8
163SKIPJACK_BLOCK_LEN = 8
164CAST128_BLOCK_LEN = 8
165RIJNDAEL128_BLOCK_LEN = 16
166AES_BLOCK_LEN = RIJNDAEL128_BLOCK_LEN
167CAMELLIA_BLOCK_LEN = 16
168EALG_MAX_BLOCK_LEN = AES_BLOCK_LEN
169AALG_MAX_RESULT_LEN = 64
170CRYPTO_ALGORITHM_MIN = 1
171CRYPTO_DES_CBC = 1
172CRYPTO_3DES_CBC = 2
173CRYPTO_BLF_CBC = 3
174CRYPTO_CAST_CBC = 4
175CRYPTO_SKIPJACK_CBC = 5
176CRYPTO_MD5_HMAC = 6
177CRYPTO_SHA1_HMAC = 7
178CRYPTO_RIPEMD160_HMAC = 8
179CRYPTO_MD5_KPDK = 9
180CRYPTO_SHA1_KPDK = 10
181CRYPTO_RIJNDAEL128_CBC = 11
182CRYPTO_AES_CBC = 11
183CRYPTO_ARC4 = 12
184CRYPTO_MD5 = 13
185CRYPTO_SHA1 = 14
186CRYPTO_NULL_HMAC = 15
187CRYPTO_NULL_CBC = 16
188CRYPTO_DEFLATE_COMP = 17
189CRYPTO_SHA2_256_HMAC = 18
190CRYPTO_SHA2_384_HMAC = 19
191CRYPTO_SHA2_512_HMAC = 20
192CRYPTO_CAMELLIA_CBC = 21
193CRYPTO_AES_XTS = 22
194CRYPTO_AES_ICM = 23
195CRYPTO_AES_NIST_GMAC = 24
196CRYPTO_AES_NIST_GCM_16 = 25
197CRYPTO_BLAKE2B = 29
198CRYPTO_BLAKE2S = 30
199CRYPTO_CHACHA20 = 31
200CRYPTO_SHA2_224_HMAC = 32
201CRYPTO_RIPEMD160 = 33
202CRYPTO_SHA2_224 = 34
203CRYPTO_SHA2_256 = 35
204CRYPTO_SHA2_384 = 36
205CRYPTO_SHA2_512 = 37
206CRYPTO_POLY1305 = 38
207CRYPTO_AES_CCM_CBC_MAC = 39
208CRYPTO_AES_CCM_16 = 40
209CRYPTO_ALGORITHM_MAX = 40
210CRYPTO_ALG_FLAG_SUPPORTED = 0x01
211CRYPTO_ALG_FLAG_RNG_ENABLE = 0x02
212CRYPTO_ALG_FLAG_DSA_SHA = 0x04
213CRYPTO_FLAG_HARDWARE = 0x01000000
214CRYPTO_FLAG_SOFTWARE = 0x02000000
215COP_ENCRYPT = 1
216COP_DECRYPT = 2
217COP_F_BATCH = 0x0008
218CRK_MAXPARAM = 8
219CRK_ALGORITM_MIN = 0
220CRK_MOD_EXP = 0
221CRK_MOD_EXP_CRT = 1
222CRK_DSA_SIGN = 2
223CRK_DSA_VERIFY = 3
224CRK_DH_COMPUTE_KEY = 4
225CRK_ALGORITHM_MAX = 4
226CRF_MOD_EXP = (1 << CRK_MOD_EXP)
227CRF_MOD_EXP_CRT = (1 << CRK_MOD_EXP_CRT)
228CRF_DSA_SIGN = (1 << CRK_DSA_SIGN)
229CRF_DSA_VERIFY = (1 << CRK_DSA_VERIFY)
230CRF_DH_COMPUTE_KEY = (1 << CRK_DH_COMPUTE_KEY)
231CRD_F_ENCRYPT = 0x01
232CRD_F_IV_PRESENT = 0x02
233CRD_F_IV_EXPLICIT = 0x04
234CRD_F_DSA_SHA_NEEDED = 0x08
235CRD_F_COMP = 0x0f
236CRD_F_KEY_EXPLICIT = 0x10
237CRYPTO_F_IMBUF = 0x0001
238CRYPTO_F_IOV = 0x0002
239CRYPTO_F_BATCH = 0x0008
240CRYPTO_F_CBIMM = 0x0010
241CRYPTO_F_DONE = 0x0020
242CRYPTO_F_CBIFSYNC = 0x0040
243CRYPTO_BUF_CONTIG = 0x0
244CRYPTO_BUF_IOV = 0x1
245CRYPTO_BUF_MBUF = 0x2
246CRYPTO_OP_DECRYPT = 0x0
247CRYPTO_OP_ENCRYPT = 0x1
248CRYPTO_HINT_MORE = 0x1
249def CRYPTO_SESID2HID(_sid): return (((_sid) >> 32) & 0x00ffffff)
250
251def CRYPTO_SESID2CAPS(_sid): return (((_sid) >> 32) & 0xff000000)
252
253def CRYPTO_SESID2LID(_sid): return (((u_int32_t) (_sid)) & 0xffffffff)
254
255CRYPTOCAP_F_HARDWARE = CRYPTO_FLAG_HARDWARE
256CRYPTOCAP_F_SOFTWARE = CRYPTO_FLAG_SOFTWARE
257CRYPTOCAP_F_SYNC = 0x04000000
258CRYPTO_SYMQ = 0x1
259CRYPTO_ASYMQ = 0x2
260