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 <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
1411157d85
commit
586cbe51ab
|
@ -124,11 +124,11 @@ static void netboot_update_env(void)
|
||||||
setenv("netmask", tmp);
|
setenv("netmask", tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NetOurHostName[0])
|
if (net_hostname[0])
|
||||||
setenv("hostname", NetOurHostName);
|
setenv("hostname", net_hostname);
|
||||||
|
|
||||||
if (NetOurRootPath[0])
|
if (net_root_path[0])
|
||||||
setenv("rootpath", NetOurRootPath);
|
setenv("rootpath", net_root_path);
|
||||||
|
|
||||||
if (net_ip.s_addr) {
|
if (net_ip.s_addr) {
|
||||||
ip_to_string(net_ip, tmp);
|
ip_to_string(net_ip, tmp);
|
||||||
|
@ -154,8 +154,8 @@ static void netboot_update_env(void)
|
||||||
setenv("dnsip2", tmp);
|
setenv("dnsip2", tmp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (NetOurNISDomain[0])
|
if (net_nis_domain[0])
|
||||||
setenv("domain", NetOurNISDomain);
|
setenv("domain", net_nis_domain);
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_SNTP) \
|
#if defined(CONFIG_CMD_SNTP) \
|
||||||
&& defined(CONFIG_BOOTP_TIMEOFFSET)
|
&& defined(CONFIG_BOOTP_TIMEOFFSET)
|
||||||
|
|
|
@ -473,9 +473,9 @@ extern struct in_addr net_dns_server;
|
||||||
/* Our 2nd Domain Name Server (0 = unknown) */
|
/* Our 2nd Domain Name Server (0 = unknown) */
|
||||||
extern struct in_addr net_dns_server2;
|
extern struct in_addr net_dns_server2;
|
||||||
#endif
|
#endif
|
||||||
extern char NetOurNISDomain[32]; /* Our NIS domain */
|
extern char net_nis_domain[32]; /* Our IS domain */
|
||||||
extern char NetOurHostName[32]; /* Our hostname */
|
extern char net_hostname[32]; /* Our hostname */
|
||||||
extern char NetOurRootPath[64]; /* Our root path */
|
extern char net_root_path[64]; /* Our root path */
|
||||||
/** END OF BOOTP EXTENTIONS **/
|
/** END OF BOOTP EXTENTIONS **/
|
||||||
extern uchar NetOurEther[6]; /* Our ethernet address */
|
extern uchar NetOurEther[6]; /* Our ethernet address */
|
||||||
extern uchar NetServerEther[6]; /* Boot server enet address */
|
extern uchar NetServerEther[6]; /* Boot server enet address */
|
||||||
|
|
51
net/bootp.c
51
net/bootp.c
|
@ -56,6 +56,9 @@ unsigned int bootp_num_ids;
|
||||||
int BootpTry;
|
int BootpTry;
|
||||||
ulong bootp_start;
|
ulong bootp_start;
|
||||||
ulong bootp_timeout;
|
ulong bootp_timeout;
|
||||||
|
char net_nis_domain[32] = {0,}; /* Our NIS domain */
|
||||||
|
char net_hostname[32] = {0,}; /* Our hostname */
|
||||||
|
char net_root_path[64] = {0,}; /* Our bootpath */
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_DHCP)
|
#if defined(CONFIG_CMD_DHCP)
|
||||||
static dhcp_state_t dhcp_state = INIT;
|
static dhcp_state_t dhcp_state = INIT;
|
||||||
|
@ -220,11 +223,11 @@ static void BootpVendorFieldProcess(u8 *ext)
|
||||||
case 11: /* RPL server - Not yet supported */
|
case 11: /* RPL server - Not yet supported */
|
||||||
break;
|
break;
|
||||||
case 12: /* Host name */
|
case 12: /* Host name */
|
||||||
if (NetOurHostName[0] == 0) {
|
if (net_hostname[0] == 0) {
|
||||||
size = truncate_sz("Host Name",
|
size = truncate_sz("Host Name",
|
||||||
sizeof(NetOurHostName), size);
|
sizeof(net_hostname), size);
|
||||||
memcpy(&NetOurHostName, ext + 2, size);
|
memcpy(&net_hostname, ext + 2, size);
|
||||||
NetOurHostName[size] = 0;
|
net_hostname[size] = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 13: /* Boot file size */
|
case 13: /* Boot file size */
|
||||||
|
@ -242,11 +245,11 @@ static void BootpVendorFieldProcess(u8 *ext)
|
||||||
case 16: /* Swap server - Not yet supported */
|
case 16: /* Swap server - Not yet supported */
|
||||||
break;
|
break;
|
||||||
case 17: /* Root path */
|
case 17: /* Root path */
|
||||||
if (NetOurRootPath[0] == 0) {
|
if (net_root_path[0] == 0) {
|
||||||
size = truncate_sz("Root Path",
|
size = truncate_sz("Root Path",
|
||||||
sizeof(NetOurRootPath), size);
|
sizeof(net_root_path), size);
|
||||||
memcpy(&NetOurRootPath, ext + 2, size);
|
memcpy(&net_root_path, ext + 2, size);
|
||||||
NetOurRootPath[size] = 0;
|
net_root_path[size] = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 18: /* Extension path - Not yet supported */
|
case 18: /* Extension path - Not yet supported */
|
||||||
|
@ -258,11 +261,11 @@ static void BootpVendorFieldProcess(u8 *ext)
|
||||||
break;
|
break;
|
||||||
/* IP host layer fields */
|
/* IP host layer fields */
|
||||||
case 40: /* NIS Domain name */
|
case 40: /* NIS Domain name */
|
||||||
if (NetOurNISDomain[0] == 0) {
|
if (net_nis_domain[0] == 0) {
|
||||||
size = truncate_sz("NIS Domain Name",
|
size = truncate_sz("NIS Domain Name",
|
||||||
sizeof(NetOurNISDomain), size);
|
sizeof(net_nis_domain), size);
|
||||||
memcpy(&NetOurNISDomain, ext + 2, size);
|
memcpy(&net_nis_domain, ext + 2, size);
|
||||||
NetOurNISDomain[size] = 0;
|
net_nis_domain[size] = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
|
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
|
||||||
|
@ -310,14 +313,14 @@ static void BootpVendorProcess(u8 *ext, int size)
|
||||||
debug("net_boot_file_expected_size_in_blocks : %d\n",
|
debug("net_boot_file_expected_size_in_blocks : %d\n",
|
||||||
net_boot_file_expected_size_in_blocks);
|
net_boot_file_expected_size_in_blocks);
|
||||||
|
|
||||||
if (NetOurHostName[0])
|
if (net_hostname[0])
|
||||||
debug("NetOurHostName : %s\n", NetOurHostName);
|
debug("net_hostname : %s\n", net_hostname);
|
||||||
|
|
||||||
if (NetOurRootPath[0])
|
if (net_root_path[0])
|
||||||
debug("NetOurRootPath : %s\n", NetOurRootPath);
|
debug("net_root_path : %s\n", net_root_path);
|
||||||
|
|
||||||
if (NetOurNISDomain[0])
|
if (net_nis_domain[0])
|
||||||
debug("NetOurNISDomain : %s\n", NetOurNISDomain);
|
debug("net_nis_domain : %s\n", net_nis_domain);
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
|
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
|
||||||
if (net_ntp_server)
|
if (net_ntp_server)
|
||||||
|
@ -793,17 +796,17 @@ static void DhcpOptionsProcess(uchar *popt, struct Bootp_t *bp)
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
size = truncate_sz("Host Name",
|
size = truncate_sz("Host Name",
|
||||||
sizeof(NetOurHostName), oplen);
|
sizeof(net_hostname), oplen);
|
||||||
memcpy(&NetOurHostName, popt + 2, size);
|
memcpy(&net_hostname, popt + 2, size);
|
||||||
NetOurHostName[size] = 0;
|
net_hostname[size] = 0;
|
||||||
break;
|
break;
|
||||||
case 15: /* Ignore Domain Name Option */
|
case 15: /* Ignore Domain Name Option */
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
size = truncate_sz("Root Path",
|
size = truncate_sz("Root Path",
|
||||||
sizeof(NetOurRootPath), oplen);
|
sizeof(net_root_path), oplen);
|
||||||
memcpy(&NetOurRootPath, popt + 2, size);
|
memcpy(&net_root_path, popt + 2, size);
|
||||||
NetOurRootPath[size] = 0;
|
net_root_path[size] = 0;
|
||||||
break;
|
break;
|
||||||
case 28: /* Ignore Broadcast Address Option */
|
case 28: /* Ignore Broadcast Address Option */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -121,12 +121,6 @@ struct in_addr net_dns_server;
|
||||||
/* Our 2nd DNS IP address */
|
/* Our 2nd DNS IP address */
|
||||||
struct in_addr net_dns_server2;
|
struct in_addr net_dns_server2;
|
||||||
#endif
|
#endif
|
||||||
/* Our NIS domain */
|
|
||||||
char NetOurNISDomain[32] = {0,};
|
|
||||||
/* Our hostname */
|
|
||||||
char NetOurHostName[32] = {0,};
|
|
||||||
/* Our bootpath */
|
|
||||||
char NetOurRootPath[64] = {0,};
|
|
||||||
|
|
||||||
#ifdef CONFIG_MCAST_TFTP /* Multicast TFTP */
|
#ifdef CONFIG_MCAST_TFTP /* Multicast TFTP */
|
||||||
struct in_addr net_mcast_addr;
|
struct in_addr net_mcast_addr;
|
||||||
|
|
Loading…
Reference in New Issue