OPAL  Version 3.12.5
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: 27956 $
22  * $Author: rjongbloed $
23  * $Date: 2012-07-04 01:56:20 -0500 (Wed, 04 Jul 2012) $
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 #ifndef _PTLIB_H
34 #include <ptlib.h>
35 #endif
36 
37 #include <opal/buildopts.h>
38 
39 #include <opal/mediatype.h>
40 #include <opal/mediafmt.h>
41 #include <h224/q922.h>
42 
43 #define H224_HEADER_SIZE 6
44 
46 //
47 // declare a media type for H.224
48 //
49 
51 {
52  public:
53  static const char * Name();
54 
56 
57  static const OpalMediaType & MediaType();
58 
59 #if OPAL_SIP
60  static const PCaselessString & GetSDPMediaType();
61 
62  virtual bool MatchesSDP(
63  const PCaselessString & sdpMediaType,
64  const PCaselessString & sdpTransport,
65  const PStringArray & sdpLines,
66  PINDEX index
67  );
68 
70  const OpalTransportAddress & localAddress
71  ) const;
72 #endif // OPAL_SIP
73 };
74 
76 //
77 // H.224 Media Format
78 //
79 
81 {
83 
84  public:
86  const char * fullName,
87  RTP_DataFrame::PayloadTypes rtpPayloadType
88  );
89  virtual PObject * Clone() const;
90  virtual PBoolean IsValidForProtocol(const PString & protocol) const;
91 };
92 
95 
96 
97 #define OpalH224AnnexQ GetOpalH224_H323AnnexQ()
98 #define OpalH224Tunnelled GetOpalH224_HDLCTunneling()
99 
101 
102 class OpalH224Client;
103 
104 class H224_Frame : public Q922_Frame
105 {
106  PCLASSINFO(H224_Frame, Q922_Frame);
107 
108 public:
109 
110  H224_Frame(PINDEX clientDataSize = 254);
111  H224_Frame(const OpalH224Client & h224Client, PINDEX clientDataSize = 254);
112  ~H224_Frame();
113 
114  PBoolean IsHighPriority() const { return (GetLowOrderAddressOctet() == 0x71); }
115  void SetHighPriority(PBoolean flag);
116 
117  WORD GetDestinationTerminalAddress() const;
118  void SetDestinationTerminalAddress(WORD destination);
119 
120  WORD GetSourceTerminalAddress() const;
121  void SetSourceTerminalAddress(WORD source);
122 
124  void SetClient(const OpalH224Client & h224Client);
125 
126  BYTE GetClientID() const;
127  void SetClientID(BYTE clientID);
128 
130  BYTE GetExtendedClientID() const;
132  void SetExtendedClientID(BYTE extendedClientID);
133 
135  BYTE GetCountryCode() const;
136  BYTE GetCountryCodeExtension() const;
137  WORD GetManufacturerCode() const;
138  BYTE GetManufacturerClientID() const;
139 
141  void SetNonStandardClientInformation(BYTE countryCode,
142  BYTE countryCodeExtension,
143  WORD manufacturerCode,
144  BYTE manufacturerClientID);
145 
148  PBoolean GetBS() const;
149  void SetBS(PBoolean bs);
150 
151  PBoolean GetES() const;
152  void SetES(PBoolean es);
153 
154  PBoolean GetC1() const;
155  void SetC1(PBoolean c1);
156 
157  PBoolean GetC0() const;
158  void SetC0(PBoolean c0);
159 
160  BYTE GetSegmentNumber() const;
161  void SetSegmentNumber(BYTE segmentNumber);
162 
163  BYTE *GetClientDataPtr() const;
164 
165  PINDEX GetClientDataSize() const;
166  void SetClientDataSize(PINDEX size);
167 
168  PBoolean DecodeAnnexQ(const BYTE *data, PINDEX size);
169  PBoolean DecodeHDLC(const BYTE *data, PINDEX size);
170 
171 private:
172  PINDEX GetHeaderSize() const;
173 };
174 
175 #endif // OPAL_H224_H224_H
176