]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/glsdk-u-boot.git/commitdiff
net: cosmetic: Un-typedef ICMP_t
authorJoe Hershberger <joe.hershberger@ni.com>
Wed, 23 May 2012 07:58:09 +0000 (07:58 +0000)
committerJoe Hershberger <joe.hershberger@ni.com>
Wed, 23 May 2012 22:46:15 +0000 (17:46 -0500)
Remove typedef and lower-case name

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
include/net.h
net/net.c
net/ping.c

index eeea466d659442cefd30b71ee7869554e9069efb..fd19c42d12d695ced157c87a47714a45e36e216f 100644 (file)
@@ -298,7 +298,7 @@ struct arp_hdr {
 /* Codes for NOT_REACH */
 #define ICMP_NOT_REACH_PORT    3       /* Port unreachable             */
 
-typedef struct icmphdr {
+struct icmp_hdr {
        uchar           type;
        uchar           code;
        ushort          checksum;
@@ -314,8 +314,10 @@ typedef struct icmphdr {
                } 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.
index 6d342540438908b02074eadc5863684f51b48130..4cdd9cd0f278e12ae32c8c64d9fd88cc4cad8c68 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -825,7 +825,7 @@ static inline struct ip_udp_hdr *NetDefragment(struct ip_udp_hdr *ip, int *lenp)
 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:
index 04a594cf53ae9944576fdc7ce525beb1dfa44d6b..3102521c064d14ed5d2ba71d25639694af984069 100644 (file)
@@ -100,7 +100,7 @@ void ping_start(void)
 
 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) {