Remove typedef and lower-case name
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
/* Codes for NOT_REACH */
#define ICMP_NOT_REACH_PORT 3 /* Port unreachable */
-typedef struct icmphdr {
+struct icmp_hdr {
uchar type;
uchar code;
ushort checksum;
} frag;
uchar data[0];
} un;
-} ICMP_t;
+};
+#define ICMP_HDR_SIZE (sizeof(struct icmp_hdr))
+#define IP_ICMP_HDR_SIZE (IP_HDR_SIZE + ICMP_HDR_SIZE)
/*
* Maximum packet size; used to allocate packet storage.
static void receive_icmp(struct ip_udp_hdr *ip, int len,
IPaddr_t src_ip, struct ethernet_hdr *et)
{
- ICMP_t *icmph = (ICMP_t *)&ip->udp_src;
+ struct icmp_hdr *icmph = (struct icmp_hdr *)&ip->udp_src;
switch (icmph->type) {
case ICMP_REDIRECT:
void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
{
- ICMP_t *icmph = (ICMP_t *)&(ip->udp_src);
+ struct icmp_hdr *icmph = (struct icmp_hdr *)&ip->udp_src;
IPaddr_t src_ip;
switch (icmph->type) {