OPAL  Version 3.14.3
h224.h
Go to the documentation of this file.
1 /*
2  * h224.h
3  *
4  * H.224 PDU implementation for the OpenH323 Project.
5  *
6  * Copyright (c) 2006 Network for Educational Technology, ETH Zurich.
7  * Written by Hannes Friederich.
8  *
9  * The contents of this file are subject to the Mozilla Public License
10  * Version 1.0 (the "License"); you may not use this file except in
11  * compliance with the License. You may obtain a copy of the License at
12  * http://www.mozilla.org/MPL/
13  *
14  * Software distributed under the License is distributed on an "AS IS"
15  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
16  * the License for the specific language governing rights and limitations
17  * under the License.
18  *
19  * Contributor(s): ______________________________________.
20  *
21  * $Revision: 30570 $
22  * $Author: rjongbloed $
23  * $Date: 2013-09-25 19:23:57 +1000 (Wed, 25 Sep 2013) $
24  */
25 
26 #ifndef OPAL_H224_H224_H
27 #define OPAL_H224_H224_H
28 
29 #ifdef P_USE_PRAGMA
30 #pragma interface
31 #endif
32 
33 #include <opal_config.h>
34 
35 #if OPAL_HAS_H224
36 
37 #include <opal/mediatype.h>
38 #include <opal/mediafmt.h>
39 #include <h224/q922.h>
40 
41 
43 
44 
46 //
47 // H.224 Media Format
48 //
49 
51 {
53  public:
55  const char * fullName,
56  const char * description,
57  bool hdlcTunneling
58  );
59 
60  virtual bool IsValidForProtocol(const PString & protocol) const;
61 };
62 
63 
65 {
67  public:
70  ) : OpalMediaFormat(info) { }
71 
72  static const PString & HDLCTunnelingOption();
73 };
74 
75 
77 
78 class OpalH224Client;
79 
80 class H224_Frame : public Q922_Frame
81 {
82  PCLASSINFO(H224_Frame, Q922_Frame);
83 
84 public:
85 
86  H224_Frame(PINDEX clientDataSize = 254);
87  H224_Frame(const OpalH224Client & h224Client, PINDEX clientDataSize = 254);
88  ~H224_Frame();
89 
90  PBoolean IsHighPriority() const { return (GetLowOrderAddressOctet() == 0x71); }
91  void SetHighPriority(PBoolean flag);
92 
93  WORD GetDestinationTerminalAddress() const;
94  void SetDestinationTerminalAddress(WORD destination);
95 
96  WORD GetSourceTerminalAddress() const;
97  void SetSourceTerminalAddress(WORD source);
98 
100  void SetClient(const OpalH224Client & h224Client);
101 
102  BYTE GetClientID() const;
103  void SetClientID(BYTE clientID);
104 
106  BYTE GetExtendedClientID() const;
108  void SetExtendedClientID(BYTE extendedClientID);
109 
111  BYTE GetCountryCode() const;
112  BYTE GetCountryCodeExtension() const;
113  WORD GetManufacturerCode() const;
114  BYTE GetManufacturerClientID() const;
115 
117  void SetNonStandardClientInformation(BYTE countryCode,
118  BYTE countryCodeExtension,
119  WORD manufacturerCode,
120  BYTE manufacturerClientID);
121 
124  PBoolean GetBS() const;
125  void SetBS(PBoolean bs);
126 
127  PBoolean GetES() const;
128  void SetES(PBoolean es);
129 
130  PBoolean GetC1() const;
131  void SetC1(PBoolean c1);
132 
133  PBoolean GetC0() const;
134  void SetC0(PBoolean c0);
135 
136  BYTE GetSegmentNumber() const;
137  void SetSegmentNumber(BYTE segmentNumber);
138 
139  BYTE *GetClientDataPtr() const;
140 
141  PINDEX GetClientDataSize() const;
142  void SetClientDataSize(PINDEX size);
143 
144  PBoolean DecodeAnnexQ(const BYTE *data, PINDEX size);
145  PBoolean DecodeHDLC(const BYTE *data, PINDEX size);
146 
147 private:
148  PINDEX GetHeaderSize() const;
149 };
150 
151 
152 #endif // OPAL_HAS_H224
153 
154 #endif // OPAL_H224_H224_H