ip.h
来自「实用的程序代码」· C头文件 代码 · 共 38 行
H
38 行
/* * IP Header File */#ifndef _IP_H#define _IP_H// ip header structurestruct xilnet_ip_hdr { unsigned char version:4, hdr_len:4; unsigned char tos; unsigned short total_len; unsigned short ident; unsigned short frag_off; unsigned char ttl; unsigned char prot; unsigned short check_sum; unsigned int src_ip; unsigned int dst_ip;};#define IP_VERSION 4 /* 4 for IPV4 */#define IP_HDR_LEN 5 /* no. of 32-bit words in header */#define IP_TOS 0x00 /* 0x00 is the tos val for tftp */#define IP_TOTAL_LEN 0x0220 /* 544 bytes is the max length of ip datagram for TFTP */#define IP_IDENT 0x006F /* 111 is the value for no fragmentation */#define IP_FRAG_OFF 0x0000 /* No fragmentation - 0x0000 */#define IP_TTL 0x20 /* 32 hops */#define IP_DADDR_BASE 16#define IP_SADDR_BASE 12 #endif /* _SYS_IP_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?