plebble
us::gov::dfs::daemon Struct Reference

#include <daemon.h>

Inheritance diagram for us::gov::dfs::daemon:
Collaboration diagram for us::gov::dfs::daemon:

Public Types

typedef relay::daemon b
 
typedef dfs::mezzanine t
 
- Public Types inherited from us::gov::relay::daemon
typedef peer::daemon b
 
typedef crypto::ec::keys::pub_t::hash_t hash_t
 
- Public Types inherited from us::gov::peer::daemon
typedef auth::daemon b
 
typedef peer::mezzanine t
 
typedef socket::client client
 
typedef crypto::ec::keys keys
 
typedef keys::pub_t pub_t
 
typedef pub_t::hash_t hash_t
 
- Public Types inherited from us::gov::id::daemon
typedef socket::daemon b
 
typedef crypto::ec::keys keys
 
using datagram = socket::datagram
 
- Public Types inherited from us::gov::socket::daemon
typedef server b
 
typedef thpool pool_t
 
- Public Types inherited from us::gov::socket::server
typedef bgtask b
 
typedef crypto::ec::keys::pub_t pub_t
 
- Public Types inherited from us::gov::peer::mezzanine
typedef bgtask b
 
- Public Types inherited from us::gov::dfs::mezzanine
typedef bgtask b
 

Public Member Functions

 daemon ()
 
 daemon (uint16_t port, uint16_t pport, uint8_t edges, uint8_t devices, int workers, const vector< pair< uint32_t, uint16_t >> &sn)
 
virtual ~daemon ()
 
 daemon (const daemon &)=delete
 
daemonoperator= (const daemon &)=delete
 
virtual bool process_work (socket::peer_t *c, datagram *d) override
 
void receive_file (peer_t *c, datagram *d)
 
void dump (const string &prefix, ostream &) const
 
void send_file (peer_t *c, datagram *request)
 
void save (const string &hash, const vector< uint8_t > &data, int propagate)
 
string load (const string &hash)
 
virtual bool check_dfs_permission (const hash_t &addr) const
 
void wait ()
 
void run ()
 
void onwakeup ()
 
ko start () override
 
ko wait_ready (const chrono::system_clock::time_point &deadline) const override
 
void stop () override
 
void join () override
 
void wakeup ()
 
bool isup () const
 
void index_set (const vector< pair< hash_t, uint32_t >> &)
 
void index_add (const hash_t &, uint32_t sz)
 
void index_rm (const hash_t &)
 
void index_clear ()
 
void rm_file (const hash_t &h)
 
size_t rm_files (const set< hash_t > &exclude)
 
- Public Member Functions inherited from us::gov::relay::daemon
 daemon ()
 
 daemon (const daemon &)=delete
 
daemonoperator= (const daemon &)=delete
 
 daemon (uint16_t port, uint16_t pport, uint8_t edges, uint8_t devices, int workers)
 
 ~daemon () override
 
bool process_work (socket::peer_t *c, datagram *d) override
 
bool process_evidence (const datagram &)
 
void process_harvester_payload (const string &payload, string &ans)
 
virtual bool process_evidence (evidence *)=0
 
void dump (const string &prefix, ostream &os) const
 
void send_evidence (datagram *)
 
int send (int num, const socket::client *exclude, const datagram &)
 
int send (int num, const socket::client *exclude, datagram *)
 
int grid_devices_send (const datagram &d)
 
int grid_devices_send (const datagram &d, const function< bool(const client &)> &)
 
int grid_devices_send (const vector< datagram * > &v, const function< bool(const client &)> &filter)
 
void rollback (uint16_t timeout, string payload)
 
void on_destroy (client &) override
 
virtual bool check_relay_permission (const hash_t &addr) const
 
virtual evidenceparse_custom_evidence (const string &payload) const
 
- Public Member Functions inherited from us::gov::peer::daemon
 daemon ()
 
 daemon (uint16_t port, uint16_t pport, uint8_t edges, uint8_t devices, uint8_t workers)
 
void dump (const string &prefix, ostream &) const
 
void visit (const function< void(socket::client &)> &visitor)
 
vector< pair< uint32_t, uint16_t > > list_neighbours () const
 
vector< pair< uint32_t, uint16_t > > list_dev_neighbours () const
 
void purge_idle ()
 
ko start () override
 
ko wait_ready (const chrono::system_clock::time_point &deadline) const override
 
void stop () override
 
void join () override
 
bool is_active () const
 
void wakeup ()
 
bool isup () const
 
void wait ()
 
void dump_random_nodes (size_t num, ostream &os) const
 
bool lookup_node (const hash_t &p, ostream &os) const
 
virtual void remote_port (const crypto::ec::keys::pub_t &, uint16_t port)
 
void test_connectivity ()
 
void grid_rotate (nodes_t &)
 
void run ()
 
void onwakeup ()
 
void set_seed_nodes (const vector< pair< uint32_t, uint16_t >> &)
 
ko add_seed_node (const pair< uint32_t, uint16_t > &)
 
ko add_seed_node_ (const pair< uint32_t, uint16_t > &)
 
void set_nodes (const vector< pair< hash_t, pair< uint32_t, uint16_t >>> &)
 
ko add_node_ (const pair< hash_t, pair< uint32_t, uint16_t >> &)
 
void grid_setcur ()
 
void disconnect_one ()
 
clientgrid_connect (uint32_t netaddr, uint16_t port)
 
bool grid_connect_test (peer::peer_t *p, uint32_t netaddr, uint16_t port, ostream &os)
 
nodes_tget_nodes ()
 
const nodes_tget_nodes () const
 
- Public Member Functions inherited from us::gov::id::daemon
 daemon ()
 
 daemon (uint16_t port, uint16_t pport, int workers)
 
virtual socket::clientcreate_client (int sock) override
 
virtual const keysget_keys () const =0
 
bool is_duplicate (const pub_t &) const
 
void dump (const string &prefix, ostream &os) const
 
- Public Member Functions inherited from us::gov::socket::daemon
 daemon ()
 
 daemon (const daemon &)=delete
 
daemonoperator= (const daemon &)=delete
 
 daemon (uint16_t port, uint8_t workers)
 
 ~daemon () override
 
clientcreate_client (int sock) override
 
ko start () override
 
ko wait_ready (const chrono::system_clock::time_point &deadline) const override
 
void stop () override
 
void join () override
 
void dump (const string &prefix, ostream &os) const
 
void receive_and_process (client *) override
 
void process_work (peer_t *c)
 
virtual string homedir () const =0
 
- Public Member Functions inherited from us::gov::socket::server
 server ()
 
 server (uint16_t port)
 
virtual ~server ()
 
virtual void attach (client *)
 
virtual void attach_noupdate (client *)
 
virtual void detach (client *)
 
datagramread_from_client (int sock)
 
int make_socket (uint16_t port)
 
bool banned_throttle (const string &addr)
 
void dump (const string &prefix, ostream &os) const
 
void proc_evil (const vector< pair< uint32_t, string >> &)
 
void run ()
 
void onwakeup ()
 
ko start () override
 
ko wait_ready (const chrono::system_clock::time_point &deadline) const override
 
void stop () override
 
void join () override
 
- Public Member Functions inherited from us::gov::bgtask
 bgtask ()
 
 bgtask (function< void()> run, function< void()> onwakeup)
 
virtual ~bgtask ()
 
void set_run_function (function< void()> r)
 
void wakeup ()
 
bool isup () const
 
bool isdown () const
 
bool resumed () const
 
void run_ ()
 
void reset ()
 
bool reset_wait ()
 
bool reset_resume ()
 
bool is_active () const
 
 bgtask ()
 
 bgtask (callback cb0)
 
void set_callback (callback r)
 
ko wait_ready (Date deadline)
 
boolean reset_wait ()
 
boolean reset_resume ()
 
boolean isup ()
 
boolean isdown ()
 
boolean resumed ()
 
void reset ()
 
boolean is_active ()
 
- Public Member Functions inherited from us::gov::peer::mezzanine
 mezzanine (daemon *)
 
- Public Member Functions inherited from us::gov::dfs::mezzanine
 mezzanine (daemon *)
 

Static Public Member Functions

static string resolve_filename (const string &filename)
 
- Static Public Member Functions inherited from us::gov::socket::server
static int set_not_blocking_mode (int sock)
 

Public Attributes

condition_variable cv
 
mutex mx
 
unordered_map< hash_t, uint32_t > index
 
string fsroot
 
- Public Attributes inherited from us::gov::relay::daemon
mem_t _mem
 
- Public Attributes inherited from us::gov::peer::daemon
clientcli {nullptr}
 
mutex mx_nodes
 
mutex mx_hall
 
nodes_t hall
 
nodes_t seed_nodes
 
mutex mx_seed_nodes
 
uint8_t edges
 
grid_t grid
 
condition_variable cv
 
hash_t myself
 
chrono::system_clock::time_point tlo
 
bool force_seeds {false}
 
grid_t grid_dev
 
- Public Attributes inherited from us::gov::id::daemon
uint16_t pport
 
- Public Attributes inherited from us::gov::socket::daemon
pool_t pool
 
uint8_t num_workers
 
- Public Attributes inherited from us::gov::socket::server
clients_t clients
 
uint16_t port
 
int sock {0}
 
blacklist ban
 
client::queue_t sendq
 
- Public Attributes inherited from us::gov::peer::mezzanine
daemond
 
- Public Attributes inherited from us::gov::dfs::mezzanine
daemond
 

Additional Inherited Members

- Static Public Attributes inherited from us::gov::socket::daemon
static const char * KO_4093
 
- Static Public Attributes inherited from us::gov::bgtask
static const char * KO_81021
 
static ko KO_81021 =new ko("KO 81021 Ready status never reached.")
 
- Protected Attributes inherited from us::gov::bgtask
atomic< short > resume {0}
 
thread * th {nullptr}
 
bool active {false}
 
function< void()> run
 
function< void()> onwakeup
 
mutex mx_ready
 
bool ready {false}
 
condition_variable cv_ready
 
AtomicInteger resume =new AtomicInteger(0)
 
Thread th =null
 
boolean active =false
 
callback cb =null
 
ReentrantLock mx_ready = new ReentrantLock()
 
boolean ready =false
 
Condition cv_ready =mx_ready.newCondition()
 

Member Typedef Documentation

◆ b

◆ t

Constructor & Destructor Documentation

◆ daemon() [1/3]

us::gov::dfs::daemon::daemon ( )

◆ daemon() [2/3]

us::gov::dfs::daemon::daemon ( uint16_t  port,
uint16_t  pport,
uint8_t  edges,
uint8_t  devices,
int  workers,
const vector< pair< uint32_t, uint16_t >> &  sn 
)

◆ ~daemon()

virtual us::gov::dfs::daemon::~daemon ( )
virtual

Reimplemented from us::gov::id::daemon.

◆ daemon() [3/3]

us::gov::dfs::daemon::daemon ( const daemon )
delete

Member Function Documentation

◆ check_dfs_permission()

virtual bool us::gov::dfs::daemon::check_dfs_permission ( const hash_t addr) const
virtual

Reimplemented in us::gov::engine::networking.

◆ dump()

void us::gov::dfs::daemon::dump ( const string &  prefix,
ostream &   
) const

◆ index_add()

void us::gov::dfs::daemon::index_add ( const hash_t ,
uint32_t  sz 
)

◆ index_clear()

void us::gov::dfs::daemon::index_clear ( )

◆ index_rm()

void us::gov::dfs::daemon::index_rm ( const hash_t )

◆ index_set()

void us::gov::dfs::daemon::index_set ( const vector< pair< hash_t, uint32_t >> &  )

◆ isup()

bool us::gov::dfs::daemon::isup ( ) const
inline

◆ join()

void us::gov::dfs::daemon::join ( )
overridevirtual

Reimplemented from us::gov::bgtask.

◆ load()

string us::gov::dfs::daemon::load ( const string &  hash)

◆ onwakeup()

void us::gov::dfs::daemon::onwakeup ( )

◆ operator=()

daemon& us::gov::dfs::daemon::operator= ( const daemon )
delete

◆ process_work()

virtual bool us::gov::dfs::daemon::process_work ( socket::peer_t c,
datagram d 
)
overridevirtual

Reimplemented from us::gov::id::daemon.

Reimplemented in us::gov::engine::networking.

◆ receive_file()

void us::gov::dfs::daemon::receive_file ( peer_t c,
datagram d 
)

◆ resolve_filename()

static string us::gov::dfs::daemon::resolve_filename ( const string &  filename)
static

◆ rm_file()

void us::gov::dfs::daemon::rm_file ( const hash_t h)

◆ rm_files()

size_t us::gov::dfs::daemon::rm_files ( const set< hash_t > &  exclude)

◆ run()

void us::gov::dfs::daemon::run ( )

Reimplemented from us::gov::bgtask.

◆ save()

void us::gov::dfs::daemon::save ( const string &  hash,
const vector< uint8_t > &  data,
int  propagate 
)

◆ send_file()

void us::gov::dfs::daemon::send_file ( peer_t c,
datagram request 
)

◆ start()

ko us::gov::dfs::daemon::start ( )
overridevirtual

Reimplemented from us::gov::bgtask.

◆ stop()

void us::gov::dfs::daemon::stop ( )
overridevirtual

Reimplemented from us::gov::bgtask.

◆ wait()

void us::gov::dfs::daemon::wait ( )

◆ wait_ready()

ko us::gov::dfs::daemon::wait_ready ( const chrono::system_clock::time_point &  deadline) const
overridevirtual

Reimplemented from us::gov::bgtask.

◆ wakeup()

void us::gov::dfs::daemon::wakeup ( )
inline

Reimplemented from us::gov::bgtask.

Member Data Documentation

◆ cv

condition_variable us::gov::dfs::daemon::cv

◆ fsroot

string us::gov::dfs::daemon::fsroot

◆ index

unordered_map<hash_t,uint32_t> us::gov::dfs::daemon::index

◆ mx

mutex us::gov::dfs::daemon::mx
mutable

The documentation for this struct was generated from the following file: