1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_diameter_codec_OamModule_hpp
10 #define anna_diameter_codec_OamModule_hpp
13 #include <anna/core/Singleton.hpp>
14 #include <anna/core/define.autoenum.hpp>
17 #include <anna/core/oam/Module.hpp>
30 class OamModule : public anna::oam::Module, public anna::Singleton <OamModule> {
36 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
37 // Transferable Alarms: preffix = c_ //
38 // Grouped Alarms: preffix = g_ //
39 // Be careful: this alarms take more than one place (better define them at the end) //
40 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
46 /////////////////////////////////////////////
47 // All defined alarms are not transferable //
48 /////////////////////////////////////////////
52 AvpDecode__NotEnoughBytesToCoverAvpHeaderLength,
53 // El buffer pasado no es suficiente para construir un AVP
54 // Not enough buffer to build AVP
56 AvpDecode__IncoherenceBetweenActivatedVBitAndZeroedVendorIDValueReceived,
57 // Los Flags indican que el AVP es vendor-specific (bit V) y sin embargo el campo vendor-ID tiene un valor 0 (IETF)
58 // AVP Flags are vendor-specific (V bit) but vendor-ID octets value is 0 (IETF)
60 AvpDecode__IncorrectLength,
61 // Existe un error de formato en el AVP, la longitud es incorrecta
62 // There is an error inside the AVP, the length is not correct
64 AvpDecode__DataPartInconsistence,
65 // Existe un error de inconsistencia en la parte de datos
66 // There is an inconsistence error inside the AVP data part
68 AvpDecode__UnknownAvp__s__WithMandatoryBit,
69 // Formato desconocido del AVP %s con bit M activo
70 // Unknown format for AVP %s with activated M bit
72 /* Message decoding */
74 MessageDecode__NotEnoughBytesToCoverMessageHeaderLength,
75 // El buffer pasado no es suficiente para construir la cabecera de un mensaje DIAMETER
76 // Not enough buffer to build the DIAMETER message header
78 MessageDecode__NotEnoughBytesToCoverMessageLength,
79 // No se han proporcionado octetos suficientes para cubrir la longitud del mensaje DIAMETER
80 // Not enough bytes to fit DIAMETER message length
85 AvpValidation__EnumeratedAvp__s__WithValue__d__DoesNotComplyRestriction__s__,
86 // El AVP enumerado %s con valor %d, no cumple la restriccion: %s
87 // Enumerated AVP %s with value %d does not comply to restriction: %s
89 AvpValidation__Avp__s__Flags__d__DoesNotFulfillTheDefinedFlagRules__s__,
90 // El AVP %s tiene flags (%d) incoherentes con las reglas de flags definidas: %s
91 // AVP %s flags (%d) does not fulfill the defined flag rules: %s
94 /* Message validation */
96 MessageValidation__UnknownOperation__s__UnableToValidate,
97 // Operacion %s desconocida, imposible validar
98 // Unknown operation %s, unable to validate
100 MessageValidation__Operation__s__HaveIncoherentFlags__d__,
101 // La operacion %s tiene flags (%d) incoherentes
102 // Operation %s have incoherent flags (%d)
105 /* Level validation */
107 LevelValidation__MissingFixedRule__s__Inside__s__,
108 // Falta un AVP fijo %s dentro de %s
109 // Missing fixed rule %s inside %s
111 LevelValidation__FailedRule__s__ForCardinality_Found__d__ItemsInside__s__,
112 // Ha fallado la regla %s de cardinalidad (encontrados %s items dentro de %s)
113 // Failed rule %s for cardinality (found %d items inside %s)
115 LevelValidation__FailedGenericAvpRule__s__ForCardinality_Found__d__DisregardedItemsInside__s__,
116 // Ha fallado la regla del AVP Generico %s para la cardinalidad (encontrados %d items no contemplados dentro de %s)
117 // Failed Generic AVP rule %s for cardinality (found %d disregarded items inside %s)
119 LevelValidation__FoundDisregardedItemsInside__s__AndGenericAVPWasNotSpecified__s__
120 // Encontrados items no contemplados dentro de %s y el AVP Generico no se especifico: %s
121 // Found disregarded items inside %s and Generic AVP was not specified: %s
124 anna_declare_enum(Alarm);
129 // In order to simplify, the literals assigned to
130 // enum-type counters are equal to specification ones (in spanish)
135 AvpDecode__NotEnoughBytesToCoverAvpHeaderLength,
136 AvpDecode__IncoherenceBetweenActivatedVBitAndZeroedVendorIDValueReceived,
137 AvpDecode__IncorrectLength,
138 AvpDecode__DataPartInconsistence,
139 AvpDecode__UnknownAvpWithMandatoryBit,
141 /* Message decoding */
142 MessageDecode__NotEnoughBytesToCoverMessageHeaderLength,
143 MessageDecode__NotEnoughBytesToCoverMessageLength,
146 AvpValidation__EnumeratedAvpWithValueDoesNotComplyRestriction,
147 AvpValidation__AvpFlagsDoesNotFulfillTheDefinedFlagRules,
149 /* Message validation */
150 MessageValidation__UnknownOperationUnableToValidate,
151 MessageValidation__OperationHaveIncoherentFlags,
153 /* Level validation */
154 LevelValidation__MissingFixedRule,
155 LevelValidation__FailedRuleForCardinality,
156 LevelValidation__FailedRuleForCardinalityLessThanNeeded,
157 LevelValidation__FailedRuleForCardinalityMoreThanNeeded,
158 LevelValidation__FailedGenericAvpRuleForCardinalityFoundDisregardedItem,
159 LevelValidation__FoundDisregardedItemsAndGenericAVPWasNotSpecified
162 anna_declare_enum(Counter);
165 /* virtual */std::string getDefaultInternalAlarmDescription(const int & alarmType) const throw() { return Alarm::asCString((Alarm::_v)alarmType); }
166 /* virtual */std::string getDefaultInternalCounterDescription(const int & counterType) const throw() { return Counter::asCString((Counter::_v)counterType); }
171 // private constructor
172 OamModule() : anna::oam::Module("diameter::codec oam module") {};
175 friend class anna::Singleton <OamModule>;