00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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
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