[minip] Correct ip ordering in status, add IPV4_SPLIT macro
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <lib/pktbuf.h>
|
||||
|
||||
#define IPV4(a,b,c,d) (((a)&0xFF)|(((b)&0xFF)<<8)|(((c)&0xFF)<<16)|(((d)&0xFF)<<24))
|
||||
#define IPV4_SPLIT(a) (a & 0xFF), ((a >> 8) & 0xFF), ((a >> 16) & 0xFF), ((a >> 24) & 0xFF)
|
||||
#define IPV4_BCAST (0xFFFFFFFF)
|
||||
#define IPV4_NONE (0)
|
||||
|
||||
|
||||
@@ -95,8 +95,7 @@ minip_usage:
|
||||
uint32_t ipaddr = minip_get_ipaddr();
|
||||
|
||||
printf("hostname: %s\n", minip_get_hostname());
|
||||
printf("ip: %u.%u.%u.%u\n",
|
||||
ipaddr >> 24, (ipaddr >> 16) & 0xFF, (ipaddr >> 8) & 0xFF, (ipaddr & 0xFF));;
|
||||
printf("ip: %u.%u.%u.%u\n", IPV4_SPLIT(ipaddr));
|
||||
}
|
||||
break;
|
||||
case 't': {
|
||||
|
||||
Reference in New Issue
Block a user