In file /home/eternity/Source/Eso/Majordomo/H/majordomo.h:

class Majordomo : public SixMajordomo

Class responsible for handling messages comming to Eso

Inheritance:

Majordomo < SixMajordomo < Runable < Debugable


Public Methods

Majordomo (Eso * parent, LogFile * majordomoLogFile)
Eso's majordomo constructor.
Err Majordomo::DRCAnswerFromBank (MsgField *dataInMsgFld)
DRCAnswerFromBank (cmd be_reply_to_resp) Dlouhy_komentar
Err Majordomo::DRCAnswerFromBank (MsgField *dataInMsgFld)
DRCAnswerFromBank (cmd be_reply_to_resp)
Err Majordomo::DRCAnswerFromEso (MsgField *dataFld)
Serves Eso's answer to reply to its request for money
Err Majordomo::DRCAnswerHeader (const MsgField *dataFld)
Serves CE_REPLY_HEADER message
MsgField* Majordomo::DecryptByACPriv (const ACID acid, const MsgField *eData)
Decrypts data by private key
MsgField* Majordomo::DecryptByACPriv (const ACID acid, const MsgField *eData)
Decrypts data with access private key
void Majordomo::DownloadFile ()
Downloads file from Esos
void Majordomo::DownloadHeaders ()
Downloads headers from Esos
GMessage* Majordomo::GetCertificates (string type, Size count)
Asks mix for some certificates and then returns them
void Majordomo::GetCertificates (GMessage * request)
Returns certificates from Mix's repository (Certificate Repository)
GMessage* Majordomo::GetOnion (Size onionLen, Size requestID)
Asks Mix for onion
ACManager* Majordomo::GetPtrToACManager (Char *)
Returns always NULL
void Majordomo::RequestStorage (ArrayGMessage *certificates, File *fileToStore)
Asks Esos to store the file
void* Majordomo::Run (void *)
Acs majordomo Run() method
void* Majordomo::Run (void * )
Run method in Client Majordomo
void* Majordomo::Run (void *)
Decides what to do with messages for which Mix is a final point
void Majordomo::WaitForAnswersToReqForStor (int requestsSent)
Waits for answers to CE_REQUEST_FOR_STOR
Majordomo::~Majordomo ()
Destructor of Majordomo

Public


Functions for ACManagers

Protected

methods

Functions for commands got from receiverToMajordomo queue (Mix cmds and timeouts)

Functions for commands from Service

Saving files

Finding files

Filling messages for Service
virtual MsgField* DecryptByACPriv (const ACID acid, const MsgField *dData)
Decrypting data from Service
Err SendToEsos (Char *command, GMessage *msg, Int count)
Sends messages to other Esos through Mix

Inherited from SixMajordomo:

Public Methods

Err SixMajordomo::AskForOnion()
Err SixMajordomo::BeginTransaction(ID *newTID)
Err SixMajordomo::CommandDataReceived(MsgField *paramFld)
Err SixMajordomo::CommandOnionGenerated(MsgField *dataFld)
Err SixMajordomo::CommandTest(MsgField *dataFld)
GMessage* SixMajordomo::CreateGenerateOnionMsg(Size hopCount = CFG_HOPS_IN_AC)
GMessage* SixMajordomo::CreateGetACsMsg(Char *type, Int count)
GMessage* SixMajordomo::CreateNextACTimeOutMsg(Char *type)
GMessage* SixMajordomo::CreatePublishCertificateMsg(GMessage *ac)
GMessage* SixMajordomo::CreateSendDataMsg(Char *commandSer, GMessage *dataSer, GMessage *ac, Size hops)
GMessage* SixMajordomo::CreateTestMsg(MsgField *dataFld)
Err SixMajordomo::DRCTest(const MsgField *dataFld)
Err SixMajordomo::DecryptDataMsg(const GMessage *dataMsg, MsgField **decryptedBodyFld, ACID *acid)
Err SixMajordomo::EndTransaction(ID tid)
Err SixMajordomo::FeedSenderWithMsgForMix(GMessage *mixMsg)
Err SixMajordomo::FeedSenderWithOutMsgQueue()
Err SixMajordomo::FillReplyToInfo(GMessage *gMsg)
Err SixMajordomo::FillTest(GMessage *gMsg, MsgField *msgFld)
Err SixMajordomo::GenerateRequestForMissingACs(Char *acType)
GMessage* SixMajordomo::GetACByACID(Char *type, ACID acID)
Queue* SixMajordomo::GetACs(Char *type, const int count, Queue *notIn)
ID SixMajordomo::GetTID()
Err SixMajordomo::HandleDataReceivedBody(const MsgField *bodyFld, const ACID acid)
Err SixMajordomo::HandleGeneratedAC(GMessage *)
Void SixMajordomo::HandleMixMessage(GMessage *inMsg)
Err SixMajordomo::InsertAC(Char *type, GMessage *ac)
Err SixMajordomo::NextACTimeOut(Char *type, ESTime *t)
void* SixMajordomo::Run(void *)
SixMajordomo::SixMajordomo(Six * parent, LogFile * majordomoLogFile)
Err SixMajordomo::SwitchDataReceivedCommand(const Char *command, const MsgField *dataFld, const ACID acid)
Err SixMajordomo::SwitchDataReceivedVersion(const Char *version, const GMessage *body, const ACID acid)
Err SixMajordomo::SwitchMixCommand(MsgField *commandFld, MsgField *dataFld)
Err SixMajordomo::TestACCount(Char *type, Int *missing)
SixMajordomo::~SixMajordomo()

Public

methods

SixMajordomo(Six * parent, LogFile * majordomoLogFile)
Constructor.
virtual ~SixMajordomo()
Destructor.
virtual void* Run(void *)
Method that runs the whole Eso - processes messages from receiverToMajordomo.
GMessage* CreateSendDataMsg(Char *commandSer, GMessage *dataSer, GMessage *ac, Size hops = CFG_SEND_DATA_HOPS)
Creates "send_data" message.
Err BeginTransaction(ID *newTID)
Starts new transaction and returns its ID.
Err EndTransaction(ID tid)
Ends transaction with ID tid.
ID GetTID()
Returns ID of the most recently started transaction.
Functions for getting information from ACManagers
virtual ACManager* GetPtrToACManager(Char *type)
Gets pointer to ACManager.
virtual Err InsertAC(Char *type, GMessage *ac)
Inserts AC into ACManager of given type.
virtual Queue* GetACs(Char *type, const int count = 1, Queue *notIn = NULL)
Gets given count of ACs of given type not included in notIn queue.
virtual GMessage* GetACByACID(Char *type, ACID acID)
Gets AC of given type by ACID.
virtual Err NextACTimeOut(Char *type, ESTime *t)
Returns next timeout of ACManager of given type.
virtual GMessage* CreateNextACTimeOutMsg(Char *type)
Creates messages that will be returned in next TimeOut.
virtual Err TestACCount(Char *type, Int *missing)
Tests AC count in ACMgr of given type.
virtual Err GenerateRequestForMissingACs(Char *acType)
Generates request for missing ACs.
virtual Err AskForOnion()
Asks Mix for onion.

Protected

attributes

TID tID
transaction ID.
Queue* outMsgQueue
Queue with messages prepared to send to Mix.
TransactionManager* transactionManager
Object for managing transactions.

methods

Help functions for putting the messages to the majordomoToSender queue
Err FeedSenderWithOutMsgQueue()
Puts the messages from outMsgQueue to majordomoToSender queue.
Err FeedSenderWithMsgForMix(GMessage *mixMsg)
Puts one message to majordomoToSender queue.
Functions for commands got from IIQ (Mix cmds)
virtual Void HandleMixMessage(GMessage *inMsg)
gets the Command and Data fields from inMsg and calls SwitchMixCommand.
virtual Err SwitchMixCommand(MsgField *commandFld, MsgField *dataFld)
calls appropriate method for Mix command.
virtual Err CommandTest(MsgField *dataFld)
Serves Test command from MIX.
virtual Err CommandDataReceived(MsgField *dataFld)
Serves DataReceived command from MIX.
virtual Err CommandOnionGenerated(MsgField *dataFld)
Serves OnionGenerated command from MIX.
Functions needed for serving OnionGenerated command from Mix
virtual Err GenerateThisSixAC(MsgField *onion, GMessage **generatedAC)
Generates AC of this six having the Onion (Mix certificate).
virtual Err HandleGeneratedAC(GMessage *generatedAC)
Handles the generated AC according to the type of Six.
Functions needed for serving DataReceived command from Mix
virtual MsgField* DecryptByACPriv(const ACID acid, const MsgField *dData)
Decrypting data by privateKey associated with ACID.
Err DecryptDataMsg(const GMessage *dataMsg, MsgField **decryptedBodyFld, ACID *acid)
Decrypting data that came from Service.
Err HandleDataReceivedBody(const MsgField *bodyFld, const ACID acid)
Handles the body of the message (the decrypted request from Service).
virtual Err SwitchDataReceivedVersion(const Char *version, const GMessage *body, const ACID acid)
Chooses the way to continue according to the protocol version of the message.
Functions that handle various commands from Service
virtual Err SwitchDataReceivedCommand(const Char *command, const MsgField *dataFld, const ACID acid)
Initializing switch.
Err DRCTest(const MsgField *dataFld)
Serving Test command.
Filling the fields into the messages to Service
Err FillTest(GMessage *gMsg, MsgField *msgFld)
Filling fields of TestMessage.
Err FillReplyToInfo(GMessage *gMsg)
Filling Reply-to-AC and Reply-To-TID fields of a GMessage.
Functions that create messages for Mix
GMessage* CreateTestMsg(MsgField *dataFld)
Creates testing message.
GMessage* CreateGetACsMsg(Char *type, Int count)
Creates "get_certificates" message.
GMessage* CreateGenerateOnionMsg(Size hopCount = CFG_HOPS_IN_AC)
Creates "generate_onion" message.

Inherited from Runable:

Public Methods

void Runable::MaskAllSignals()
Runable::Runable(LogFile * logFile)

Inherited from Debugable:

Public Methods

string* Debugable::CreateString(char *firstStr, int firstInt, int secondInt)
Debugable::Debugable(LogFile * debugLogFile)
int Debugable::SetDebugOptions(int newLogOptions)
void Debugable::SetLogFile(LogFile *aLogFile)
void Debugable::WriteString(LogLevel debugLevel, char * format, ...)
Debugable::~Debugable()

Inherited from SixOffspring:

Public Methods

SixOffspring::SixOffspring(Six * aSix)

Documentation

Class responsible for handling messages comming to Eso. This class encapsulates main Eso's functionality. Its behaviour is inherited from general SixManager. Majordomo is capable of receiving messages from Mix and other Sixes in the Eternity Service, taking appropriate actions (such as to store or find a file) and creating replies.
methods

Functions for commands got from receiverToMajordomo queue (Mix cmds and timeouts)

Functions for commands from Service

Saving files

Finding files

Filling messages for Service

virtual MsgField* DecryptByACPriv(const ACID acid, const MsgField *dData)
Decrypting data from Service. Overrides pure virtual SixMajordomo::DecryptByACPriv

Err SendToEsos(Char *command, GMessage *msg, Int count)
Sends messages to other Esos through Mix

Majordomo(Eso * parent, LogFile * majordomoLogFile)
Eso's majordomo constructor.

Functions for ACManagers

Err Majordomo::DRCAnswerFromBank(MsgField *dataInMsgFld)
DRCAnswerFromBank (cmd be_reply_to_resp) Dlouhy_komentar
Parameters:
dataInMsgFld -
Author:
Ivana
See Also:

Err Majordomo::DRCAnswerFromBank(MsgField *dataInMsgFld)
DRCAnswerFromBank (cmd be_reply_to_resp). Dlouhy_komentar
Returns:
error code
Parameters:
parametr -
Author:
Ivana
See Also:
co_se_toho_tyka

Err Majordomo::DRCAnswerFromEso(MsgField *dataFld)
Serves Eso's answer to reply to its request for money. Compares if Eso sent the same MAC as Bank holds for requested payment.
Returns:
error code
Parameters:
dataFld - data comming along with command
Author:
Ivana
See Also:

Err Majordomo::DRCAnswerHeader(const MsgField *dataFld)
Serves CE_REPLY_HEADER message. Gets the header out of the GMessage and prints info about it to the stdout.
Returns:
error code
Parameters:
dataFld - Data from the GMessage.
Author:
Marek
See Also:

MsgField* Majordomo::DecryptByACPriv(const ACID acid, const MsgField *eData)
Decrypts data by private key. Overriden SixMajordomo method realized by a call to TCBWrapper.
Returns:
MsgField *
Parameters:
acid - ID of access certificate which public key was used to encrypt data.
eData - encrypted data
Author:
Pavel
See Also:
TCBWrapper, SixMajordomo

MsgField* Majordomo::DecryptByACPriv(const ACID acid, const MsgField *eData)
Decrypts data with access private key. Identifies proper private key by access certificate ID and then decrypts given data. Decrypted data are returned.
Returns:
co
Parameters:
acid - ID of access certificate which private key is to be used for decrypting process
eData - Encrypted data
Author:
Marek
See Also:
SixMajordomo, KeyManager, Cipherer

void Majordomo::DownloadFile()
Downloads file from Esos. Tries to find files according to FindFileID given by user in command line.
Returns:
void
Author:
Marek
See Also:

void Majordomo::DownloadHeaders()
Downloads headers from Esos. Tries to find files according to FileAttributeMask given by user in command line.
Returns:
void
Author:
Marek
See Also:

GMessage* Majordomo::GetCertificates(string type, Size count)
Asks mix for some certificates and then returns them. Constructs message of this type:
Command: get_certificates
Parameters:
Count:
Certificate-Type:
Request-ID:
Returns:
GMessage - got certificates.
Parameters:
type - Type of certificates to get
count - Count of certificates to get.
Author:
Venca, Pechy
See Also:

void Majordomo::GetCertificates(GMessage * request)
Returns certificates from Mix's repository (Certificate Repository). Mix returns all certificates from its repository. When there is not enough certificates of requested type, Mix asks for them Acs. When certificates come to Mix from Acs, they are returned to the Six that wanted them.
Returns:
void
Parameters:
request - Request's GMessage:
GM_PARAMETERS
CERTIFICATE_TYPE
GM_COUNT

Author:
Venca
See Also:
CertificateRepository, Acs

GMessage* Majordomo::GetOnion(Size onionLen, Size requestID)
Asks Mix for onion. Creates GenerateOnion message for Client and waits for reply.
Returns:
GMessage - the onion.
Parameters:
onionLen - Requested length of onion.
requestID - RequestID to send to client
Author:
Pechy, Venca
See Also:

ACManager* Majordomo::GetPtrToACManager(Char *)
Returns always NULL. This is an overriden Six method. Because Client has no ACManagers, this method always returns NULL.
Returns:
NULL
Parameters:
char - * - not used
Author:
Marek
See Also:
SixMajordomo

void Majordomo::RequestStorage(ArrayGMessage *certificates, File *fileToStore)
Asks Esos to store the file. Contact all these Eso's and ask if it is possible to store file
Returns:
void
Parameters:
certificates - Certificates of Esos to ask.
fileToStore - file to try to store
Author:
Pavel
See Also:

void* Majordomo::Run(void *)
Acs majordomo Run() method. Gets message with the following structure:
Command: data_received
Parameters:
Data:
Command: get_certificates
Request-ID:                        ... Mix's request ID
Parameters:
Onion:
Certificate-Type:
Count:
Request-ID:
or
Command: data_received
Parameters:
Data:
Command: publish_certificates
Parameters:
Certificate-1:
Certificate-2:
... 
Certificate-n:
And sends back a reply:
Command: send_data
Parameters:
Add-Hops:
Onion:
Data:
Command: certificates_received
Request-ID:                        ... Mix's request ID
Parameters:
Request-ID:
Certificates:
Certificae-1:
Certificae-2:
...
Certificae-n:
Returns:
(void *)NULL - no result is returned
Author:
Venca
See Also:
Majordomo, GetCertificates(), PublishCertificates()

void* Majordomo::Run(void * )
Run method in Client Majordomo. Generates asymetric key and according to the switches given by user runs specified method.
Returns:
void *
Author:
Pavel
See Also:

void* Majordomo::Run(void *)
Decides what to do with messages for which Mix is a final point. When a message ends in Mix, it can have different recipients - Six or Mix. We use GM_X_DESTINATION and GM_ORIGIN to decide which type of the message it is. Message can go from Mix to Mix, from Six to Mix and from Mix to Six. According to this, Majordomo passes chunks along the way or gives them to the object that is the real recipient in Mix.
Author:
Venca, Pechy
See Also:
GM_X_DESTINATION, GM_ORIGIN

void Majordomo::WaitForAnswersToReqForStor(int requestsSent)
Waits for answers to CE_REQUEST_FOR_STOR. Waits for answers to CE_REQUEST_FOR_STOR in a loop until a timeout is over.
Returns:
void
Parameters:
requestSent - Number of messages for wait for.
Author:
Pavel
See Also:

Majordomo::~Majordomo()
Destructor of Majordomo. Destructor of Majordomo in Client
Returns:
co
Author:
pavel
See Also:


This class has no child classes.
Author:
Ivanka, Marek, Pavel
See Also:
SixMajordomo, Six, Eso

alphabetic index hierarchy of classes


generated by doc++