Alex Bikfalvi
SimStream Documentation
PacketIp.h
00001 #pragma once 00002 00003 #include "Packet.h" 00004 #include "Address.h" 00005 00006 #define PACKET_IP_HEADER 160 00007 00008 class CPacketIp : public CPacket 00009 { 00010 protected: 00011 CAddress src; 00012 CAddress dst; 00013 __byte ttl; 00014 00015 public: 00016 CPacketIp( 00017 CAddress src, 00018 CAddress dst, 00019 __byte ttl, 00020 CPacket* payload 00021 ); 00022 virtual ~CPacketIp() { } 00023 00024 inline CAddress Src() { return this->src; } 00025 inline CAddress Dst() { return this->dst; } 00026 inline __byte Ttl() { return this->ttl; } 00027 00028 inline void DecTtl() { this->ttl--; } 00029 00030 virtual inline EPacketType Type() { return PACKET_TYPE_IP; } 00031 virtual CPacket* Copy(); 00032 };
Last updated: February 8, 2011