From 85848f0377bc9f8703f2b07db51bd1eb88e2b3ba Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Sun, 22 Mar 2015 17:09:09 -0500 Subject: cmd: net: Clean up return codes The return codes in common/cmd_net.c had a number of inconsistencies. Update them to all use the enum from command.h Signed-off-by: Joe Hershberger Reviewed-by: Simon Glass --- common/cmd_net.c | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'common/cmd_net.c') diff --git a/common/cmd_net.c b/common/cmd_net.c index 09489d404e3..3f52edc805d 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -44,10 +44,7 @@ U_BOOT_CMD( #ifdef CONFIG_CMD_TFTPPUT int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - int ret; - - ret = netboot_common(TFTPPUT, cmdtp, argc, argv); - return ret; + return netboot_common(TFTPPUT, cmdtp, argc, argv); } U_BOOT_CMD( @@ -217,7 +214,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, if (strict_strtoul(argv[1], 16, &save_addr) < 0 || strict_strtoul(argv[2], 16, &save_size) < 0) { printf("Invalid address/size\n"); - return cmd_usage(cmdtp); + return CMD_RET_USAGE; } copy_filename(BootFile, argv[3], sizeof(BootFile)); break; @@ -230,7 +227,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, if ((size = NetLoop(proto)) < 0) { bootstage_error(BOOTSTAGE_ID_NET_NETLOOP_OK); - return 1; + return CMD_RET_FAILURE; } bootstage_mark(BOOTSTAGE_ID_NET_NETLOOP_OK); @@ -240,7 +237,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, /* done if no file was loaded (no errors though) */ if (size == 0) { bootstage_error(BOOTSTAGE_ID_NET_LOADED); - return 0; + return CMD_RET_SUCCESS; } /* flush cache */ @@ -250,10 +247,10 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, rcode = bootm_maybe_autostart(cmdtp, argv[0]); - if (rcode < 0) - bootstage_error(BOOTSTAGE_ID_NET_DONE_ERR); - else + if (rcode == CMD_RET_SUCCESS) bootstage_mark(BOOTSTAGE_ID_NET_DONE); + else + bootstage_error(BOOTSTAGE_ID_NET_DONE_ERR); return rcode; } @@ -261,7 +258,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc < 2) - return -1; + return CMD_RET_USAGE; NetPingIP = string_to_ip(argv[1]); if (NetPingIP == 0) @@ -269,12 +266,12 @@ static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (NetLoop(PING) < 0) { printf("ping failed; host %s is not alive\n", argv[1]); - return 1; + return CMD_RET_FAILURE; } printf("host %s is alive\n", argv[1]); - return 0; + return CMD_RET_SUCCESS; } U_BOOT_CMD( @@ -313,12 +310,12 @@ int do_cdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) r = NetLoop(CDP); if (r < 0) { printf("cdp failed; perhaps not a CISCO switch?\n"); - return 1; + return CMD_RET_FAILURE; } cdp_update_env(); - return 0; + return CMD_RET_SUCCESS; } U_BOOT_CMD( @@ -337,13 +334,13 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) NetNtpServerIP = getenv_IPaddr("ntpserverip"); if (NetNtpServerIP == 0) { printf("ntpserverip not set\n"); - return (1); + return CMD_RET_FAILURE; } } else { NetNtpServerIP = string_to_ip(argv[1]); if (NetNtpServerIP == 0) { printf("Bad NTP server IP address\n"); - return (1); + return CMD_RET_FAILURE; } } @@ -356,10 +353,10 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (NetLoop(SNTP) < 0) { printf("SNTP failed: host %pI4 not responding\n", &NetNtpServerIP); - return 1; + return CMD_RET_FAILURE; } - return 0; + return CMD_RET_SUCCESS; } U_BOOT_CMD( @@ -389,7 +386,7 @@ int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ if (strlen(argv[1]) >= 255) { printf("dns error: hostname too long\n"); - return 1; + return CMD_RET_FAILURE; } NetDNSResolve = argv[1]; @@ -401,10 +398,10 @@ int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (NetLoop(DNS) < 0) { printf("dns lookup of %s failed, check setup\n", argv[1]); - return 1; + return CMD_RET_FAILURE; } - return 0; + return CMD_RET_SUCCESS; } U_BOOT_CMD( @@ -422,7 +419,7 @@ static int do_link_local(cmd_tbl_t *cmdtp, int flag, int argc, char tmp[22]; if (NetLoop(LINKLOCAL) < 0) - return 1; + return CMD_RET_FAILURE; NetOurGatewayIP = 0; ip_to_string(NetOurGatewayIP, tmp); @@ -435,7 +432,7 @@ static int do_link_local(cmd_tbl_t *cmdtp, int flag, int argc, setenv("ipaddr", tmp); setenv("llipaddr", tmp); /* store this for next time */ - return 0; + return CMD_RET_SUCCESS; } U_BOOT_CMD( -- cgit v1.2.3 From 049a95a7759c0e384c1fc7b8575d968d56a33997 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 8 Apr 2015 01:41:01 -0500 Subject: net: cosmetic: Change IPaddr_t to struct in_addr This patch is simply clean-up to make the IPv4 type that is used match what Linux uses. It also attempts to move all variables that are IP addresses use good naming instead of CamelCase. No functional change. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- common/cmd_net.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'common/cmd_net.c') diff --git a/common/cmd_net.c b/common/cmd_net.c index 3f52edc805d..53760a2c935 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -114,13 +114,13 @@ static void netboot_update_env(void) { char tmp[22]; - if (NetOurGatewayIP) { - ip_to_string(NetOurGatewayIP, tmp); + if (net_gateway.s_addr) { + ip_to_string(net_gateway, tmp); setenv("gatewayip", tmp); } - if (NetOurSubnetMask) { - ip_to_string(NetOurSubnetMask, tmp); + if (net_netmask.s_addr) { + ip_to_string(net_netmask, tmp); setenv("netmask", tmp); } @@ -130,8 +130,8 @@ static void netboot_update_env(void) if (NetOurRootPath[0]) setenv("rootpath", NetOurRootPath); - if (NetOurIP) { - ip_to_string(NetOurIP, tmp); + if (net_ip.s_addr) { + ip_to_string(net_ip, tmp); setenv("ipaddr", tmp); } #if !defined(CONFIG_BOOTP_SERVERIP) @@ -139,18 +139,18 @@ static void netboot_update_env(void) * Only attempt to change serverip if net/bootp.c:BootpCopyNetParams() * could have set it */ - if (NetServerIP) { - ip_to_string(NetServerIP, tmp); + if (net_server_ip.s_addr) { + ip_to_string(net_server_ip, tmp); setenv("serverip", tmp); } #endif - if (NetOurDNSIP) { - ip_to_string(NetOurDNSIP, tmp); + if (net_dns_server.s_addr) { + ip_to_string(net_dns_server, tmp); setenv("dnsip", tmp); } #if defined(CONFIG_BOOTP_DNS2) - if (NetOurDNS2IP) { - ip_to_string(NetOurDNS2IP, tmp); + if (net_dns_server2.s_addr) { + ip_to_string(net_dns_server2, tmp); setenv("dnsip2", tmp); } #endif @@ -166,8 +166,8 @@ static void netboot_update_env(void) #endif #if defined(CONFIG_CMD_SNTP) \ && defined(CONFIG_BOOTP_NTPSERVER) - if (NetNtpServerIP) { - ip_to_string(NetNtpServerIP, tmp); + if (net_ntp_server.s_addr) { + ip_to_string(net_ntp_server, tmp); setenv("ntpserverip", tmp); } #endif @@ -260,8 +260,8 @@ static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (argc < 2) return CMD_RET_USAGE; - NetPingIP = string_to_ip(argv[1]); - if (NetPingIP == 0) + net_ping_ip = string_to_ip(argv[1]); + if (net_ping_ip.s_addr == 0) return CMD_RET_USAGE; if (NetLoop(PING) < 0) { @@ -331,14 +331,14 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) char *toff; if (argc < 2) { - NetNtpServerIP = getenv_IPaddr("ntpserverip"); - if (NetNtpServerIP == 0) { + net_ntp_server = getenv_ip("ntpserverip"); + if (net_ntp_server.s_addr == 0) { printf("ntpserverip not set\n"); return CMD_RET_FAILURE; } } else { - NetNtpServerIP = string_to_ip(argv[1]); - if (NetNtpServerIP == 0) { + net_ntp_server = string_to_ip(argv[1]); + if (net_ntp_server.s_addr == 0) { printf("Bad NTP server IP address\n"); return CMD_RET_FAILURE; } @@ -352,7 +352,7 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (NetLoop(SNTP) < 0) { printf("SNTP failed: host %pI4 not responding\n", - &NetNtpServerIP); + &net_ntp_server); return CMD_RET_FAILURE; } @@ -421,14 +421,14 @@ static int do_link_local(cmd_tbl_t *cmdtp, int flag, int argc, if (NetLoop(LINKLOCAL) < 0) return CMD_RET_FAILURE; - NetOurGatewayIP = 0; - ip_to_string(NetOurGatewayIP, tmp); + net_gateway.s_addr = 0; + ip_to_string(net_gateway, tmp); setenv("gatewayip", tmp); - ip_to_string(NetOurSubnetMask, tmp); + ip_to_string(net_netmask, tmp); setenv("netmask", tmp); - ip_to_string(NetOurIP, tmp); + ip_to_string(net_ip, tmp); setenv("ipaddr", tmp); setenv("llipaddr", tmp); /* store this for next time */ -- cgit v1.2.3 From 1411157d857840da444db63f6ba3a3a658a99c5b Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 8 Apr 2015 01:41:02 -0500 Subject: net: cosmetic: Fixup var names related to boot file The variables around the bootfile were inconsistent and used CamelCase. Update them to make the code more readable. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- common/cmd_net.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'common/cmd_net.c') diff --git a/common/cmd_net.c b/common/cmd_net.c index 53760a2c935..d75718ce501 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -201,11 +201,13 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, if (end == (argv[1] + strlen(argv[1]))) load_addr = addr; else - copy_filename(BootFile, argv[1], sizeof(BootFile)); + copy_filename(net_boot_file_name, argv[1], + sizeof(net_boot_file_name)); break; case 3: load_addr = simple_strtoul(argv[1], NULL, 16); - copy_filename(BootFile, argv[2], sizeof(BootFile)); + copy_filename(net_boot_file_name, argv[2], + sizeof(net_boot_file_name)); break; @@ -216,7 +218,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, printf("Invalid address/size\n"); return CMD_RET_USAGE; } - copy_filename(BootFile, argv[3], sizeof(BootFile)); + copy_filename(net_boot_file_name, argv[3], + sizeof(net_boot_file_name)); break; #endif default: -- cgit v1.2.3 From 586cbe51ab8ef357bcf3a52c6885ab00bc7293dd Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 8 Apr 2015 01:41:03 -0500 Subject: net: cosmetic: Fixup var names for DHCP strings Remove CamelCase variable naming. Move the definition to the same compilation unit as the primary use. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- common/cmd_net.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'common/cmd_net.c') diff --git a/common/cmd_net.c b/common/cmd_net.c index d75718ce501..87c4ed112b1 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -124,11 +124,11 @@ static void netboot_update_env(void) setenv("netmask", tmp); } - if (NetOurHostName[0]) - setenv("hostname", NetOurHostName); + if (net_hostname[0]) + setenv("hostname", net_hostname); - if (NetOurRootPath[0]) - setenv("rootpath", NetOurRootPath); + if (net_root_path[0]) + setenv("rootpath", net_root_path); if (net_ip.s_addr) { ip_to_string(net_ip, tmp); @@ -154,8 +154,8 @@ static void netboot_update_env(void) setenv("dnsip2", tmp); } #endif - if (NetOurNISDomain[0]) - setenv("domain", NetOurNISDomain); + if (net_nis_domain[0]) + setenv("domain", net_nis_domain); #if defined(CONFIG_CMD_SNTP) \ && defined(CONFIG_BOOTP_TIMEOFFSET) -- cgit v1.2.3 From 6aede5b750e342c3293ec1d87c4dbb9376280bbe Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 8 Apr 2015 01:41:14 -0500 Subject: net: cosmetic: Clean up CDP variables and functions Make a thorough pass through all variables and function names contained within cdp.c and remove CamelCase and improve naming. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- common/cmd_net.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'common/cmd_net.c') diff --git a/common/cmd_net.c b/common/cmd_net.c index 87c4ed112b1..1deebf2b876 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -290,18 +290,19 @@ static void cdp_update_env(void) { char tmp[16]; - if (CDPApplianceVLAN != htons(-1)) { - printf("CDP offered appliance VLAN %d\n", ntohs(CDPApplianceVLAN)); - VLAN_to_string(CDPApplianceVLAN, tmp); + if (cdp_appliance_vlan != htons(-1)) { + printf("CDP offered appliance VLAN %d\n", + ntohs(cdp_appliance_vlan)); + VLAN_to_string(cdp_appliance_vlan, tmp); setenv("vlan", tmp); - NetOurVLAN = CDPApplianceVLAN; + NetOurVLAN = cdp_appliance_vlan; } - if (CDPNativeVLAN != htons(-1)) { - printf("CDP offered native VLAN %d\n", ntohs(CDPNativeVLAN)); - VLAN_to_string(CDPNativeVLAN, tmp); + if (cdp_native_vlan != htons(-1)) { + printf("CDP offered native VLAN %d\n", ntohs(cdp_native_vlan)); + VLAN_to_string(cdp_native_vlan, tmp); setenv("nvlan", tmp); - NetOurNativeVLAN = CDPNativeVLAN; + NetOurNativeVLAN = cdp_native_vlan; } } -- cgit v1.2.3 From 786eac5f9d0a9c30c2aceaededc9170a9dfb0197 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 8 Apr 2015 01:41:15 -0500 Subject: net: cosmetic: Clean up DNS variables and functions Make a thorough pass through all variables and function names contained within dns.c and remove CamelCase and improve naming. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- common/cmd_net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/cmd_net.c') diff --git a/common/cmd_net.c b/common/cmd_net.c index 1deebf2b876..0270ac371de 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -393,12 +393,12 @@ int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return CMD_RET_FAILURE; } - NetDNSResolve = argv[1]; + net_dns_resolve = argv[1]; if (argc == 3) - NetDNSenvvar = argv[2]; + net_dns_env_var = argv[2]; else - NetDNSenvvar = NULL; + net_dns_env_var = NULL; if (NetLoop(DNS) < 0) { printf("dns lookup of %s failed, check setup\n", argv[1]); -- cgit v1.2.3 From 4fd5055f59eaf6b5374ceedd924a17453e18a798 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 8 Apr 2015 01:41:17 -0500 Subject: net: cosmetic: Clean up cmd_net variables and functions Make a thorough pass through all variables and function names contained within common/cmd_net.c and remove CamelCase and improve naming. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- common/cmd_net.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'common/cmd_net.c') diff --git a/common/cmd_net.c b/common/cmd_net.c index 0270ac371de..a672d77d495 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -157,15 +157,13 @@ static void netboot_update_env(void) if (net_nis_domain[0]) setenv("domain", net_nis_domain); -#if defined(CONFIG_CMD_SNTP) \ - && defined(CONFIG_BOOTP_TIMEOFFSET) +#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET) if (NetTimeOffset) { sprintf(tmp, "%d", NetTimeOffset); setenv("timeoffset", tmp); } #endif -#if defined(CONFIG_CMD_SNTP) \ - && defined(CONFIG_BOOTP_NTPSERVER) +#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER) if (net_ntp_server.s_addr) { ip_to_string(net_ntp_server, tmp); setenv("ntpserverip", tmp); @@ -183,9 +181,9 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, ulong addr; /* pre-set load_addr */ - if ((s = getenv("loadaddr")) != NULL) { + s = getenv("loadaddr"); + if (s != NULL) load_addr = simple_strtoul(s, NULL, 16); - } switch (argc) { case 1: @@ -205,7 +203,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, sizeof(net_boot_file_name)); break; - case 3: load_addr = simple_strtoul(argv[1], NULL, 16); + case 3: + load_addr = simple_strtoul(argv[1], NULL, 16); copy_filename(net_boot_file_name, argv[2], sizeof(net_boot_file_name)); @@ -214,7 +213,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, #ifdef CONFIG_CMD_TFTPPUT case 4: if (strict_strtoul(argv[1], 16, &save_addr) < 0 || - strict_strtoul(argv[2], 16, &save_size) < 0) { + strict_strtoul(argv[2], 16, &save_size) < 0) { printf("Invalid address/size\n"); return CMD_RET_USAGE; } @@ -228,7 +227,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, } bootstage_mark(BOOTSTAGE_ID_NET_START); - if ((size = NetLoop(proto)) < 0) { + size = NetLoop(proto); + if (size < 0) { bootstage_error(BOOTSTAGE_ID_NET_NETLOOP_OK); return CMD_RET_FAILURE; } @@ -293,18 +293,17 @@ static void cdp_update_env(void) if (cdp_appliance_vlan != htons(-1)) { printf("CDP offered appliance VLAN %d\n", ntohs(cdp_appliance_vlan)); - VLAN_to_string(cdp_appliance_vlan, tmp); + vlan_to_string(cdp_appliance_vlan, tmp); setenv("vlan", tmp); - NetOurVLAN = cdp_appliance_vlan; + net_our_vlan = cdp_appliance_vlan; } if (cdp_native_vlan != htons(-1)) { printf("CDP offered native VLAN %d\n", ntohs(cdp_native_vlan)); - VLAN_to_string(cdp_native_vlan, tmp); + vlan_to_string(cdp_native_vlan, tmp); setenv("nvlan", tmp); - NetOurNativeVLAN = cdp_native_vlan; + net_native_vlan = cdp_native_vlan; } - } int do_cdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) @@ -356,7 +355,7 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (NetLoop(SNTP) < 0) { printf("SNTP failed: host %pI4 not responding\n", - &net_ntp_server); + &net_ntp_server); return CMD_RET_FAILURE; } -- cgit v1.2.3 From bc0571fc1067ff8a8fd16990ae65c1a2826ea90c Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 8 Apr 2015 01:41:21 -0500 Subject: net: cosmetic: Fix checkpatch.pl failures in net.c Finish eliminating CamelCase from net.c and other failures Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- common/cmd_net.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'common/cmd_net.c') diff --git a/common/cmd_net.c b/common/cmd_net.c index a672d77d495..b2f3c7b709b 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -158,8 +158,8 @@ static void netboot_update_env(void) setenv("domain", net_nis_domain); #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET) - if (NetTimeOffset) { - sprintf(tmp, "%d", NetTimeOffset); + if (net_ntp_time_offset) { + sprintf(tmp, "%d", net_ntp_time_offset); setenv("timeoffset", tmp); } #endif @@ -227,14 +227,14 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, } bootstage_mark(BOOTSTAGE_ID_NET_START); - size = NetLoop(proto); + size = net_loop(proto); if (size < 0) { bootstage_error(BOOTSTAGE_ID_NET_NETLOOP_OK); return CMD_RET_FAILURE; } bootstage_mark(BOOTSTAGE_ID_NET_NETLOOP_OK); - /* NetLoop ok, update environment */ + /* net_loop ok, update environment */ netboot_update_env(); /* done if no file was loaded (no errors though) */ @@ -267,7 +267,7 @@ static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (net_ping_ip.s_addr == 0) return CMD_RET_USAGE; - if (NetLoop(PING) < 0) { + if (net_loop(PING) < 0) { printf("ping failed; host %s is not alive\n", argv[1]); return CMD_RET_FAILURE; } @@ -310,7 +310,7 @@ int do_cdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int r; - r = NetLoop(CDP); + r = net_loop(CDP); if (r < 0) { printf("cdp failed; perhaps not a CISCO switch?\n"); return CMD_RET_FAILURE; @@ -349,11 +349,11 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) toff = getenv("timeoffset"); if (toff == NULL) - NetTimeOffset = 0; + net_ntp_time_offset = 0; else - NetTimeOffset = simple_strtol(toff, NULL, 10); + net_ntp_time_offset = simple_strtol(toff, NULL, 10); - if (NetLoop(SNTP) < 0) { + if (net_loop(SNTP) < 0) { printf("SNTP failed: host %pI4 not responding\n", &net_ntp_server); return CMD_RET_FAILURE; @@ -399,7 +399,7 @@ int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) else net_dns_env_var = NULL; - if (NetLoop(DNS) < 0) { + if (net_loop(DNS) < 0) { printf("dns lookup of %s failed, check setup\n", argv[1]); return CMD_RET_FAILURE; } @@ -421,7 +421,7 @@ static int do_link_local(cmd_tbl_t *cmdtp, int flag, int argc, { char tmp[22]; - if (NetLoop(LINKLOCAL) < 0) + if (net_loop(LINKLOCAL) < 0) return CMD_RET_FAILURE; net_gateway.s_addr = 0; -- cgit v1.2.3