这篇教程C++ uip_setnetmask函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uip_setnetmask函数的典型用法代码示例。如果您正苦于以下问题:C++ uip_setnetmask函数的具体用法?C++ uip_setnetmask怎么用?C++ uip_setnetmask使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uip_setnetmask函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainvoidmain(int argc, char **argv){ contiki_argc = argc; contiki_argv = argv;#else /* WITH_ARGS */voidmain(void){#endif /* WITH_ARGS */ process_init();#if 1 ethernet_config = config_read("contiki.cfg");#else { static struct ethernet_config config = {0xDE08, "cs8900a.eth"}; uip_ipaddr_t addr; uip_ipaddr(&addr, 192,168,0,128); uip_sethostaddr(&addr); uip_ipaddr(&addr, 255,255,255,0); uip_setnetmask(&addr); uip_ipaddr(&addr, 192,168,0,1); uip_setdraddr(&addr); uip_ipaddr(&addr, 192,168,0,1); uip_nameserver_update(&addr, UIP_NAMESERVER_INFINITE_LIFETIME); ethernet_config = &config; }#endif procinit_init(); process_start((struct process *)ðernet_process, (void *)ethernet_config); autostart_start(autostart_processes); log_message("Contiki up and running ...", ""); while(1) { process_run(); etimer_request_poll(); }}
开发者ID:SmallLars,项目名称:contiki,代码行数:54,
示例2: dhcpc_configuredvoiddhcpc_configured(const struct dhcpc_state *s){ uip_sethostaddr(s->ipaddr); uip_setnetmask(s->netmask); uip_setdraddr(s->default_router);#if CFG_SUPPORT_DNS resolv_conf(s->dnsaddr); resolv_query("www.baidu.com");#endif}
开发者ID:Altizon,项目名称:Aliot-SDK-Examples,代码行数:11,
示例3: main/*-----------------------------------------------------------------------------------*/voidmain(void){ struct ethernet_config *ethernet_config;#if WITH_REBOOT rebootafterexit();#endif /* WITH_REBOOT */ videomode(VIDEOMODE_80COL); process_init();#if 1 ethernet_config = config_read("contiki.cfg");#else { static struct ethernet_config config = {0xC0B0, "cs8900a.eth"}; uip_ipaddr_t addr; uip_ipaddr(&addr, 192,168,0,128); uip_sethostaddr(&addr); uip_ipaddr(&addr, 255,255,255,0); uip_setnetmask(&addr); uip_ipaddr(&addr, 192,168,0,1); uip_setdraddr(&addr); uip_ipaddr(&addr, 192,168,0,1); resolv_conf(&addr); ethernet_config = &config; }#endif procinit_init(); process_start((struct process *)ðernet_process, (char *)ethernet_config); autostart_start(autostart_processes); log_message("Contiki up and running ...", ""); while(1) { process_run(); etimer_request_poll(); clock_update(); }}
开发者ID:AWRyder,项目名称:contiki,代码行数:54,
示例4: sendmail_mainint sendmail_main(int argc, char *argv[]){ struct in_addr addr;#if defined(CONFIG_EXAMPLES_SENDMAIL_NOMAC) uint8_t mac[IFHWADDRLEN];#endif void *handle; printf("sendmail: To: %s/n", g_recipient); printf("sendmail: From: %s/n", g_sender); printf("sendmail: Subject: %s/n", g_subject); printf("sendmail: Body: %s/n", g_msg_body);/* Many embedded network interfaces must have a software assigned MAC */#ifdef CONFIG_EXAMPLES_SENDMAIL_NOMAC mac[0] = 0x00; mac[1] = 0xe0; mac[2] = 0xde; mac[3] = 0xad; mac[4] = 0xbe; mac[5] = 0xef; uip_setmacaddr("eth0", mac);#endif /* Set up our host address */ addr.s_addr = HTONL(CONFIG_EXAMPLES_SENDMAIL_IPADDR); uip_sethostaddr("eth0", &addr); /* Set up the default router address */ addr.s_addr = HTONL(CONFIG_EXAMPLES_SENDMAIL_DRIPADDR); uip_setdraddr("eth0", &addr); /* Setup the subnet mask */ addr.s_addr = HTONL(CONFIG_EXAMPLES_SENDMAIL_NETMASK); uip_setnetmask("eth0", &addr); /* Then send the mail */ uip_ipaddr(addr.s_addr, 127, 0, 0, 1); handle = smtp_open(); if (handle) { smtp_configure(handle, g_host_name, &addr.s_addr); smtp_send(handle, g_recipient, NULL, g_sender, g_subject, g_msg_body, strlen(g_msg_body)); smtp_close(handle); } return 0;}
开发者ID:0919061,项目名称:PX4NuttX,代码行数:53,
示例5: memcpyvoid Network::dhcpc_configured(uint32_t ipaddr, uint32_t ipmask, uint32_t ipgw){ memcpy(this->ipaddr, &ipaddr, 4); memcpy(this->ipmask, &ipmask, 4); memcpy(this->ipgw, &ipgw, 4); uip_sethostaddr((u16_t*)this->ipaddr); uip_setnetmask((u16_t*)this->ipmask); uip_setdraddr((u16_t*)this->ipgw); setup_servers();}
开发者ID:2thetop,项目名称:Smoothieware,代码行数:12,
示例6: netif_set_addrvoid netif_set_addr(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw){ uip_ipaddr_t hipaddr; uip_ipaddr(hipaddr, RT_LWIP_IPADDR0,RT_LWIP_IPADDR1,RT_LWIP_IPADDR2,RT_LWIP_IPADDR3); uip_sethostaddr(hipaddr); uip_ipaddr(hipaddr, RT_LWIP_GWADDR0,RT_LWIP_GWADDR1,RT_LWIP_GWADDR2,RT_LWIP_GWADDR3); uip_setdraddr(hipaddr); uip_ipaddr(hipaddr, RT_LWIP_MSKADDR0,RT_LWIP_MSKADDR1,RT_LWIP_MSKADDR2,RT_LWIP_MSKADDR3); uip_setnetmask(hipaddr); return ;}
开发者ID:haitao52198,项目名称:HD-Elastos,代码行数:12,
示例7: dhcpc_configured/*---------------------------------------------------------------------------*/voiddhcpc_configured(const struct dhcpc_state *s){ uip_sethostaddr(s->ipaddr); uip_setdraddr(s->default_router); uip_setnetmask(s->netmask);// uip_udp_remove(s->conn);#ifdef TDTP_SOCKAPP tdtp_init();#endif}
开发者ID:mogorman,项目名称:stevie,代码行数:13,
示例8: dhcpc_configuredvoid dhcpc_configured(const struct dhcpc_state *s){ #ifdef MY_DEBUG //rprintf("IP : %d.%d.%d.%d/n", uip_ipaddr1(s->ipaddr), uip_ipaddr2(s->ipaddr), uip_ipaddr3(s->ipaddr), uip_ipaddr4(s->ipaddr)); //rprintf("NM : %d.%d.%d.%d/n", uip_ipaddr1(s->netmask), uip_ipaddr2(s->netmask), uip_ipaddr3(s->netmask), uip_ipaddr4(s->netmask)); //rprintf("GW : %d.%d.%d.%d/n", uip_ipaddr1(s->default_router), uip_ipaddr2(s->default_router), uip_ipaddr3(s->default_router), uip_ipaddr4(s->default_router)); #endif uip_sethostaddr(s->ipaddr); uip_setnetmask(s->netmask); uip_setdraddr(s->default_router);}
开发者ID:hokim72,项目名称:AVR-Common,代码行数:12,
示例9: dhcpc_configuredvoid dhcpc_configured(const struct dhcpc_state *s) {#ifdef XTCP_VERBOSE_DEBUG printf("dhcp: ");uip_printip4(s->ipaddr);printf("/n");#endif#if UIP_USE_AUTOIP autoip_stop();#endif uip_sethostaddr(s->ipaddr); uip_setdraddr(s->default_router); uip_setnetmask(s->netmask); uip_xtcp_up(); dhcp_done = 1;}
开发者ID:graymalkin,项目名称:sc_xtcp,代码行数:13,
示例10: dhcpc_configured/*-----------------------------------------------------------------------------------*/voiddhcpc_configured(const struct dhcpc_state *s){ uip_sethostaddr(&s->ipaddr); uip_setnetmask(&s->netmask); uip_setdraddr(&s->default_router);#if WITH_DNS resolv_conf(&s->dnsaddr);#endif /* WITH_DNS */ set_statustext("Configured."); process_post(PROCESS_CURRENT(), PROCESS_EVENT_MSG, NULL);}
开发者ID:AWRyder,项目名称:contiki,代码行数:14,
示例11: dhcpc_configuredvoid dhcpc_configured(const struct dhcpc_state *s){ if( s->ipaddr[ 0 ] != 0 ) { uip_sethostaddr( s->ipaddr ); uip_setnetmask( s->netmask ); uip_setdraddr( s->default_router ); resolv_conf( ( u16_t* )s->dnsaddr ); elua_uip_configured = 1; } else elua_uip_conf_static();}
开发者ID:Linux-enCaja,项目名称:robotica,代码行数:13,
示例12: elua_uip_conf_staticstatic void elua_uip_conf_static(){ uip_ipaddr_t ipaddr; uip_ipaddr( ipaddr, ELUA_CONF_IPADDR0, ELUA_CONF_IPADDR1, ELUA_CONF_IPADDR2, ELUA_CONF_IPADDR3 ); uip_sethostaddr( ipaddr ); uip_ipaddr( ipaddr, ELUA_CONF_NETMASK0, ELUA_CONF_NETMASK1, ELUA_CONF_NETMASK2, ELUA_CONF_NETMASK3 ); uip_setnetmask( ipaddr ); uip_ipaddr( ipaddr, ELUA_CONF_DEFGW0, ELUA_CONF_DEFGW1, ELUA_CONF_DEFGW2, ELUA_CONF_DEFGW3 ); uip_setdraddr( ipaddr ); uip_ipaddr( ipaddr, ELUA_CONF_DNS0, ELUA_CONF_DNS1, ELUA_CONF_DNS2, ELUA_CONF_DNS3 ); resolv_conf( ipaddr ); elua_uip_configured = 1;}
开发者ID:Linux-enCaja,项目名称:robotica,代码行数:13,
示例13: config_read/*-----------------------------------------------------------------------------------*/struct ethernet_config * CC_FASTCALLconfig_read(char *filename){ static struct { uip_ipaddr_t hostaddr; uip_ipaddr_t netmask; uip_ipaddr_t draddr; uip_ipaddr_t resolvaddr; struct ethernet_config ethernetcfg; } config; int file; file = cfs_open(filename, CFS_READ); if(file < 0) { log_message(filename, ": File not found"); error_exit(); } if(cfs_read(file, &config, sizeof(config)) < sizeof(config) - sizeof(config.ethernetcfg.name)) { log_message(filename, ": No config file"); error_exit(); } cfs_close(file); log_message("IP Address: ", ipaddrtoa(&config.hostaddr, uip_buf)); log_message("Subnet Mask: ", ipaddrtoa(&config.netmask, uip_buf)); log_message("Def. Router: ", ipaddrtoa(&config.draddr, uip_buf)); log_message("DNS Server: ", ipaddrtoa(&config.resolvaddr, uip_buf));#ifndef ETHERNET log_message("Eth. Driver: ", config.ethernetcfg.name);#else /* !ETHERNET */ #define _stringize(arg) #arg #define stringize(arg) _stringize(arg) log_message("Eth. Driver: ", stringize(ETHERNET)); #undef _stringize #undef stringize#endif /* !ETHERNET */ log_message("Driver Port: $", utoa(config.ethernetcfg.addr, uip_buf, 16)); uip_sethostaddr(&config.hostaddr); uip_setnetmask(&config.netmask); uip_setdraddr(&config.draddr);#if WITH_DNS resolv_conf(&config.resolvaddr);#endif /* WITH_DNS */ return &config.ethernetcfg;}
开发者ID:Contiki-leoqin,项目名称:contiki,代码行数:52,
示例14: net_conf_uip_setvoid net_conf_uip_set(void){ uip_ipaddr_t ipaddr; uip_ipaddr(ipaddr, net_conf_ip_addr[0], net_conf_ip_addr[1], net_conf_ip_addr[2], net_conf_ip_addr[3]); uip_sethostaddr(ipaddr); uip_ipaddr(ipaddr, net_conf_gateway[0], net_conf_gateway[1], net_conf_gateway[2], net_conf_gateway[3]); uip_setdraddr(ipaddr); uip_ipaddr(ipaddr, net_conf_net_mask[0], net_conf_net_mask[1], net_conf_net_mask[2], net_conf_net_mask[3]); uip_setnetmask(ipaddr);}
开发者ID:atalax,项目名称:avr-uip-2,代码行数:14,
示例15: dhcpc_configuredvoid dhcpc_configured(const struct dhcpc_state *s) { uip_sethostaddr(&s->ipaddr); uip_setnetmask(&s->netmask); uip_setdraddr(&s->default_router); /* We don't call resolv_conf here, because that would drag in all the resolver code and state whether or not it's used by the sketch. Instead we pass the address of the DNS server to the DHCP status callback code provided by the sketch and allow that to initialise the resolver if desired. */ // resolv_conf(s->dnsaddr); if (uip.dhcp_status_callback!=NULL) { uip.dhcp_status_callback(DHCP_STATUS_OK, &s->dnsaddr); }}
开发者ID:skydome,项目名称:NanodeUIP,代码行数:14,
示例16: dhcpc_configuredvoiddhcpc_configured(const struct dhcpc_state *s){ if(s == 0) { set_eeprom_addr(); return; } ewip(s->ipaddr, EE_IP4_ADDR); uip_sethostaddr(s->ipaddr); ewip(s->default_router, EE_IP4_GATEWAY); uip_setdraddr(s->default_router); ewip(s->netmask, EE_IP4_NETMASK); uip_setnetmask(s->netmask); //resolv_conf(s->dnsaddr); uip_udp_remove(s->conn); ip_initialized();}
开发者ID:Talustus,项目名称:culfw,代码行数:14,
示例17: UIP_TASK_NetmaskSets32 UIP_TASK_NetmaskSet(u32 mask){ uip_ipaddr_t ipaddr; my_netmask = mask; uip_ipaddr(ipaddr, ((mask)>>24) & 0xff, ((mask)>>16) & 0xff, ((mask)>> 8) & 0xff, ((mask)>> 0) & 0xff); uip_setnetmask(ipaddr); return 0; // no error}
开发者ID:JKcompute,项目名称:395_midi_controller,代码行数:14,
示例18: main/*-----------------------------------------------------------------------------------*/voidmain(void){ struct ethernet_config *ethernet_config; clrscr(); bordercolor(BORDERCOLOR); bgcolor(SCREENCOLOR); process_init();#if 1 ethernet_config = config_read("contiki.cfg");#else { static struct ethernet_config config = {0xD500, "cs8900a.eth"}; uip_ipaddr_t addr; uip_ipaddr(&addr, 192,168,0,128); uip_sethostaddr(&addr); uip_ipaddr(&addr, 255,255,255,0); uip_setnetmask(&addr); uip_ipaddr(&addr, 192,168,0,1); uip_setdraddr(&addr); uip_ipaddr(&addr, 192,168,0,1); resolv_conf(&addr); ethernet_config = &config; }#endif procinit_init(); process_start((struct process *)ðernet_process, (char *)ethernet_config); autostart_start(autostart_processes); log_message("Contiki up and running ...", ""); while(1) { process_run(); etimer_request_poll(); }}
开发者ID:1uk3,项目名称:contiki,代码行数:50,
示例19: zbus_stack_initvoid zbus_stack_init (void){ uip_ipaddr_t ip; set_CONF_ZBUS_IP(&ip); uip_sethostaddr(&ip);#ifdef IPV6_SUPPORT uip_setprefixlen(CONF_ZBUS_IP6_PREFIX_LEN);#else set_CONF_ZBUS_IP4_NETMASK(&ip); uip_setnetmask(&ip);#endif}
开发者ID:1234tester,项目名称:ethersex,代码行数:15,
示例20: timer_setvoid SerialIPStack::begin(IP_ADDR myIP, IP_ADDR subnet){ uip_ipaddr_t ipaddr; timer_set(&this->periodic_timer, CLOCK_SECOND / 4); slipdev_init(); uip_init(); uip_ipaddr(ipaddr, myIP.a, myIP.b, myIP.c, myIP.d); uip_sethostaddr(ipaddr); uip_ipaddr(ipaddr, subnet.a, subnet.b, subnet.c, subnet.d); uip_setnetmask(ipaddr);}
开发者ID:lstefani006,项目名称:teensy,代码行数:15,
示例21: dhcpc_unconfigured/*-----------------------------------------------------------------------------------*/voiddhcpc_unconfigured(const struct dhcpc_state *s){ static uip_ipaddr_t nulladdr; uip_sethostaddr(&nulladdr); uip_setnetmask(&nulladdr); uip_setdraddr(&nulladdr);#if WITH_DNS resolv_conf(&nulladdr);#endif /* WITH_DNS */ set_statustext("Unconfigured."); process_post(PROCESS_CURRENT(), PROCESS_EVENT_MSG, NULL);}
开发者ID:AWRyder,项目名称:contiki,代码行数:16,
示例22: config_read/*-----------------------------------------------------------------------------------*/voidconfig_read(char *filename){ int file; file = cfs_open(filename, CFS_READ); if(file < 0) { log_message(filename, ": File not found"); error_exit(); } if(cfs_read(file, &config, sizeof(config)) < sizeof(uip_ipaddr_t) * 4 + sizeof(uint16_t)) { log_message(filename, ": No config file"); error_exit(); } cfs_close(file); log_message("IP Address: ", ipaddrtoa(&config.hostaddr, uip_buf)); log_message("Subnet Mask: ", ipaddrtoa(&config.netmask, uip_buf)); log_message("Def. Router: ", ipaddrtoa(&config.draddr, uip_buf)); log_message("DNS Server: ", ipaddrtoa(&config.resolvaddr, uip_buf));#ifdef STATIC_DRIVER #define _stringize(arg) #arg #define stringize(arg) _stringize(arg)#if WITH_SLIP log_message("SLIP Driver: ", stringize(STATIC_DRIVER));#else /* WITH_SLIP */ log_message("Eth. Driver: ", stringize(STATIC_DRIVER));#endif /* WITH_SLIP */ #undef _stringize #undef stringize#else /* STATIC_DRIVER */ log_message("Eth. Driver: ", config.ethernet.name);#endif /* STATIC_DRIVER */#if !WITH_SLIP log_message("Driver Port: $", utoa(config.ethernet.addr, uip_buf, 16));#endif /* !WITH_SLIP */ uip_sethostaddr(&config.hostaddr); uip_setnetmask(&config.netmask); uip_setdraddr(&config.draddr);#if WITH_DNS uip_nameserver_update(&config.resolvaddr, UIP_NAMESERVER_INFINITE_LIFETIME);#endif /* WITH_DNS */}
开发者ID:1847123212,项目名称:contiki,代码行数:49,
示例23: autoip_configuredvoid autoip_configured(uip_ipaddr_t autoip_ipaddr) { if (!dhcp_done) { uip_ipaddr_t ipaddr;#ifdef XTCP_VERBOSE_DEBUG printf("ipv4ll: "); uip_printip4(autoip_ipaddr); printf("/n");#endif /* XTCP_VERBOSE_DEBUG */ uip_sethostaddr(autoip_ipaddr); uip_ipaddr(ipaddr, 255, 255, 0, 0); uip_setnetmask(ipaddr); uip_ipaddr(ipaddr, 0, 0, 0, 0); uip_setdraddr(ipaddr); uip_xtcp_up(); }}
开发者ID:graymalkin,项目名称:sc_xtcp,代码行数:16,
示例24: ip_init/** * /brief Initialize the uIP startup settings * /param void There are no parameters needed. * /return No return values. */voidip_init(void){ uip_ipaddr_t ip_addr, subnet; /*Init uIP Stack*/ uip_init(); /*Set IPv4 Address*/ uip_ipaddr(&ip_addr, 192, 168, 2, 2); uip_sethostaddr(&ip_addr); /*Set (IPv4) Subnet*/ uip_ipaddr(&subnet, 255, 255, 255, 0); uip_setnetmask(&subnet);}
开发者ID:kincki,项目名称:contiki,代码行数:22,
示例25: dhcpc_configured/////////////////////////////////////////////////////////////////////////////// Called by DHCP client once it got IP addresses/////////////////////////////////////////////////////////////////////////////void dhcpc_configured(const struct dhcpc_state *s){ // set IP settings uip_sethostaddr(s->ipaddr); uip_setnetmask(s->netmask); uip_setdraddr(s->default_router); // start services UIP_TASK_StartServices(); // print unused settings MIOS32_MIDI_SendDebugMessage("[UIP_TASK] Got DNS server %d.%d.%d.%d/n", uip_ipaddr1(s->dnsaddr), uip_ipaddr2(s->dnsaddr), uip_ipaddr3(s->dnsaddr), uip_ipaddr4(s->dnsaddr)); MIOS32_MIDI_SendDebugMessage("[UIP_TASK] Lease expires in %d hours/n", (ntohs(s->lease_time[0])*65536ul + ntohs(s->lease_time[1]))/3600);}
开发者ID:JKcompute,项目名称:395_midi_controller,代码行数:20,
|