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

ZrtpPacketCommit.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 /*
00019  * Authors: Werner Dittmann <Werner.Dittmann@t-online.de>
00020  */
00021 #ifndef _ZRTPPACKETCOMMIT_H_
00022 #define _ZRTPPACKETCOMMIT_H_
00023 
00024 #include <libzrtpcpp/ZrtpPacketBase.h>
00025 
00037 class ZrtpPacketCommit : public ZrtpPacketBase {
00038 
00039  protected:
00040     Commit_t* commitHeader;
00041 
00042  public:
00043     ZrtpPacketCommit();          /* Creates a Commit packet with default data */
00044     ZrtpPacketCommit(uint8_t* data); /* Creates a Commit packet from received data */
00045     virtual ~ZrtpPacketCommit();
00046 
00047     uint8_t* getHashType()    { return commitHeader->hash; };
00048     uint8_t* getCipherType()  { return commitHeader->cipher; };
00049     uint8_t* getAuthLen()     { return commitHeader->authlengths; };
00050     uint8_t* getPubKeysType() { return commitHeader->pubkey; };
00051     uint8_t* getSasType()     { return commitHeader->sas; };
00052     uint8_t* getZid()         { return commitHeader->zid; };
00053     uint8_t* getHvi()         { return commitHeader->hvi; };
00054 
00055     void setHashType(uint8_t* text)    { memcpy(commitHeader->hash, text, ZRTP_WORD_SIZE); };
00056     void setCipherType(uint8_t* text)  { memcpy(commitHeader->cipher, text, ZRTP_WORD_SIZE); };
00057     void setAuthLen(uint8_t* text)     { memcpy(commitHeader->authlengths, text, ZRTP_WORD_SIZE); };
00058     void setPubKeyType(uint8_t* text)  { memcpy(commitHeader->pubkey, text, ZRTP_WORD_SIZE); };
00059     void setSasType(uint8_t* text)     { memcpy(commitHeader->sas, text, ZRTP_WORD_SIZE); };
00060     void setZid(uint8_t* text)         { memcpy(commitHeader->zid, text, sizeof(commitHeader->zid)); };
00061     void setHvi(uint8_t* text)         { memcpy(commitHeader->hvi, text, sizeof(commitHeader->hvi)); };
00062 
00063  private:
00064      CommitPacket_t data;
00065 };
00066 
00067 #endif // ZRTPPACKETCOMMIT
00068 

© sourcejam.com 2005-2008