OPAL  Version 3.18.8
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 
22 #ifndef OPAL_H224_H224_H
23 #define OPAL_H224_H224_H
24 
25 #ifdef P_USE_PRAGMA
26 #pragma interface
27 #endif
28 
29 #include <opal_config.h>
30 
31 #if OPAL_HAS_H224
32 
33 #include <opal/mediatype.h>
34 #include <opal/mediafmt.h>
35 #include <h224/q922.h>
36 
37 
39 
40 
42 //
43 // H.224 Media Format
44 //
45 
47 {
49  public:
51  {
52  PCLASSINFO(Internal, OpalMediaFormatInternal);
53  public:
54  Internal(const char * fullName, const char * description, bool hdlcTunneling);
55  virtual bool IsValidForProtocol(const PString & protocol) const;
56  };
57 
58  OpalH224MediaFormat(Internal * info, bool dynamic) : OpalMediaFormat(info, dynamic) { }
59  OpalH224MediaFormat(const PString & name) : OpalMediaFormat(name) { }
60 
61  static const PString & HDLCTunnelingOption();
62 };
63 
64 
66 
67 class OpalH224Client;
68 
69 class H224_Frame : public Q922_Frame
70 {
71  PCLASSINFO(H224_Frame, Q922_Frame);
72 
73 public:
74 
75  H224_Frame(PINDEX clientDataSize = 254);
76  H224_Frame(const OpalH224Client & h224Client, PINDEX clientDataSize = 254);
77  ~H224_Frame();
78 
79  PBoolean IsHighPriority() const { return (GetLowOrderAddressOctet() == 0x71); }
80  void SetHighPriority(PBoolean flag);
81 
82  WORD GetDestinationTerminalAddress() const;
83  void SetDestinationTerminalAddress(WORD destination);
84 
85  WORD GetSourceTerminalAddress() const;
86  void SetSourceTerminalAddress(WORD source);
87 
89  void SetClient(const OpalH224Client & h224Client);
90 
91  BYTE GetClientID() const;
92  void SetClientID(BYTE clientID);
93 
95  BYTE GetExtendedClientID() const;
97  void SetExtendedClientID(BYTE extendedClientID);
98 
100  BYTE GetCountryCode() const;
101  BYTE GetCountryCodeExtension() const;
102  WORD GetManufacturerCode() const;
103  BYTE GetManufacturerClientID() const;
104 
106  void SetNonStandardClientInformation(BYTE countryCode,
107  BYTE countryCodeExtension,
108  WORD manufacturerCode,
109  BYTE manufacturerClientID);
110 
113  PBoolean GetBS() const;
114  void SetBS(PBoolean bs);
115 
116  PBoolean GetES() const;
117  void SetES(PBoolean es);
118 
119  PBoolean GetC1() const;
120  void SetC1(PBoolean c1);
121 
122  PBoolean GetC0() const;
123  void SetC0(PBoolean c0);
124 
125  BYTE GetSegmentNumber() const;
126  void SetSegmentNumber(BYTE segmentNumber);
127 
128  BYTE *GetClientDataPtr() const;
129 
130  PINDEX GetClientDataSize() const;
131  void SetClientDataSize(PINDEX size);
132 
133  PBoolean DecodeAnnexQ(const BYTE *data, PINDEX size);
134  PBoolean DecodeHDLC(const BYTE *data, PINDEX size);
135 
136 private:
137  PINDEX GetHeaderSize() const;
138 };
139 
140 
141 #endif // OPAL_HAS_H224
142 
143 #endif // OPAL_H224_H224_H
PBoolean DecodeHDLC(const BYTE *data, PINDEX size)
OpalH224MediaFormat(Internal *info, bool dynamic)
Definition: h224.h:58
WORD GetManufacturerCode() const
void SetClient(const OpalH224Client &h224Client)
Definition: h224handler.h:41
Definition: h224.h:50
PBoolean GetES() const
Definition: q922.h:39
Definition: mediafmt.h:717
Definition: mediatype.h:66
BYTE GetClientID() const
static const PString & HDLCTunnelingOption()
PINDEX GetClientDataSize() const
BYTE GetExtendedClientID() const
Definition: h224.h:69
PBoolean GetBS() const
BYTE * GetClientDataPtr() const
Internal(const char *fullName, const char *description, bool hdlcTunneling)
virtual bool IsValidForProtocol(const PString &protocol) const
void SetClientID(BYTE clientID)
void SetHighPriority(PBoolean flag)
BYTE GetCountryCode() const
PBoolean DecodeAnnexQ(const BYTE *data, PINDEX size)
Definition: mediafmt.h:806
void SetES(PBoolean es)
void SetC1(PBoolean c1)
WORD GetDestinationTerminalAddress() const
void SetDestinationTerminalAddress(WORD destination)
H224_Frame(PINDEX clientDataSize=254)
Definition: h224.h:46
PBoolean IsHighPriority() const
Definition: h224.h:79
const OpalMediaType & OpalH224MediaType()
BYTE GetManufacturerClientID() const
BYTE GetSegmentNumber() const
OpalH224MediaFormat(const PString &name)
Definition: h224.h:59
void SetSourceTerminalAddress(WORD source)
WORD GetSourceTerminalAddress() const
BYTE GetLowOrderAddressOctet() const
Definition: q922.h:49
void SetExtendedClientID(BYTE extendedClientID)
void SetNonStandardClientInformation(BYTE countryCode, BYTE countryCodeExtension, WORD manufacturerCode, BYTE manufacturerClientID)
void SetBS(PBoolean bs)
void SetSegmentNumber(BYTE segmentNumber)
void SetC0(PBoolean c0)
PBoolean GetC1() const
void SetClientDataSize(PINDEX size)
BYTE GetCountryCodeExtension() const
PBoolean GetC0() const