zrtpudp.h

Go to the documentation of this file.
00001 /*
00002  * zrtpudp.h
00003  *
00004  * ZRTP protocol handler
00005  *
00006  * OPAL Library
00007  *
00008  * Copyright (C) 2006 Post Increment
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is OPAL Library.
00021  *
00022  * The Initial Developer of the Original Code is Post Increment
00023  *
00024  * Contributor(s): ______________________________________.
00025  *
00026  * $Revision$
00027  * $Author$
00028  * $Date$
00029  */
00030 
00031 #ifndef OPAL_RTP_ZRTPUDP_H
00032 #define OPAL_RTP_ZRTPUDP_H
00033 
00034 #ifdef P_USE_PRAGMA
00035 #pragma interface
00036 #endif
00037 
00038 #include <ptlib.h>
00039 
00040 #include <opal/buildopts.h>
00041 
00042 #include <opal/rtpconn.h>
00043 
00044 
00045 struct zrtp_profile_t;
00046 struct zrtp_conn_ctx_t;
00047 struct zrtp_stream_ctx_t;
00048 
00049 
00050 class OpalZrtp_UDP : public SecureRTP_UDP
00051 {
00052     PCLASSINFO(OpalZrtp_UDP, SecureRTP_UDP);
00053   public:
00054     OpalZrtp_UDP(
00055       const PString & encoding,       
00056       bool audio,                     
00057 #if OPAL_RTP_AGGREGATE
00058       PHandleAggregator * aggregator, 
00059 #endif
00060       unsigned id,                    
00061       PBoolean remoteIsNAT            
00062     );
00063 
00064     virtual ~OpalZrtp_UDP();
00065 
00066     virtual PBoolean WriteZrtpData(RTP_DataFrame & frame);
00067 
00068     virtual SendReceiveStatus OnSendData(RTP_DataFrame & frame);
00069     virtual SendReceiveStatus OnReceiveData(RTP_DataFrame & frame);
00070     virtual SendReceiveStatus OnSendControl(RTP_ControlFrame & frame, PINDEX & len);
00071     virtual SendReceiveStatus OnReceiveControl(RTP_ControlFrame & frame);
00072     virtual DWORD GetOutgoingSSRC();
00073 
00074   public:
00075     zrtp_stream_ctx_t *zrtpStream;
00076 };
00077 
00078 
00079 class OpalZrtpSecurityMode : public OpalSecurityMode
00080 {
00081   PCLASSINFO(OpalZrtpSecurityMode, OpalSecurityMode);
00082 };
00083 
00084 class LibZrtpSecurityMode_Base : public OpalZrtpSecurityMode
00085 {
00086     PCLASSINFO(LibZrtpSecurityMode_Base, OpalZrtpSecurityMode);
00087   public:
00088     LibZrtpSecurityMode_Base();
00089     ~LibZrtpSecurityMode_Base();
00090 
00091     RTP_UDP * CreateRTPSession(
00092       OpalRTPConnection & connection,     
00093       const RTP_Session::Params & options 
00094     );
00095 
00096     PBoolean Open();
00097 
00098     zrtp_profile_t *GetZrtpProfile();
00099 
00100     zrtp_conn_ctx_t     * zrtpSession;
00101 
00102   protected:
00103     // last element of each array mush be 0
00104     void Init(int *sas, int *pk, int *auth, int *cipher, int *hash);
00105     zrtp_profile_t *profile;
00106 };
00107 
00108 
00109 #endif // OPAL_RTP_ZRTPUDP_H

Generated on Mon Feb 23 02:01:40 2009 for OPAL by  doxygen 1.5.1