BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
c2b0401
Branches
Tags
master
mips_sys
fw
icmp.h
added file headers
Stefan Schuermans
commited
c2b0401
at 2012-04-08 11:54:40
icmp.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 ICMP_H #define ICMP_H #include "ethernet.h" #include "ip.h" /// header of ICMP packet struct icmp_header { unsigned char type; unsigned char code; unsigned short chk; } __attribute__((packed)); /// ICMP packet struct icmp_packet { struct ethernet_header eth_hdr; struct ip_header ip_hdr; struct icmp_header icmp_hdr; } __attribute__((packed)); // header of ICMP echo request/reply packet struct icmp_echo_header { unsigned short id; unsigned short seq; } __attribute__((packed)); /// ICMP echo request/reply packet struct icmp_echo_packet { struct ethernet_header eth_hdr; struct ip_header ip_hdr; struct icmp_header icmp_hdr; struct icmp_echo_header echo_hdr; } __attribute__((packed)); /** * @brief process a received ICMP packet * @param[in] ptr pointer to data of packet * @param[in] sz size of packet */ void icmp_recv(void *ptr, unsigned int sz); #endif // #ifdef ICMP_H