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

class Majordomo : public SixMajordomo

Client majordomo

Inheritance:

Majordomo < SixMajordomo < Runable < Debugable


Public Methods

Err Majordomo::AskForEsoCertificates ()
Asks for Eso certificates
Err Majordomo::DRCAnswerHeader (const MsgField *dataField)
Serves CMD_ANSWER_HEADER message
Err Majordomo::DRCDTSGetFields (const MsgField *dataFld, GMessage **replyToAC, TID *replyToTID, TID *inReplyToTID, MsgField **ffid, MsgField **keywords, MsgField **dataToStoreFld)
Parses the GMessage comming with command CE_DATA_TO_STORE
Err Majordomo::DRCDataToStore (const MsgField *dataFld, const ACID acid)
Serves CE_DATA_TO_STOR command
Err Majordomo::DRCMoneyFromClient (MsgField *dataFld)
Serves command from client
Err Majordomo::FillReplyAllocation (GMessage *outMsg, TID inReplyToTID, MsgField *payPlan)
Sets the outMsg as ReplyAllocation
Err Majordomo::FillReplyFile (GMessage *outMsg, TID inReplyToTID, MsgField *aFile)
Sets the outMsg as ReplyFile
Err Majordomo::FillReplyFileStored (GMessage *outMsg, TID inReplyToTID)
Sets the outMsg as ReplyFileStored
Err Majordomo::FillReplyHeader (GMessage *outMsg, TID inReplyToTID, GMessage *aHeader)
Sets the outMsg as ReplyHeader
ACManager* Majordomo::GetPtrToACManager (Char *type)
Returns pointer to ACManager
ACManager* Majordomo::GetPtrToACManager (Char *type)
Returns pointer to ACManeger
ESTime* Majordomo::GetTime ()
Gets current time
Err Majordomo::HandleGeneratedAC (GMessage *generatedAC)
Handles generated access certificate
Err Majordomo::HandleGeneratedAC (GMessage *generatedAC)
Saves the generated AC to ACManager
Err Majordomo::Initialize ()
Initializes Bank Majordomo
Err Majordomo::InsertToOutMsgQueue (GMessage *msg)
Inserts message to outMsgQueue
GMessage* Majordomo::LoadPrivateKey ()
Returns Client's privKey
void Majordomo::SendData (MsgField * data, GMessage * destination, string destinationType, Size hops)
Send data to onion
Err Majordomo::SendToEsos (Char *command, GMessage *msg, Int count)
Sends message to number of Esos
void Majordomo::StoreFile (ArrayGMessage *certificates)
Stores file on Esos
Err Majordomo::SwitchDataReceivedCommand (const Char *command, const MsgField *dataFld, const ACID acid)
Chooses the method to handle the command

Public

methods
Majordomo (Client * parent, LogFile * logFile)
Constructor
virtual ~Majordomo ()
destructor

overriden methods
virtual void* Run (void *)
Main thread method that handles all requests
virtual ACManager* GetPtrToACManager (Char *type)
Returns the AC Manager for the specified type.
virtual Queue* GetACs (Char *type, const int count = 1, Queue *notIn = NULL)
Get access certificates of specified type

local methods

commands

data_received commands

Helper functions for commands

Tests and not finished versions of commands

Protected

attributes
methods
virtual Err SwitchDataReceivedCommand (const Char *command, const MsgField *dataFld, const ACID acid)
Handle data received command
virtual Err GenerateThisSixAC (MsgField *onion, GMessage **generatedAC)
generating client's AC
Err GenerateACID (ACID *acid)
Generates uniqueu access certificate ID
Err GetAsymetricKey (GMessage **acPubKey)
returns Acs asymetric key
Err GenerateAsymetricKey ()
Generates asymetric key for making access certificate
virtual MsgField* DecryptByACPriv (const ACID acid, const MsgField *dData)
Decrypts data by Acs' private key

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()

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

Client majordomo. Implements all the tasks for communication with Eso Mix Bank and is an expert in protocols used between these entities.
attributes

methods

virtual Err SwitchDataReceivedCommand(const Char *command, const MsgField *dataFld, const ACID acid)
Handle data received command

virtual Err GenerateThisSixAC(MsgField *onion, GMessage **generatedAC)
generating client's AC

Err GenerateACID(ACID *acid)
Generates uniqueu access certificate ID

Err GetAsymetricKey(GMessage **acPubKey)
returns Acs asymetric key

Err GenerateAsymetricKey()
Generates asymetric key for making access certificate

virtual MsgField* DecryptByACPriv(const ACID acid, const MsgField *dData)
Decrypts data by Acs' private key

methods

Majordomo(Client * parent, LogFile * logFile)
Constructor

virtual ~Majordomo()
destructor

overriden methods

virtual void* Run(void *)
Main thread method that handles all requests

virtual ACManager* GetPtrToACManager(Char *type)
Returns the AC Manager for the specified type.

virtual Queue* GetACs(Char *type, const int count = 1, Queue *notIn = NULL)
Get access certificates of specified type

local methods

commands

data_received commands

Helper functions for commands

Tests and not finished versions of commands

Err Majordomo::AskForEsoCertificates()
Asks for Eso certificates. Generates message for missing ACs and sends it to Mix.
Returns:
error code
Author:
Marek
See Also:
Six, SixMajordomo

Err Majordomo::DRCAnswerHeader(const MsgField *dataField)
Serves CMD_ANSWER_HEADER message. processes the incoming found header - forwards found header to client
Returns:
error code
Parameters:
dataField - encrypted request comming with message
acid - ID of this Eso access certificate which was used to address thid message
Author:
Marek
See Also:
TCBWrapper, Finder

Err Majordomo::DRCDTSGetFields(const MsgField *dataFld, GMessage **replyToAC, TID *replyToTID, TID *inReplyToTID, MsgField **ffid, MsgField **keywords, MsgField **dataToStoreFld)
Parses the GMessage comming with command CE_DATA_TO_STORE. GMessage comming with command CE_DATA_TO_STORE should have this structure:
Reply-To-ID: ID of a message assigned by sender (Client)
FFID:
Keywords:
Data:
Returns:
error code
Parameters:
dataFld - data comming with command
replyToAC - out parameter for Reply-To access certificate
replyToTID - out parameter for Reply-To message ID
inReplyToTID - out parameter for In-Reply-To message ID
ffid - out parameter for file find ID
keywords - out parameter for keywords
dataToStoreFld - out parameter for data to store
Author:
Pavel
See Also:
DRCDataToStore()

Err Majordomo::DRCDataToStore(const MsgField *dataFld, const ACID acid)
Serves CE_DATA_TO_STOR command. Handles the CE_DATA_TO_STOR command, according to Eso-Others interface.
In-Reply-To-TID: ID of a EC_REPLY_ALLOC message
Reply-To-ID: ID of a message assigned by sender (Client)
Reply-To-AC: AC to reply to
FFID:
Keywords:
Data:
Returns:
error code
Parameters:
dataFld - data comming with command
Author:
Pavel
See Also:
FillReplyFileStored(), Allocator, Banker, Scheduler, TCBWrapper

Err Majordomo::DRCMoneyFromClient(MsgField *dataFld)
Serves command from client. Handles command that Client sends after successfull storage of his file on Eso, to inform Bank about the stored file owner.
Returns:
error code
Parameters:
dataFld - Data comming along with command
Author:
Ivana
See Also:

Err Majordomo::FillReplyAllocation(GMessage *outMsg, TID inReplyToTID, MsgField *payPlan)
Sets the outMsg as ReplyAllocation. Fills all needed fields in a message that is sent as a reply to CE_REQ_FOR_STOR command.
Returns:
error code
Parameters:
parametr -
Author:
Pavel
See Also:
co_se_toho_tyka

Err Majordomo::FillReplyFile(GMessage *outMsg, TID inReplyToTID, MsgField *aFile)
Sets the outMsg as ReplyFile . Fills all needed fields in a message that is sent as a CMD_REPLY_FILE command.
Returns:
error code
Parameters:
parametr -
Author:
Marek
See Also:
co_se_toho_tyka

Err Majordomo::FillReplyFileStored(GMessage *outMsg, TID inReplyToTID)
Sets the outMsg as ReplyFileStored. Fills all needed fields in a message that is sent as a reply to CE_DATA_TO_STOR command.
Returns:
error code
Parameters:
parametr -
Author:
Pavel
See Also:
co_se_toho_tyka

Err Majordomo::FillReplyHeader(GMessage *outMsg, TID inReplyToTID, GMessage *aHeader)
Sets the outMsg as ReplyHeader . Fills all needed fields in a message that is sent as a CMD_REPLY_HEADER command.
Returns:
error code
Parameters:
parametr -
Author:
Marek
See Also:
co_se_toho_tyka

ACManager* Majordomo::GetPtrToACManager(Char *type)
Returns pointer to ACManager. Returns pointer to ACManager of given type, but does not create a copy of this manager, so DON'T EVER DELETE this value. All ACManagers are owned by Eso.
Returns:
ACManager *
Parameters:
type - one of ACTYPE_... values identifying ACManager
Author:
Marek
See Also:
Eso, SixMajordomo, ACManager

ACManager* Majordomo::GetPtrToACManager(Char *type)
Returns pointer to ACManeger. Returns pointer to ACManager of given type, but does not create a copy of this manager, so DON'T EVER DELETE this value. All ACManagers are owned by Bank.
Returns:
ACManager of given type
Parameters:
type - one of ACTYPE_... values identifying ACManager
Author:
Marek
See Also:
Bank, SixMajordomo, ACManager

ESTime* Majordomo::GetTime()
Gets current time. Uses ESTime method to check current time.
Returns:
error code
Author:
Marek
See Also:

Err Majordomo::HandleGeneratedAC(GMessage *generatedAC)
Handles generated access certificate. Saves given access certificates and publishes it (through Mix) to Acs.
Returns:
error code
Parameters:
generatedAC - given access certificate
Author:
Marek
See Also:
InsertAC(), CreatePublishCertificateMsg()

Err Majordomo::HandleGeneratedAC(GMessage *generatedAC)
Saves the generated AC to ACManager. This is an overriden method from Six. In Bank it is necessary to set generated AC to ACManager.
Returns:
error code
Parameters:
generatedAC - Generated AC to handle.
Author:
Marek
See Also:
Eso::HandleGeneratedAC(), Client::HandleGeneratedAC()

Err Majordomo::Initialize()
Initializes Bank Majordomo. Certain (but really COOL) initialization.
Returns:
error code
Author:
Marek
See Also:

Err Majordomo::InsertToOutMsgQueue(GMessage *msg)
Inserts message to outMsgQueue. Puts the message to queue that is periodically feeded to majordomoToSender MessageQueue, which is then emptied to Mix.
Returns:
error code
Parameters:
msg - message to be sent
Author:
Marek
See Also:
SixMajordomo

GMessage* Majordomo::LoadPrivateKey()
Returns Client's privKey. Loads Client's privKey from file.
Returns:
client's privKey
Author:
Marek
See Also:

void Majordomo::SendData(MsgField * data, GMessage * destination, string destinationType, Size hops)
Send data to onion. Sends data to onion or mix - method used by test methods in Client.
Returns:
void
Parameters:
data - Data to send.
destination - Onion to send the data to.
hops - number of hops to add.
Author:
Pechy, Venca
See Also:

Err Majordomo::SendToEsos(Char *command, GMessage *msg, Int count)
Sends message to number of Esos. Sends the message to count randomly chosen Esos (creates count "send_data" mixMsgs and puts them into outMsgQueue)
Returns:
error code
Parameters:
command - command to be sent to Esos
msg - message to be sent to Esos
count - count of Esos to send the message to
Author:
Marek
See Also:
SixMajordomo

void Majordomo::StoreFile(ArrayGMessage *certificates)
Stores file on Esos. Creates messages to store file on Esos with given certificates and waits for answers to them.
Returns:
void
Parameters:
certificates - Certificates of Esos to store the file on.
Author:
Pavel
See Also:
Banker

Err Majordomo::SwitchDataReceivedCommand(const Char *command, const MsgField *dataFld, const ACID acid)
Chooses the method to handle the command. Decidec which method to use according to got command.
Returns:
error code
Parameters:
command - got command
dataFld - got data
acid - ID of certificate to which the message was sent
Author:
Pavel
See Also:


This class has no child classes.
Author:
Marek, Pavel, Pechy, Venca
See Also:
Mix Client Eso Bank

alphabetic index hierarchy of classes


generated by doc++