*/
#include <common.h>
#include <command.h>
-#include <net.h> /* for print_IPaddr */
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_HERMES
print_str ("ethspeed", strmhz(buf, bd->bi_ethspeed));
#endif
- puts ("\nIP addr = "); print_IPaddr (bd->bi_ip_addr);
- printf ("\nbaudrate = %6ld bps\n", bd->bi_baudrate );
+ printf ("IP addr = %pI4\n", &bd->bi_ip_addr);
+ printf ("baudrate = %6ld bps\n", bd->bi_baudrate );
return 0;
}
for (i=0; i<6; ++i) {
printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
}
- puts ("\nip_addr = ");
- print_IPaddr (bd->bi_ip_addr);
- printf ("\nbaudrate = %ld bps\n", bd->bi_baudrate);
+ printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
+ printf ("baudrate = %ld bps\n", bd->bi_baudrate);
return 0;
}
for (i=0; i<6; ++i) {
printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
}
- puts ("\nip_addr = ");
- print_IPaddr (bd->bi_ip_addr);
+ printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
#endif
- printf ("\nbaudrate = %ld bps\n", bd->bi_baudrate);
+ printf ("baudrate = %ld bps\n", bd->bi_baudrate);
return 0;
}
for (i=0; i<6; ++i) {
printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
}
- puts ("\nip_addr = ");
- print_IPaddr (bd->bi_ip_addr);
+ printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
#endif
- printf ("\nbaudrate = %ld bps\n", (ulong)bd->bi_baudrate);
+ printf ("baudrate = %ld bps\n", (ulong)bd->bi_baudrate);
return 0;
}
for (i = 0; i < 6; ++i) {
printf("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
}
- puts("\nIP addr = ");
- print_IPaddr(bd->bi_ip_addr);
+ printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
#endif
- printf("\nbaudrate = %6ld bps\n", bd->bi_baudrate);
+ printf("baudrate = %6ld bps\n", bd->bi_baudrate);
return 0;
}
}
#endif
- puts ("\nip_addr = ");
- print_IPaddr (bd->bi_ip_addr);
+ printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
#endif
- printf ("\nbaudrate = %ld bps\n", bd->bi_baudrate);
+ printf ("baudrate = %ld bps\n", bd->bi_baudrate);
return 0;
}
puts("ethaddr =");
for (i = 0; i < 6; ++i)
printf("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
- puts("\nip_addr = ");
- print_IPaddr(bd->bi_ip_addr);
- printf("\nbaudrate = %d bps\n", bd->bi_baudrate);
+ printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
+ printf("baudrate = %d bps\n", bd->bi_baudrate);
return 0;
}
for (i=0; i<6; ++i) {
printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
}
- puts ("\nip_addr = ");
- print_IPaddr (bd->bi_ip_addr);
- printf ("\nbaudrate = %d bps\n", bd->bi_baudrate);
+ printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
+ printf ("baudrate = %d bps\n", bd->bi_baudrate);
return 0;
}
for (i=0; i<6; ++i) {
printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
}
- puts ( "\n"
- "ip_addr = ");
- print_IPaddr (bd->bi_ip_addr);
+ puts ( "\n" );
+ printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
#endif
- printf ("\n"
- "baudrate = %d bps\n", bd->bi_baudrate);
+ printf ("baudrate = %d bps\n", bd->bi_baudrate);
return 0;
}
/* Processes a received packet */
extern void NetReceive(volatile uchar *, int);
-/* Print an IP address on the console */
-extern void print_IPaddr (IPaddr_t);
-
/*
* The following functions are a bit ugly, but necessary to deal with
* alignment restrictions on ARM.
#ifdef DEBUG_BOOTP_EXT
puts ("[BOOTP] Received fields: \n");
- if (NetOurSubnetMask) {
- puts ("NetOurSubnetMask : ");
- print_IPaddr (NetOurSubnetMask);
- putc ('\n');
- }
+ if (NetOurSubnetMask)
+ printf ("NetOurSubnetMask : %pI4\n", &NetOurSubnetMask);
- if (NetOurGatewayIP) {
- puts ("NetOurGatewayIP : ");
- print_IPaddr (NetOurGatewayIP);
- putc ('\n');
- }
+ if (NetOurGatewayIP)
+ printf ("NetOurGatewayIP : %pI4", &NetOurGatewayIP);
if (NetBootFileSize) {
printf ("NetBootFileSize : %d\n", NetBootFileSize);
DhcpOptionsProcess((u8 *)&bp->bp_vend[4], bp);
BootpCopyNetParams(bp); /* Store net params from reply */
dhcp_state = BOUND;
- puts ("DHCP client bound to address ");
- print_IPaddr(NetOurIP);
- putc ('\n');
+ printf ("DHCP client bound to address %pI4\n", &NetOurIP);
/* Obey the 'autoload' setting */
if ((s = getenv("autoload")) != NULL) {
case ICMP_REDIRECT:
if (icmph->code != ICMP_REDIR_HOST)
return;
- puts (" ICMP Host Redirect to ");
- print_IPaddr(icmph->un.gateway);
- putc(' ');
+ printf (" ICMP Host Redirect to %pI4 ", &icmph->un.gateway);
return;
#if defined(CONFIG_CMD_PING)
case ICMP_ECHO_REPLY:
return htons(id);
}
-void print_IPaddr (IPaddr_t x)
-{
- char tmp[16];
-
- ip_to_string (x, tmp);
-
- puts (tmp);
-}
-
IPaddr_t getenv_IPaddr (char *var)
{
return (string_to_ip(getenv(var)));
printf ("Using %s device\n", eth_get_name());
#endif
- puts ("File transfer via NFS from server "); print_IPaddr (NfsServerIP);
- puts ("; our IP address is "); print_IPaddr (NetOurIP);
+ printf("File transfer via NFS from server %pI4"
+ "; our IP address is %pI4", &NfsServerIP, &NetOurIP);
/* Check if we need to send across this subnet */
if (NetOurGatewayIP && NetOurSubnetMask) {
IPaddr_t OurNet = NetOurIP & NetOurSubnetMask;
IPaddr_t ServerNet = NetServerIP & NetOurSubnetMask;
- if (OurNet != ServerNet) {
- puts ("; sending through gateway ");
- print_IPaddr (NetOurGatewayIP) ;
- }
+ if (OurNet != ServerNet)
+ printf("; sending through gateway %pI4", &NetOurGatewayIP);
}
printf ("\nFilename '%s/%s'.", nfs_path, nfs_filename);
#if defined(CONFIG_NET_MULTI)
printf ("Using %s device\n", eth_get_name());
#endif
- puts ("TFTP from server "); print_IPaddr (TftpServerIP);
- puts ("; our IP address is "); print_IPaddr (NetOurIP);
+ printf("TFTP from server %pI4"
+ "; our IP address is %pI4", &TftpServerIP, &NetOurIP);
/* Check if we need to send across this subnet */
if (NetOurGatewayIP && NetOurSubnetMask) {
IPaddr_t OurNet = NetOurIP & NetOurSubnetMask;
IPaddr_t ServerNet = TftpServerIP & NetOurSubnetMask;
- if (OurNet != ServerNet) {
- puts ("; sending through gateway ");
- print_IPaddr (NetOurGatewayIP) ;
- }
+ if (OurNet != ServerNet)
+ printf("; sending through gateway %pI4", &NetOurGatewayIP);
}
putc ('\n');