BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
ca04d99
Branches
Tags
master
mips_sys
fw
udp.h
implement DHCP (not yet bug-free)
Stefan Schuermans
commited
ca04d99
at 2012-04-04 22:27:47
udp.h
Blame
History
Raw
#ifndef UDP_H #define UDP_H #include "ethernet.h" #include "ip.h" /// header of UDP packet struct udp_header { unsigned short src_port; unsigned short dest_port; unsigned short length; unsigned short chk; } __attribute__((packed)); /// UDP packet struct udp_packet { struct ethernet_header eth_hdr; struct ip_header ip_hdr; struct udp_header udp_hdr; } __attribute__((packed)); /// tick procedure - call every 200ms void udp_tick200(void); /** * @brief process a received UDP packet * @param[in] ptr pointer to data of packet * @param[in] sz size of packet */ void udp_recv(void *ptr, unsigned int sz); /** * @brief send a UDP packet * @param[in] ptr pointer to data of packet * @param[in] sz size of packet * * ptr must point to a udp_packet * with ip_hdr.proto ip_hdr.dest, udp_hdr.src_port and udp_hdr.dest_port * already initialized */ void udp_send(void *ptr, unsigned int sz); #endif // #ifdef UDP_H