00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _ZRTPCALLBACK_H_
00019 #define _ZRTPCALLBACK_H_
00020
00021 #include <string>
00022 #include <libzrtpcpp/ZrtpPacketBase.h>
00023
00067 enum MessageSeverity {
00068 Info = 1,
00069 Warning,
00070 Error,
00071 Alert
00072 };
00073
00089 typedef enum {
00090 Responder = 1,
00091 Initiator
00092 } Role;
00093
00103 typedef struct srtpSecrets {
00104 const uint8_t* keyInitiator;
00105 int32_t initKeyLen;
00106 const uint8_t* saltInitiator;
00107 int32_t initSaltLen;
00108 const uint8_t* keyResponder;
00109 int32_t respKeyLen;
00110 const uint8_t* saltResponder;
00111 int32_t respSaltLen;
00112 int32_t srtpAuthTagLen;
00113 std::string sas;
00114 Role role;
00115 } SrtpSecret_t;
00116
00117 enum EnableSecurity {
00118 ForReceiver = 1,
00119 ForSender = 2
00120 };
00121
00122
00123 class ZrtpCallback {
00124
00125 public:
00126 virtual ~ZrtpCallback() {};
00140 virtual int32_t sendDataZRTP(const uint8_t* data, int32_t length) =0;
00141
00150 virtual int32_t activateTimer(int32_t time) =0;
00151
00158 virtual int32_t cancelTimer() =0;
00159
00174 virtual void sendInfo(MessageSeverity severity, char* msg) =0;
00175
00201 virtual bool srtpSecretsReady(SrtpSecret_t* secrets, EnableSecurity part) =0;
00202
00209 virtual void srtpSecretsOff(EnableSecurity part) =0;
00210
00219 virtual void srtpSecretsOn(const char* c, const char* s) =0;
00220
00229 virtual void handleGoClear() =0;
00230
00243 virtual void zrtpNegotiationFailed(MessageSeverity severity, char* msg) =0;
00244
00252 virtual void zrtpNotSuppOther() =0;
00253 };
00254
00255 #endif // ZRTPCALLBACK
00256