资源说明:构造等都写好了,你只需使用即可
#define ICMP 0x01
#define IGMP 0x02
#define TCP 0x06
#define UDP 0x11
typedef struct lp_interface
{
char in_protocol;
char in_destaddr[16];
UINT in_destport;
}LP_INTER;
//_________________________________________________________________
class CSendIpPack
{
public:
CSendIpPack();
virtual ~CSendIpPack();
LP_INTER m_p;
UINT SendIP(DWORD m_sleep,int m_speed);
UINT SendIP(int m_speed);
UINT SendIP();
protected:
LPSTR GetLocalIpAddr();
USHORT CheckSum(USHORT *buffer, int size);
//////////////////////////////////////
protected:
typedef struct ip_hdr
{
unsigned char ip_verlen;
unsigned char ip_tos;
unsigned short ip_totallength;
unsigned short ip_id;
unsigned short ip_offset;
unsigned char ip_ttl;
unsigned char ip_protocol;
unsigned short ip_checksum;
unsigned int ip_srcaddr;
unsigned int ip_destaddr;
}IP_HDR;
typedef struct udp_hdr
{
unsigned short src_portno;
unsigned short dst_portno;
unsigned short udp_length;
unsigned short udp_checksum;
}UDP_HDR;
};
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。