这篇教程C++ tcpip_init函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中tcpip_init函数的典型用法代码示例。如果您正苦于以下问题:C++ tcpip_init函数的具体用法?C++ tcpip_init怎么用?C++ tcpip_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了tcpip_init函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: network_initint network_init() {#if DEBUG tcpip_init(tcpip_init_done, (void*) ((uintptr_t) timer_getms()));#else tcpip_init(tcpip_init_done, NULL);#endif return 0;}
开发者ID:WareX97,项目名称:aPlus,代码行数:9,
示例2: system_socket_initint system_socket_init(void){ struct ip_addr ipaddr, gw, netmask; LWIP_CONFIG lwip_cfg; net_dm9ka_attach(); ipaddr.addr=inet_addr(IP_ADDRESS); netmask.addr=inet_addr(NM_ADDRESS); gw.addr=inet_addr(GW_ADDRESS); lwip_cfg.mem.enable = TRUE; lwip_cfg.mem.start = __MM_SUB_PB_START_ADDR;//LWIP_MEM_ADDR can be a Macro to define a address value. lwip_cfg.mem.length = 32*1024;//At least 32*1024; lwip_cfg.memp.enable = TRUE; lwip_cfg.memp.start = __MM_LWIP_MEMP_ADDR;//LWIP_MEMP_ADDR can be a Macro to define a address value. lwip_cfg.memp.length = __MM_LWIP_MEMP_LEN;//At least 1532*256; tcpip_init(NULL, NULL, &lwip_cfg); if (ERR_OK != sys_add_netif(&ipaddr, &netmask, &gw)) { return -1; } return 0;}
开发者ID:jinfeng-geeya,项目名称:3202C,代码行数:27,
示例3: serve_initvoidserve_init(uint32_t ipaddr, uint32_t netmask, uint32_t gw){ int r; lwip_core_lock(); uint32_t done = 0; tcpip_init(&tcpip_init_done, &done); lwip_core_unlock(); thread_wait(&done, 0, (uint32_t)~0); lwip_core_lock(); lwip_init(&nif, &output_envid, ipaddr, netmask, gw); start_timer(&t_arp, ðarp_tmr, "arp timer", ARP_TMR_INTERVAL); start_timer(&t_tcpf, &tcp_fasttmr, "tcp f timer", TCP_FAST_INTERVAL); start_timer(&t_tcps, &tcp_slowtmr, "tcp s timer", TCP_SLOW_INTERVAL); struct in_addr ia = {ipaddr}; cprintf("ns: %02x:%02x:%02x:%02x:%02x:%02x" " bound to static IP %s/n", nif.hwaddr[0], nif.hwaddr[1], nif.hwaddr[2], nif.hwaddr[3], nif.hwaddr[4], nif.hwaddr[5], inet_ntoa(ia)); lwip_core_unlock(); cprintf("NS: TCP/IP initialized./n");}
开发者ID:130B848,项目名称:JOS-labs,代码行数:29,
示例4: _lwip_sys_initstatic void _lwip_sys_init(void){ struct ip_addr ipaddr, netmask, gw; unsigned char *ip; ip = getCfgIP(); IP4_ADDR(&ipaddr,ip[0],ip[1],ip[2],ip[3]); ip = getCfgGateWay(); IP4_ADDR(&gw, ip[0],ip[1],ip[2],ip[3]); ip = getCfgNetMask(); IP4_ADDR(&netmask,ip[0],ip[1],ip[2],ip[3]); tcpip_init(RT_NULL, RT_NULL); netif_set_addr(netif_default, &ipaddr, &netmask, &gw); // We SHOULD define an IP address (udp setup should work any time). // So, it may send DHCP packets of src_addr not all zero, tested ok. /* if( isDHCPEnabled() ) { // when DHCP is enabled, ip/netmask/gateway should be set to all 0. IP4_ADDR(&ipaddr,0,0,0,0); netif_set_addr(netif_default, &ipaddr, &ipaddr, &ipaddr); } else { netif_set_addr(netif_default, &ipaddr, &netmask, &gw); }*/ netif_set_up(netif_default); if( isDHCPEnabled() ) dhcp_start(netif_default); else dhcp_stop(netif_default);}
开发者ID:visitor83,项目名称:fighting_stm32,代码行数:35,
示例5: v/*****************************************************************************************************************************函数名称: ip_input**函数功能: eth_hdr: +----------------------------------------------------------------------------------------+ + desMAC[6] | srcMAC[6] | type[2]( ARP / IP) | 数据[46-1500] | 校验[4] + +----------------------------------------------------------------------------------------+ *注: desMAC[6]: 目的MAC地址; srcMAC[6]: 源MAC地址; type[2]: 类型(IP:0X800/ARP:0X806) 数据[46-1500]:具体数据; 校验[4]:校验; etharp_hdr: +-----------------------------------------------------------------------------------------------------+ + hwhdr[2] | porotl[2] | hwlen[1] | porotllen[1] | op[2] | srcMAC[6] | srcIP[4] |desMAC[6] | desIP[4] + +-----------------------------------------------------------------------------------------------------+ *注: hwhdr[2]:硬件类型字段-表示硬件地址的类型,它的值为1即表示以太网MAC地址,长度为6个字节; porotl[2]:协议类型字段表示要映射的协议地址类型,它的值为0X800即表示要映射的IP地址; hwlen[1]: 硬件地址长度,对于以太网ARP请求或者应答来说,他的值为6; porotllen[1]:协议地址长度,对于以太网ARP请求或者应答来说,他的值为4; op[2]:操作类型 ARP请求=1,ARP应答=2,RARP请求=3,RARP=4; srcMAC[6]:发送端MAC地址; srcIP[4]: 发送端IP地址; desMAC[6]:目的端MAC地址 desIP[4]: 目的端IP地址; ip_hdr: +---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + v(bit4) | hdrlen(bit4) | TOS[1] | len[2] | flag0[2] | flag1(bit3) | offset(bit13) | ttl[1] | porotl[1] | hdrchecsum[2] | srcIP[4] | desIP[4] | 选项[...] | data[N] + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ *注: v(bit4): 版本号,目前的版本号是4即IPv4; hdrlen(bit4): 首部长度-指首部站32Bit字的数目,包括可选项,由于它是个4bit因此首部最长60字节; TOS[1]:包括一个3bit的优先字段,4bit TOS字段和1 bit未使用但必须为0,如果所有4bit都为0,即一般服务; len[2]:整个IP数据报的长度以字节为单位; flag0[2]:指唯一标示主机发送的每一份数据报,通常每发送一份报文值就会加1; flag1(bit3): 用于在IP数据包分片时使用; offset(bit13): 用于在IP数据包分片时使用; ttl[1]:描述该IP数据包最多能被转发多少次,每经过一次转发,该值就会减1,当该值为0时,一个ICMP报文会被返回至源主机; porotl[1]: 协议字段描述该IP数据包是来自上层哪个协议,改值为1表示为ICMP,2=IGMP,6=TCP,17=UDP; hdrchecsum[2]:首部校验和只针对IP首部做校验,它并不关心其内部数据在传输过程中出错与否,对于数据校验是上层协议负责的; srcIP[4]:源IP地址; desIP[4]:目标IP地址; 选项[...]:选项,可有可无; data[N]:数据data; icmp_hdr: +--------------------------------------------------------------------------------+ + type[1] | code[1] | checksum[2] | others[N](不同的类型和代码有不同的内容) | +--------------------------------------------------------------------------------+ **入口参数:**返回参数:***************************************************************************************************************************/void ipcFlyEthernetInit(void){ struct ip_addr ip_computer; memset(&flyEhternetInfo,0,sizeof(flyEhternetInfo)); flyEhternetInfo.LwIPSem = OSSemCreate(0); if(NULL == flyEhternetInfo.LwIPSem) { LIBMCU_DEBUG(ETHERNTE_DEBUG,("/r/n OSSemCreate Fail")); } tcpip_init(NULL,NULL); IP4_ADDR(&flyEhternetInfo.ipaddr, 192, 168, 8, 7); IP4_ADDR(&flyEhternetInfo.netmask, 255, 255, 0, 0); IP4_ADDR(&flyEhternetInfo.gw, 192, 168, 1, 1); netif_add(&flyEhternetInfo.netif, &flyEhternetInfo.ipaddr, &flyEhternetInfo.netmask, &flyEhternetInfo.gw, NULL, ethernetif_init, ethernet_input); netif_set_default(&flyEhternetInfo.netif); netif_set_up(&flyEhternetInfo.netif); FlyEthernetCreate(); LwipTaskCreate(); EMAC_IntStart();}
开发者ID:liudonghua7914,项目名称:FlyMcu,代码行数:84,
示例6: vWebTaskstatic void vWebTask( void *pvParameters ){ struct ip_addr ipaddr; struct ip_addr netmask; struct ip_addr gw; IP4_ADDR(&gw, 192,168,1,1); IP4_ADDR(&ipaddr, 192,168,1,2); IP4_ADDR(&netmask, 255,255,255,0); printf("Local IP:192.168.1.2/n"); tcpip_init(NULL, NULL); netif_add(&netif, &ipaddr, &netmask, &gw, NULL, ethernetif_init, tcpip_input); netif_set_default(&netif);#ifdef USE_DHCP dhcp_start(&netif);#else netif_set_up(&netif);#endif //NVIC_SetPriority(EMAC_TX_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); NVIC_EnableIRQ(EMAC_TX_IRQn); //NVIC_SetPriority(EMAC_RX_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); NVIC_EnableIRQ(EMAC_RX_IRQn); tcp_echoserver_netconn_init(); vTaskSuspend( NULL );}
开发者ID:wjw890912,项目名称:Power-measurement,代码行数:32,
示例7: ip_stack_initvoid ip_stack_init(void){ /* Netif configuration */ static ip_addr_t ipaddr, netmask, gw; IP4_ADDR(&gw, 10, 0, 0, 11); // toradex board IP IP4_ADDR(&ipaddr, 10, 0, 0, 10); IP4_ADDR(&netmask, 255,255,255,255); /* Creates the "Init done" semaphore. */ sys_sem_new(&lwip_init_done, 0); /* We start the init of the IP stack. */ tcpip_init(ipinit_done_cb, NULL); /* We wait for the IP stack to be fully initialized. */ printf("Waiting for LWIP init.../n"); sys_sem_wait(&lwip_init_done); /* Deletes the init done semaphore. */ sys_sem_free(&lwip_init_done); printf("LWIP init complete/n"); /* Adds a tap pseudo interface for unix debugging. */ netif_add(&slipf, &ipaddr, &netmask, &gw, NULL, slipif_init, tcpip_input); netif_set_default(&slipf); netif_set_up(&slipf);}
开发者ID:cvra,项目名称:debra-old,代码行数:30,
示例8: MX_LWIP_Init/* init function */void MX_LWIP_Init(void){ tcpip_init( NULL, NULL ); /* add the network interface */ netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, ðernetif_init, &tcpip_input); /* Registers the default network interface */ netif_set_default(&gnetif); if (netif_is_link_up(&gnetif)) { /* When the netif is fully configured this function must be called */ netif_set_up(&gnetif); } else { /* When the netif link is down this function must be called */ netif_set_down(&gnetif); } dhcp_start(&gnetif); /* USER CODE BEGIN 3 *//* USER CODE END 3 */}
开发者ID:wangxian0718,项目名称:STM32-F7-Ethernet-emWin,代码行数:31,
示例9: initstatic void init(void){ /* Enable all the interrupts */ IRQ_ENABLE; /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); /* Initialize system timer */ timer_init(); /* Initialize UART0 */ ser_init(&out, SER_UART0); /* Configure UART0 to work at 115.200 bps */ ser_setbaudrate(&out, 115200); /* Initialize LED driver */ LED_INIT(); /* * Kernel initialization: processes (allow to create and dispatch * processes using proc_new()). */ proc_init(); /* Initialize TCP/IP stack */ tcpip_init(NULL, NULL); /* Bring up the network interface */ netif_add(&netif, &ipaddr, &netmask, &gw, NULL, ethernetif_init, tcpip_input); netif_set_default(&netif); netif_set_up(&netif);}
开发者ID:DINKIN,项目名称:bertos,代码行数:30,
示例10: networkInit/********************************************************************************* networkInit** Initializes the network interface configuration and creates the TCP/IP thread.*** RETURNS: None* *******************************************************************************/void networkInit( void ){#if defined(CUTE) && defined (INCLUDE_NETWORK) static ETH_DEV_PARAMS ethDevParms; u32_t addr; u32_t size; NETDBG(("lwIP Initializing.../n")); geifGetMemInfo( &addr, &size ); NETDBG(("geif mem: Pool: 0x%08x-0x%08x size: %u bytes/n", addr, (addr + size - 1), size)); /* Setup the network interface configuration */ /* Note: if DHCP is configured, it will override */ /* the IP address settings made here */ memset( ðDevParms, 0, sizeof(ETH_DEV_PARAMS) ); ethDevParms.num = 1; /* Number of devices to start */ ethDevParms.devices[0].vid = 0x8086; ethDevParms.devices[0].did = 0x1521; /* 82579LM */ ethDevParms.devices[0].irqNo = 18; ethDevParms.devices[0].instance = 1; IP4_ADDR((ðDevParms.devices[0].ipAddr), 192,67,84,250); IP4_ADDR((ðDevParms.devices[0].netMask), 255,255,255,0); IP4_ADDR((ðDevParms.devices[0].gateway), 192,67,84,21); /* Creates the TCP/IP thread and start the interfaces */ tcpip_init( 1, lwIPAppsInit, (void *) ðDevParms );#endif}
开发者ID:testing-ishita,项目名称:test2,代码行数:44,
示例11: WebEthIntit/********************************************************************************* Name: WebEthIntit** Input:void** Return: void** Owner:zhuzhe** Date: 2014.6.24** Time: 11:08:41*******************************************************************************/_WEB_TASK_WEBTASK_INIT_INIT FUN void WebEthIntit(void){ WEB_TASK_CTRL_BLOCK* pWebTaskControlBlock = gpstWebCtrlBlock; WEB_EVENT_CLASS TempWebEventItem; struct netif * pNetif = pWebTaskControlBlock->pWifiNetif; uint32 timeout; tcpip_init(NULL, NULL); memset(pWebTaskControlBlock->pWifiNetif, 0, sizeof(struct netif)); netif_add(pWebTaskControlBlock->pWifiNetif, NULL, NULL, NULL, NULL,ethernetif_init, ethernet_input); netif_set_default(pWebTaskControlBlock->pWifiNetif); netif_set_link_up(pWebTaskControlBlock->pWifiNetif); dhcp_start(pWebTaskControlBlock->pWifiNetif); do { vTaskDelay(100); if ( netif_is_up(pWebTaskControlBlock->pWifiNetif)) { rk_printf("IP %"U16_F".%"U16_F".%"U16_F".%"U16_F"/n", ip4_addr1_16(&(pNetif->ip_addr)), ip4_addr2_16(&(pNetif->ip_addr)), ip4_addr3_16(&(pNetif->ip_addr)), ip4_addr4_16(&(pNetif->ip_addr))); rk_printf("GW %"U16_F".%"U16_F".%"U16_F".%"U16_F"/n", ip4_addr1_16(&(pNetif->ip_addr)), ip4_addr2_16(&(pNetif->ip_addr)), ip4_addr3_16(&(pNetif->ip_addr)), ip4_addr4_16(&(pNetif->ip_addr))); break; } } while (1);}
开发者ID:wjw890912,项目名称:RK_NanoD_WIFI_demo,代码行数:42,
示例12: StartThread/** * @brief Start thread * @param argument: not used * @retval None */static void StartThread(void const * argument){ /* Initialize LCD and LEDs */ BSP_Config(); /* Create tcp_ip stack thread */ tcpip_init(NULL, NULL); /* Initilaize the LwIP stack */ Netif_Config(); /* Notify user about the netwoek interface config */ User_notification(&gnetif); /* Start SSL Server task */ osThreadDef(Server, ssl_server, osPriorityAboveNormal, 0, configMINIMAL_STACK_SIZE * 20); osThreadCreate (osThread(Server), NULL);#ifdef USE_DHCP /* Start DHCPClient */ osThreadDef(DHCP, DHCP_thread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE * 2); osThreadCreate (osThread(DHCP), &gnetif);#endif /* Start toogleLed4 task : Toggle LED4 every 250ms */ osThreadDef(LED4, ToggleLed4, osPriorityLow, 0, configMINIMAL_STACK_SIZE); osThreadCreate (osThread(LED4), NULL); for( ;; ) { /* Delete the Start Thread */ osThreadTerminate(NULL); }}
开发者ID:acrepina,项目名称:STM32F7_serverWEB,代码行数:39,
示例13: mbed_lwip_core_initstatic void mbed_lwip_core_init(void){ // Check if we've already brought up lwip if (!lwip_inited) { // Seed lwip random lwip_seed_random(); // Initialise TCP sequence number uint32_t tcp_isn_secret[4]; for (int i = 0; i < 4; i++) { tcp_isn_secret[i] = LWIP_RAND(); } lwip_init_tcp_isn(0, (u8_t *) &tcp_isn_secret); sys_sem_new(&lwip_tcpip_inited, 0); sys_sem_new(&lwip_netif_linked, 0); sys_sem_new(&lwip_netif_unlinked, 0); sys_sem_new(&lwip_netif_has_any_addr, 0);#if PREF_ADDR_TIMEOUT sys_sem_new(&lwip_netif_has_pref_addr, 0);#endif#if BOTH_ADDR_TIMEOUT sys_sem_new(&lwip_netif_has_both_addr, 0);#endif tcpip_init(mbed_lwip_tcpip_init_irq, NULL); sys_arch_sem_wait(&lwip_tcpip_inited, 0); lwip_inited = true; }}
开发者ID:OpenNuvoton,项目名称:mbed,代码行数:31,
示例14: mainint main( void ){ /* Configure any generic parameters needed to run the demo. */ prvSetupHardware(); /* Start the timers that demonstrate FreeRTOS software timers and basic GPIO functionality. */ vGPIOSoftwareTimersStart(); /* Start the task that demonstrates the SPI port being used to implement a disk IO interface to an SD card. */// vStartSPIInterfaceToSDCardTask(); /* This call creates the TCP/IP thread. */ tcpip_init( lwIPAppsInit, NULL ); /* Register two command line commands to show task stats and run time stats respectively. */ FreeRTOS_CLIRegisterCommand( &xTaskStats ); FreeRTOS_CLIRegisterCommand( &xRunTimeStats ); /* Start the FreeRTOS scheduler. */ vTaskStartScheduler(); /* The following line should never execute. If it does, it means there was insufficient FreeRTOS heap memory available to create the Idle and/or timer tasks. See the memory management section on the http://www.FreeRTOS.org web site for more information. */ for( ;; );}
开发者ID:cisarnet,项目名称:Vocoder,代码行数:30,
示例15: StartThread/** * @brief Main task * @param pvParameters not used * @retval None */static void StartThread(void const * argument){ /* Initialize LCD and LEDs */ BSP_Config(); /* Create tcp_ip stack thread */ tcpip_init(NULL, NULL); /* Initilaize the LwIP stack */ Netif_Config(); /* Initialize tcp echo server */ tcpecho_init(); /* Initialize udp echo server */ udpecho_init(); /* Notify user about the netwoek interface config */ User_notification(&gnetif); /* Start toogleLed4 task : Toggle LED4 every 250ms */ osThreadDef(LED4, ToggleLed4, osPriorityLow, 0, configMINIMAL_STACK_SIZE); osThreadCreate (osThread(LED4), NULL); for( ;; ) { /* Delete the Init Thread*/ osThreadTerminate(NULL); }}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:35,
示例16: InitializeLWIPstatic inline int InitializeLWIP(void){ sys_sem_t Sema; int iRet; dbgprintf("PS2IP: Module Loaded./n"); if ((iRet=RegisterLibraryEntries(&_exp_ps2ip))!=0) { printf("PS2IP: RegisterLibraryEntries returned: %d/n", iRet); } RxPBufsFree=LWIP_STACK_MAX_RX_PBUFS; NetManRxPacketBufferPoolFreeStart=0; recv_pbuf_queue_start=recv_pbuf_queue_end=NULL; sys_sem_new(&Sema, 0); dbgprintf("PS2IP: Calling tcpip_init/n"); tcpip_init(InitDone,&Sema); sys_arch_sem_wait(&Sema, 0); sys_sem_free(&Sema); dbgprintf("PS2IP: tcpip_init called/n");#if NOSYS InitTimer();#endif dbgprintf("PS2IP: System Initialised/n"); return 0;}
开发者ID:ylyking,项目名称:ps2sdk,代码行数:31,
示例17: main_lwIPvoid main_lwIP( void ){TimerHandle_t xTimer; /* Init lwIP and start lwIP tasks. */ tcpip_init( lwIPAppsInit, NULL ); /* A timer is used to toggle an LED just to show the application is executing. */ xTimer = xTimerCreate( "LED", /* Text name to make debugging easier. */ mainTIMER_PERIOD_MS, /* The timer's period. */ pdTRUE, /* This is an auto reload timer. */ NULL, /* ID is not used. */ prvLEDToggleTimer ); /* The callback function. */ /* Start the timer. */ configASSERT( xTimer ); xTimerStart( xTimer, mainDONT_BLOCK ); /* Start the tasks and timer running. */ vTaskStartScheduler(); /* If all is well, the scheduler will now be running, and the following line will never be reached. If the following line does execute, then there was either insufficient FreeRTOS heap memory available for the idle and/or timer tasks to be created, or vTaskStartScheduler() was called from User mode. See the memory management section on the FreeRTOS web site for more details on the FreeRTOS heap http://www.freertos.org/a00111.html. The mode from which main() is called is set in the C start up code and must be a privileged mode (not user mode). */ for( ;; );}
开发者ID:danstiurcaFC,项目名称:FreeRTOS,代码行数:32,
示例18: lwIPInit/** * * @brief Initializes the lwIP TCP/IP stack. * * @param lwipIf The interface structure for lwIP * * @return true if everything ok, false otherwise.*/static bool lwIPInit(LWIP_IF *const lwipIf, const unsigned int ifNum){ static unsigned int lwipInitFlag = LWIP_NOT_INITIALIZED; bool ret = true; /* do lwip library init only once */ if(LWIP_NOT_INITIALIZED == lwipInitFlag) { tcpip_init(NULL, NULL); } setPortIf(lwipIf, ifNum); if(netif_add(&cpswNetIF[ifNum], &lwipIf->ipAddr, &lwipIf->netMask, &lwipIf->gwAddr,&cpswPortIf[ifNum], cpswif_init, tcpip_input) != NULL) { if(LWIP_NOT_INITIALIZED == lwipInitFlag) { netif_set_default(&cpswNetIF[ifNum]); lwipInitFlag = LWIP_INITIALIZED; } lwipIf->ipMode = IPADDR_USE_DHCP; ret = netifStart(lwipIf, ifNum); } else { LWIP_PRINTF("/n/rUnable to add interface for interface %d", ifNum); ret = false; } return ret;}
开发者ID:ragunath3252,项目名称:lwip-drv,代码行数:38,
示例19: main_thread/*-----------------------------------------------------------------------------------*/static voidmain_thread(void *arg){ sys_sem_t sem; LWIP_UNUSED_ARG(arg); if(sys_sem_new(&sem, 0) != ERR_OK) { LWIP_ASSERT("Failed to create semaphore", 0); } tcpip_init(tcpip_init_done, &sem); sys_sem_wait(&sem); printf("TCP/IP initialized./n");#if LWIP_SOCKET if(ping_flag) { sys_thread_new("ping_thread", ping_thread, NULL, DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO); }#endif printf("Applications started./n");#ifdef MEM_PERF mem_perf_init("/tmp/memstats.client");#endif /* MEM_PERF */#if 0 stats_display();#endif /* Block forever. */ sys_thread_new("pppos_rx_thread", pppos_rx_thread, NULL, DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO); sys_sem_wait(&sem);}
开发者ID:aps243,项目名称:2A-lwIP,代码行数:33,
示例20: LwIP_Init/** * @brief Initializes the lwIP stack * @param None * @retval None */void LwIP_Init(void){ struct ip_addr ipaddr; struct ip_addr netmask; struct ip_addr gw; #ifndef USE_DHCP uint8_t iptab[4]; uint8_t iptxt[20]; #endif /* Create tcp_ip stack thread */ tcpip_init( NULL, NULL ); /* IP address setting & display on STM32_evalboard LCD*/ #ifdef USE_DHCP ipaddr.addr = 0; netmask.addr = 0; gw.addr = 0; #else IP4_ADDR(&ipaddr, IP_ADDR0, IP_ADDR1, IP_ADDR2, IP_ADDR3); IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1 , NETMASK_ADDR2, NETMASK_ADDR3); IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3); iptab[0] = IP_ADDR3; iptab[1] = IP_ADDR2; iptab[2] = IP_ADDR1; iptab[3] = IP_ADDR0; sprintf((char*)iptxt, " %d.%d.%d.%d", iptab[3], iptab[2], iptab[1], iptab[0]); syslog(SYSTEM_LVL,true, "Static IP address %s", iptxt); #endif /* - netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw, void *state, err_t (* init)(struct netif *netif), err_t (* input)(struct pbuf *p, struct netif *netif)) Adds your network interface to the netif_list. Allocate a struct netif and pass a pointer to this structure as the first argument. Give pointers to cleared ip_addr structures when using DHCP, or fill them with sane numbers otherwise. The state pointer may be NULL. The init function pointer must point to a initialization function for your ethernet netif interface. The following code illustrates it's use. */ netif_add(&xnetif, &ipaddr, &netmask, &gw, NULL, ðernetif_init, &tcpip_input); /* Registers the default network interface. */ netif_set_default(&xnetif); /* When the netif is fully configured this function must be called.*/ netif_set_up(&xnetif); #if !defined(USE_DHCP) netif_status_callback(&xnetif); #endif}
开发者ID:8bitgeek,项目名称:caribou-rtos,代码行数:64,
示例21: ethernet_init_LwIP/************************************************************************************************* * ethernet_init_LwIP * * starts the LwIP layer */static void ethernet_init_LwIP(void){ sys_sem_t sem; #if ( (LWIP_VERSION) == ((1U << 24) | (3U << 16) | (2U << 8) | (LWIP_VERSION_RC)) ) sem = sys_sem_new(0); // Create a new semaphore. tcpip_init(ethernet_tcpip_init_done, &sem); sys_sem_wait(sem); // Block until the lwIP stack is initialized. sys_sem_free(sem); // Free the semaphore. #else err_t err_sem; err_sem = sys_sem_new(&sem, 0); // Create a new semaphore. tcpip_init(ethernet_tcpip_init_done, &sem); sys_sem_wait(&sem); // Block until the lwIP stack is initialized. sys_sem_free(&sem); // Free the semaphore. #endif}
开发者ID:lsilberbauer,项目名称:avr32webboot,代码行数:22,
示例22: __dim_sum_lwip_init/********************************** LWIP INIT ****************************************************/static int __dim_sum_lwip_init(void *argv){ tcpip_init(NULL, NULL); dim_sum_netdev_startup(); printk("LWIP-1.4.1 TCP/IP initialized./n"); return 0;}
开发者ID:hominlinx,项目名称:hot-pot-lab,代码行数:10,
示例23: init_netifstatic void init_netif(ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw) { tcpip_init(tcpip_init_done, NULL); tcpip_inited.wait(); memset((void*) &lpcNetif, 0, sizeof(lpcNetif)); netif_add(&lpcNetif, ipaddr, netmask, gw, NULL, lpc_enetif_init, tcpip_input); netif_set_default(&lpcNetif); netif_set_status_callback(&lpcNetif, netif_status_callback);}
开发者ID:AlienEngineer,项目名称:demo-cortex-m3,代码行数:9,
示例24: init_ethernet/** * /brief Initialize ethernet stask. */void init_ethernet(void){ /* Initialize lwIP. */ /* Call tcpip_init for threaded lwIP mode. */ tcpip_init(NULL, NULL); /* Set hw and IP parameters, initialize MAC too */ ethernet_configure_interface();}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:12,
示例25: main/*-----------------------------------------------------------------------------------*/void#ifdef __APPLE2__main(void)#else /* __APPLE2__ */main(int argc, char *argv[])#endif /* __APPLE2__ */{#if STACK_SIZE memset((void *)(0xBF00 - STACK_SIZE), 0xA2, STACK_SIZE - (0xBF00 - *(unsigned int *)0x80) - 10); atexit(stack_size);#endif /* STACK_SIZE */ ek_init(); ek_start(&init); tcpip_init(NULL); resolv_init(NULL); ctk_init(); program_handler_init(); program_handler_add(&www_dsc, "Web browser", 1); program_handler_add(&email_dsc, "E-mail", 1); program_handler_add(&ftp_dsc, "FTP client", 1); program_handler_add(&directory_dsc, "Directory", 1); while(1) { if(ek_run() == 0) {#ifdef __APPLE2__ program_handler_load("welcome.prg", NULL);#else /* __APPLE2__ */ static char *startup; static char *slash; if(argc == 1) { startup = "welcome.prg"; } else { startup = argv[1]; while(slash = strchr(startup, '/')) { startup = slash + 1; } } program_handler_load(startup, NULL);#endif /* __APPLE2__ */ break; } } while(1) { ek_run(); }}
开发者ID:ZhepingYang,项目名称:contiki-1.x,代码行数:61,
示例26: _initvoid _init(void){ sys_sem_t sem; if(sys_sem_new(&sem, 0) != ERR_OK) { LWIP_ASSERT("failed to create semaphore", 0); } tcpip_init(tcpip_init_done, &sem); sys_sem_wait(&sem); sys_sem_free(&sem);}
开发者ID:Kavetron,项目名称:lwip_contrib,代码行数:10,
示例27: lwip_sock_initvoidlwip_sock_init(){ volatile unsigned tcpip_init_done_signal = 0; tcpip_init(tcpip_init_done, (void *)&tcpip_init_done_signal); /* wait until tcpip initialization is complete */ while (!tcpip_init_done_signal) ;}
开发者ID:Malutan,项目名称:TE060X-GigaBee-Reference-Designs,代码行数:11,
注:本文中的tcpip_init函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tcpip_ipv6_output函数代码示例 C++ tcpip_handler函数代码示例 |