📄 dhcp.h
字号:
#include "sys.h"#define DHCP_REFRESH_INTERVAL 3600*4typedef struct{ Uint8 opcode; Uint8 hw_type; Uint8 hw_addrlen; Uint8 hop_count; Uint16 xid_h; Uint16 xid_l; Uint16 secnum; Uint16 flags; Uint16 clientip_h; Uint16 clientip_l; Uint16 yourip_h; Uint16 yourip_l; Uint16 serverip_h; Uint16 serverip_l; Uint16 gwip_h; Uint16 gwip_l; Uint8 clienthw_addr[16]; Uint8 server_hostname[64]; Uint8 boot_fileman[128]; Uint16 magic_cookie_h; Uint16 magic_cookie_l;} DHCP_HEADER;#define DHCP_SIZE sizeof(DHCP_HEADER)typedef struct{ Uint8 opcode; Uint8 len;} DHCP_OPT;#define DHCPOPT_SIZE sizeof(DHCP_OPT)void dhcp_sendack(Uint16 ip_h, Uint16 ip_l, Uint16 serverip_h, Uint16 serverip_l);void dhcp_getip(void);void dhcp_parse(DHCP_HEADER *dhcp_packet,Uint16 srcip_h,Uint16 srcip_l);#define DHCP_OFFSET (ETH_SIZE+IP_SIZE+UDP_SIZE)#define DHCPOPT_ROOT (DHCP_OFFSET+DHCP_SIZE)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -