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/connection.h>
00010
00011 class OpalZrtp_UDP : public SecureRTP_UDP {
00012 PCLASSINFO(OpalZrtp_UDP, SecureRTP_UDP);
00013 public:
00014 OpalZrtp_UDP(
00015 #if OPAL_RTP_AGGREGATE
00016 PHandleAggregator * aggregator,
00017 #endif
00018 unsigned id,
00019 PBoolean remoteIsNAT
00020 );
00021
00022 virtual ~OpalZrtp_UDP();
00023
00024 virtual PBoolean WriteZrtpData(RTP_DataFrame & frame);
00025
00026 virtual SendReceiveStatus OnSendData(RTP_DataFrame & frame);
00027 virtual SendReceiveStatus OnReceiveData(RTP_DataFrame & frame);
00028 virtual SendReceiveStatus OnSendControl(RTP_ControlFrame & frame, PINDEX & len);
00029 virtual SendReceiveStatus OnReceiveControl(RTP_ControlFrame & frame);
00030 virtual DWORD GetOutgoingSSRC();
00031
00032 public:
00033 zrtp_stream_ctx_t *zrtpStream;
00034 };
00035
00036 class OpalZrtpSecurityMode : public OpalSecurityMode {
00037 PCLASSINFO(OpalZrtpSecurityMode, OpalSecurityMode);
00038 };
00039
00040 class LibZrtpSecurityMode_Base : public OpalZrtpSecurityMode {
00041 PCLASSINFO(LibZrtpSecurityMode_Base, OpalZrtpSecurityMode);
00042 public:
00043 LibZrtpSecurityMode_Base();
00044
00045 RTP_UDP * CreateRTPSession(
00046 #if OPAL_RTP_AGGREGATE
00047 PHandleAggregator *_aggregator,
00048 #endif
00049 unsigned id,
00050 PBoolean remoteIsNAT,
00051 OpalConnection & conn
00052 );
00053 PBoolean Open();
00054
00055 zrtp_profile_t *GetZrtpProfile();
00056
00057 protected:
00058
00059 void Init(int *sas, int *pk, int *auth, int *cipher, int *hash);
00060 zrtp_profile_t *profile;
00061 };
00062
00063
00064 #endif //__ZRTPUDP_H