Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

ZrtpCallback.h

Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2006-2007 Werner Dittmann
00003 
00004   This program is free software: you can redistribute it and/or modify
00005   it under the terms of the GNU General Public License as published by
00006   the Free Software Foundation, either version 3 of the License, or
00007   (at your option) any later version.
00008 
00009   This program is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012   GNU General Public License for more details.
00013 
00014   You should have received a copy of the GNU General Public License
00015   along with this program.  If not, see <http://www.gnu.org/licenses/>.
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 

© sourcejam.com 2005-2008