BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
00d70be
Branches
Tags
master
mips_sys
fw
icmp.h
implemented IP + ICMP, fixed ARP (padding overwriting stack)
Stefan Schuermans
commited
00d70be
at 2012-03-24 13:58:46
icmp.h
Blame
History
Raw
#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)); /// ICMP packet with padding ETHERNET_PAD(icmp_packet); // 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)); /// ICMP echo request/reply packet with padding ETHERNET_PAD(icmp_echo_packet); /** * @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