blob: 840df6246629739c6cb11ab580ac3690777f84cc [file] [log] [blame]
Alexandre Lision51140e12013-12-02 10:54:09 -05001/*
Alexandre Lisionddd731e2014-01-31 11:50:08 -05002 Copyright (C) 2006-2009 Werner Dittmann
Alexandre Lision51140e12013-12-02 10:54:09 -05003
4 This program is free software: you can redistribute it and/or modify
Alexandre Lisionddd731e2014-01-31 11:50:08 -05005 it under the terms of the GNU General Public License as published by
Alexandre Lision51140e12013-12-02 10:54:09 -05006 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 _ZRTPPACKETPING_H_
19#define _ZRTPPACKETPING_H_
20
21/**
22 * @file ZrtpPacketPing.h
23 * @brief The ZRTP Ping message
24 *
25 * @ingroup GNU_ZRTP
26 * @{
27 */
28
29#include <libzrtpcpp/ZrtpPacketBase.h>
30
31/**
32 * Implement the PingAck packet.
33 *
34 * The ZRTP simple message PingAck.
35 *
36 * @author Werner Dittmann <Werner.Dittmann@t-online.de>
37 */
38class __EXPORT ZrtpPacketPing : public ZrtpPacketBase {
39
40 protected:
41 Ping_t* pingHeader; ///< Point the the Ping message
42
43 public:
44 /// Creates a Ping message with default data
45 ZrtpPacketPing();
46
47 /// Creates a Ping message from received data
48 ZrtpPacketPing(uint8_t* data);
49
50 virtual ~ZrtpPacketPing();
51
52 /// Set ZRTP protocol version field, fixed ASCII character array
53 void setVersion(uint8_t *text) { memcpy(pingHeader->version, text,ZRTP_WORD_SIZE ); }
54
55 /// Get the endpoit hash, fixed byte array
56 uint8_t* getEpHash() { return pingHeader->epHash; }
57
58 private:
59 PingPacket_t data;
60};
61
62/**
63 * @}
64 */
65
66#endif // ZRTPPACKETCLEARACK
67