source: trunk/ETSI-Testsuites/ETSI_auto_IOT/codec/c++/isup_codets.h

Last change on this file was 22, checked in by rings, 14 years ago
  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#ifndef ISUP_CODETS_H
2#define ISUP_CODETS_H
3
4#include <t3devlib/t3devlib.h>
5#include <t3devlib/generator.h>
6
7namespace 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
14T3DEVLIB_FIXED_STRING_DEFINITION(SipIsup_ISUP_ParamTypes, CallInstanceCode, Octetstring, 32);
15T3DEVLIB_FIXED_STRING_DEFINITION(SipIsup_ISUP_ParamTypes, FAI_PAR_v, Bitstring, 8);
16T3DEVLIB_FIXED_STRING_DEFINITION(SipIsup_ISUP_ParamTypes, CGC_PAR_v, Bitstring, 8);
17T3DEVLIB_FIXED_STRING_DEFINITION(SipIsup_ISUP_ParamTypes, TMR_PAR_v, Bitstring, 8);
18
19// aliases (subtypes without restrictions)
20T3DEVLIB_BASIC_DEFINITION(SipIsup_ISUP_ParamTypes, APMUserInformation_g1, Octetstring);
21
22// types to be coded as variable-length string withing a range
23T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (SipIsup_ISUP_ParamTypes, Oct1to2, Octetstring, 8, 16);
24T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (SipIsup_ISUP_ParamTypes, Oct0to4, Octetstring, 0, 32);
25T3DEVLIB_VARIABLE_SIZE_STRING_DEFINITION (SipIsup_ISUP_ParamTypes, Oct0to8, Octetstring, 0, 64);
26T3DEVLIB_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.
32class EOP : public Bit8
33{
34public:
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
Note: See TracBrowser for help on using the repository browser.