⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipa_type.h

📁 监控局域网上网
💻 H
字号:

#ifndef __IPA_TYPE_H__
#define __IPA_TYPE_H__

#define  SHOW_STEP "YES"

// 6 byte MAC Address
typedef struct mac_address 
{
	u_char byte1;
	u_char byte2;
	u_char byte3;
	u_char byte4;
	u_char byte5;
	u_char byte6;
} mac_address_t;

// 4 bytes IP address
typedef struct ip_address
{
	u_char byte1;
	u_char byte2;
	u_char byte3;
	u_char byte4;
}ip_address_t;

// 20 bytes IP Header
typedef struct ip_header
{
	u_char	      ver_ihl;        // Version (4 bits) + Internet header length (4 bits)
	u_char	      tos;            // Type of service 
	u_short	      tlen;           // Total length 
	u_short	      identification; // Identification
	u_short	      flags_fo;       // Flags (3 bits) + Fragment offset (13 bits)
	u_char	      ttl;            // Time to live
	u_char	      proto;          // Protocol
	u_short	      crc;            // Header checksum
	ip_address_t  saddr;	    // Source address
	ip_address_t  daddr;	    // Destination address
//      u_int	      op_pad;         // Option + Padding	-- NOT NEEDED!
}ip_header_t;


// 20 bytes TCP Header
typedef struct tcp_header 
{
	u_short sport;			// Source port
	u_short dport;			// Destination port
	u_int	seqnum;			// Sequence Number
	u_int	acknum;			// Acknowledgement number
	u_char	hlen;			// Header length
	u_char	flags;			// packet flags
	u_short win;			// Window size
	u_short crc;			// Header Checksum
	u_short urgptr;			// Urgent pointer...still don't know what this is...
}tcp_header_t;

typedef struct
{
	char    devname[8];
	u_char  mac_addr[6];
	u_int   ip_addr;	//网络字节顺序
} m_dev_t;	//头,任何一个请求或应答都包含这个头


typedef struct
{
	int	buflen;
	int	code  ;
} Header_t;	//头,任何一个请求或应答都包含这个头

typedef struct
{
	char	ip  [16];
	char	mac [18];
	char    name[32];
} IP_MAC_NAME_t;	//

typedef struct
{
	unsigned int ip;
	char	 mac[6];
} IP_MAC_t;	//

typedef struct
{
	mac_address_t srcmac ;
	ip_address_t  srcip  ;
	u_short       sport  ;
	mac_address_t destmac;
	ip_address_t  destip ; 
	u_short       dport  ;
	u_int         seqnum ;
	u_int         win    ;
} REQUEST_RESET_TCP_t;	//某个后置网关请求数据库中属于自己网关的MT短信;某个前置网关请求数据库中属于自己网关的MO短信

typedef struct
{
	char aline[60];
} ipline_t;


typedef struct
{
	char hexc;	
	char intc;
} chex2char_t;

typedef struct
{
	char WINDOWSUPDATE_ADDRESS[256];   //windowsupdate.microsoft.nsatc.net   ;for windowsupdate
	char SNIFFER_DEVICE       [16] ;   //eth0                                ;for sniffer
	char TCP_RESET_DEVICE     [16] ;   //eth0                                ;for tcp reset
	char IPA_LOG_LEVEL             ;   // 3                                  ;logs level
} ipa_conf_t;

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -