NET: Rename functions in apps/netutils/netlib to begin with netlib_ vs uip_
This commit is contained in:
parent
d8e69bb0c1
commit
e7fedfa4a5
@ -105,23 +105,23 @@ int dhcpd_main(int argc, char *argv[])
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_DHCPD_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_DHCPD_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_DHCPD_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
/* Then start the server */
|
||||
|
||||
|
@ -109,7 +109,7 @@ int discover_main(int argc, char *argv[])
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
@ -119,17 +119,17 @@ int discover_main(int argc, char *argv[])
|
||||
#else
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_DISCOVER_IPADDR);
|
||||
#endif
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_DISCOVER_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_DISCOVER_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_DISCOVER_DHCPC
|
||||
/* Set up the resolver */
|
||||
@ -138,7 +138,7 @@ int discover_main(int argc, char *argv[])
|
||||
|
||||
/* Get the MAC address of the NIC */
|
||||
|
||||
uip_getmacaddr("eth0", mac);
|
||||
netlib_getmacaddr("eth0", mac);
|
||||
|
||||
/* Set up the DHCPC modules */
|
||||
|
||||
@ -153,16 +153,16 @@ int discover_main(int argc, char *argv[])
|
||||
{
|
||||
struct dhcpc_state ds;
|
||||
(void)dhcpc_request(handle, &ds);
|
||||
uip_sethostaddr("eth1", &ds.ipaddr);
|
||||
netlib_sethostaddr("eth1", &ds.ipaddr);
|
||||
|
||||
if (ds.netmask.s_addr != 0)
|
||||
{
|
||||
uip_setnetmask("eth0", &ds.netmask);
|
||||
netlib_setnetmask("eth0", &ds.netmask);
|
||||
}
|
||||
|
||||
if (ds.default_router.s_addr != 0)
|
||||
{
|
||||
uip_setdraddr("eth0", &ds.default_router);
|
||||
netlib_setdraddr("eth0", &ds.default_router);
|
||||
}
|
||||
|
||||
if (ds.dnsaddr.s_addr != 0)
|
||||
|
@ -96,23 +96,23 @@ static void fptd_netinit(void)
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_FTPD_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_FTPD_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_FTPD_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
#endif /* CONFIG_EXAMPLES_FTPD_NONETINIT */
|
||||
}
|
||||
|
||||
|
@ -99,23 +99,23 @@ int igmp_main(int argc, char *argv[])
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_IGMP_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_IGMP_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_IGMP_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
/* Not much of a test for now */
|
||||
/* Join the group */
|
||||
|
@ -81,23 +81,23 @@ int nettest_main(int argc, char *argv[])
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_NETTEST_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_NETTEST_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_NETTEST_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_NETTEST_SERVER
|
||||
recv_server();
|
||||
|
@ -304,23 +304,23 @@ static void net_configure(void)
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -97,23 +97,23 @@ static void net_configure(void)
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -124,23 +124,23 @@ int sendmail_main(int argc, char *argv[])
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_SENDMAIL_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_SENDMAIL_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_SENDMAIL_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
/* Then send the mail */
|
||||
|
||||
|
@ -121,7 +121,7 @@ static int tcpecho_netsetup()
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
@ -131,17 +131,17 @@ static int tcpecho_netsetup()
|
||||
#else
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_TCPECHO_IPADDR);
|
||||
#endif
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_TCPECHO_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_TCPECHO_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_TCPECHO_DHCPC
|
||||
/* Set up the resolver */
|
||||
@ -150,7 +150,7 @@ static int tcpecho_netsetup()
|
||||
|
||||
/* Get the MAC address of the NIC */
|
||||
|
||||
uip_getmacaddr("eth0", mac);
|
||||
netlib_getmacaddr("eth0", mac);
|
||||
|
||||
/* Set up the DHCPC modules */
|
||||
|
||||
@ -170,16 +170,16 @@ static int tcpecho_netsetup()
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
uip_sethostaddr("eth1", &ds.ipaddr);
|
||||
netlib_sethostaddr("eth1", &ds.ipaddr);
|
||||
|
||||
if (ds.netmask.s_addr != 0)
|
||||
{
|
||||
uip_setnetmask("eth0", &ds.netmask);
|
||||
netlib_setnetmask("eth0", &ds.netmask);
|
||||
}
|
||||
|
||||
if (ds.default_router.s_addr != 0)
|
||||
{
|
||||
uip_setdraddr("eth0", &ds.default_router);
|
||||
netlib_setdraddr("eth0", &ds.default_router);
|
||||
}
|
||||
|
||||
if (ds.dnsaddr.s_addr != 0)
|
||||
|
@ -200,23 +200,23 @@ static void telnetd_netinit(void)
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_TELNETD_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_TELNETD_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_TELNETD_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -200,24 +200,24 @@ int thttp_main(int argc, char *argv[])
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr(NET_DEVNAME, mac);
|
||||
netlib_setmacaddr(NET_DEVNAME, mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
message("Setup network addresses\n");
|
||||
addr.s_addr = HTONL(CONFIG_THTTPD_IPADDR);
|
||||
uip_sethostaddr(NET_DEVNAME, &addr);
|
||||
netlib_sethostaddr(NET_DEVNAME, &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_THTTPD_DRIPADDR);
|
||||
uip_setdraddr(NET_DEVNAME, &addr);
|
||||
netlib_setdraddr(NET_DEVNAME, &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_THTTPD_NETMASK);
|
||||
uip_setnetmask(NET_DEVNAME, &addr);
|
||||
netlib_setnetmask(NET_DEVNAME, &addr);
|
||||
|
||||
/* Initialize the NXFLAT binary loader */
|
||||
|
||||
|
@ -69,17 +69,17 @@ int udp_main(int argc, char *argv[])
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_UDP_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_UDP_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_UDP_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_UDP_SERVER
|
||||
recv_server();
|
||||
|
@ -129,7 +129,7 @@ int uip_main(int argc, char *argv[])
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
@ -139,17 +139,17 @@ int uip_main(int argc, char *argv[])
|
||||
#else
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_UIP_IPADDR);
|
||||
#endif
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_UIP_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_UIP_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_UIP_DHCPC
|
||||
/* Set up the resolver */
|
||||
@ -158,7 +158,7 @@ int uip_main(int argc, char *argv[])
|
||||
|
||||
/* Get the MAC address of the NIC */
|
||||
|
||||
uip_getmacaddr("eth0", mac);
|
||||
netlib_getmacaddr("eth0", mac);
|
||||
|
||||
/* Set up the DHCPC modules */
|
||||
|
||||
@ -173,16 +173,16 @@ int uip_main(int argc, char *argv[])
|
||||
{
|
||||
struct dhcpc_state ds;
|
||||
(void)dhcpc_request(handle, &ds);
|
||||
uip_sethostaddr("eth1", &ds.ipaddr);
|
||||
netlib_sethostaddr("eth1", &ds.ipaddr);
|
||||
|
||||
if (ds.netmask.s_addr != 0)
|
||||
{
|
||||
uip_setnetmask("eth0", &ds.netmask);
|
||||
netlib_setnetmask("eth0", &ds.netmask);
|
||||
}
|
||||
|
||||
if (ds.default_router.s_addr != 0)
|
||||
{
|
||||
uip_setdraddr("eth0", &ds.default_router);
|
||||
netlib_setdraddr("eth0", &ds.default_router);
|
||||
}
|
||||
|
||||
if (ds.dnsaddr.s_addr != 0)
|
||||
|
@ -37,7 +37,7 @@ WD = ${shell pwd}
|
||||
TOPDIR = $(WD)/../..
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
OBJS = host.o1 webclient.o1 uip_parsehttpurl.o1
|
||||
OBJS = host.o1 webclient.o1 netlib_parsehttpurl.o1
|
||||
BIN = wget
|
||||
|
||||
HOSTCFLAGS += -DCONFIG_WEBCLIENT_HOST=1
|
||||
|
@ -125,23 +125,23 @@ int wget_main(int argc, char *argv[])
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_WGET_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_WGET_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_WGET_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
/* Then start the server */
|
||||
|
||||
|
@ -286,7 +286,7 @@ static int xmlrpc_netinit(void)
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr("eth0", mac);
|
||||
netlib_setmacaddr("eth0", mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
@ -296,17 +296,17 @@ static int xmlrpc_netinit(void)
|
||||
#else
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_XMLRPC_IPADDR);
|
||||
#endif
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
netlib_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_XMLRPC_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
netlib_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_XMLRPC_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
netlib_setnetmask("eth0", &addr);
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_XMLRPC_DHCPC
|
||||
/* Set up the resolver */
|
||||
@ -315,7 +315,7 @@ static int xmlrpc_netinit(void)
|
||||
|
||||
/* Get the MAC address of the NIC */
|
||||
|
||||
uip_getmacaddr("eth0", mac);
|
||||
netlib_getmacaddr("eth0", mac);
|
||||
|
||||
/* Set up the DHCPC modules */
|
||||
|
||||
@ -331,16 +331,16 @@ static int xmlrpc_netinit(void)
|
||||
{
|
||||
struct dhcpc_state ds;
|
||||
(void)dhcpc_request(handle, &ds);
|
||||
uip_sethostaddr("eth1", &ds.ipaddr);
|
||||
netlib_sethostaddr("eth1", &ds.ipaddr);
|
||||
|
||||
if (ds.netmask.s_addr != 0)
|
||||
{
|
||||
uip_setnetmask("eth0", &ds.netmask);
|
||||
netlib_setnetmask("eth0", &ds.netmask);
|
||||
}
|
||||
|
||||
if (ds.default_router.s_addr != 0)
|
||||
{
|
||||
uip_setdraddr("eth0", &ds.default_router);
|
||||
netlib_setdraddr("eth0", &ds.default_router);
|
||||
}
|
||||
|
||||
if (ds.dnsaddr.s_addr != 0)
|
||||
|
@ -108,39 +108,39 @@ bool netlib_hwmacconv(FAR const char *hwstr, uint8_t *hw);
|
||||
/* Get and set IP/MAC addresses (Ethernet L2 only) */
|
||||
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
int uip_setmacaddr(FAR const char *ifname, const uint8_t *macaddr);
|
||||
int uip_getmacaddr(FAR const char *ifname, uint8_t *macaddr);
|
||||
int netlib_setmacaddr(FAR const char *ifname, const uint8_t *macaddr);
|
||||
int netlib_getmacaddr(FAR const char *ifname, uint8_t *macaddr);
|
||||
#endif
|
||||
|
||||
/* IP address support */
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
int uip_gethostaddr(FAR const char *ifname, struct in6_addr *addr);
|
||||
int uip_sethostaddr(FAR const char *ifname, const struct in6_addr *addr);
|
||||
int uip_setdraddr(FAR const char *ifname, const struct in6_addr *addr);
|
||||
int uip_setnetmask(FAR const char *ifname, const struct in6_addr *addr);
|
||||
int netlib_gethostaddr(FAR const char *ifname, struct in6_addr *addr);
|
||||
int netlib_sethostaddr(FAR const char *ifname, const struct in6_addr *addr);
|
||||
int netlib_setdraddr(FAR const char *ifname, const struct in6_addr *addr);
|
||||
int netlib_setnetmask(FAR const char *ifname, const struct in6_addr *addr);
|
||||
#else
|
||||
int uip_gethostaddr(FAR const char *ifname, struct in_addr *addr);
|
||||
int uip_sethostaddr(FAR const char *ifname, const struct in_addr *addr);
|
||||
int uip_setdraddr(FAR const char *ifname, const struct in_addr *addr);
|
||||
int uip_setnetmask(FAR const char *ifname, const struct in_addr *addr);
|
||||
int netlib_gethostaddr(FAR const char *ifname, struct in_addr *addr);
|
||||
int netlib_sethostaddr(FAR const char *ifname, const struct in_addr *addr);
|
||||
int netlib_setdraddr(FAR const char *ifname, const struct in_addr *addr);
|
||||
int netlib_setnetmask(FAR const char *ifname, const struct in_addr *addr);
|
||||
#endif
|
||||
|
||||
/* HTTP support */
|
||||
|
||||
int uip_parsehttpurl(FAR const char *url, uint16_t *port,
|
||||
int netlib_parsehttpurl(FAR const char *url, uint16_t *port,
|
||||
FAR char *hostname, int hostlen,
|
||||
FAR char *filename, int namelen);
|
||||
|
||||
/* Generic server logic */
|
||||
|
||||
int uip_listenon(uint16_t portno);
|
||||
void uip_server(uint16_t portno, pthread_startroutine_t handler,
|
||||
int netlib_listenon(uint16_t portno);
|
||||
void netlib_server(uint16_t portno, pthread_startroutine_t handler,
|
||||
int stacksize);
|
||||
|
||||
int uip_getifstatus(FAR const char *ifname, FAR uint8_t *flags);
|
||||
int uip_ifup(FAR const char *ifname);
|
||||
int uip_ifdown(FAR const char *ifname);
|
||||
int netlib_getifstatus(FAR const char *ifname, FAR uint8_t *flags);
|
||||
int netlib_ifup(FAR const char *ifname);
|
||||
int netlib_ifdown(FAR const char *ifname);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
@ -447,7 +447,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
|
||||
/* Save the currently assigned IP address (should be INADDR_ANY) */
|
||||
|
||||
oldaddr.s_addr = 0;
|
||||
uip_gethostaddr("eth0", &oldaddr);
|
||||
netlib_gethostaddr("eth0", &oldaddr);
|
||||
|
||||
/* Loop until we receive the lease (or an error occurs) */
|
||||
|
||||
@ -456,7 +456,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
|
||||
/* Set the IP address to INADDR_ANY. */
|
||||
|
||||
newaddr.s_addr = INADDR_ANY;
|
||||
(void)uip_sethostaddr("eth0", &newaddr);
|
||||
(void)netlib_sethostaddr("eth0", &newaddr);
|
||||
|
||||
/* Loop sending DISCOVER until we receive an OFFER from a DHCP
|
||||
* server. We will lock on to the first OFFER and decline any
|
||||
@ -495,7 +495,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
|
||||
* out of the loop.
|
||||
*/
|
||||
|
||||
(void)uip_sethostaddr("eth0", &presult->ipaddr);
|
||||
(void)netlib_sethostaddr("eth0", &presult->ipaddr);
|
||||
state = STATE_HAVE_OFFER;
|
||||
}
|
||||
}
|
||||
@ -587,7 +587,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
|
||||
{
|
||||
/* An error other than a timeout was received */
|
||||
|
||||
(void)uip_sethostaddr("eth0", &oldaddr);
|
||||
(void)netlib_sethostaddr("eth0", &oldaddr);
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ include $(APPDIR)/Make.defs
|
||||
ASRCS =
|
||||
CSRCS = netlib.c netlib_sethostaddr.c netlib_gethostaddr.c
|
||||
CSRCS += netlib_setdraddr.c netlib_setnetmask.c netlib_parsehttpurl.c
|
||||
CSRCS += netlib_setifflag.c netlib_getifflag.c
|
||||
CSRCS += netlib_setifstatus.c netlib_getifstatus.c
|
||||
|
||||
# These require TCP support
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_gethostaddr.c
|
||||
* netutils/netlib/netlib_gethostaddr.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -61,7 +61,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_gethostaddr
|
||||
* Name: netlib_gethostaddr
|
||||
*
|
||||
* Description:
|
||||
* Get the network driver IP address
|
||||
@ -76,9 +76,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
int uip_gethostaddr(const char *ifname, struct in6_addr *addr)
|
||||
int netlib_gethostaddr(const char *ifname, struct in6_addr *addr)
|
||||
#else
|
||||
int uip_gethostaddr(const char *ifname, struct in_addr *addr)
|
||||
int netlib_gethostaddr(const char *ifname, struct in_addr *addr)
|
||||
#endif
|
||||
{
|
||||
int ret = ERROR;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_getifflag.c
|
||||
* netutils/netlib/netlib_getifflag.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011, 2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -58,7 +58,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_getifstatus
|
||||
* Name: netlib_getifstatus
|
||||
*
|
||||
* Description:
|
||||
* Get the network driver ifup/ifdown status
|
||||
@ -72,7 +72,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int uip_getifstatus(FAR const char *ifname, FAR uint8_t *flags)
|
||||
int netlib_getifstatus(FAR const char *ifname, FAR uint8_t *flags)
|
||||
{
|
||||
int ret = ERROR;
|
||||
if (ifname)
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_getmacaddr.c
|
||||
* netutils/netlib/netlib_getmacaddr.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -57,7 +57,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_getmacaddr
|
||||
* Name: netlib_getmacaddr
|
||||
*
|
||||
* Description:
|
||||
* Get the network driver IP address
|
||||
@ -71,7 +71,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int uip_getmacaddr(const char *ifname, uint8_t *macaddr)
|
||||
int netlib_getmacaddr(const char *ifname, uint8_t *macaddr)
|
||||
{
|
||||
int ret = ERROR;
|
||||
if (ifname && macaddr)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_setmultiaddr.c
|
||||
* netutils/netlib/netlib_setipmsfilter.c
|
||||
*
|
||||
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_listenon.c
|
||||
* netutils/netlib/netlib_listenon.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -59,7 +59,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_listenon
|
||||
* Name: netlib_listenon
|
||||
*
|
||||
* Description:
|
||||
* Implement basic server listening
|
||||
@ -72,7 +72,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int uip_listenon(uint16_t portno)
|
||||
int netlib_listenon(uint16_t portno)
|
||||
{
|
||||
struct sockaddr_in myaddr;
|
||||
int listensd;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_parsehttpurl.c
|
||||
* netutils/netlib/netlib_parsehttpurl.c
|
||||
*
|
||||
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -57,10 +57,10 @@ const char g_http[] = "http://";
|
||||
*****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_parsehttpurl
|
||||
* Name: netlib_parsehttpurl
|
||||
****************************************************************************/
|
||||
|
||||
int uip_parsehttpurl(const char *url, uint16_t *port,
|
||||
int netlib_parsehttpurl(const char *url, uint16_t *port,
|
||||
char *hostname, int hostlen,
|
||||
char *filename, int namelen)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_server.c
|
||||
* netutils/netlib/netlib_server.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -62,7 +62,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_server
|
||||
* Name: netlib_server
|
||||
*
|
||||
* Description:
|
||||
* Implement basic server logic
|
||||
@ -78,7 +78,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void uip_server(uint16_t portno, pthread_startroutine_t handler, int stacksize)
|
||||
void netlib_server(uint16_t portno, pthread_startroutine_t handler, int stacksize)
|
||||
{
|
||||
struct sockaddr_in myaddr;
|
||||
#ifdef CONFIG_NET_HAVE_SOLINGER
|
||||
@ -93,7 +93,7 @@ void uip_server(uint16_t portno, pthread_startroutine_t handler, int stacksize)
|
||||
|
||||
/* Create a new TCP socket to use to listen for connections */
|
||||
|
||||
listensd = uip_listenon(portno);
|
||||
listensd = netlib_listenon(portno);
|
||||
if (listensd < 0)
|
||||
{
|
||||
return;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_setdraddr.c
|
||||
* netutils/netlib/netlib_setdraddr.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -57,7 +57,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_setdraddr
|
||||
* Name: netlib_setdraddr
|
||||
*
|
||||
* Description:
|
||||
* Set the default router IP address
|
||||
@ -72,9 +72,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
int uip_setdraddr(const char *ifname, const struct in6_addr *addr)
|
||||
int netlib_setdraddr(const char *ifname, const struct in6_addr *addr)
|
||||
#else
|
||||
int uip_setdraddr(const char *ifname, const struct in_addr *addr)
|
||||
int netlib_setdraddr(const char *ifname, const struct in_addr *addr)
|
||||
#endif
|
||||
{
|
||||
int ret = ERROR;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_sethostaddr.c
|
||||
* netutils/netlib/netlib_sethostaddr.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -57,7 +57,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_sethostaddr
|
||||
* Name: netlib_sethostaddr
|
||||
*
|
||||
* Description:
|
||||
* Set the network driver IP address
|
||||
@ -72,9 +72,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
int uip_sethostaddr(const char *ifname, const struct in6_addr *addr)
|
||||
int netlib_sethostaddr(const char *ifname, const struct in6_addr *addr)
|
||||
#else
|
||||
int uip_sethostaddr(const char *ifname, const struct in_addr *addr)
|
||||
int netlib_sethostaddr(const char *ifname, const struct in_addr *addr)
|
||||
#endif
|
||||
{
|
||||
int ret = ERROR;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_setifflag.c
|
||||
* netutils/netlib/netlib_setifstatus.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011, 2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -57,7 +57,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_ifup
|
||||
* Name: netlib_ifup
|
||||
*
|
||||
* Description:
|
||||
* Set the network interface UP
|
||||
@ -70,7 +70,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int uip_ifup(const char *ifname)
|
||||
int netlib_ifup(const char *ifname)
|
||||
{
|
||||
int ret = ERROR;
|
||||
if (ifname)
|
||||
@ -100,7 +100,7 @@ int uip_ifup(const char *ifname)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_ifdown
|
||||
* Name: netlib_ifdown
|
||||
*
|
||||
* Description:
|
||||
* Set the network interface DOWN
|
||||
@ -113,7 +113,7 @@ int uip_ifup(const char *ifname)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int uip_ifdown(const char *ifname)
|
||||
int netlib_ifdown(const char *ifname)
|
||||
{
|
||||
int ret = ERROR;
|
||||
if (ifname)
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_setmacaddr.c
|
||||
* netutils/netlib/netlib_setmacaddr.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -67,7 +67,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_setmacaddr
|
||||
* Name: netlib_setmacaddr
|
||||
*
|
||||
* Description:
|
||||
* Set the network driver MAC address
|
||||
@ -81,7 +81,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int uip_setmacaddr(const char *ifname, const uint8_t *macaddr)
|
||||
int netlib_setmacaddr(const char *ifname, const uint8_t *macaddr)
|
||||
{
|
||||
int ret = ERROR;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* netutils/netlib/uip_setnetmask.c
|
||||
* netutils/netlib/netlib_setnetmask.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -56,7 +56,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: uip_setnetmask
|
||||
* Name: netlib_setnetmask
|
||||
*
|
||||
* Description:
|
||||
* Set the netmask
|
||||
@ -71,9 +71,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
int uip_setnetmask(const char *ifname, const struct in6_addr *addr)
|
||||
int netlib_setnetmask(const char *ifname, const struct in6_addr *addr)
|
||||
#else
|
||||
int uip_setnetmask(const char *ifname, const struct in_addr *addr)
|
||||
int netlib_setnetmask(const char *ifname, const struct in_addr *addr)
|
||||
#endif
|
||||
{
|
||||
int ret = ERROR;
|
||||
|
@ -347,7 +347,7 @@ static inline int wget_parseheaders(struct wget_s *ws)
|
||||
* retain the current location.
|
||||
*/
|
||||
|
||||
(void)uip_parsehttpurl(ws->line + strlen(g_httplocation), &ws->port,
|
||||
(void)netlib_parsehttpurl(ws->line + strlen(g_httplocation), &ws->port,
|
||||
ws->hostname, CONFIG_WEBCLIENT_MAXHOSTNAME,
|
||||
ws->filename, CONFIG_WEBCLIENT_MAXFILENAME);
|
||||
nvdbg("New hostname='%s' filename='%s'\n", ws->hostname, ws->filename);
|
||||
@ -423,7 +423,7 @@ static int wget_base(FAR const char *url, FAR char *buffer, int buflen,
|
||||
|
||||
/* Parse the hostname (with optional port number) and filename from the URL */
|
||||
|
||||
ret = uip_parsehttpurl(url, &ws.port,
|
||||
ret = netlib_parsehttpurl(url, &ws.port,
|
||||
ws.hostname, CONFIG_WEBCLIENT_MAXHOSTNAME,
|
||||
ws.filename, CONFIG_WEBCLIENT_MAXFILENAME);
|
||||
if (ret != 0)
|
||||
|
@ -788,7 +788,7 @@ static void single_server(uint16_t portno, pthread_startroutine_t handler, int s
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
listensd = uip_listenon(portno);
|
||||
listensd = netlib_listenon(portno);
|
||||
if (listensd < 0)
|
||||
{
|
||||
return;
|
||||
@ -861,7 +861,7 @@ int httpd_listen(void)
|
||||
#ifdef CONFIG_NETUTILS_HTTPD_SINGLECONNECT
|
||||
single_server(HTONS(80), httpd_handler, CONFIG_NETUTILS_HTTPDSTACKSIZE);
|
||||
#else
|
||||
uip_server(HTONS(80), httpd_handler, CONFIG_NETUTILS_HTTPDSTACKSIZE);
|
||||
netlib_server(HTONS(80), httpd_handler, CONFIG_NETUTILS_HTTPDSTACKSIZE);
|
||||
#endif
|
||||
|
||||
/* the server accept loop only returns on errors */
|
||||
|
@ -287,7 +287,7 @@ int ifconfig_callback(FAR struct net_driver_s *dev, void *arg)
|
||||
const char *status;
|
||||
int ret;
|
||||
|
||||
ret = uip_getifstatus(dev->d_ifname, &iff);
|
||||
ret = netlib_getifstatus(dev->d_ifname, &iff);
|
||||
if (ret != OK)
|
||||
{
|
||||
nsh_output(vtbl, "\tGet %s interface flags error: %d\n",
|
||||
@ -546,7 +546,7 @@ int cmd_ifup(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
}
|
||||
|
||||
intf = argv[1];
|
||||
ret = uip_ifup(intf);
|
||||
ret = netlib_ifup(intf);
|
||||
nsh_output(vtbl, "ifup %s...%s\n", intf, (ret == OK) ? "OK" : "Failed");
|
||||
return ret;
|
||||
}
|
||||
@ -570,7 +570,7 @@ int cmd_ifdown(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
}
|
||||
|
||||
intf = argv[1];
|
||||
ret = uip_ifdown(intf);
|
||||
ret = netlib_ifdown(intf);
|
||||
nsh_output(vtbl, "ifdown %s...%s\n", intf, (ret == OK) ? "OK" : "Failed");
|
||||
return ret;
|
||||
}
|
||||
@ -712,7 +712,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
if (hw)
|
||||
{
|
||||
ndbg("HW MAC: %s\n", hw);
|
||||
uip_setmacaddr(intf, mac);
|
||||
netlib_setmacaddr(intf, mac);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -733,7 +733,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
gip = addr.s_addr = inet_addr(hostip);
|
||||
}
|
||||
|
||||
uip_sethostaddr(intf, &addr);
|
||||
netlib_sethostaddr(intf, &addr);
|
||||
|
||||
/* Set gateway */
|
||||
|
||||
@ -756,7 +756,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
addr.s_addr = gip;
|
||||
}
|
||||
|
||||
uip_setdraddr(intf, &addr);
|
||||
netlib_setdraddr(intf, &addr);
|
||||
|
||||
/* Set network mask */
|
||||
|
||||
@ -771,7 +771,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
addr.s_addr = inet_addr("255.255.255.0");
|
||||
}
|
||||
|
||||
uip_setnetmask(intf, &addr);
|
||||
netlib_setnetmask(intf, &addr);
|
||||
|
||||
#if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS)
|
||||
if (dns)
|
||||
@ -793,7 +793,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
|
||||
if (!gip)
|
||||
{
|
||||
uip_getmacaddr("eth0", mac);
|
||||
netlib_getmacaddr("eth0", mac);
|
||||
|
||||
/* Set up the DHCPC modules */
|
||||
|
||||
@ -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);
|
||||
uip_sethostaddr("eth0", &ds.ipaddr);
|
||||
netlib_sethostaddr("eth0", &ds.ipaddr);
|
||||
|
||||
if (ds.netmask.s_addr != 0)
|
||||
{
|
||||
uip_setnetmask("eth0", &ds.netmask);
|
||||
netlib_setnetmask("eth0", &ds.netmask);
|
||||
}
|
||||
|
||||
if (ds.default_router.s_addr != 0)
|
||||
{
|
||||
uip_setdraddr("eth0", &ds.default_router);
|
||||
netlib_setdraddr("eth0", &ds.default_router);
|
||||
}
|
||||
|
||||
if (ds.dnsaddr.s_addr != 0)
|
||||
|
@ -123,7 +123,7 @@ int nsh_netinit(void)
|
||||
mac[3] = 0xad;
|
||||
mac[4] = 0xbe;
|
||||
mac[5] = 0xef;
|
||||
uip_setmacaddr(NET_DEVNAME, mac);
|
||||
netlib_setmacaddr(NET_DEVNAME, mac);
|
||||
#endif
|
||||
|
||||
/* Set up our host address */
|
||||
@ -133,17 +133,17 @@ int nsh_netinit(void)
|
||||
#else
|
||||
addr.s_addr = 0;
|
||||
#endif
|
||||
uip_sethostaddr(NET_DEVNAME, &addr);
|
||||
netlib_sethostaddr(NET_DEVNAME, &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_NSH_DRIPADDR);
|
||||
uip_setdraddr(NET_DEVNAME, &addr);
|
||||
netlib_setdraddr(NET_DEVNAME, &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_NSH_NETMASK);
|
||||
uip_setnetmask(NET_DEVNAME, &addr);
|
||||
netlib_setnetmask(NET_DEVNAME, &addr);
|
||||
|
||||
#if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS)
|
||||
/* Set up the resolver */
|
||||
@ -158,7 +158,7 @@ int nsh_netinit(void)
|
||||
#if defined(CONFIG_NSH_DHCPC)
|
||||
/* Get the MAC address of the NIC */
|
||||
|
||||
uip_getmacaddr(NET_DEVNAME, mac);
|
||||
netlib_getmacaddr(NET_DEVNAME, mac);
|
||||
|
||||
/* Set up the DHCPC modules */
|
||||
|
||||
@ -172,16 +172,16 @@ int nsh_netinit(void)
|
||||
{
|
||||
struct dhcpc_state ds;
|
||||
(void)dhcpc_request(handle, &ds);
|
||||
uip_sethostaddr(NET_DEVNAME, &ds.ipaddr);
|
||||
netlib_sethostaddr(NET_DEVNAME, &ds.ipaddr);
|
||||
|
||||
if (ds.netmask.s_addr != 0)
|
||||
{
|
||||
uip_setnetmask(NET_DEVNAME, &ds.netmask);
|
||||
netlib_setnetmask(NET_DEVNAME, &ds.netmask);
|
||||
}
|
||||
|
||||
if (ds.default_router.s_addr != 0)
|
||||
{
|
||||
uip_setdraddr(NET_DEVNAME, &ds.default_router);
|
||||
netlib_setdraddr(NET_DEVNAME, &ds.default_router);
|
||||
}
|
||||
|
||||
if (ds.dnsaddr.s_addr != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user