h224.h

Go to the documentation of this file.
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: 20177 $
00022  * $Author: csoutheren $
00023  * $Date: 2008-05-06 05:55:40 +0000 (Tue, 06 May 2008) $
00024  */
00025 
00026 #ifndef __OPAL_H224_H
00027 #define __OPAL_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/mediatype.h>
00038 #include <h224/q922.h>
00039 
00040 #define H224_HEADER_SIZE 6
00041 
00042 #define H224_BROADCAST 0x0000
00043 
00045 //
00046 //  declare a media type for H.224
00047 //
00048 
00049 class OpalH224MediaType : OpalRTPAVPMediaType 
00050 {
00051   public:
00052     OpalH224MediaType();
00053 
00054 #if OPAL_SIP
00055     SDPMediaDescription * CreateSDPMediaDescription(const OpalTransportAddress & localAddress);
00056 #endif
00057 };
00058 
00060 
00061 class H224_Frame : public Q922_Frame
00062 {
00063   PCLASSINFO(H224_Frame, Q922_Frame);
00064         
00065 public:
00066         
00067   H224_Frame(PINDEX clientDataSize = 254);
00068   ~H224_Frame();
00069         
00070   PBoolean IsHighPriority() const { return (GetLowOrderAddressOctet() == 0x71); }
00071   void SetHighPriority(PBoolean flag);
00072         
00073   WORD GetDestinationTerminalAddress() const;
00074   void SetDestinationTerminalAddress(WORD destination);
00075         
00076   WORD GetSourceTerminalAddress() const;
00077   void SetSourceTerminalAddress(WORD source);
00078         
00079   // Only standard client IDs are supported at the moment
00080   BYTE GetClientID() const;
00081   void SetClientID(BYTE clientID);
00082         
00083   PBoolean GetBS() const;
00084   void SetBS(PBoolean bs);
00085         
00086   PBoolean GetES() const;
00087   void SetES(PBoolean es);
00088         
00089   PBoolean GetC1() const;
00090   void SetC1(PBoolean c1);
00091         
00092   PBoolean GetC0() const;
00093   void SetC0(PBoolean c0);
00094         
00095   BYTE GetSegmentNumber() const;
00096   void SetSegmentNumber(BYTE segmentNumber);
00097         
00098   BYTE *GetClientDataPtr() const { return (GetInformationFieldPtr() + H224_HEADER_SIZE); }
00099         
00100   PINDEX GetClientDataSize() const { return (GetInformationFieldSize() - H224_HEADER_SIZE); }
00101   void SetClientDataSize(PINDEX size) { SetInformationFieldSize(size + H224_HEADER_SIZE); }
00102         
00103   PBoolean Decode(const BYTE *data, PINDEX size);
00104 };
00105 
00106 #endif // __OPAL_H224_H
00107 

Generated on Mon Sep 15 11:48:45 2008 for OPAL by  doxygen 1.5.1