[22] | 1 | #ifndef ISUP_CODETS_H |
---|
| 2 | #define ISUP_CODETS_H |
---|
| 3 | |
---|
| 4 | #include <t3devlib/t3devlib.h> |
---|
| 5 | #include <t3devlib/generator.h> |
---|
| 6 | |
---|
| 7 | namespace t3devlib { namespace gen { |
---|
| 8 | |
---|
| 9 | // |
---|
| 10 | // Implementation of subtypes defined in the module SipIsup_ISUP_ParamTypes |
---|
| 11 | // |
---|
| 12 | |
---|
| 13 | // types to be coded as a fixed-lengh string |
---|
| 14 | T3DEVLIB_FIXED_STRING_DEFINITION(SipIsup_ISUP_ParamTypes, CallInstanceCode, Octetstring, 32); |
---|
| 15 | T3DEVLIB_FIXED_STRING_DEFINITION(SipIsup_ISUP_ParamTypes, FAI_PAR_v, Bitstring, 8); |
---|
| 16 | T3DEVLIB_FIXED_STRING_DEFINITION(SipIsup_ISUP_ParamTypes, CGC_PAR_v, Bitstring, 8); |
---|
| 17 | T3DEVLIB_FIXED_STRING_DEFINITION(SipIsup_ISUP_ParamTypes, TMR_PAR_v, Bitstring, 8); |
---|
| 18 | |
---|
| 19 | // aliases (subtypes without restrictions) |
---|
| 20 | T3DEVLIB_BASIC_DEFINITION(SipIsup_ISUP_ParamTypes, APMUserInformation_g1, Octetstring); |
---|
| 21 | |
---|
| 22 | // types to be coded as variable-length string withing a range |
---|
| 23 | T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (SipIsup_ISUP_ParamTypes, Oct1to2, Octetstring, 8, 16); |
---|
| 24 | T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (SipIsup_ISUP_ParamTypes, Oct0to4, Octetstring, 0, 32); |
---|
| 25 | T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (SipIsup_ISUP_ParamTypes, Oct0to8, Octetstring, 0, 64); |
---|
| 26 | T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (SipIsup_ISUP_ParamTypes, Oct0to9, Octetstring, 0, 72); |
---|
| 27 | |
---|
| 28 | // EOP is a 8-bit bitstring that must contain '00000000'B. |
---|
| 29 | // |
---|
| 30 | // We implement directly this class to ensure that the value is correct |
---|
| 31 | // when decoding such a value. |
---|
| 32 | class EOP : public Bit8 |
---|
| 33 | { |
---|
| 34 | public: |
---|
| 35 | const char* GetModuleName() const { return "SipIsup_ISUP_ParamTypes"; } |
---|
| 36 | const char* GetTypeName() const { return "EOP"; } |
---|
| 37 | |
---|
| 38 | void Decode (Buffer& buffer) throw (DecodeError) { |
---|
| 39 | Bit8::Decode (buffer); |
---|
| 40 | if ((GetLength() != 8) || (*GetValueBin() != '\0')) { |
---|
| 41 | throw DecodeError (this, "Malformed EOP (must have null value)"); |
---|
| 42 | } |
---|
| 43 | } |
---|
| 44 | }; |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | }} // namespaces |
---|
| 48 | |
---|
| 49 | #endif |
---|
| 50 | |
---|