xref: /xnu-11215/bsd/dev/random/randomdev.h (revision a5e72196)
18149afccSApple OSS Distributions /*
23ca3bd55SApple OSS Distributions  * Copyright (c) 1999, 2000-2002, 2009 Apple, Inc. All rights reserved.
38149afccSApple OSS Distributions  *
4e13b1fa5SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
58149afccSApple OSS Distributions  *
6e13b1fa5SApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7e13b1fa5SApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8e13b1fa5SApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9e13b1fa5SApple OSS Distributions  * compliance with the License. The rights granted to you under the License
10e13b1fa5SApple OSS Distributions  * may not be used to create, or enable the creation or redistribution of,
11e13b1fa5SApple OSS Distributions  * unlawful or unlicensed copies of an Apple operating system, or to
12e13b1fa5SApple OSS Distributions  * circumvent, violate, or enable the circumvention or violation of, any
13e13b1fa5SApple OSS Distributions  * terms of an Apple operating system software license agreement.
148149afccSApple OSS Distributions  *
15e13b1fa5SApple OSS Distributions  * Please obtain a copy of the License at
16e13b1fa5SApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17e13b1fa5SApple OSS Distributions  *
18e13b1fa5SApple OSS Distributions  * The Original Code and all software distributed under the License are
19e13b1fa5SApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
208149afccSApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
218149afccSApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22e13b1fa5SApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23e13b1fa5SApple OSS Distributions  * Please see the License for the specific language governing rights and
24e13b1fa5SApple OSS Distributions  * limitations under the License.
258149afccSApple OSS Distributions  *
26e13b1fa5SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
278149afccSApple OSS Distributions  */
288149afccSApple OSS Distributions 
293ca3bd55SApple OSS Distributions /*
30*a5e72196SApple OSS Distributions  *       WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
31*a5e72196SApple OSS Distributions  *
32*a5e72196SApple OSS Distributions  *       THIS FILE IS NEEDED TO PASS FIPS ACCEPTANCE FOR THE RANDOM NUMBER GENERATOR.
33*a5e72196SApple OSS Distributions  *       IF YOU ALTER IT IN ANY WAY, WE WILL NEED TO GO THOUGH FIPS ACCEPTANCE AGAIN,
34*a5e72196SApple OSS Distributions  *       AN OPERATION THAT IS VERY EXPENSIVE AND TIME CONSUMING.  IN OTHER WORDS,
35*a5e72196SApple OSS Distributions  *       DON'T MESS WITH THIS FILE.
36*a5e72196SApple OSS Distributions  *
37*a5e72196SApple OSS Distributions  *       WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
383ca3bd55SApple OSS Distributions  */
393ca3bd55SApple OSS Distributions 
408149afccSApple OSS Distributions #ifndef __DEV_RANDOMDEV_H__
418149afccSApple OSS Distributions #define __DEV_RANDOMDEV_H__
428149afccSApple OSS Distributions 
43fad439e7SApple OSS Distributions #include <sys/appleapiopts.h>
44fad439e7SApple OSS Distributions 
45fad439e7SApple OSS Distributions #ifdef __APPLE_API_PRIVATE
46fad439e7SApple OSS Distributions 
47fad439e7SApple OSS Distributions #include <sys/random.h>
48fad439e7SApple OSS Distributions 
4914e3d835SApple OSS Distributions void PreliminarySetup( void );
5014e3d835SApple OSS Distributions void random_init( void );
518149afccSApple OSS Distributions int random_open(dev_t dev, int flags, int devtype, struct proc *pp);
528149afccSApple OSS Distributions int random_close(dev_t dev, int flags, int mode, struct proc *pp);
538149afccSApple OSS Distributions int random_read(dev_t dev, struct uio *uio, int ioflag);
548149afccSApple OSS Distributions int random_write(dev_t dev, struct uio *uio, int ioflag);
558149afccSApple OSS Distributions 
563ca3bd55SApple OSS Distributions u_int32_t RandomULong( void );
578149afccSApple OSS Distributions 
58fad439e7SApple OSS Distributions #endif /* __APPLE_API_PRIVATE */
598149afccSApple OSS Distributions #endif /* __DEV_RANDOMDEV_H__ */
60