logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

random.h (1897B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * include/linux/random.h
  4. *
  5. * Include file for the random number generator.
  6. */
  7. #ifndef _LINUX_RANDOM_H
  8. #define _LINUX_RANDOM_H
  9. #include <linux/types.h>
  10. #include <linux/ioctl.h>
  11. #include <linux/irqnr.h>
  12. /* ioctl()'s for the random number generator */
  13. /* Get the entropy count. */
  14. #define RNDGETENTCNT _IOR( 'R', 0x00, int )
  15. /* Add to (or subtract from) the entropy count. (Superuser only.) */
  16. #define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
  17. /* Get the contents of the entropy pool. (Superuser only.) (Removed in 2.6.9-rc2.) */
  18. #define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
  19. /*
  20. * Write bytes into the entropy pool and add to the entropy count.
  21. * (Superuser only.)
  22. */
  23. #define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
  24. /* Clear entropy count to 0. (Superuser only.) */
  25. #define RNDZAPENTCNT _IO( 'R', 0x04 )
  26. /* Clear the entropy pool and associated counters. (Superuser only.) */
  27. #define RNDCLEARPOOL _IO( 'R', 0x06 )
  28. /* Reseed CRNG. (Superuser only.) */
  29. #define RNDRESEEDCRNG _IO( 'R', 0x07 )
  30. struct rand_pool_info {
  31. int entropy_count;
  32. int buf_size;
  33. __u32 buf[];
  34. };
  35. /*
  36. * Flags for getrandom(2)
  37. *
  38. * GRND_NONBLOCK Don't block and return EAGAIN instead
  39. * GRND_RANDOM No effect
  40. * GRND_INSECURE Return non-cryptographic random bytes
  41. */
  42. #define GRND_NONBLOCK 0x0001
  43. #define GRND_RANDOM 0x0002
  44. #define GRND_INSECURE 0x0004
  45. /**
  46. * struct vgetrandom_opaque_params - arguments for allocating memory for vgetrandom
  47. *
  48. * @size_per_opaque_state: Size of each state that is to be passed to vgetrandom().
  49. * @mmap_prot: Value of the prot argument in mmap(2).
  50. * @mmap_flags: Value of the flags argument in mmap(2).
  51. * @reserved: Reserved for future use.
  52. */
  53. struct vgetrandom_opaque_params {
  54. __u32 size_of_opaque_state;
  55. __u32 mmap_prot;
  56. __u32 mmap_flags;
  57. __u32 reserved[13];
  58. };
  59. #endif /* _LINUX_RANDOM_H */