00001 #ifndef __ZRTPUDP_H
00002 #define __ZRTPUDP_H
00003
00004 #ifdef P_USE_PRAGMA
00005 #pragma interface
00006 #endif
00007
00008 #include <ptlib.h>
00009 #include <opal/rtpconn.h>
00010
00011
00012 struct zrtp_profile_t;
00013 struct zrtp_conn_ctx_t;
00014 struct zrtp_stream_ctx_t;
00015
00016
00017 class OpalZrtp_UDP : public SecureRTP_UDP
00018 {
00019 PCLASSINFO(OpalZrtp_UDP, SecureRTP_UDP);
00020 public:
00021 OpalZrtp_UDP(
00022 const PString & encoding,
00023 #if OPAL_RTP_AGGREGATE
00024 PHandleAggregator * aggregator,
00025 #endif
00026 unsigned id,
00027 PBoolean remoteIsNAT
00028 );
00029
00030 virtual ~OpalZrtp_UDP();
00031
00032 virtual PBoolean WriteZrtpData(RTP_DataFrame & frame);
00033
00034 virtual SendReceiveStatus OnSendData(RTP_DataFrame & frame);
00035 virtual SendReceiveStatus OnReceiveData(RTP_DataFrame & frame);
00036 virtual SendReceiveStatus OnSendControl(RTP_ControlFrame & frame, PINDEX & len);
00037 virtual SendReceiveStatus OnReceiveControl(RTP_ControlFrame & frame);
00038 virtual DWORD GetOutgoingSSRC();
00039
00040 public:
00041 zrtp_stream_ctx_t *zrtpStream;
00042 };
00043
00044
00045 class OpalZrtpSecurityMode : public OpalSecurityMode
00046 {
00047 PCLASSINFO(OpalZrtpSecurityMode, OpalSecurityMode);
00048 };
00049
00050 class LibZrtpSecurityMode_Base : public OpalZrtpSecurityMode
00051 {
00052 PCLASSINFO(LibZrtpSecurityMode_Base, OpalZrtpSecurityMode);
00053 public:
00054 LibZrtpSecurityMode_Base();
00055 ~LibZrtpSecurityMode_Base();
00056
00057 RTP_UDP * CreateRTPSession(
00058 OpalRTPConnection & connection,
00059 const PString & encoding,
00060 #if OPAL_RTP_AGGREGATE
00061 PHandleAggregator * _aggregator,
00062 #endif
00063 unsigned id,
00064 PBoolean remoteIsNAT
00065 );
00066
00067 PBoolean Open();
00068
00069 zrtp_profile_t *GetZrtpProfile();
00070
00071 zrtp_conn_ctx_t * zrtpSession;
00072
00073 protected:
00074
00075 void Init(int *sas, int *pk, int *auth, int *cipher, int *hash);
00076 zrtp_profile_t *profile;
00077 };
00078
00079
00080 #endif //__ZRTPUDP_H