diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-01-18 14:17:00 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-01-18 14:17:00 -0600 |
commit | 7726fc06938fe042704ef985b2335cc7f1278f63 (patch) | |
tree | a6155f8662c9b0d3ee5cbd241ca04c4e47ca7ea9 /apps/nshlib | |
parent | ad6c6ee858c6f7317b95a4aeab2fcc42614c3b18 (diff) | |
download | nuttx-7726fc06938fe042704ef985b2335cc7f1278f63.tar.gz nuttx-7726fc06938fe042704ef985b2335cc7f1278f63.tar.bz2 nuttx-7726fc06938fe042704ef985b2335cc7f1278f63.zip |
Rename IPv4 netlib functions and files to make room in the namespace for corresponding IPv6 functions and files
Diffstat (limited to 'apps/nshlib')
-rw-r--r-- | apps/nshlib/nsh_netcmds.c | 12 | ||||
-rw-r--r-- | apps/nshlib/nsh_netinit.c | 20 |
2 files changed, 19 insertions, 13 deletions
diff --git a/apps/nshlib/nsh_netcmds.c b/apps/nshlib/nsh_netcmds.c index 7b902f9b5..4c99fac63 100644 --- a/apps/nshlib/nsh_netcmds.c +++ b/apps/nshlib/nsh_netcmds.c @@ -732,7 +732,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) gip = addr.s_addr = inet_addr(hostip); } - netlib_sethostaddr(intf, &addr); + netlib_set_ipv4addr(intf, &addr); /* Set gateway */ @@ -755,7 +755,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) addr.s_addr = gip; } - netlib_setdraddr(intf, &addr); + netlib_set_dripv4addr(intf, &addr); /* Set network mask */ @@ -770,7 +770,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) addr.s_addr = inet_addr("255.255.255.0"); } - netlib_setnetmask(intf, &addr); + netlib_set_ipv4netmask(intf, &addr); #if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS) if (dns) @@ -808,16 +808,16 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) struct dhcpc_state ds; (void)dhcpc_request(handle, &ds); - netlib_sethostaddr("eth0", &ds.ipaddr); + netlib_set_ipv4addr("eth0", &ds.ipaddr); if (ds.netmask.s_addr != 0) { - netlib_setnetmask("eth0", &ds.netmask); + netlib_set_ipv4netmask("eth0", &ds.netmask); } if (ds.default_router.s_addr != 0) { - netlib_setdraddr("eth0", &ds.default_router); + netlib_set_dripv4addr("eth0", &ds.default_router); } if (ds.dnsaddr.s_addr != 0) diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c index 16fc78eb6..5581ef5cd 100644 --- a/apps/nshlib/nsh_netinit.c +++ b/apps/nshlib/nsh_netinit.c @@ -1,7 +1,7 @@ /**************************************************************************** * apps/nshlib/nsh_netinit.c * - * Copyright (C) 2010-2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2012, 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * This is influenced by similar logic from uIP: @@ -184,6 +184,7 @@ static void nsh_netinit_configure(void) netlib_setmacaddr(NET_DEVNAME, mac); #endif +#ifdef CONFIG_NET_IPv4 /* Set up our host address */ #if !defined(CONFIG_NSH_DHCPC) @@ -191,17 +192,22 @@ static void nsh_netinit_configure(void) #else addr.s_addr = 0; #endif - netlib_sethostaddr(NET_DEVNAME, &addr); + netlib_set_ipv4addr(NET_DEVNAME, &addr); /* Set up the default router address */ addr.s_addr = HTONL(CONFIG_NSH_DRIPADDR); - netlib_setdraddr(NET_DEVNAME, &addr); + netlib_set_dripv4addr(NET_DEVNAME, &addr); /* Setup the subnet mask */ addr.s_addr = HTONL(CONFIG_NSH_NETMASK); - netlib_setnetmask(NET_DEVNAME, &addr); + netlib_set_ipv4netmask(NET_DEVNAME, &addr); +#endif + +#ifdef CONFIG_NET_IPv6 +# warning Missing logic +#endif #if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS) /* Set up the resolver */ @@ -230,16 +236,16 @@ static void nsh_netinit_configure(void) { struct dhcpc_state ds; (void)dhcpc_request(handle, &ds); - netlib_sethostaddr(NET_DEVNAME, &ds.ipaddr); + netlib_set_ipv4addr(NET_DEVNAME, &ds.ipaddr); if (ds.netmask.s_addr != 0) { - netlib_setnetmask(NET_DEVNAME, &ds.netmask); + netlib_set_ipv4netmask(NET_DEVNAME, &ds.netmask); } if (ds.default_router.s_addr != 0) { - netlib_setdraddr(NET_DEVNAME, &ds.default_router); + netlib_set_dripv4addr(NET_DEVNAME, &ds.default_router); } if (ds.dnsaddr.s_addr != 0) |