# zrtpudp.h

Go to the documentation of this file.

    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
    00010 #include <opal/buildopts.h>
    00011
    00012 #include <opal/rtpconn.h>
    00013
    00014
    00015 struct zrtp_profile_t;
    00016 struct zrtp_conn_ctx_t;
    00017 struct zrtp_stream_ctx_t;
    00018
    00019
    00020 class OpalZrtp_UDP : public SecureRTP_UDP
    00021 {
    00022     PCLASSINFO(OpalZrtp_UDP, SecureRTP_UDP);
    00023   public:
    00024     OpalZrtp_UDP(
    00025       const PString & encoding,
    00026       bool audio,
    00027 #if OPAL_RTP_AGGREGATE
    00028       PHandleAggregator * aggregator,
    00029 #endif
    00030       unsigned id,
    00031       PBoolean remoteIsNAT
    00032     );
    00033
    00034     virtual ~OpalZrtp_UDP();
    00035
    00036     virtual PBoolean WriteZrtpData(RTP_DataFrame & frame);
    00037
    00038     virtual SendReceiveStatus OnSendData(RTP_DataFrame & frame);
    00039     virtual SendReceiveStatus OnReceiveData(RTP_DataFrame & frame);
    00040     virtual SendReceiveStatus OnSendControl(RTP_ControlFrame & frame, PINDEX & len);
    00041     virtual SendReceiveStatus OnReceiveControl(RTP_ControlFrame & frame);
    00042     virtual DWORD GetOutgoingSSRC();
    00043
    00044   public:
    00045     zrtp_stream_ctx_t *zrtpStream;
    00046 };
    00047
    00048
    00049 class OpalZrtpSecurityMode : public OpalSecurityMode
    00050 {
    00051   PCLASSINFO(OpalZrtpSecurityMode, OpalSecurityMode);
    00052 };
    00053
    00054 class LibZrtpSecurityMode_Base : public OpalZrtpSecurityMode
    00055 {
    00056     PCLASSINFO(LibZrtpSecurityMode_Base, OpalZrtpSecurityMode);
    00057   public:
    00058     LibZrtpSecurityMode_Base();
    00059     ~LibZrtpSecurityMode_Base();
    00060
    00061     RTP_UDP * CreateRTPSession(
    00062       OpalRTPConnection & connection,
    00063       const RTP_Session::Params & options
    00064     );
    00065
    00066     PBoolean Open();
    00067
    00068     zrtp_profile_t *GetZrtpProfile();
    00069
    00070     zrtp_conn_ctx_t     * zrtpSession;
    00071
    00072   protected:
    00073     // last element of each array mush be 0
    00074     void Init(int *sas, int *pk, int *auth, int *cipher, int *hash);
    00075     zrtp_profile_t *profile;
    00076 };
    00077
    00078
    00079 #endif //__ZRTPUDP_H