?? ip.h
字號:
#ifndef _IP_H
#define _IP_H
#include "types.h"
#define INADDR_BROADCAST (ULONG)0xffffffff
#define ETHERTYPE_IP 0x0008 /* IP protocol */
#define IPPROTO_IP 0 /* Dummy for IP. */
#define IPPROTO_ICMP 1 /* Control message protocol. */
#define IPPROTO_TCP 6 /* Transmission control protocol. */
#define IPPROTO_UDP 17 /* User datagram protocol. */
#define IPVERSION 4 /* IP protocol version. */
#define IP_DF 0x4000 /* Don't fragment flag. */
#define IP_MF 0x2000 /* More fragments flag. */
#define IP_OFFMASK 0x1fff /* Mask for fragmenting bits. */
struct IPHDR{
UCHAR ip_hl:4, /* Header length. */
ip_v:4; /* Version. */
UCHAR ip_tos; /* Type of service. */
short ip_len; /* Total length. */
USHORT ip_id; /* Identification. */
short ip_off; /* Fragment offset field. */
UCHAR ip_ttl; /* Time to live. */
UCHAR ip_p; /* Protocol. */
USHORT ip_sum; /* Checksum. */
ULONG ip_src; /* Source IP address. */
ULONG ip_dst; /* Destination IP address. */
};
extern USHORT IpChkSum(USHORT *buf, USHORT count);
extern int IpInput(UCHAR proto, USHORT tms);
extern int IpOutput(ULONG dst, UCHAR proto, USHORT len);
#endif /* _IP_H */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -