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_codec_OamModule_hpp
38 #define anna_diameter_codec_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 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
74 /////////////////////////////////////////////
75 // All defined alarms are not transferable //
76 /////////////////////////////////////////////
80 AvpDecode__NotEnoughBytesToCoverAvpHeaderLength,
81 // El buffer pasado no es suficiente para construir un AVP
82 // Not enough buffer to build AVP
84 AvpDecode__IncoherenceBetweenActivatedVBitAndZeroedVendorIDValueReceived,
85 // Los Flags indican que el AVP es vendor-specific (bit V) y sin embargo el campo vendor-ID tiene un valor 0 (IETF)
86 // AVP Flags are vendor-specific (V bit) but vendor-ID octets value is 0 (IETF)
88 AvpDecode__IncorrectLength,
89 // Existe un error de formato en el AVP, la longitud es incorrecta
90 // There is an error inside the AVP, the length is not correct
92 AvpDecode__DataPartInconsistence,
93 // Existe un error de inconsistencia en la parte de datos
94 // There is an inconsistence error inside the AVP data part
96 AvpDecode__UnknownAvp__s__WithMandatoryBit,
97 // Formato desconocido del AVP %s con bit M activo
98 // Unknown format for AVP %s with activated M bit
100 /* Message decoding */
102 MessageDecode__NotEnoughBytesToCoverMessageHeaderLength,
103 // El buffer pasado no es suficiente para construir la cabecera de un mensaje DIAMETER
104 // Not enough buffer to build the DIAMETER message header
106 MessageDecode__NotEnoughBytesToCoverMessageLength,
107 // No se han proporcionado octetos suficientes para cubrir la longitud del mensaje DIAMETER
108 // Not enough bytes to fit DIAMETER message length
113 AvpValidation__EnumeratedAvp__s__WithValue__d__DoesNotComplyRestriction__s__,
114 // El AVP enumerado %s con valor %d, no cumple la restriccion: %s
115 // Enumerated AVP %s with value %d does not comply to restriction: %s
117 AvpValidation__Avp__s__Flags__d__DoesNotFulfillTheDefinedFlagRules__s__,
118 // El AVP %s tiene flags (%d) incoherentes con las reglas de flags definidas: %s
119 // AVP %s flags (%d) does not fulfill the defined flag rules: %s
122 /* Message validation */
124 MessageValidation__UnknownOperation__s__UnableToValidate,
125 // Operacion %s desconocida, imposible validar
126 // Unknown operation %s, unable to validate
128 MessageValidation__Operation__s__HaveIncoherentFlags__d__,
129 // La operacion %s tiene flags (%d) incoherentes
130 // Operation %s have incoherent flags (%d)
133 /* Level validation */
135 LevelValidation__MissingFixedRule__s__Inside__s__,
136 // Falta un AVP fijo %s dentro de %s
137 // Missing fixed rule %s inside %s
139 LevelValidation__FailedRule__s__ForCardinality_Found__d__ItemsInside__s__,
140 // Ha fallado la regla %s de cardinalidad (encontrados %s items dentro de %s)
141 // Failed rule %s for cardinality (found %d items inside %s)
143 LevelValidation__FailedGenericAvpRule__s__ForCardinality_Found__d__DisregardedItemsInside__s__,
144 // Ha fallado la regla del AVP Generico %s para la cardinalidad (encontrados %d items no contemplados dentro de %s)
145 // Failed Generic AVP rule %s for cardinality (found %d disregarded items inside %s)
147 LevelValidation__FoundDisregardedItemsInside__s__AndGenericAVPWasNotSpecified__s__
148 // Encontrados items no contemplados dentro de %s y el AVP Generico no se especifico: %s
149 // Found disregarded items inside %s and Generic AVP was not specified: %s
152 anna_declare_enum(Alarm);
157 // In order to simplify, the literals assigned to
158 // enum-type counters are equal to specification ones (in spanish)
163 AvpDecode__NotEnoughBytesToCoverAvpHeaderLength,
164 AvpDecode__IncoherenceBetweenActivatedVBitAndZeroedVendorIDValueReceived,
165 AvpDecode__IncorrectLength,
166 AvpDecode__DataPartInconsistence,
167 AvpDecode__UnknownAvpWithMandatoryBit,
169 /* Message decoding */
170 MessageDecode__NotEnoughBytesToCoverMessageHeaderLength,
171 MessageDecode__NotEnoughBytesToCoverMessageLength,
174 AvpValidation__EnumeratedAvpWithValueDoesNotComplyRestriction,
175 AvpValidation__AvpFlagsDoesNotFulfillTheDefinedFlagRules,
177 /* Message validation */
178 MessageValidation__UnknownOperationUnableToValidate,
179 MessageValidation__OperationHaveIncoherentFlags,
181 /* Level validation */
182 LevelValidation__MissingFixedRule,
183 LevelValidation__FailedRuleForCardinality,
184 LevelValidation__FailedRuleForCardinalityLessThanNeeded,
185 LevelValidation__FailedRuleForCardinalityMoreThanNeeded,
186 LevelValidation__FailedGenericAvpRuleForCardinalityFoundDisregardedItem,
187 LevelValidation__FoundDisregardedItemsAndGenericAVPWasNotSpecified
190 anna_declare_enum(Counter);
193 /* virtual */std::string getDefaultInternalAlarmDescription(const int & alarmType) const throw() { return Alarm::asCString((Alarm::_v)alarmType); }
194 /* virtual */std::string getDefaultInternalCounterDescription(const int & counterType) const throw() { return Counter::asCString((Counter::_v)counterType); }
199 // private constructor
200 OamModule() : anna::oam::Module("diameter::codec oam module") {};
203 friend class anna::Singleton <OamModule>;