BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
ca04d99
Branches
Tags
master
mips_sys
fw
dhcp.h
implement DHCP (not yet bug-free)
Stefan Schuermans
commited
ca04d99
at 2012-04-04 22:27:47
dhcp.h
Blame
History
Raw
#ifndef DHCP_H #define DHCP_H #include "ethernet.h" #include "ip.h" #include "udp.h" /// header of DHCP packet struct dhcp_header { unsigned char op; unsigned char h_type; unsigned char h_len; unsigned char h_ops; unsigned long x_id; unsigned short secs; unsigned short flags; unsigned char ci_addr[4]; unsigned char yi_addr[4]; unsigned char si_addr[4]; unsigned char gi_addr[4]; unsigned char ch_addr[16]; unsigned char s_name[64]; unsigned char file[128]; unsigned long m_cookie; } __attribute__((packed)); /// DHCP packet struct dhcp_packet { struct ethernet_header eth_hdr; struct ip_header ip_hdr; struct udp_header udp_hdr; struct dhcp_header dhcp_hdr; } __attribute__((packed)); /// tick procedure - call every 200ms void dhcp_tick200(void); /** * @brief process a received DHCP packet * @param[in] ptr pointer to data of packet * @param[in] sz size of packet */ void dhcp_recv(void *ptr, unsigned int sz); #endif // #ifdef DHCP_H