00001 /* 00002 * h224.h 00003 * 00004 * H.224 PDU implementation for the OpenH323 Project. 00005 * 00006 * Copyright (c) 2006 Network for Educational Technology, ETH Zurich. 00007 * Written by Hannes Friederich. 00008 * 00009 * The contents of this file are subject to the Mozilla Public License 00010 * Version 1.0 (the "License"); you may not use this file except in 00011 * compliance with the License. You may obtain a copy of the License at 00012 * http://www.mozilla.org/MPL/ 00013 * 00014 * Software distributed under the License is distributed on an "AS IS" 00015 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00016 * the License for the specific language governing rights and limitations 00017 * under the License. 00018 * 00019 * Contributor(s): ______________________________________. 00020 * 00021 * $Revision: 21283 $ 00022 * $Author: rjongbloed $ 00023 * $Date: 2008-10-11 07:10:58 +0000 (Sat, 11 Oct 2008) $ 00024 */ 00025 00026 #ifndef OPAL_H224_H224_H 00027 #define OPAL_H224_H224_H 00028 00029 #ifdef P_USE_PRAGMA 00030 #pragma interface 00031 #endif 00032 00033 #ifndef _PTLIB_H 00034 #include <ptlib.h> 00035 #endif 00036 00037 #include <opal/buildopts.h> 00038 00039 #include <opal/mediatype.h> 00040 #include <h224/q922.h> 00041 00042 #define H224_HEADER_SIZE 6 00043 00044 #define H224_BROADCAST 0x0000 00045 00047 // 00048 // declare a media type for H.224 00049 // 00050 00051 class OpalH224MediaType : OpalRTPAVPMediaType 00052 { 00053 public: 00054 OpalH224MediaType(); 00055 00056 #if OPAL_SIP 00057 SDPMediaDescription * CreateSDPMediaDescription(const OpalTransportAddress & localAddress); 00058 #endif 00059 }; 00060 00062 00063 class H224_Frame : public Q922_Frame 00064 { 00065 PCLASSINFO(H224_Frame, Q922_Frame); 00066 00067 public: 00068 00069 H224_Frame(PINDEX clientDataSize = 254); 00070 ~H224_Frame(); 00071 00072 PBoolean IsHighPriority() const { return (GetLowOrderAddressOctet() == 0x71); } 00073 void SetHighPriority(PBoolean flag); 00074 00075 WORD GetDestinationTerminalAddress() const; 00076 void SetDestinationTerminalAddress(WORD destination); 00077 00078 WORD GetSourceTerminalAddress() const; 00079 void SetSourceTerminalAddress(WORD source); 00080 00081 // Only standard client IDs are supported at the moment 00082 BYTE GetClientID() const; 00083 void SetClientID(BYTE clientID); 00084 00085 PBoolean GetBS() const; 00086 void SetBS(PBoolean bs); 00087 00088 PBoolean GetES() const; 00089 void SetES(PBoolean es); 00090 00091 PBoolean GetC1() const; 00092 void SetC1(PBoolean c1); 00093 00094 PBoolean GetC0() const; 00095 void SetC0(PBoolean c0); 00096 00097 BYTE GetSegmentNumber() const; 00098 void SetSegmentNumber(BYTE segmentNumber); 00099 00100 BYTE *GetClientDataPtr() const { return (GetInformationFieldPtr() + H224_HEADER_SIZE); } 00101 00102 PINDEX GetClientDataSize() const { return (GetInformationFieldSize() - H224_HEADER_SIZE); } 00103 void SetClientDataSize(PINDEX size) { SetInformationFieldSize(size + H224_HEADER_SIZE); } 00104 00105 PBoolean Decode(const BYTE *data, PINDEX size); 00106 }; 00107 00108 #endif // OPAL_H224_H224_H 00109