xref: /freebsd/sys/sys/random.h (revision 4a7cdfd7b9356f3620c279b3b254e911853c1071)
14eeb4f04SMark Murray /*-
27aa4389aSMark Murray  * Copyright (c) 2000 Mark R. V. Murray
34eeb4f04SMark Murray  * All rights reserved.
41bb2d314SMark Murray  *
51bb2d314SMark Murray  * Redistribution and use in source and binary forms, with or without
61bb2d314SMark Murray  * modification, are permitted provided that the following conditions
71bb2d314SMark Murray  * are met:
81bb2d314SMark Murray  * 1. Redistributions of source code must retain the above copyright
94eeb4f04SMark Murray  *    notice, this list of conditions and the following disclaimer
104eeb4f04SMark Murray  *    in this position and unchanged.
111bb2d314SMark Murray  * 2. Redistributions in binary form must reproduce the above copyright
121bb2d314SMark Murray  *    notice, this list of conditions and the following disclaimer in the
131bb2d314SMark Murray  *    documentation and/or other materials provided with the distribution.
141bb2d314SMark Murray  *
154eeb4f04SMark Murray  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
164eeb4f04SMark Murray  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
174eeb4f04SMark Murray  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
184eeb4f04SMark Murray  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
194eeb4f04SMark Murray  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
204eeb4f04SMark Murray  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
214eeb4f04SMark Murray  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
224eeb4f04SMark Murray  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
234eeb4f04SMark Murray  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
244eeb4f04SMark Murray  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251bb2d314SMark Murray  *
264eeb4f04SMark Murray  * $FreeBSD$
271bb2d314SMark Murray  */
281bb2d314SMark Murray 
29a3b693c9SBruce Evans #ifndef	_SYS_RANDOM_H_
30a3b693c9SBruce Evans #define	_SYS_RANDOM_H_
311bb2d314SMark Murray 
32da3fb6b4SMark Murray #ifdef _KERNEL
33da3fb6b4SMark Murray 
34e1199601SMark Murray int read_random(void *, int);
351bb2d314SMark Murray 
36e1199601SMark Murray enum esource {
37e1199601SMark Murray 	RANDOM_START = 0,
38e1199601SMark Murray 	RANDOM_WRITE = 0,
39e1199601SMark Murray 	RANDOM_KEYBOARD,
40e1199601SMark Murray 	RANDOM_MOUSE,
41e1199601SMark Murray 	RANDOM_NET,
42e1199601SMark Murray 	RANDOM_INTERRUPT,
43e1199601SMark Murray 	ENTROPYSOURCE
44e1199601SMark Murray };
457aa4389aSMark Murray void random_harvest(void *, u_int, u_int, u_int, enum esource);
46da3fb6b4SMark Murray 
4714636c3bSMark Murray /* Allow the sysadmin to select the broad category of
4814636c3bSMark Murray  * entropy types to harvest
4914636c3bSMark Murray  */
5014636c3bSMark Murray struct harvest_select {
5114636c3bSMark Murray 	int ethernet;
5214636c3bSMark Murray 	int point_to_point;
5314636c3bSMark Murray 	int interrupt;
544a7cdfd7SMark Murray 	int swi;
5514636c3bSMark Murray };
5614636c3bSMark Murray 
5714636c3bSMark Murray extern struct harvest_select harvest;
5814636c3bSMark Murray 
594a7cdfd7SMark Murray #endif /* _KERNEL */
60da3fb6b4SMark Murray 
614eeb4f04SMark Murray #endif /* _SYS_RANDOM_H_ */
62