|
Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
|
Server parameters. More...
#include <percyparams.h>
Public Member Functions | |
| PercyServerParams (const PercyParams *params, nservers_t sid, bool be_byzantine=false) | |
| Constructor. More... | |
| PercyServerParams (const PercyParams *params, nservers_t sid, nservers_t num_threads=0, DistSplit tsplit=DIST_SPLIT_RECORDS, nservers_t num_workers=0, DistSplit wsplit=DIST_SPLIT_RECORDS, std::vector< nservers_t > worker_sids=std::vector< nservers_t >(), bool fork=false, bool be_byzantine=false) | |
| Constructor for parallel server computation. More... | |
| virtual | ~PercyServerParams () |
| Destructor. More... | |
| void | send (std::ostream &os, bool to_worker=false) const |
| Send parameters and sid to client to test compatibility. More... | |
| bool | is_compatible (std::istream &is) const |
| Test compatibility with client. More... | |
| bool | is_recursive () const |
| Check if the server is recursive. More... | |
| nservers_t | get_sid () const |
| Get the server ID. More... | |
| bool | is_byzantine () const |
| Check if the server is Byzantine (responses incorrectly/maliciously). More... | |
| bool | is_threaded () const |
| Check if the server is using multithreading. More... | |
| nservers_t | num_threads () const |
| Get the number of threads being used. More... | |
| DistSplit | thread_split () const |
| Get the method of partitioning work amoung threads. More... | |
| bool | use_forked_threads () const |
| Check if the server is using forked processes instead of threading. More... | |
| bool | is_distributed () const |
| Check if the server is using distributed computation. More... | |
| nservers_t | num_workers () const |
| Get the number of worker processes being used. More... | |
| DistSplit | worker_split () const |
| Get the method of partitioning work amoung workers. More... | |
| const PercyParams * | get_worker_params (nservers_t wid) const |
| Get the protocol parameters for a worker. More... | |
| std::vector< const PercyParams * > | get_all_worker_params () const |
| Get the protocol parameters for all workers. More... | |
| const PercyServerParams * | get_worker_serverparams (nservers_t wid) const |
| Get the server parameters for a worker. More... | |
| std::vector< const PercyServerParams * > | get_all_worker_serverparams () const |
| Get the server parameters for all workers. More... | |
| const PercyParams * | get_thread_params (nservers_t wid) const |
| Get the protocol parameters for a thread. More... | |
| std::vector< const PercyParams * > | get_all_thread_params () const |
| Get the protocol parameters for all threads. More... | |
| const PercyServerParams * | get_thread_serverparams (nservers_t wid) const |
| Get the server parameters for a thread. More... | |
| std::vector< const PercyServerParams * > | get_all_thread_serverparams () const |
| Get the server parameters for all threads. More... | |
| void | print (std::ostream &os) const |
| Prints the parameters in CSV form. More... | |
| virtual void | print_distributed (std::ostream &os) const |
| Print the distributed properties of the server. More... | |
| const PercyParams * | percy_params () const |
| Get the protocol parameters. More... | |
Protected Attributes | |
| const PercyParams * | params |
| The protocol parameters. More... | |
| nservers_t | sid |
| Server ID. More... | |
| bool | be_byzantine |
| Whether or not the server is Byzantine. More... | |
| nservers_t | _num_threads |
| The number of threads. More... | |
| DistSplit | tsplit |
| The method of partitioning work between threads. More... | |
| bool | is_forked |
| Whether or not the server is using forked processes instead of threading. More... | |
| nservers_t | _num_workers |
| The number of workers. More... | |
| DistSplit | wsplit |
| The method of partitioning work between workers. More... | |
| std::vector< const PercyParams * > | worker_params |
| The workers' protocol parameters. More... | |
| std::vector< const PercyServerParams * > | worker_serverparams |
| The workers' server parameters. More... | |
| std::vector< const PercyParams * > | thread_params |
| The threads' protocol parameters. More... | |
| std::vector< const PercyServerParams * > | thread_serverparams |
| The threads' server parameters. More... | |
Server parameters.
| PercyServerParams | ( | const PercyParams * | params, |
| nservers_t | sid, | ||
| bool | be_byzantine = false |
||
| ) |
Constructor.
| params | The protocol parameters. |
| sid | The server ID. |
| be_byzantine | If true, do not send correct responses to the client. |
| PercyServerParams | ( | const PercyParams * | params, |
| nservers_t | sid, | ||
| nservers_t | num_threads = 0, |
||
| DistSplit | tsplit = DIST_SPLIT_RECORDS, |
||
| nservers_t | num_workers = 0, |
||
| DistSplit | wsplit = DIST_SPLIT_RECORDS, |
||
| std::vector< nservers_t > | worker_sids = std::vector< nservers_t >(), |
||
| bool | fork = false, |
||
| bool | be_byzantine = false |
||
| ) |
Constructor for parallel server computation.
| params | The protocol parameters. |
| sid | The server ID. |
| num_threads | The number of threads to distribute computation over. |
| tsplit | The method of partitioning work between threads. |
| num_workers | The number of workers to distributed computation over. |
| wsplit | The method of partitioning work between workers. |
| worker_sids | The server IDs of workers. |
| fork | If true, use process forking instead of threading. |
| be_byzantine | If true, do not send correct responses to the client. |
|
virtual |
Destructor.
|
inline |
Get the protocol parameters for all threads.
|
inline |
Get the server parameters for all threads.
|
inline |
Get the protocol parameters for all workers.
|
inline |
Get the server parameters for all workers.
|
inline |
Get the server ID.
|
inline |
Get the protocol parameters for a thread.
| wid | Index of the thread. |
|
inline |
Get the server parameters for a thread.
| wid | Index of the thread. |
|
inline |
Get the protocol parameters for a worker.
| wid | Index of the worker. |
|
inline |
Get the server parameters for a worker.
param wid Index of the worker.
|
inline |
Check if the server is Byzantine (responses incorrectly/maliciously).
| bool is_compatible | ( | std::istream & | is | ) | const |
Test compatibility with client.
Read parameters and a server ID from a client and test compatibility.
| is | Stream to read from. |
|
inline |
Check if the server is using distributed computation.
|
inline |
Check if the server is recursive.
|
inline |
Check if the server is using multithreading.
|
inline |
Get the number of threads being used.
|
inline |
Get the number of worker processes being used.
|
inline |
Get the protocol parameters.
| void print | ( | std::ostream & | os | ) | const |
Prints the parameters in CSV form.
Prints the protocol parameters and add the following server fields:
sid,byzantine,distributed_information,
where distributed_information is the result of print_distributed().
| os | Stream to print to. |
|
virtual |
Print the distributed properties of the server.
Reimplemented in RecursiveServerParams.
| void send | ( | std::ostream & | os, |
| bool | to_worker = false |
||
| ) | const |
Send parameters and sid to client to test compatibility.
| os | Stream to write to. |
| to_worker | If true, the parameters are being sent to a worker. |
|
inline |
Get the method of partitioning work amoung threads.
|
inline |
Check if the server is using forked processes instead of threading.
|
inline |
Get the method of partitioning work amoung workers.
|
protected |
The number of threads.
|
protected |
The number of workers.
|
protected |
Whether or not the server is Byzantine.
|
protected |
Whether or not the server is using forked processes instead of threading.
|
protected |
The protocol parameters.
|
protected |
Server ID.
|
protected |
The threads' protocol parameters.
|
protected |
The threads' server parameters.
|
protected |
The method of partitioning work between threads.
|
protected |
The workers' protocol parameters.
|
protected |
The workers' server parameters.
|
protected |
The method of partitioning work between workers.
1.8.7