a_commMessages.release(msg);
}
-anna::diameter::codec::Message *Launcher::createCodecMessage() throw(anna::RuntimeException) {
- return a_codecMessages.create();
-}
-
-void Launcher::releaseCodecMessage(anna::diameter::codec::Message *msg) throw() {
- a_codecMessages.release(msg);
-}
-
-
-void Launcher::baseProtocolSetupAsClient(void) throw(anna::RuntimeException) {
+void Launcher::baseProtocolSetupAsClient(anna::diameter::codec::Engine *codecEngine) throw(anna::RuntimeException) {
// Build CER
// <CER> ::= < Diameter Header: 257, REQ >
// { Origin-Host } 264 diameterIdentity
// * [ Supported-Vendor-Id ] 265 Unsigned32
// * [ Auth-Application-Id ] 258 Unsigned32
// * [Acct-Application-Id] 259 Unsigned32
- anna::diameter::codec::Message diameterCER;
+ anna::diameter::codec::Message diameterCER(codecEngine);
int applicationId = 0 /*anna::diameter::helpers::APPID__3GPP_Rx*/; // Unsigned32
std::string OH = a_myDiameterEngine->getHost();
std::string OR = a_myDiameterEngine->getRealm();
// <DWR> ::= < Diameter Header: 280, REQ >
// { Origin-Host }
// { Origin-Realm }
- anna::diameter::codec::Message diameterDWR;
+ anna::diameter::codec::Message diameterDWR(codecEngine);
loadingError = false;
try {
diameterDWR.addAvp(anna::diameter::helpers::base::AVPID__Origin_Realm)->getDiameterIdentity()->setValue(OR);
}
-//////////////////////////
-// IDEM FOR CEA AND DWA //
-//////////////////////////
-// // Build CER
-// // <CER> ::= < Diameter Header: 257, REQ >
-// // { Origin-Host } 264 diameterIdentity
-// // { Origin-Realm } 296 idem
-// // 1* { Host-IP-Address } 257, address
-// // { Vendor-Id } 266 Unsigned32
-// // { Product-Name } 269 UTF8String
-// // [Origin-State-Id] 278 Unsigned32
-// // * [ Supported-Vendor-Id ] 265 Unsigned32
-// // * [ Auth-Application-Id ] 258 Unsigned32
-// // * [Acct-Application-Id] 259 Unsigned32
-// anna::diameter::codec::Message diameterCER;
-// int applicationId = 0 /*anna::diameter::helpers::APPID__3GPP_Rx*/; // Unsigned32
-// std::string OH = a_myDiameterEngine->getHost();
-// std::string OR = a_myDiameterEngine->getRealm();
-// std::string hostIP = anna::functions::getHostnameIP(); // Address
-// int vendorId = anna::diameter::helpers::VENDORID__tgpp; // Unsigned32
-// std::string productName = "ANNA Diameter Launcher"; // UTF8String
-// bool loadingError = false;
-//
-// try {
-// diameterCER.loadXML("cer.xml");
-// } catch (anna::RuntimeException &ex) {
-// ex.trace();
-// loadingError = true;
-// }
-//
-// if (loadingError) {
-// LOGWARNING(anna::Logger::warning("CER file not found. Get harcoded.", ANNA_FILE_LOCATION));
-// diameterCER.setId(anna::diameter::helpers::base::COMMANDID__Capabilities_Exchange_Request);
-// diameterCER.setApplicationId(applicationId);
-// diameterCER.addAvp(anna::diameter::helpers::base::AVPID__Origin_Host)->getDiameterIdentity()->setValue(OH);
-// diameterCER.addAvp(anna::diameter::helpers::base::AVPID__Origin_Realm)->getDiameterIdentity()->setValue(OR);
-// diameterCER.addAvp(anna::diameter::helpers::base::AVPID__Host_IP_Address)->getAddress()->fromPrintableString(hostIP.c_str()); // supported by Address class, anyway is better to provide "1|<ip address>"
-// diameterCER.addAvp(anna::diameter::helpers::base::AVPID__Vendor_Id)->getUnsigned32()->setValue(vendorId);
-// diameterCER.addAvp(anna::diameter::helpers::base::AVPID__Product_Name)->getUTF8String()->setValue(productName);
-// diameterCER.addAvp(anna::diameter::helpers::base::AVPID__Auth_Application_Id)->getUnsigned32()->setValue(applicationId);
-// }
-//
-// // Build DWR
-// // <DWR> ::= < Diameter Header: 280, REQ >
-// // { Origin-Host }
-// // { Origin-Realm }
-// anna::diameter::codec::Message diameterDWR;
-// loadingError = false;
-//
-// try {
-// diameterDWR.loadXML("dwr.xml");
-// } catch (anna::RuntimeException &ex) {
-// ex.trace();
-// loadingError = true;
-// }
-//
-// if (loadingError) {
-// LOGWARNING(anna::Logger::warning("DWR file not found. Get harcoded.", ANNA_FILE_LOCATION));
-// diameterDWR.setId(anna::diameter::helpers::base::COMMANDID__Device_Watchdog_Request);
-// diameterDWR.setApplicationId(applicationId);
-// diameterDWR.addAvp(anna::diameter::helpers::base::AVPID__Origin_Host)->getDiameterIdentity()->setValue(OH);
-// diameterDWR.addAvp(anna::diameter::helpers::base::AVPID__Origin_Realm)->getDiameterIdentity()->setValue(OR);
-// }
// Assignment for CER/DWR and CEA/DWA:
a_myDiameterEngine->setCERandDWR(diameterCER.code(), diameterDWR.code());
//a_myDiameterEngine->setCEAandDWA(diameterCEA.code(), diameterDWA.code());
}
-void Launcher::writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail) const throw() {
+void Launcher::writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail, anna::diameter::codec::Engine *codecEngine) const throw() {
// if (!logEnabled()) return;
- anna::diameter::codec::Message codecMsg;
+ anna::diameter::codec::Message codecMsg(codecEngine);
try { codecMsg.decode(db); } catch(anna::RuntimeException &ex) { ex.trace(); }
writeLogFile(codecMsg, logExtension, detail);
//ServerSocket *createServerSocket(const std::string & addr, int port = Session::DefaultPort, int maxConnections = -1, int category = 1, const std::string & description = "")
a_diameterLocalServer = (MyLocalServer*)(a_myDiameterEngine->createLocalServer(address, port, diameterServerSessions));
a_diameterLocalServer->setDescription("Launcher diameter local server");
- a_diameterLocalServer->setProgrammedAnswersCodecEngine(getCodecEngine());
+ a_diameterLocalServer->setCodecEngine(getCodecEngine()); // this is for automatic answers (failed-avp) XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX el del nodo correspondiente
int allowedInactivityTime = 90000; // ms
if(cl.exists("allowedInactivityTime")) allowedInactivityTime = cl.getIntegerValue("allowedInactivityTime");
}
}
- getCodecEngine()->setDictionary(d);
+ getCodecEngine()->setDictionary(d); // XXXX esto cambiara...
LOGDEBUG(anna::Logger::debug(getCodecEngine()->asString(), ANNA_FILE_LOCATION));
if(lst.size() > 1) {
// Integration (validation 'Complete' for receiving messages) and debugging (validation also before encoding: 'Always').
// If missing 'integrationAndDebugging', default behaviour at engine is: mode 'AfterDecoding', depth 'FirstError':
if(cl.exists("integrationAndDebugging")) {
- getCodecEngine()->setValidationMode(anna::diameter::codec::Engine::ValidationMode::Always);
+ getCodecEngine()->setValidationMode(anna::diameter::codec::Engine::ValidationMode::Always); // XXXXXXXXXXXXXXXXXXXXXXXXX
getCodecEngine()->setValidationDepth(anna::diameter::codec::Engine::ValidationDepth::Complete);
}
else if (fixMode == "Always") fm = anna::diameter::codec::Engine::FixMode::Always;
else if (fixMode == "Never") fm = anna::diameter::codec::Engine::FixMode::Never;
else LOGINFORMATION(anna::Logger::information("Unreconized command-line fix mode. Assumed default 'BeforeEncoding'", ANNA_FILE_LOCATION));
- getCodecEngine()->setFixMode(fm);
+ getCodecEngine()->setFixMode(fm); // XXXXXXXXXXXXXXXXXXXXXXX
}
- getCodecEngine()->ignoreFlagsOnValidation(cl.exists("ignoreFlags"));
+ getCodecEngine()->ignoreFlagsOnValidation(cl.exists("ignoreFlags")); // XXXXXXXXXXXXXXXXXXXXXXX
// Diameter Server:
if(cl.exists("diameterServer"))
int entityServerSessions = cl.exists("entityServerSessions") ? cl.getIntegerValue("entityServerSessions") : 1;
if(entityServerSessions > 0) {
- baseProtocolSetupAsClient(); // Same CER/CEA, DWR/DWA for all diameter servers
+ baseProtocolSetupAsClient(getCodecEngine()); // Same CER/CEA, DWR/DWA for all diameter servers XXXXXXXXXXXXXXXXXXXXXXXXX
anna::socket_v servers = anna::functions::getSocketVectorFromString(cl.getValue("entity"));
a_myDiameterEngine->setNumberOfClientSessionsPerServer(entityServerSessions);
a_entity = (MyDiameterEntity*)(a_myDiameterEngine->createEntity(servers, "Launcher diameter entity"));
a_entity->setClassCodeTimeout(anna::diameter::comm::ClassCode::Bind, ceaTimeout);
a_entity->setClassCodeTimeout(anna::diameter::comm::ClassCode::ApplicationMessage, answersTimeout);
- a_entity->setProgrammedAnswersCodecEngine(getCodecEngine());
+ a_entity->setCodecEngine(getCodecEngine()); // XXXXXXXXXXXXXXXXXXXXXXX
a_entity->bind();
}
}
anna::diameter::comm::Server *usedServer = a_entity->getLastUsedResource();
anna::diameter::comm::ClientSession *usedClientSession = usedServer ? usedServer->getLastUsedResource() : NULL;
std::string detail = usedClientSession ? usedClientSession->asString() : "<null client session>"; // esto no deberia ocurrir
- writeLogFile(msg->getBody(), (result ? "sent2e" : "send2eError"), detail);
+ writeLogFile(msg->getBody(), (result ? "sent2e" : "send2eError"), detail, getCodecEngine()); // el del nodo de trabajo
}
return result;
if(it != a_burstMessages.end()) {
// Decode
- anna::diameter::codec::Message codecMsg;
+ anna::diameter::codec::Message codecMsg(getCodecEngine()); // XXXXXXXXXXXXXXXX el del nodo de trabajo
try { codecMsg.decode((*it).second->getBody()); } catch(anna::RuntimeException &ex) { ex.trace(); }
result = codecMsg.asXMLString();
}
response_content = "Operation processed with exception. See traces\n"; // supposed
std::string result = "";
anna::DataBlock db_aux(true);
- anna::diameter::codec::Message codecMsg;
+ anna::diameter::codec::Message codecMsg(getCodecEngine()); // XXXXXXXXXXXXXX el del nodo de trabajo
///////////////////////////////////////////////////////////////////
// Simple operations without arguments:
} else if (param1 == "dump") {
localServer->getReactingAnswers()->dump();
} else {
- anna::diameter::codec::Message *message = getCodecEngine()->createMessage(param1);
+ anna::diameter::codec::Message *message = getCodecEngine()->createMessage(param1); // // XXXXXXXXXXXXXX el del nodo de trabajo
LOGDEBUG
(
anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION);
} else if (param1 == "dump") {
entity->getReactingAnswers()->dump();
} else {
- anna::diameter::codec::Message *message = getCodecEngine()->createMessage(param1);
+ anna::diameter::codec::Message *message = getCodecEngine()->createMessage(param1); // XXXXXXXXXXXXXX el del nodo de trabajo
LOGDEBUG
(
anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION);
result->createAttribute("StartTime", a_start_time.asString());
result->createAttribute("SecondsLifeTime", anna::time::functions::lapsedMilliseconds() / 1000);
// Diameter:
- getCodecEngine()->asXML(result);
+ getCodecEngine()->asXML(result); // XXXXXXXXXXXXXXX todos los nodos ...
// OAM:
anna::diameter::comm::OamModule::instantiate().asXML(result);
anna::diameter::comm::ApplicationMessageOamModule::instantiate().asXML(result);
// comm Messages factory:
anna::Recycler<anna::diameter::comm::Message> a_commMessages;
- anna::Recycler<anna::diameter::codec::Message> a_codecMessages;
anna::comm::ServerSocket* a_httpServerSocket; // HTTP
MyLocalServer* a_diameterLocalServer; // DIAMETER
public:
Launcher();
- anna::diameter::codec::Engine *getCodecEngine() const throw() { return a_codecEngine; }
+ anna::diameter::codec::Engine *getCodecEngine() const throw() { return a_codecEngine; } // XXXXXXXXXXXXXXXXX El del nodo de trabajo
MyCommunicator *getCommunicator() throw() { return a_communicator; }
MyDiameterEngine* getMyDiameterEngine() const throw() { return (a_myDiameterEngine); }
- void baseProtocolSetupAsClient(void) throw(anna::RuntimeException);
+ void baseProtocolSetupAsClient(anna::diameter::codec::Engine *codecEngine) throw(anna::RuntimeException);
MyDiameterEntity *getEntity() throw() { return a_entity; }
MyLocalServer* getDiameterLocalServer() throw() { return a_diameterLocalServer; }
void eventOperation(const std::string &, std::string &) throw(anna::RuntimeException);
bool logEnabled() const throw() { return (((a_logFile == "") || (a_logFile == "null")) ? false : true); }
- void writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail) const throw();
+ void writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail, anna::diameter::codec::Engine *codecEngine) const throw();
void writeLogFile(const anna::diameter::codec::Message & decodedMessage, const std::string &logExtension, const std::string &detail) const throw();
void writeBurstLogFile(const std::string &buffer) throw();
bool burstLogEnabled() const throw() { return (((a_burstLogFile == "") || (a_burstLogFile == "null")) ? false : true); }
// Messages factory:
anna::diameter::comm::Message *createCommMessage() throw(anna::RuntimeException);
void releaseCommMessage(anna::diameter::comm::Message*) throw();
- anna::diameter::codec::Message *createCodecMessage() throw(anna::RuntimeException);
- void releaseCodecMessage(anna::diameter::codec::Message*) throw();
// helpers
bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw();
);
// Write reception
- if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfe", clientSession->asString());
+ if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfe", clientSession->asString(), a_codecEngine);
// Lookup reacting answers list:
int code = cid.first;
if(my_app.logEnabled()) {
anna::diameter::comm::ServerSession *usedServerSession = localServer->getLastUsedResource();
std::string detail = usedServerSession ? usedServerSession->asString() : "<null server session>"; // esto no deberia ocurrir
- my_app.writeLogFile(message, (success ? "fwd2c" : "fwd2cError"), detail);
+ my_app.writeLogFile(message, (success ? "fwd2c" : "fwd2cError"), detail, a_codecEngine);
}
} catch(anna::RuntimeException &ex) {
ex.trace();
LOGWARNING(anna::Logger::warning("Context Expired for Diameter Request which was sent to the entity", ANNA_FILE_LOCATION));
if(request_cid != anna::diameter::helpers::base::COMMANDID__Capabilities_Exchange_Request) { // don't trace CEA
- if(my_app.logEnabled()) my_app.writeLogFile(*request, "req2e-expired", clientSession->asString());
+ if(my_app.logEnabled()) my_app.writeLogFile(*request, "req2e-expired", clientSession->asString(), a_codecEngine);
}
}
// Write reception
if(request_cid != anna::diameter::helpers::base::COMMANDID__Capabilities_Exchange_Request) { // don't trace CEA
if(my_app.logEnabled()) {
- my_app.writeLogFile(*message, "recvfe", clientSession->asString());
+ my_app.writeLogFile(*message, "recvfe", clientSession->asString(), a_codecEngine);
}
}
std::string detail = usedServerSession ? usedServerSession->asString() : "<null server session>"; // esto no deberia ocurrir
if(my_app.logEnabled()) {
- my_app.writeLogFile(*message, (success ? "fwd2c" : "fwd2cError"), detail);
+ my_app.writeLogFile(*message, (success ? "fwd2c" : "fwd2cError"), detail, a_codecEngine);
}
} catch(anna::RuntimeException &ex) {
ex.trace();
);
// Write reception
- if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfe-ans-unknown", clientSession->asString());
+ if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfe-ans-unknown", clientSession->asString(), a_codecEngine);
}
void MyDiameterEntity::eventDPA(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message)
);
// Write reception
- if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfe", clientSession->asString());
+ if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfe", clientSession->asString(), a_codecEngine);
}
class MyDiameterEntity : public anna::diameter::comm::Entity {
+ anna::diameter::codec::Engine * a_codecEngine; // for automatic answers (failed-avp), write logs, etc.
+
void eventResponse(const anna::diameter::comm::Response&) throw(anna::RuntimeException);
void eventRequest(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException);
void eventUnknownResponse(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException);
public:
ProgrammedAnswers a_reactingAnswers;
- void setProgrammedAnswersCodecEngine(anna::diameter::codec::Engine *codecEngine) throw() { a_reactingAnswers.setCodecEngine(codecEngine); }
+ void setCodecEngine(anna::diameter::codec::Engine *codecEngine) throw() { a_codecEngine = codecEngine; a_reactingAnswers.setCodecEngine(codecEngine); }
ProgrammedAnswers *getReactingAnswers() throw() { return (ProgrammedAnswers *)&a_reactingAnswers; }
};
);
// Write reception
- if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfc", serverSession->asString());
+ if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfc", serverSession->asString(), a_codecEngine);
// If no answer is programmed and entity is configured, the failed request would be forwarded even being wrong (delegates at the end point)
int code = cid.first;
anna::diameter::comm::Server *usedServer = entity->getLastUsedResource();
anna::diameter::comm::ClientSession *usedClientSession = usedServer ? usedServer->getLastUsedResource() : NULL;
std::string detail = usedClientSession ? usedClientSession->asString() : "<null client session>"; // esto no deberia ocurrir
- my_app.writeLogFile(message, (success ? "fwd2e" : "fwd2eError"), detail); // forwarded
+ my_app.writeLogFile(message, (success ? "fwd2e" : "fwd2eError"), detail, a_codecEngine); // forwarded
}
return;
// Error analisys:
bool analysisOK = true; // by default
anna::diameter::codec::Message *answer_message = NULL;
- anna::diameter::codec::Message *codecMsg = my_app.createCodecMessage();
+ anna::diameter::codec::Message codecMsg(a_codecEngine);
+ anna::diameter::codec::Message codecAnsMsg(a_codecEngine);
if(!cl.exists("ignoreErrors")) { // Error analysis
- answer_message = my_app.createCodecMessage();
+ answer_message = (anna::diameter::codec::Message *)&codecAnsMsg;
answer_message->clear();
// Decode
- try { codecMsg->decode(message, answer_message); } catch(anna::RuntimeException &ex) { ex.trace(); }
+ try { codecMsg.decode(message, answer_message); } catch(anna::RuntimeException &ex) { ex.trace(); }
- answer_message->setStandardToAnswer(*codecMsg, my_app.getMyDiameterEngine()->getHost(), my_app.getMyDiameterEngine()->getRealm());
- my_app.releaseCodecMessage(codecMsg);
+ answer_message->setStandardToAnswer(codecMsg, my_app.getMyDiameterEngine()->getHost(), my_app.getMyDiameterEngine()->getRealm());
analysisOK = (answer_message->getResultCode() == anna::diameter::helpers::base::AVPVALUES__Result_Code::DIAMETER_SUCCESS);
}
} else return; // nothing done
}
- anna::diameter::codec::Engine *codecEngine = my_app.getCodecEngine();
- anna::diameter::codec::Engine::ValidationMode::_v backupVM = codecEngine->getValidationMode();
+ anna::diameter::codec::Engine::ValidationMode::_v backupVM = a_codecEngine->getValidationMode();
if(!analysisOK)
- codecEngine->setValidationMode(anna::diameter::codec::Engine::ValidationMode::Never);
+ a_codecEngine->setValidationMode(anna::diameter::codec::Engine::ValidationMode::Never);
try {
anna::diameter::comm::Message *msg = my_app.createCommMessage();
if(my_app.logEnabled()) my_app.writeLogFile(*answer_message, "send2cError", serverSession->asString());
}
- // Release auxiliary codec message
- my_app.releaseCodecMessage(answer_message);
-
// Restore validation mode
- codecEngine->setValidationMode(backupVM);
+ a_codecEngine->setValidationMode(backupVM);
// Pop front the reacting answer:
if(analysisOK && programmed) a_reactingAnswers.nextMessage(code);
LOGWARNING(anna::Logger::warning("Context Expired for Diameter Request which was sent to the client", ANNA_FILE_LOCATION));
if(request_cid != anna::diameter::helpers::base::COMMANDID__Capabilities_Exchange_Request) { // don't trace CEA
- if(my_app.logEnabled()) my_app.writeLogFile(*request, "req2c-expired", serverSession->asString());
+ if(my_app.logEnabled()) my_app.writeLogFile(*request, "req2c-expired", serverSession->asString(), a_codecEngine);
}
}
);
// Write reception
- if(my_app.logEnabled()) my_app.writeLogFile(*message, "recvfc", serverSession->asString());
+ if(my_app.logEnabled()) my_app.writeLogFile(*message, "recvfc", serverSession->asString(), a_codecEngine);
// This is not very usual, but answers could arrive from clients:
anna::diameter::comm::Entity *entity = my_app.getEntity();
my_app.releaseCommMessage(msg);
my_app.releaseCommMessage(request);
- if(my_app.logEnabled()) my_app.writeLogFile(*message, "fwd2e", detail); // forwarded
+ if(my_app.logEnabled()) my_app.writeLogFile(*message, "fwd2e", detail, a_codecEngine); // forwarded
} catch(anna::RuntimeException &ex) {
ex.trace();
- if(my_app.logEnabled()) my_app.writeLogFile(*message, "fwd2eError", detail); // forwarded
+ if(my_app.logEnabled()) my_app.writeLogFile(*message, "fwd2eError", detail, a_codecEngine); // forwarded
}
}
}
anna::Logger::debug(msg, ANNA_FILE_LOCATION);
);
- if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfc-ans-unknown", serverSession->asString());
+ if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfc-ans-unknown", serverSession->asString(), a_codecEngine);
}
void MyLocalServer::eventDPA(anna::diameter::comm::ServerSession *serverSession, const anna::DataBlock &message)
anna::Logger::debug(msg, ANNA_FILE_LOCATION);
);
- if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfc", serverSession->asString());
+ if(my_app.logEnabled()) my_app.writeLogFile(message, "recvfc", serverSession->asString(), a_codecEngine);
}
class MyLocalServer : public anna::diameter::comm::LocalServer {
+ anna::diameter::codec::Engine * a_codecEngine; // for automatic answers (failed-avp), write logs, etc.
+
void eventResponse(const anna::diameter::comm::Response&) throw(anna::RuntimeException);
void eventRequest(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException);
void eventUnknownResponse(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException);
public:
ProgrammedAnswers a_reactingAnswers;
- void setProgrammedAnswersCodecEngine(anna::diameter::codec::Engine *codecEngine) throw() { a_reactingAnswers.setCodecEngine(codecEngine); }
+ void setCodecEngine(anna::diameter::codec::Engine *codecEngine) throw() { a_codecEngine = codecEngine; a_reactingAnswers.setCodecEngine(codecEngine); }
ProgrammedAnswers *getReactingAnswers() throw() { return (ProgrammedAnswers *)&a_reactingAnswers; }
};
}
void ProgrammedAnswers::addMessage(int code, anna::diameter::codec::Message *message) throw() {
+ if (!message) return; // just in case
+ message->setEngine(a_codecEngine); // just in case
+
reacting_answers_const_iterator it = a_deques.find(code);
if (it != a_deques.end()) {
it->second->push_back(message);
*/
void setEngine(Engine *e) throw() { a_engine = e; }
+// /**
+// * Gets the diameter::comm::Engine
+// * @return Diameter::comm::Engine
+// */
+// Engine *getEngine() const throw() { return a_engine; }
/**
* Add a server to the entity and create all the servers configured at #setSocketsPerDiameterServer within that server.
*/
void setEngine(Engine *e) throw() { a_engine = e; }
+// /**
+// * Gets the diameter::comm::Engine
+// * @return Diameter::comm::Engine
+// */
+// Engine *getEngine() const throw() { return a_engine; }
// getters