Alexandre Lision | 51140e1 | 2013-12-02 10:54:09 -0500 | [diff] [blame] | 1 | /* |
| 2 | Copyright (C) 2006-2007 Werner Dittmann |
| 3 | |
| 4 | This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation, either version 3 of the License, or |
| 7 | (at your option) any later version. |
| 8 | |
| 9 | This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ |
| 17 | |
| 18 | #ifndef _ZRTPPACKETGOCLEAR_H_ |
| 19 | #define _ZRTPPACKETGOCLEAR_H_ |
| 20 | |
| 21 | /** |
| 22 | * @file ZrtpPacketGoClear.h |
| 23 | * @brief The ZRTP GoClear message |
| 24 | * |
| 25 | * GNU ZRTP does not implement GoClear feature |
| 26 | * @ingroup GNU_ZRTP |
| 27 | * @{ |
| 28 | */ |
| 29 | |
| 30 | #include <libzrtpcpp/ZrtpPacketBase.h> |
| 31 | |
| 32 | /** |
| 33 | * Implement the GoClear packet. |
| 34 | * |
| 35 | * The ZRTP message GoClear. The implementation sends this |
| 36 | * to order the peer to switch to clear mode (non-SRTP mode). |
| 37 | * |
| 38 | * @author Werner Dittmann <Werner.Dittmann@t-online.de> |
| 39 | */ |
| 40 | |
| 41 | class __EXPORT ZrtpPacketGoClear : public ZrtpPacketBase { |
| 42 | |
| 43 | protected: |
| 44 | GoClear_t* clearHeader; |
| 45 | |
| 46 | public: |
| 47 | /// Creates a GoCLear packet with default data |
| 48 | ZrtpPacketGoClear(); |
| 49 | |
| 50 | /// Creates a GoClear packet from received data |
| 51 | ZrtpPacketGoClear(uint8_t* data); |
| 52 | |
| 53 | virtual ~ZrtpPacketGoClear(); |
| 54 | |
| 55 | /// Not used |
| 56 | const uint8_t* getClearHmac() { return clearHeader->clearHmac; }; |
| 57 | |
| 58 | /// Not used |
| 59 | void setClearHmac(uint8_t *text) { memcpy(clearHeader->clearHmac, text, 32); }; |
| 60 | |
| 61 | /// Not used |
| 62 | void clrClearHmac() { memset(clearHeader->clearHmac, 0, 32); }; |
| 63 | |
| 64 | private: |
| 65 | GoClearPacket_t data; |
| 66 | }; |
| 67 | |
| 68 | /** |
| 69 | * @} |
| 70 | */ |
| 71 | #endif // ZRTPPACKETGOCLEAR |
| 72 | |