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 * @author: Werner Dittmann <Werner.Dittmann@t-online.de> 00020 */ 00021 00022 #include <libzrtpcpp/ZrtpPacketCommit.h> 00023 00024 ZrtpPacketCommit::ZrtpPacketCommit() { 00025 DEBUGOUT((fprintf(stdout, "Creating commit packet without data\n"))); 00026 00027 zrtpHeader = &data.hdr; // the standard header 00028 commitHeader = &data.commit; 00029 00030 setZrtpId(); 00031 setLength((sizeof (CommitPacket_t) / ZRTP_WORD_SIZE) - 1); 00032 setMessageType((uint8_t*)CommitMsg); 00033 } 00034 00035 ZrtpPacketCommit::ZrtpPacketCommit(uint8_t *data) { 00036 DEBUGOUT((fprintf(stdout, "Creating commit packet from data\n"))); 00037 zrtpHeader = (zrtpPacketHeader_t *)&((CommitPacket_t *)data)->hdr; // the standard header 00038 commitHeader = (Commit_t *)&((CommitPacket_t *)data)->commit; 00039 } 00040 00041 ZrtpPacketCommit::~ZrtpPacketCommit() { 00042 DEBUGOUT((fprintf(stdout, "Deleting commit packet: alloc: %x\n", allocated))); 00043 }