BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
902aa40
Branches
Tags
master
mips_sys
fw
udp.h
replace email address in headers with blinkenarea address
Stefan Schuermans
commited
902aa40
at 2012-05-21 17:42:50
udp.h
Blame
History
Raw
/* MIPS I system * Copyright 2011-2012 Stefan Schuermans <stefan@blinkenarea.org> * Copyleft GNU public license V2 or later * http://www.gnu.org/copyleft/gpl.html */ #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