Allow ipv6 builds on win32 platform. (webserver6 builds with cygwin, needs changes for VC++ compiler)
This commit is contained in:
parent
c48b7ab78d
commit
46de21e771
2 changed files with 32 additions and 2 deletions
|
@ -13,7 +13,6 @@
|
|||
#endif /* _USRDLL */
|
||||
#define CLIF __declspec(dllexport)
|
||||
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
int strcasecmp(const char*, const char*);
|
||||
char* strdup(const char*);
|
||||
|
@ -54,7 +53,18 @@ typedef unsigned short uip_stats_t;
|
|||
#define UIP_CONF_BUFFER_SIZE 420
|
||||
#define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN
|
||||
#define UIP_CONF_TCP_SPLIT 1
|
||||
#if UIP_CONF_IPV6
|
||||
#define UIP_CONF_IP_FORWARD 0
|
||||
#define UIP_CONF_DS6_NBR_NBU 100
|
||||
#define UIP_CONF_DS6_DEFRT_NBU 2
|
||||
#define UIP_CONF_DS6_PREFIX_NBU 5
|
||||
#define UIP_CONF_DS6_ROUTE_NBU 100
|
||||
#define UIP_CONF_DS6_ADDR_NBU 10
|
||||
#define UIP_CONF_DS6_MADDR_NBU 0 //VC++ does not allow zero length arrays
|
||||
#define UIP_CONF_DS6_AADDR_NBU 0 //inside a struct
|
||||
#else
|
||||
#define UIP_CONF_IP_FORWARD 1
|
||||
#endif
|
||||
#define UIP_CONF_LOGGING 1
|
||||
#define UIP_CONF_UDP_CHECKSUMS 1
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ main(void)
|
|||
|
||||
autostart_start(autostart_processes);
|
||||
|
||||
#if 1
|
||||
#if !UIP_CONF_IPV6
|
||||
{
|
||||
uip_ipaddr_t addr;
|
||||
uip_ipaddr(&addr, 10,1,1,1);
|
||||
|
@ -129,6 +129,26 @@ main(void)
|
|||
resolv_conf(&addr);
|
||||
log_message("DNS Server: ", inet_ntoa(*(struct in_addr*)&addr));
|
||||
}
|
||||
|
||||
#else /* UIP_CONF_IPV6 */
|
||||
|
||||
#if !UIP_CONF_IPV6_RPL
|
||||
#ifdef HARD_CODED_ADDRESS
|
||||
uip_ipaddr_t ipaddr;
|
||||
uiplib_ipaddrconv(HARD_CODED_ADDRESS, &ipaddr);
|
||||
if ((ipaddr.u16[0]!=0) || (ipaddr.u16[1]!=0) || (ipaddr.u16[2]!=0) || (ipaddr.u16[3]!=0)) {
|
||||
#if UIP_CONF_ROUTER
|
||||
uip_ds6_prefix_add(&ipaddr, UIP_DEFAULT_PREFIX_LEN, 0, 0, 0, 0);
|
||||
#else /* UIP_CONF_ROUTER */
|
||||
uip_ds6_prefix_add(&ipaddr, UIP_DEFAULT_PREFIX_LEN, 0);
|
||||
#endif /* UIP_CONF_ROUTER */
|
||||
#if !UIP_CONF_IPV6_RPL
|
||||
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
|
||||
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
|
||||
#endif
|
||||
}
|
||||
#endif /* HARD_CODED_ADDRESS */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
while(1) {
|
||||
|
|
Loading…
Reference in a new issue