1 // ANNA - Anna is Not Nothingness Anymore
3 // (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
5 // http://redmine.teslayout.com/projects/anna-suite
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
11 // * Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // * Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following disclaimer
15 // in the documentation and/or other materials provided with the
17 // * Neither the name of the copyright holder nor the names of its
18 // contributors may be used to endorse or promote products derived from
19 // this software without specific prior written permission.
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 // Authors: eduardo.ramos.testillano@gmail.com
34 // cisco.tierra@gmail.com
37 #ifndef anna_diameter_comm_OamModule_hpp
38 #define anna_diameter_comm_OamModule_hpp
41 #include <anna/core/Singleton.hpp>
42 #include <anna/core/define.autoenum.hpp>
45 #include <anna/core/oam/Module.hpp>
58 class OamModule : public anna::oam::Module, public anna::Singleton <OamModule> {
64 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
65 // Transferable Alarms: preffix = c_ //
66 // Grouped Alarms: preffix = g_ //
67 // Be careful: this alarms take more than one place (better define them at the end) //
68 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
71 // Enumerated labels represent english text and formats. Final order is not restricted to this in any language, but, is useful to
72 // remember the names at CSL. For example, we should have CSL="primary_address,secondary_address", and then the database text
73 // could have any composition: "Fail to deliver on secondary address '${secondary_address:%s}' after failing over primary '${primary_address:%s}'"
79 UnableToDeliverDiameterMessageToEntityDefinedAs__s__, // 'address1:port1 address2:port2 ...'
80 UnableToDeliverDiameterMessageToEntityDefinedAsPrimary__s__AndSecondary__s__, // 'Primary Server address1:port1 and Secondary Server address2:port2'
81 RequestSentOnClientSessionExpired,
82 RequestSentOnServerSessionExpired,
83 AnswerReceivedOnClientSessionUnknown,
84 AnswerReceivedOnServerSessionUnknown,
85 c_LostAvailabilityOverClientSessionWithServer__s__,
86 c_LostAvailabilityOverClientSessionWithServer__s__ClientSessionId__d__,
87 c_LostAvailabilityOverServerDefinedAs__s__, // 'address:port'
88 c_LostAvailabilityOverEntityDefinedAs__s__, // 'address1:port1 address2:port2 ...'
89 c_LostAvailabilityOverEntityDefinedAsPrimary__s__AndSecondary__s__, // 'Primary Server address1:port1 and Secondary Server address2:port2'
90 c_LostAvailabilityOverEntitiesForEngineWithClassName__s__,
92 UnableToDeliverDiameterMessageToClientFromLocalServer__s__, // 'address:port'
93 LostConnectionForServerSessionAtLocalServer__s__,
94 LostConnectionForServerSessionAtLocalServer__s__ServerSessionId__d__,
95 UnbindConnectionForServerSessionAtLocalServer__s__DueToInactivityTimeAnomaly,
96 UnbindConnectionForServerSessionAtLocalServer__s__ServerSessionId__d__DueToInactivityTimeAnomaly,
97 c_LostAvailabilityOverLocalServerDefinedAs__s__, // 'address:port'
98 c_LostAvailabilityOverLocalServersForEngineWithClassName__s__
101 anna_declare_enum(Alarm);
106 // In order to simplify, the literals assigned to
107 // enum-type counters are equivalent to spanich specification ones
115 RequestReceivedOnClientSession,
116 AnswerReceivedOnClientSession,
117 RequestReceivedOnServerSession,
118 AnswerReceivedOnServerSession,
124 RequestSentOnClientSessionOK,
125 RequestSentOnClientSessionNOK,
126 AnswerSentOnClientSessionOK,
127 AnswerSentOnClientSessionNOK,
128 RequestSentOnServerSessionOK,
129 RequestSentOnServerSessionNOK,
130 AnswerSentOnServerSessionOK,
131 AnswerSentOnServerSessionNOK,
135 RequestSentOnClientSessionExpired,
136 RequestSentOnServerSessionExpired,
138 // unknown received answers
139 AnswerReceivedUnknown,
140 AnswerReceivedOnClientSessionUnknown,
141 AnswerReceivedOnServerSessionUnknown,
143 /* Capabilities Exchange */
153 /* Diameter Keepalive */
163 /* Peer disconnection */
173 /* server socket operations (enable/disable listening port for any local server) */
179 UnableToDeliverOverEntity,
180 LostAvailabilityOverClientSession,
181 RecoveredAvailabilityOverClientSession,
182 LostAvailabilityOverServer,
183 RecoveredAvailabilityOverServer,
184 LostAvailabilityOverEntity,
185 RecoveredAvailabilityOverEntity,
186 LostAvailabilityOverEngineForEntities,
187 RecoveredAvailabilityOverEngineForEntities,
189 UnableToDeliverToClient,
190 LostConnectionForServerSession,
191 UnbindConnectionForServerSessionDueToInactivityTimeAnomaly,
192 CreatedConnectionForServerSession,
193 LostAvailabilityOverLocalServer,
194 RecoveredAvailabilityOverLocalServer,
195 LostAvailabilityOverEngineForLocalServers,
196 RecoveredAvailabilityOverEngineForLocalServers
199 anna_declare_enum(Counter);
202 /* virtual */std::string getDefaultInternalAlarmDescription(const int & alarmType) const throw() { return Alarm::asCString((Alarm::_v)alarmType); }
203 /* virtual */std::string getDefaultInternalCounterDescription(const int & counterType) const throw() { return Counter::asCString((Counter::_v)counterType); }
208 // private constructor
209 OamModule() : anna::oam::Module("diameter::comm oam module") {};
212 friend class anna::Singleton <OamModule>;