您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ uip_ipaddr函数代码示例

51自学网 2021-06-03 09:08:14
  C++
这篇教程C++ uip_ipaddr函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中uip_ipaddr函数的典型用法代码示例。如果您正苦于以下问题:C++ uip_ipaddr函数的具体用法?C++ uip_ipaddr怎么用?C++ uip_ipaddr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了uip_ipaddr函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: prvInitialise_uIP

static void prvInitialise_uIP( void ){uip_ipaddr_t xIPAddr;xTimerHandle xARPTimer, xPeriodicTimer;	uip_init();	uip_ipaddr( &xIPAddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );	uip_sethostaddr( &xIPAddr );	uip_ipaddr( &xIPAddr, configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 );	uip_setnetmask( &xIPAddr );	prvSetMACAddress();	httpd_init();	/* Create the queue used to sent TCP/IP events to the uIP stack. */	xEMACEventQueue = xQueueCreate( uipEVENT_QUEUE_LENGTH, sizeof( unsigned long ) );	/* Create and start the uIP timers. */	xARPTimer = xTimerCreate( 	( signed char * ) "ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */								( 10000UL / portTICK_RATE_MS ), /* Timer period. */								pdTRUE, /* Autor-reload. */								( void * ) uipARP_TIMER,								prvUIPTimerCallback							);	xPeriodicTimer = xTimerCreate( 	( signed char * ) "PeriodicTimer",									( 500UL / portTICK_RATE_MS ),									pdTRUE, /* Autor-reload. */									( void * ) uipPERIODIC_TIMER,									prvUIPTimerCallback								);	/* Sanity check that the timers were indeed created. */	configASSERT( xARPTimer );	configASSERT( xPeriodicTimer );	configASSERT( xEMACEventQueue );	/* These commands will block indefinitely until they succeed, so there is	no point in checking their return values. */	xTimerStart( xARPTimer, portMAX_DELAY );	xTimerStart( xPeriodicTimer, portMAX_DELAY );}
开发者ID:EnglishArcher,项目名称:Code,代码行数:41,


示例2: socket_connect

//Connect to a remote host and associate the file_handle with the connection.//returns true on success, false on failure (eg, no more uip connection slots available )//Note that success does not indicate the connection was establshed; watch the file handle's status for state changes.bool socket_connect( file_handle_t file_handle, struct inetaddr_t *remote_address ){    struct file_t* file = file_get_by_handle( file_handle );    if( file == NULL ) return false;    u16_t ipaddr[2];    uip_ipaddr(ipaddr, remote_address->addr1,remote_address->addr2,remote_address->addr3,remote_address->addr4);    struct uip_conn *conn = uip_connect(ipaddr, htons( remote_address->port ) );    if( conn == NULL ) return false;    conn->appstate[0] = file_handle;    file->state = OpenPending;    return true;}
开发者ID:Random1984,项目名称:dangerous-prototypes-open-hardware,代码行数:15,


示例3: dhcpc_request

/*---------------------------------------------------------------------------*/voiddhcpc_request(void){    uip_ipaddr_t ipaddr;    if(s.state == STATE_INITIAL)    {        uip_ipaddr(&ipaddr, 0,0,0,0);        uip_sethostaddr(&ipaddr);        handle_dhcp(PROCESS_EVENT_NONE, NULL);    }}
开发者ID:aiss83,项目名称:nucbit,代码行数:13,


示例4: netif_set_addr

void 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);	uip_ethaddr.addr[0] = mymac[0];	uip_ethaddr.addr[1] = mymac[1];	uip_ethaddr.addr[2] = mymac[2];	uip_ethaddr.addr[3] = mymac[3];	uip_ethaddr.addr[4] = mymac[4];	uip_ethaddr.addr[5] = mymac[5];	uip_setethaddr(uip_ethaddr);	      return ;}
开发者ID:congallenwang,项目名称:uip-webserver,代码行数:21,


示例5: sendmail_main

int 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,


示例6: uip_task_init

void uip_task_init(const uint8 *ipbuf, const uint8 *netmask, const uint8 *mac){  	uip_ipaddr_t ipaddr;  		  	uip_init();  	uip_arp_init();  	  	uip_ipaddr(ipaddr, ipbuf[0], ipbuf[1], ipbuf[2], ipbuf[3]);  	uip_sethostaddr(ipaddr);  	  	uip_ipaddr(ipaddr, netmask[0], netmask[1], netmask[2], netmask[3]);  	uip_setnetmask(ipaddr);  			uip_ethaddr.addr[0] = mac[0];	uip_ethaddr.addr[1] = mac[1];	uip_ethaddr.addr[2] = mac[2];	uip_ethaddr.addr[3] = mac[3];	uip_ethaddr.addr[4] = mac[4];	uip_ethaddr.addr[5] = mac[5];  		}
开发者ID:jayaraj-poroor,项目名称:freertos-uip-kernel,代码行数:21,


示例7: dhcpc_request

/*---------------------------------------------------------------------------*/voiddhcpc_request(void){  uip_ipaddr_t ipaddr;    if(s.state == STATE_INITIAL) {    uip_ipaddr(&ipaddr, 0,0,0,0);    uip_sethostaddr(&ipaddr);    s.task = posTaskCreate(dhcpTask, NULL, 1, 1000);    POS_SETTASKNAME(s.task, "uip:dhcpc");  }}
开发者ID:AriZuu,项目名称:picoos-net,代码行数:14,


示例8: udpHandler_init

/*---------------------------------------------------------------------------*/voidudpHandler_init(void){	uip_ipaddr_t addr;	struct uip_udp_conn *c;	uip_ipaddr(&addr, 192,168,0,199);	c = uip_udp_new(&addr, HTONS(0));	if(c != NULL) {		uip_udp_bind(c, HTONS(1101));	}}
开发者ID:Arseni,项目名称:Studienarbeit,代码行数:14,


示例9: prvInitialise_uIP

static void prvInitialise_uIP( void ){    TimerHandle_t xARPTimer, xPeriodicTimer;    uip_ipaddr_t xIPAddr;    const unsigned long ul_uIPEventQueueLength = 10UL;    /* Initialise the uIP stack. */    uip_init();    uip_ipaddr( &xIPAddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );    uip_sethostaddr( &xIPAddr );    uip_ipaddr( &xIPAddr, configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 );    uip_setnetmask( &xIPAddr );    prvSetMACAddress();    httpd_init();    /* Create the queue used to sent TCP/IP events to the uIP stack. */    xEMACEventQueue = xQueueCreate( ul_uIPEventQueueLength, sizeof( unsigned long ) );    /* Create and start the uIP timers. */    xARPTimer = xTimerCreate( 	"ARPTimer", /* Just a name that is helpful for debugging, not used by the kernel. */                                ( 10000UL / portTICK_PERIOD_MS ), /* Timer period. */                                pdTRUE, /* Autor-reload. */                                ( void * ) uipARP_TIMER,                                prvUIPTimerCallback                            );    xPeriodicTimer = xTimerCreate( 	"PeriodicTimer",                                    ( 50 / portTICK_PERIOD_MS ),                                    pdTRUE, /* Autor-reload. */                                    ( void * ) uipPERIODIC_TIMER,                                    prvUIPTimerCallback                                 );    configASSERT( xARPTimer );    configASSERT( xPeriodicTimer );    xTimerStart( xARPTimer, portMAX_DELAY );    xTimerStart( xPeriodicTimer, portMAX_DELAY );}
开发者ID:BuiChien,项目名称:FreeRTOS-TM4C123GXL,代码行数:39,


示例10: uip_server_init

void uip_server_init(chanend xtcp[], int num_xtcp, xtcp_ipconfig_t* ipconfig, unsigned char mac_address[6]){	if (ipconfig != NULL)		memcpy(&uip_static_ipconfig, ipconfig, sizeof(xtcp_ipconfig_t));	memcpy(&uip_ethaddr, mac_address, 6);	uip_init();#if UIP_IGMP	igmp_init();#endif	if (ipconfig != NULL && (*((int*)ipconfig->ipaddr) != 0)) {		uip_static_ip = 1;	}	if (ipconfig == NULL)	{		uip_ipaddr_t ipaddr;		uip_ipaddr(ipaddr, 0, 0, 0, 0);		uip_sethostaddr(ipaddr);		uip_setdraddr(ipaddr);		uip_setnetmask(ipaddr);		uip_setsubnetaddr();	} else {		uip_sethostaddr(ipconfig->ipaddr);		uip_setdraddr(ipconfig->gateway);		uip_setnetmask(ipconfig->netmask);		uip_setsubnetaddr();#ifdef XTCP_VERBOSE_DEBUG		printstr("Address: ");uip_printip4(uip_hostaddr);printstr("/n");		printstr("Gateway: ");uip_printip4(uip_draddr);printstr("/n");		printstr("Netmask: ");uip_printip4(uip_netmask);printstr("/n");#endif	}	{#if UIP_USE_AUTOIP		int hwsum = mac_address[0] + mac_address[1] + mac_address[2]				+ mac_address[3] + mac_address[4] + mac_address[5];		autoip_init(hwsum + (hwsum << 16) + (hwsum << 24));#endif#if UIP_USE_DHCP		dhcpc_init(uip_ethaddr.addr, 6);#endif		xtcpd_init(xtcp, num_xtcp);	}}
开发者ID:colinbroad,项目名称:sc_xtcp,代码行数:51,


示例11: PROCESS_THREAD

PROCESS_THREAD(init_process, ev, data){  uip_ipaddr_t addr;  PROCESS_BEGIN();    uip_ipaddr(&addr, 192,168,2,2);  uip_sethostaddr(&addr);  uip_ipaddr(&addr, 192,168,2,1);  uip_setdraddr(&addr);  uip_ipaddr(&addr, 255,255,255,0);  uip_setnetmask(&addr);  printf("init/n");    program_handler_add(&netconf_dsc, "Network setup", 1);  program_handler_add(&ftp_dsc, "FTP client", 1);  program_handler_add(&www_dsc, "Web browser", 1);  program_handler_add(&processes_dsc, "Processes", 1);  program_handler_add(&shell_dsc, "Command shell", 1);  program_handler_add(&calc_dsc, "Calculator", 1);  /*  program_handler_add(&email_dsc, "E-mail", 1);*/  program_handler_add(&irc_dsc, "IRC", 1);  /*  program_handler_add(&vnc_dsc, "VNC client", 1);*/  program_handler_add(&dhcp_dsc, "DHCP client", 1);  uip_fw_default(&tapif);  while(1) {    PROCESS_WAIT_EVENT();  }    PROCESS_END();}
开发者ID:kincki,项目名称:contiki,代码行数:38,


示例12: _tcpip_init

int_tcpip_init(void){  uip_ipaddr_t ipaddr;  timer_set(&periodic_timer, CLOCK_SECOND/2);  timer_set(&arp_timer, CLOCK_SECOND * 10);  timer_set(&cli_timer, CLOCK_SECOND);    mt76xx_dev_init();  uip_init();  //Printf_High("Tcp INIT /n");#ifdef CONFIG_SOFTAP	uip_ipaddr(ipaddr, 192,168,81,1);	uip_sethostaddr(ipaddr);	uip_ipaddr(ipaddr, 192,168,81,1);	uip_setdraddr(ipaddr);	uip_ipaddr(ipaddr, 255,255,255,0);	uip_setnetmask(ipaddr);//	Printf_High("TcpIP IniT===/n");	uip_gethostaddr(ipaddr); #endif   iot_udp_app_init();  iot_tcp_app_init();#ifndef CONFIG_SOFTAP  if (IoTpAd.ComCfg.Use_DHCP!=1) {	uip_ipaddr(ipaddr, IoTpAd.ComCfg.STATIC_IP[0],IoTpAd.ComCfg.STATIC_IP[1],				IoTpAd.ComCfg.STATIC_IP[2],IoTpAd.ComCfg.STATIC_IP[3]);	uip_sethostaddr(ipaddr);	uip_ipaddr(ipaddr,IoTpAd.ComCfg.SubnetMask_IP[0], IoTpAd.ComCfg.SubnetMask_IP[1], 				IoTpAd.ComCfg.SubnetMask_IP[2], IoTpAd.ComCfg.SubnetMask_IP[3]);	uip_setnetmask(ipaddr);	uip_ipaddr(ipaddr, IoTpAd.ComCfg.GateWay_IP[0], IoTpAd.ComCfg.GateWay_IP[1], 				IoTpAd.ComCfg.GateWay_IP[2], IoTpAd.ComCfg.GateWay_IP[3]);	uip_setdraddr(ipaddr);#if CFG_SUPPORT_DNS	uip_ipaddr(ipaddr, IoTpAd.ComCfg.DNS_IP[0],IoTpAd.ComCfg.DNS_IP[1],				IoTpAd.ComCfg.DNS_IP[2],IoTpAd.ComCfg.DNS_IP[3]);	resolv_conf(ipaddr);	resolv_query("www.ablecloud.cn");#endif	dhcpc_set_state(STATE_CONFIG_DONE);  }#endif  cli_fd = -1;  return 0;} 
开发者ID:cxy560,项目名称:ZCloud,代码行数:53,


示例13: network_setup

void network_setup() {  printf("network_setup/n");    uip_ipaddr_t ipaddr;  uip_ipaddr_t gatewayAddr;  uip_ipaddr_t netmaskAddr;  uip_lladdr.addr[0] = MAC_ADDRESS[0];  uip_lladdr.addr[1] = MAC_ADDRESS[1];  uip_lladdr.addr[2] = MAC_ADDRESS[2];  uip_lladdr.addr[3] = MAC_ADDRESS[3];  uip_lladdr.addr[4] = MAC_ADDRESS[4];  uip_lladdr.addr[5] = MAC_ADDRESS[5];  uip_ipaddr(&ipaddr, 192, 168, 0, 101);  uip_sethostaddr(&ipaddr);  uip_ipaddr(&gatewayAddr, 192, 168, 0, 1);  uip_setdraddr(&gatewayAddr);  uip_ipaddr(&netmaskAddr, 255, 255, 255, 0);  uip_setnetmask(&netmaskAddr);  tcpip_set_outputfunc(enc28j60_tcp_output);  enc28j60_init(uip_lladdr.addr);    uip_init();  uip_arp_init();    printf("Start RS232UDP Process/n");  process_start(&rs232udp_process, NULL);  printf("Start network Process/n");  process_start(&network_process, NULL);  printf("END network_setup/n");}
开发者ID:glocklueng,项目名称:stm32-network-rs232,代码行数:38,


示例14: network_init

voidnetwork_init(void){	uip_listen(HTONS(NETWORK_PORT_GCODE));	uip_listen(HTONS(NETWORK_PORT_DEBUG));		// Listen on a UDP port	uip_ipaddr_t addr;	struct uip_udp_conn *c;	uip_ipaddr(&addr, 0,0,0,0);	c = uip_udp_new(&addr, HTONS(0));	if(c != NULL)		uip_udp_bind(c, HTONS(NETWORK_PORT_GCODE));}
开发者ID:jsr38,项目名称:makebed,代码行数:14,


示例15: tdtp_connect

static void tdtp_connect(void){        struct uip_conn *conn;        uip_ipaddr_t ipaddr;        uip_ipaddr(&ipaddr, 10, 69, 69, 1);        conn = uip_connect(&ipaddr, htons(6969));        if(conn == NULL) {#ifdef MOG_DEBUG                printf("failure out of ports/r/n");#endif                tdtp_state=1;        }}
开发者ID:mogorman,项目名称:stevie,代码行数:14,


示例16: init_net

/*---------------------------------------------------------------------------*/voidinit_net(void){  int i;  uip_ipaddr_t hostaddr, netmask;  rimeaddr_t rimeaddr;  /* Init Rime */  ctimer_init();  rimeaddr.u8[0] = node_id & 0xff;  rimeaddr.u8[1] = node_id >> 8;  rimeaddr_set_node_addr(&rimeaddr);  printf("Rime started with address: ");  for(i = 0; i < sizeof(rimeaddr_node_addr.u8) - 1; i++) {    printf("%d.", rimeaddr_node_addr.u8[i]);  }  printf("%d/n", rimeaddr_node_addr.u8[i]);  /* Init uIPv4 */  process_start(&tcpip_process, NULL);  process_start(&uip_fw_process, NULL);  process_start(&slip_process, NULL);  uip_init();  uip_fw_init();  uip_ipaddr(&hostaddr, 172, 16, rimeaddr_node_addr.u8[1], rimeaddr_node_addr.u8[0]);  uip_ipaddr(&netmask, 255,255,0,0);  uip_sethostaddr(&hostaddr);  uip_setnetmask(&netmask);  uip_fw_register(&wsn_if);  uip_fw_default(&slip_if);  rs232_set_input(slip_input_byte);  printf("uIP started with IP address: %d.%d.%d.%d/n", uip_ipaddr_to_quad(&hostaddr));  /* uIPv4 <-> COOJA's packet radio */  /*tcpip_set_outputfunc(sender);*/  cooja_radio.set_receive_function(receiver);}
开发者ID:EDAyele,项目名称:ptunes,代码行数:38,


示例17: dhcp_init

void dhcp_init(void){        uip_ipaddr_t ipaddr;        uip_ipaddr(&ipaddr, 255, 255, 255, 255);        dhcp_s.conn = uip_udp_new(&ipaddr, HTONS(DHCP_SERVER_PORT));        uip_udp_bind(dhcp_s.conn, HTONS(DHCP_CLIENT_PORT));        dhcp_s.xid = random();        dhcp_s.dhcp_renew_time = get_clock() + 2 * CLOCK_TICKS_PER_SECOND +                                 (random() % (3 * CLOCK_TICKS_PER_SECOND));        dhcp_s.state = DHCP_STATE_BOOT_WAIT;}
开发者ID:sli92,项目名称:netcon,代码行数:15,


示例18: twitter_resolve

    inttwitter_resolve(cb_resolve_status_t cb_resolve_status, struct process *parent){    state.cb_resolve_status = cb_resolve_status;    state.parent = parent;#if UIP_UDP    resolv_query(DEFAULT_HOST);    process_start(&twitter_resolve_process, NULL);    return 1;#else /* UIP_UDP */    uip_ipaddr(ip_address, DEFAULT_IP[0], DEFAULT_IP[1], DEFAULT_IP[2], DEFAULT_IP[3]);    return 0;#endif /* UIP_UDP */}
开发者ID:kincki,项目名称:contiki,代码行数:15,


示例19: udpapp_init

void udpapp_init(void){	uip_ipaddr_t addr;	struct uip_udp_conn *c;	uip_ipaddr(&addr, 255, 255, 255, 255);	c = uip_udp_new(&addr, HTONS(0));	if(c != NULL) {		uip_udp_bind(c, HTONS(2222));	}	s.state = STATE_INIT;	PT_INIT(&s.pt);}
开发者ID:jeremywrnr,项目名称:life-of-the-party,代码行数:15,


示例20: udpapp_init

void udpapp_init(void){	uip_ipaddr_t addr;	struct uip_udp_conn *c;	uip_ipaddr(&addr, 192,168,1,23);	c = uip_udp_new(&addr, HTONS(0));	if(c != NULL) {		uip_udp_bind(c, HTONS(12344));	}	s.state = STATE_INIT;	PT_INIT(&s.pt);}
开发者ID:SoundGuyAndy,项目名称:MissingLinkFirmware,代码行数:15,


示例21: eth_device_init

/*---------------------------------------------------------------------------*/rt_err_t eth_device_init(struct eth_device* dev, const char* name){    uip_ipaddr_t ipaddr;    rt_device_register(&(dev->fops), name, RT_DEVICE_FLAG_RDWR);    dev->fops.type = RT_Device_Class_NetIf;    /*       uip_ipaddr(ipaddr, RT_UIP_IPADDR0,RT_UIP_IPADDR1,RT_UIP_IPADDR2,RT_UIP_IPADDR3);       uip_sethostaddr(ipaddr);       uip_ipaddr(ipaddr, RT_UIP_GWADDR0,RT_UIP_GWADDR1,RT_UIP_GWADDR2,RT_UIP_GWADDR3);       uip_setdraddr(ipaddr);       uip_ipaddr(ipaddr, RT_UIP_MSKADDR0,RT_UIP_MSKADDR1,RT_UIP_MSKADDR2,RT_UIP_MSKADDR3);       uip_setnetmask(ipaddr);     */    uip_ipaddr(ipaddr, 192,168,0,2);    uip_sethostaddr(ipaddr);    uip_ipaddr(ipaddr, 192,168,0,1);    uip_setdraddr(ipaddr);    uip_ipaddr(ipaddr, 255,255,255,0);    uip_setnetmask(ipaddr);    return RT_EOK;}
开发者ID:dreamflyforever,项目名称:rt-thread-1.1.0,代码行数:25,


示例22: _tcpip_init

int_tcpip_init(void){    uip_ipaddr_t ipaddr;    timer_set(&periodic_timer, CLOCK_SECOND/2);    timer_set(&arp_timer, CLOCK_SECOND * 10);    timer_set(&cli_timer, CLOCK_SECOND);    mt76xx_dev_init();    uip_init();#ifdef CONFIG_SOFTAP    uip_ipaddr(ipaddr, UIP_IPADDR0,UIP_IPADDR1,UIP_IPADDR2,UIP_IPADDR3);    uip_sethostaddr(ipaddr);    uip_ipaddr(ipaddr, UIP_IPADDR0,UIP_IPADDR1,UIP_IPADDR2,UIP_IPADDR3);    uip_setdraddr(ipaddr);    uip_ipaddr(ipaddr, UIP_NETMASK0,UIP_NETMASK1,UIP_NETMASK2,UIP_NETMASK3);    uip_setnetmask(ipaddr);    uip_gethostaddr(ipaddr);#endif    iot_udp_app_init();    iot_tcp_app_init();#ifdef CONFIG_STATION    if (IoTpAd.ComCfg.Use_DHCP!=1) {        uip_ipaddr(ipaddr, IoTpAd.ComCfg.STATIC_IP[0],IoTpAd.ComCfg.STATIC_IP[1],                   IoTpAd.ComCfg.STATIC_IP[2],IoTpAd.ComCfg.STATIC_IP[3]);        uip_sethostaddr(ipaddr);        uip_ipaddr(ipaddr,IoTpAd.ComCfg.SubnetMask_IP[0], IoTpAd.ComCfg.SubnetMask_IP[1],                   IoTpAd.ComCfg.SubnetMask_IP[2], IoTpAd.ComCfg.SubnetMask_IP[3]);        uip_setnetmask(ipaddr);        uip_ipaddr(ipaddr, IoTpAd.ComCfg.GateWay_IP[0], IoTpAd.ComCfg.GateWay_IP[1],                   IoTpAd.ComCfg.GateWay_IP[2], IoTpAd.ComCfg.GateWay_IP[3]);        uip_setdraddr(ipaddr);#if CFG_SUPPORT_DNS        uip_ipaddr(ipaddr, IoTpAd.ComCfg.DNS_IP[0],IoTpAd.ComCfg.DNS_IP[1],                   IoTpAd.ComCfg.DNS_IP[2],IoTpAd.ComCfg.DNS_IP[3]);        resolv_conf(ipaddr);        resolv_query("www.baidu.com");#endif        dhcpc_set_state(STATE_CONFIG_DONE);    }#endif    cli_fd = -1;    return 0;}
开发者ID:Altizon,项目名称:Aliot-SDK-Examples,代码行数:51,


示例23: InitNet

/********************************************************************************	函数名:InitNet*	输  入:*	输  出:*	功能说明:初始化网络硬件、UIP协议栈、配置本机IP地址*/void InitNet(void){	uip_ipaddr_t ipaddr;	/* 检测网卡芯片 */	{		uint32_t vid;		vid = dm9k_ReadID();		if (vid == DM9000A_ID_OK)		{			//printf("DM9000AE Detect Ok, vid&pid = %08X/n/r", vid);		}		else		{			//printf("DM9000AE Detect Failed, vid&pid = %08X, Expected = %08X/n/r", vid, DM9000A_ID_OK);		}	}	tapdev_init();	//printf("uip_init/n/r");	uip_init();	//printf("uip ip address : 192,168,20,11/n/r");	uip_ipaddr(ipaddr, 192,168,20,11);	uip_sethostaddr(ipaddr);	//printf("uip route address : 192,168,20,1/n/r");	uip_ipaddr(ipaddr, 192,168,20,1);	uip_setdraddr(ipaddr);	//printf("uip net mask : 255,255,255,0/n/r");	uip_ipaddr(ipaddr, 255,255,255,0);	uip_setnetmask(ipaddr);}
开发者ID:Jeansfirm,项目名称:glexer_HDPLC_COAXIAL,代码行数:42,


示例24: bootp_net_init

voidbootp_net_init(void){    uip_ipaddr_t ip;    uip_ipaddr(&ip, 255,255,255,255);    uip_udp_conn_t *bootp_conn = uip_udp_new(&ip, HTONS(BOOTPS_PORT), bootp_net_main);    if(! bootp_conn)	return; /* dammit. */    uip_udp_bind(bootp_conn, HTONS(BOOTPC_PORT));    bootp_conn->appstate.bootp.retry_timer = 0;}
开发者ID:simeonfelis,项目名称:ethersex,代码行数:15,


示例25: dhcpc_request

/*---------------------------------------------------------------------------*/voiddhcpc_request(void){  u16_t ipaddr[2];  //sendString("/r/ndhcpc request called");  if(s.state == STATE_INITIAL) {//sendString("/r/ndhcpc request init state");#if defined PORT_APP_MAPPER    dhcpc_running = 1; #endif    uip_ipaddr(ipaddr, 0,0,0,0);    uip_sethostaddr(ipaddr);    //handle_dhcp();  }}
开发者ID:hokim72,项目名称:AVR-Common,代码行数:17,


示例26: dhcpc_init

/*---------------------------------------------------------------------------*/voiddhcpc_init(const void *mac_addr, int mac_len){  uip_ipaddr_t addr;    s.mac_addr = mac_addr;  s.mac_len  = mac_len;  s.state = STATE_INITIAL;  uip_ipaddr(addr, 255,255,255,255);  s.conn = uip_udp_new(&addr, HTONS(DHCPC_SERVER_PORT));  if(s.conn != NULL) {    uip_udp_bind(s.conn, HTONS(DHCPC_CLIENT_PORT));  }  PT_INIT(&s.pt);}
开发者ID:Anil8590,项目名称:tiva-c,代码行数:17,


示例27: _mqttclient_broker_connect

static void _mqttclient_broker_connect(void) {    struct uip_conn *uc;    uip_ipaddr_t ip;    uip_ipaddr(&ip,                MQTT_BROKER_IP_ADDR0,                MQTT_BROKER_IP_ADDR1,                MQTT_BROKER_IP_ADDR2,                MQTT_BROKER_IP_ADDR3);    uc = uip_connect(&ip, htons(MQTT_BROKER_PORT));    if (uc == NULL) {        return;    }    uc->appstate.conn = &_mqtt;    update_state(MQTTCLIENT_BROKER_CONNECTING);}
开发者ID:mcmatrix,项目名称:avr-dht22-node,代码行数:16,


示例28: udp_broadcast_new

/*---------------------------------------------------------------------------*/struct uip_udp_conn *udp_broadcast_new(uint16_t port, void *appstate){    uip_ipaddr_t addr;    struct uip_udp_conn *conn;#if UIP_CONF_IPV6    uip_create_linklocal_allnodes_mcast(&addr);#else    uip_ipaddr(&addr, 255,255,255,255);#endif /* UIP_CONF_IPV6 */    conn = udp_new(&addr, port, appstate);    if(conn != NULL) {        udp_bind(conn, port);    }    return conn;}
开发者ID:kenog,项目名称:contiki-inga,代码行数:18,


示例29: tcp_cli_app1_init

void tcp_cli_app1_init(void){    UIP_CONN *tcp_conn=NULL;    uip_ipaddr_t raddr;    uint8 iot_srv_ip[MAC_IP_LEN] = TCP_CLI_APP1_IOT_SRV_IP;    uip_ipaddr(raddr, iot_srv_ip[0],iot_srv_ip[1], iot_srv_ip[2],iot_srv_ip[3]);    /* Specify remote address and port here. */    tcp_conn = uip_connect(&raddr, HTONS(TCP_CLI_APP1_REMOTE_PORT));    if (tcp_conn) {        tcp_conn->lport = HTONS(TCP_CLI_APP1_LOCAL_PORT);    } else {        printf_high("connect fail/n");    }}
开发者ID:CrippledBytes,项目名称:CentralHeater,代码行数:17,



注:本文中的uip_ipaddr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ uip_ipaddr_copy函数代码示例
C++ uip_ip6addr函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。