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

class Majordomo : public Runable, public MixOffspring

Mix majordomo

Inheritance:

Majordomo < Runable < Debugable

Majordomo < MixOffspring


Public Methods

GMessage* Majordomo::CreateSimpleReqForHeaders (GMessage *pubKey)
Creates REQ_FOR_HEADERS
GMessage* Majordomo::CreateSimpleReqForStor (File *fileToStore)
Creates simple req for storage
Err Majordomo::DRCAnswerFile (const MsgField *dataFld)
Serves CE_REPLY_FILE message
Err Majordomo::DRCAnswerFile (const MsgField *dataField)
Serves CMD_ANSWER_FILE command
Err Majordomo::DRCRequestForHeaders (const MsgField *dataField, const ACID acid)
Serves CMD_REQ_FOR_HEADERS message
Err Majordomo::DRCRequestForStorage (const MsgField *dataFld)
Serves CE_REQ_FOR_STOR command
Err Majordomo::DRCRequestFromEso (MsgField *dataFld)
Serves Eso's request for money
Err Majordomo::DRCTimeForPayment (MsgField *dataInMsgFld)
DRCTimeForPayment (cmd to_payment) Dlouhy_komentar
Err Majordomo::DRCTimeForPayment (MsgField *dataInMsgFld)
DRCTimeForPayment (cmd to_payment)
Err Majordomo::DRCTimeOutPayment (MsgField *dataInMsgFld)
DRCTimeOutPayment (cmd to_curr_pay) Dlouhy_komentar
Err Majordomo::DRCTimeOutPayment (MsgField *dataInMsgFld)
DRCTimeOutPayment (cmd to_curr_pay)
MsgField* Majordomo::DecryptByACPriv (const ACID acid, const MsgField *data)
Decrypts data by asymetric key
Err Majordomo::GenerateThisSixAC (MsgField *onion, GMessage **generatedAC)
Generates access certificate for this Eso
Err Majordomo::GenerateThisSixAC (MsgField *onion, GMessage **generatedAC)
Generates access certificate for this Bank
Queue* Majordomo::GetACs (Char *type, const int count = 1, Queue *notIn = NULL)
Gets ACs
Err Majordomo::GetAsymetricKey (GMessage **acPubKey)
Gets Asymetric key from file
Majordomo::Majordomo (Mix * parent, LogFile * majordomoLogFile)
Majordomo constructor
Majordomo::Majordomo (Bank * parent, LogFile * majordomoLogFile)
Bank Majordomo constructor
MsgField* Majordomo::ParseCipheredData ()
Parses ciphered data
void Majordomo::PublishCertificates (GMessage * request)
Publishes certificates to Acs servers
void Majordomo::UploadFile ()
Uploads file
void Majordomo::WaitForAnswersToFileToStor (int requestsSent)
Waits for answers to CE_FILE_TO_STOR
void Majordomo::WaitForAnswersToReqForFile ()
Waits for answers to REQ_FOR_FILE
void Majordomo::WaitForAnswersToReqForHeaders ()
Waits for answers to REQ_FOR_HEADERS

Public

methods

Private

methods

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

Public

attributes

int debugOptions
What messages should be logged
LogFile* logFile
Log file for debug messages

Inherited from MixOffspring:

Public Methods

MixOffspring::MixOffspring(Mix * mix)

Documentation

Mix majordomo. Processes various requests comming from network and from SIX also distributes messages to apropriate objects.

Commands that it handles are: generate_onion get_certificates publish_certificates.

methods

methods

GMessage* Majordomo::CreateSimpleReqForHeaders(GMessage *pubKey)
Creates REQ_FOR_HEADERS. Creates REQ_FRO_HEADERS message, that is to be sent to Esos.
Returns:
created GMessage
Parameters:
pubKey - PubKey for encrypting FAM.
Author:
Marek
See Also:
Cipherer

GMessage* Majordomo::CreateSimpleReqForStor(File *fileToStore)
Creates simple req for storage. Creates simple request for storage, that is the message sent to Eso as a CE_REQUEST_FOIR_STOR.
Returns:
created messsage.
Parameters:
fileToStore - File that is wanted to be stored.
Author:
Pavel
See Also:
GMessage

Err Majordomo::DRCAnswerFile(const MsgField *dataFld)
Serves CE_REPLY_FILE message. Gets the file out of the GMessage and saves it into a file specified by user.
Returns:
error code
Parameters:
dataFld - Data from the GMessage.
Author:
Marek
See Also:

Err Majordomo::DRCAnswerFile(const MsgField *dataField)
Serves CMD_ANSWER_FILE command. processes the incoming found file - forwards found file 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::DRCRequestForHeaders(const MsgField *dataField, const ACID acid)
Serves CMD_REQ_FOR_HEADERS message.
processes the incoming request for headers
- continues the search in the search tree
- looks for the file on this server
- sends the headers found on this server 
back to the client
Returns:
error code
- KO in the case of bad structure of dataField
or if fatal error comes (ex. NULL ptr to Finder)
- OK otherwise     
(that means even in case of mistake in any step
of the algorithm [ex. cannot send the message
back to client] - these situations are only
written to the logFile)
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, ACManager

Err Majordomo::DRCRequestForStorage(const MsgField *dataFld)
Serves CE_REQ_FOR_STOR command. Handles the CE_REQ_FOR_STOR command, according to Eso-Others interface. dataFld comming has this structure:
Reply-To-ID: ID of a message assigned by sender (Client)
Reply-To-AC: AC to reply to
File-Size: Size of file Client whishes to store
Storage-Time: RelTime for which the file should be stored
Returns:
error code
Parameters:
dataFld - data comming with command
Author:
Pavel
See Also:
FillReplyAllocation(), Allocator, Banker, Scheduler

Err Majordomo::DRCRequestFromEso(MsgField *dataFld)
Serves Eso's request for money. Finds appropriate oAuth to send back to Eso to verify it is the correct file owner not faking file storage.
Returns:
error code
Parameters:
dataFld - data comming along with command
Author:
Ivana
See Also:
co_se_toho_tyka

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

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

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

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

MsgField* Majordomo::DecryptByACPriv(const ACID acid, const MsgField *data)
Decrypts data by asymetric key. Decrypts data by asymetric key that is saved in a file.
Returns:
decrypted MsgField
Parameters:
acid - ID of certificate associated with the key.
data - Data to decrypt.
Author:
Marek
See Also:
Cipherer

Err Majordomo::GenerateThisSixAC(MsgField *onion, GMessage **generatedAC)
Generates access certificate for this Eso. Overrides method of SixMajordomo to make it possible for this Eso to generate its own access certificates. To generate keys uses TCBWrapper.
Returns:
error code
Parameters:
onion -
generatedAC - out parameter returning
Author:
Marek
See Also:
TCBWrapper::GenerateACKeys(), EsoAC

Err Majordomo::GenerateThisSixAC(MsgField *onion, GMessage **generatedAC)
Generates access certificate for this Bank. Creates asymetric keys and generates access certificate of this Bank using the keys and the onion.
Returns:
error code
Parameters:
onion - Onion to use in AC.
generatedAC - AC generated in this method.
Author:
Marek
See Also:
Six Eso::GenerateThisSixAC

Queue* Majordomo::GetACs(Char *type, const int count = 1, Queue *notIn = NULL)
Gets ACs. Overriden Six method. Client has always only one THIS_SIX AC, that is generated every time Client wants to communicate. The getting of THIS_SIX AC is thus overriden, otherwise the inherited method is called.
Returns:
Queue of ACs of given type.
Parameters:
type - Type of ACs to get.
count - Count of ACs to get.
notIn - Queue of ACs not wanted.
Author:
Marek
See Also:
SixMajordomo

Err Majordomo::GetAsymetricKey(GMessage **acPubKey)
Gets Asymetric key from file. Gets Client's pubKey from file.
Returns:
error code
Parameters:
acPubkey - Returned pubKey.
Author:
Marek
See Also:

Majordomo::Majordomo(Mix * parent, LogFile * majordomoLogFile)
Majordomo constructor. Saves pointers to object passed as parameters.
Parameters:
parent - Pointer to the main object Mix.
majordomoLogFile - Log file.
Author:
Venca
See Also:
~Majordomo()

Majordomo::Majordomo(Bank * parent, LogFile * majordomoLogFile)
Bank Majordomo constructor. Initializes majordomo.
Author:
Marek
See Also:
Bank, SixMajordomo

MsgField* Majordomo::ParseCipheredData()
Parses ciphered data. Parses encrypted data to get the stored file. Decrypts them with added publicKey.
The incoming ciphered data looks like this:
GM_PUBLIC_KEY:
GM_DATA: (encrypted with Private Key)
GM_RANDOM: (random string)
GM_FILE: (decrypted file)
Returns:
msgField decrypted file
Author:
Pavel
See Also:
Cipherer

void Majordomo::PublishCertificates(GMessage * request)
Publishes certificates to Acs servers. Every server using Mixes probably wants to advertise itself, so this method publishes certificates it gets.
Returns:
void
Parameters:
request -
GM_PARAMETERS
GM_CERTIFICATE_1
GM_CERTIFICATE_2
...
GM_CERTIFICATE_"n"

Author:
Venca
See Also:
Acs, CertificateRepository

void Majordomo::UploadFile()
Uploads file. Tries to upload file on number of Esos specified by user. Upload is made in two phases. The first phase is request for allocation. The file is then sent to the Esos, whose reply is positive.
Returns:
void
Author:
Pavel
See Also:

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

void Majordomo::WaitForAnswersToReqForFile()
Waits for answers to REQ_FOR_FILE. Waits for answers for number of seconds given in ConfigFile.
Returns:
void
Author:
Marek
See Also:

void Majordomo::WaitForAnswersToReqForHeaders()
Waits for answers to REQ_FOR_HEADERS. Waits for answers for number of seconds given in ConfigFile.
Returns:
void
Author:
Marek
See Also:


This class has no child classes.
Author:
Pechy, Venca
See Also:
MessageCreator, GM_COMMAND

alphabetic index hierarchy of classes


generated by doc++