00001 #include "Headers.h"
00002 #include "PacketIp.h"
00003
00004 CPacketIp::CPacketIp(
00005 CAddress src,
00006 CAddress dst,
00007 __byte ttl,
00008 CPacket* payload
00009 ) : CPacket(PACKET_IP_HEADER + (payload?payload->Size():0), payload, payload?payload->Tos():PACKET_TOS_LOW)
00010 {
00011 this->src = src;
00012 this->dst = dst;
00013 this->ttl = ttl;
00014 }
00015
00016 CPacket* CPacketIp::Copy()
00017 {
00018 CPacket* packet = new CPacketIp(
00019 this->src,
00020 this->dst,
00021 this->ttl,
00022 this->payload->Copy());
00023
00024 return packet;
00025 }