www.pudn.com > SnifferPro.rar > IPGram.h


// IPGram.h: interface for the IPGram class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_IPGRAM_H__51ED0E85_B3FC_403B_9228_815E6DD72C47__INCLUDED_) 
#define AFX_IPGRAM_H__51ED0E85_B3FC_403B_9228_815E6DD72C47__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
class IPGram   
{ 
public: 
	int	version;	//版本 
	int IHL;	//头部长度 
	int servicetype;	//服务类型 type of service 
	int precedence;	//优先级 
	bool delay;	//延迟 
	bool throughtput;	//吞吐量 
	bool reliability;	//可靠性 
	unsigned int totallen;	//总长total length 
	int identification;	//标识 
	bool DF;	//不要分段 
	bool MF;	//还有进一步的分段 
	int fragoffset;	//分段偏移fragment offset 
	int TTL;	//生命期time to live 
	int protocol;	//协议,如TCP,UDP 
	unsigned int checksum;	//头部校验和 
	long srcaddr;	//源IP地址 
	long destaddr;	//目的IP地址 
	int optlen;	//选项长度 
	unsigned char *options;	//选项内容 
	int datalen;	//数据长度 
	unsigned char *data;	//数据内容 
 
	IPGram(); 
	IPGram(const unsigned char* buf,int buflen); 
	virtual ~IPGram(); 
	CString GetService(); 
	void GetDestAddr(char *str); 
	CString GetDestAddr(); 
	void GetSrcAddr(char *str); 
	CString GetSrcAddr(); 
	CString GetID(); 
}; 
 
#endif // !defined(AFX_IPGRAM_H__51ED0E85_B3FC_403B_9228_815E6DD72C47__INCLUDED_)