Botan  1.11.15
src/lib/entropy/dev_random/dev_random.h
Go to the documentation of this file.
00001 /*
00002 * /dev/random EntropySource
00003 * (C) 1999-2009 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_ENTROPY_SRC_DEVICE_H__
00009 #define BOTAN_ENTROPY_SRC_DEVICE_H__
00010 
00011 #include <botan/entropy_src.h>
00012 #include <vector>
00013 #include <string>
00014 
00015 namespace Botan {
00016 
00017 /**
00018 * Entropy source reading from kernel devices like /dev/random
00019 */
00020 class Device_EntropySource : public EntropySource
00021    {
00022    public:
00023       std::string name() const { return "RNG Device Reader"; }
00024 
00025       void poll(Entropy_Accumulator& accum);
00026 
00027       Device_EntropySource(const std::vector<std::string>& fsnames);
00028       ~Device_EntropySource();
00029    private:
00030       typedef int fd_type;
00031 
00032       std::vector<fd_type> m_devices;
00033    };
00034 
00035 }
00036 
00037 #endif