echo
echo " (a)dvanced version: includes burst management script and templates for different scenarios. Automatic configuration during start."
echo " (b)asic version: 4 types of launcher (client, server, balancer, dummy), lightly configured and managed through SIGURS2 method."
- echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs."
+ echo " (f)unction test client: special client with regexp scheduler script based on splitted traffic logs. Requires a server to perform the tests."
echo
echo "Input option [b]:"
read option
--dictionary `grep -v ^# .dictionary`
--entity `grep -v ^# .entity`
--entityServerSessions `grep -v ^# .entityServerSessions`
--splitLog
+--dictionary `grep -v ^# .dictionary`
+--entity `grep -v ^# .entity`
+--entityServerSessions `grep -v ^# .entityServerSessions`
+--splitLog
if(localServer && (cid != anna::diameter::helpers::base::COMMANDID__Capabilities_Exchange_Request) /* don't forward CER */) {
try {
anna::diameter::comm::Message *msg = G_commMessages.create();
+ msg->setProxied(); // end-to-end will be kept
msg->setBody(message);
msg->setRequestClientSessionKey(clientSession->getKey());
bool success = localServer->send(msg);
if(localServer && (request_cid != anna::diameter::helpers::base::COMMANDID__Capabilities_Exchange_Request) /* don't forward CEA */) {
try {
+ G_commMsgFwd2c.setProxied(); // end-to-end will be kept
G_commMsgFwd2c.setBody(*message);
bool success = localServer->send(&G_commMsgFwd2c, request->getRequestServerSessionKey());
G_commMessages.release(request);
anna::diameter::comm::Entity *entity = my_app.getEntity();
if(!programmed && entity) { // forward condition (no programmed answer + entity available)
anna::diameter::comm::Message *msg = G_commMessages.create();
+ msg->setProxied(); // end-to-end will be kept
msg->setBody(message);
msg->setRequestServerSessionKey(serverSession->getKey());
bool success = entity->send(msg, cl.exists("balance"));
if(my_app.logEnabled()) detail = usedClientSession ? usedClientSession->asString() : "<null client session>"; // esto no deberia ocurrir
try {
+ G_commMsgFwd2e.setProxied(); // end-to-end will be kept
G_commMsgFwd2e.setBody(*message);
// Metodo 1:
*/
void setNumberOfClientSessionsPerServer(int numberOfClientSessionsPerServer) throw() { a_numberOfClientSessionsPerServer = numberOfClientSessionsPerServer; }
- /**
- * Gets true when end-to-end sequence is freezed on requests sendings.
- * Engine starts with false value, sequencing end-to-end as hop-by-hop does.
- * \return Freeze end-to-end indicator.
- */
- bool getFreezeEndToEndOnSending() const throw() { return a_freezeEndToEndOnSending; }
-
- /**
- * Freeze end-to-end indicator on requests sendings.
- * \param freezeEndToEndOnSending Freeze end-to-end indicator.
- */
- void setFreezeEndToEndOnSending(bool freezeEndToEndOnSending = true) throw() { a_freezeEndToEndOnSending = freezeEndToEndOnSending; }
/**
* Returns client-session instance identified by (address, port, socketId) provided.
std::string a_host;
bool a_autoBind;
int a_numberOfClientSessionsPerServer;
- bool a_freezeEndToEndOnSending;
// ClientSessions messages:
/**
Messages launched to diameter servers
+ Could be proxied (end-to-end kept) or not (by default).
*/
class Message : public anna::comm::Message {
public:
/**
- * Define las acciones a realizar en caso de que el temporizador de la petición expire.
+ * Define las acciones a realizar en caso de que el temporizador de la petici�n expire.
*/
struct OnExpiry { enum _v { Abandon, Ignore }; };
/**
Constructor.
- \param onExpiry Indica la acción a realizar si el temporizador de esta transación expira.
+ \param onExpiry Indica la acci�n a realizar si el temporizador de esta transaci�n expira.
*/
Message(const OnExpiry::_v onExpiry = OnExpiry::Ignore) : anna::comm::Message(StatusCodeBuffer::Reserve),
a_classCode(ClassCode::ApplicationMessage),
const ClassCode::_v & getClassCode() const throw() { return a_classCode; }
/**
- * Devuelve la acción a realizar en caso de que el temporizador asociado a esta petición expire.
- * \return la acción a realizar en caso de que el temporizador asociado a esta petición expire.
+ * Devuelve la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire.
+ * \return la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire.
*/
OnExpiry::_v getOnExpiry() const throw() { return a_onExpiry; }
/**
- * Establece la acción a realizar en caso de que el temporizador asociado a esta petición expire.
- * \param onExpiry Indica la acción a realizar en caso de que el temporizador asociado a esta petición expire.
+ * Establece la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire.
+ * \param onExpiry Indica la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire.
*
- * \warning Establecer el valor OnExpiry::Ignore podría causar pérdida de memoria y uso innecesario de recursos.
+ * \warning Establecer el valor OnExpiry::Ignore podr�a causar p�rdida de memoria y uso innecesario de recursos.
*/
void setOnExpiry(const OnExpiry::_v onExpiry) throw() { a_onExpiry = onExpiry; }
CommandId getCommandId(bool &isRequest) const throw();
CommandId getCommandId() const throw() { bool dummy; return getCommandId(dummy); }
- bool fixRequestSequence(HopByHop hbh, EndToEnd ete, bool freezeEndToEnd) throw();
+ bool fixRequestSequence(HopByHop hbh, EndToEnd ete) throw();
+
+ /** Diameter agents CANNOT modify the end-to-end. True value stands for intermediate agents, false for request originators */
+ bool isProxied() const throw() { return a_proxied; }
+
+ /** Diameter agents CANNOT modify the end-to-end. True value stands for intermediate agents, false for request originators */
+ void setProxied(bool proxied = true) throw() { a_proxied = proxied; }
+
// Statistics
void updateRequestTimestampMs(void) throw() { a_request_timestamp_ms = anna::functions::millisecond(); }
a_requestClientSessionKey = ""; // means unknown/unset
a_requestHopByHop = 0;
a_requestEndToEnd = 0;
+ a_proxied = false;
}
/**
Constructor.
\param classCode Tipo de clase de esta peticion.
- \param onExpiry Indica la acción a realizar si el temporizador de esta transación expira.
+ \param onExpiry Indica la acci�n a realizar si el temporizador de esta transaci�n expira.
*/
Message(const ClassCode::_v & classCode, const OnExpiry::_v onExpiry = OnExpiry::Ignore) : anna::comm::Message(StatusCodeBuffer::Reserve),
a_classCode(classCode),
std::string a_requestClientSessionKey; // idem for request which was received from servers
HopByHop a_requestHopByHop; // application backup for hop-by-hop in order to restore on answer receive
EndToEnd a_requestEndToEnd; // application backup for end-to-end in order to restore on answer receive
+ bool a_proxied; // end-to-end will be kept
void send(ClientSession&) const throw(anna::RuntimeException);
void send(ServerSession&) const throw(anna::RuntimeException);
// Tekelec PCRF
a_engine->bindingClientSession(this);
- // OAM Lo comento, porque no se contabilizan los reintentos y por lo tanto no son muy útiles.
+ // OAM Lo comento, porque no se contabilizan los reintentos y por lo tanto no son muy �tiles.
// OamModule &oamModule = OamModule::instantiate();
// oamModule.count(a_server->isAvailable() ? OamModule::Counter::TCPConnectOK:OamModule::Counter::TCPConnectNOK);
// Application bind
}
// Fixing indicator:
- fixed = message_nc->fixRequestSequence(a_nextHopByHop, a_nextEndToEnd, a_engine->getFreezeEndToEndOnSending());
+ fixed = message_nc->fixRequestSequence(a_nextHopByHop, a_nextEndToEnd);
message_nc->updateRequestTimestampMs(); // statistics purposes (processing time for request type)
}
// a_dwa(true),
a_watchdogPeriod(ClientSession::DefaultWatchdogPeriod),
a_maxConnectionDelay(anna::comm::ClientSocket::DefaultMaxConnectionDelay /* 200 ms*/),
- a_numberOfClientSessionsPerServer(1),
- a_freezeEndToEndOnSending(false) {
+ a_numberOfClientSessionsPerServer(1) {
anna::diameter::sccs::activate();
a_realm = anna::functions::getDomainname();
a_host = anna::functions::getHostname();
result->setWatchdogPeriod(a_watchdogPeriod);
result->a_parent = server;
result->a_socketId = socketId;
- result->initializeSequences(); // después de asignar el server y el socketId (*)
+ result->initializeSequences(); // despu�s de asignar el server y el socketId (*)
// (*) Las secuencias se basan en la semilla: srand(::time(NULL) + anna::functions::exclusiveHash(anna::functions::asString("%s:%d|%d", getAddress().c_str(), getPort(), a_socketId)));
result->a_engine = this;
clientSession_key key = ClientSession::getKey(server->getAddress(), server->getPort(), socketId);
//// a_onExpiry = OnExpiry::Ignore;
//}
-bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete, bool freezeEndToEnd) throw() {
+bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete) throw() {
setRequestHopByHop(getHopByHop()); // original request hop-by-hop (backup)
setRequestEndToEnd(getEndToEnd()); // original request end-to-end (backup)
bool result = false;
result = true;
}
- if(!freezeEndToEnd) {
+ if(!a_proxied) {
if(ete != getRequestEndToEnd()) {
codec::functions::setEndToEnd((anna::DataBlock&)getBody(), ete);
result = true;
msg += " (original) -> ";
msg += anna::functions::asString(hbh);
msg += " (session)";
- msg += freezeEndToEnd ? " | End to end [freezed]: " : " | End to end: ";
+ msg += a_proxied ? " | End to end [proxied]: " : " | End to end: ";
msg += anna::functions::asString(getRequestEndToEnd());
msg += " (original) -> ";
msg += anna::functions::asString(ete);
if(isRequest) {
// Fixing indicator:
- fixed = message_nc->fixRequestSequence(a_nextHopByHop, a_nextEndToEnd, a_engine->getFreezeEndToEndOnSending());
+ fixed = message_nc->fixRequestSequence(a_nextHopByHop, a_nextEndToEnd);
message_nc->updateRequestTimestampMs(); // statistics purposes (processing time for request type)
}