BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
c2b0401
Branches
Tags
master
mips_sys
fw
udp.h
added file headers
Stefan Schuermans
commited
c2b0401
at 2012-04-08 11:54:40
udp.h
Blame
History
Raw
/* MIPS I system * Copyright 2011-2012 Stefan Schuermans <stefan@schuermans.info> * 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