这篇教程C++ uip_arp_out函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uip_arp_out函数的典型用法代码示例。如果您正苦于以下问题:C++ uip_arp_out函数的具体用法?C++ uip_arp_out怎么用?C++ uip_arp_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uip_arp_out函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Test_uip_arp_arpoutvoid Test_uip_arp_arpout(CuTest *tc) { u8_t temp_buf[]= "/x11/x22/x33/x44/x55/x66/x77/x88/x99/x00/xAA/xBB/x08/x00" "/x45" //ipv4, 4*5=20byte "/x00" "/x00/x14" //fra "/x00/x00" "/x00/x00" "/x11" //ttl "/x06" //tcp "/x00/x00" //header checksum,dont fit now "/xC0/xA8/x00/x02" "/xff/xff/xff/x00" //ip broadcast,subnet broad cast "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00" "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"; iprintf_s(temp_buf,sizeof(temp_buf)); uip_arp_init(); memcpy(uip_buf,temp_buf,60);//broad cast,=dest ip equeals mask uip_arp_out(); CuAssertHexEquals_Msg(tc,"arp out 1",0xFF,IPBUF->ethhdr.dest.addr[0]); IPBUF->destipaddr[0]=0xA8C0; IPBUF->destipaddr[1]=0x0300; uip_arp_out(); CuAssertHexEquals_Msg(tc,"arp out 2",0xFF,IPBUF->ethhdr.dest.addr[0]); CuAssertHexEquals_Msg(tc,"arp out 3",0xFF,IPBUF->ethhdr.dest.addr[1]); CuAssertHexEquals_Msg(tc,"arp out 4",0xFF,IPBUF->ethhdr.dest.addr[2]); CuAssertHexEquals_Msg(tc,"arp out 5",0xFF,IPBUF->ethhdr.dest.addr[3]); CuAssertHexEquals_Msg(tc,"arp out 6",0xFF,IPBUF->ethhdr.dest.addr[4]); CuAssertHexEquals_Msg(tc,"arp out 7",0xFF,IPBUF->ethhdr.dest.addr[5]); CuAssertHexEquals_Msg(tc,"arp out 8",HTONS(UIP_ETHTYPE_ARP),BUF->ethhdr.type); CuAssertHexEquals_Msg(tc,"arp out 8",0x0608,BUF->ethhdr.type);}
开发者ID:kevinxusz,项目名称:uip,代码行数:33,
示例2: tcpip_periodic_timervoid tcpip_periodic_timer(){ int i; MT_TimerExpired(); if(timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); mt76xx_dev_send(); } }#if UIP_UDP for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); mt76xx_dev_send(); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ if(timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } }#if 0 if(timer_expired(&cli_timer)) { clk = (clk > (CLOCK_SECOND*60))?clk:(clk*2); timer_set(&cli_timer, clk); if ((cli_fd == -1) && memcmp(uip_hostaddr, 0x00000000, sizeof(uip_hostaddr))) { struct uip_conn *conn = NULL; uip_ipaddr_t srv_ip; uip_ipaddr(srv_ip, IoTpAd.ComCfg.IoT_ServeIP[0], IoTpAd.ComCfg.IoT_ServeIP[1], IoTpAd.ComCfg.IoT_ServeIP[2], IoTpAd.ComCfg.IoT_ServeIP[3]); conn = uip_connect(&srv_ip, HTONS(IoTpAd.ComCfg.IoT_TCP_Srv_Port)); if(conn) { conn->lport = HTONS(7682); cli_fd = conn->fd; } else { printf("connect fail/n"); } } }#endif }
开发者ID:cxy560,项目名称:ZCloud,代码行数:60,
示例3: xtcpd_check_connection_pollvoid xtcpd_check_connection_poll(chanend mac_tx){ for (int i = 0; i < UIP_CONNS; i++) { if (uip_conn_needs_poll(&uip_conns[i])) { uip_poll_conn(&uip_conns[i]);#if UIP_CONF_IPV6 xtcpip_ipv6_output(mac_tx);#else /* UIP_CONF_IPV6 */ if (uip_len > 0) { uip_arp_out( NULL); xtcp_tx_buffer(mac_tx); }#endif /* UIP_CONF_IPV6 */ } } for (int i = 0; i < UIP_UDP_CONNS; i++) { if (uip_udp_conn_needs_poll(&uip_udp_conns[i])) { uip_udp_periodic(i);#if UIP_CONF_IPV6 xtcpip_ipv6_output(mac_tx);#else if (uip_len > 0) { uip_arp_out(&uip_udp_conns[i]); xtcp_tx_buffer(mac_tx); }#endif } }}
开发者ID:graymalkin,项目名称:sc_xtcp,代码行数:30,
示例4: xtcp_process_incoming_packetvoid xtcp_process_incoming_packet(chanend mac_tx){ if (BUF->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); if (uip_len > 0) { if (uip_udpconnection() && (TCPBUF->proto != UIP_PROTO_ICMP) && (TCPBUF->proto != UIP_PROTO_IGMP)) uip_arp_out( uip_udp_conn); else uip_arp_out( NULL); xtcp_tx_buffer(mac_tx); } } else if (BUF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); if (uip_len > 0) { xtcp_tx_buffer(mac_tx); } for (int i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_arp_event(i); if (uip_len > 0) { uip_arp_out(&uip_udp_conns[i]); xtcp_tx_buffer(mac_tx); } } }}
开发者ID:colinbroad,项目名称:sc_xtcp,代码行数:29,
示例5: sizeofvoid Network::on_idle(void *argument){ if (!ethernet->isUp()) return; int len= sizeof(uip_buf); // set maximum size if (ethernet->_receive_frame(uip_buf, &len)) { uip_len = len; this->handlePacket(); } else { if (timer_expired(&periodic_timer)) { /* no packet but periodic_timer time out (0.1s)*/ timer_reset(&periodic_timer); for (int i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); tapdev_send(uip_buf, uip_len); } }#if UIP_CONF_UDP for (int i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); tapdev_send(uip_buf, uip_len); } }#endif }/* This didn't work actually made it worse,it should have worked though else{ // TODO if the command queue is below a certain amount we should poll any stopped connections if(command_q->size() < 4) { for (struct uip_conn *connr = &uip_conns[0]; connr <= &uip_conns[UIP_CONNS - 1]; ++connr) { if(uip_stopped(connr)){ // Force a poll of this printf("Force poll of connection/n"); uip_poll_conn(connr); } } } }*/ /* Call the ARP timer function every 10 seconds. */ if (timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } }}
开发者ID:2thetop,项目名称:Smoothieware,代码行数:60,
示例6: ethernet_servicevoid ethernet_service(void) { int i; struct uip_eth_hdr *buf = (struct uip_eth_hdr *)&uip_buf[0]; etimer_request_poll(); process_run(); uip_len = liteethmac_poll(); if(uip_len > 0) { if(buf->type == uip_htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); if(uip_len > 0) { uip_arp_out(); liteethmac_send(); } } else if(buf->type == uip_htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); if(uip_len > 0) liteethmac_send(); } } else if (elapsed(&uip_periodic_event, uip_periodic_period)) { for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); if(uip_len > 0) { uip_arp_out(); liteethmac_send(); } } } if (elapsed(&uip_arp_event, uip_arp_period)) { uip_arp_timer(); }}
开发者ID:enjoy-digital,项目名称:arty-soc,代码行数:35,
示例7: dealvoid deal(){ int i; if(uip_len > 0) { if(BUF_IF->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); current_dev->eth_tx(current_dev, uip_buf, uip_len); } } else if(BUF_IF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { current_dev->eth_tx(current_dev, uip_buf, uip_len); } } } else if(timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); current_dev->eth_tx(current_dev, uip_buf, uip_len); } }#if UIP_UDP for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); current_dev->eth_tx(current_dev, uip_buf, uip_len); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ if(timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } } //rt_exit_critical(); return 0;}
开发者ID:dreamflyforever,项目名称:rt-thread-1.1.0,代码行数:59,
示例8: enc28j60PacketReceivevoid NanodeUIP::poll(void) { int i; uip_len = enc28j60PacketReceive(UIP_BUFSIZE,uip_buf); if(uip_len > 0) { if(BUF->type == UIP_HTONS(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); enc28j60PacketSend(uip_len,uip_buf); } } else if(BUF->type == UIP_HTONS(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { enc28j60PacketSend(uip_len,uip_buf); } } } else if(timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); enc28j60PacketSend(uip_len,uip_buf); } }#if UIP_UDP for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); enc28j60PacketSend(uip_len,uip_buf); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ if(timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } }}
开发者ID:skydome,项目名称:NanodeUIP,代码行数:57,
示例9: Network_Process/** * @brief Process Network * @param None * @retval None */void Network_Process(void){ static uint8_t arp_counter = 0; int i; for (i = 0; i < UIP_CONNS; i++) { uip_periodic(i); if (uip_len > 0) { uip_arp_out(); enc28j60_send_packet((uint8_t *)uip_buf, uip_len); } } #if UIP_UDP for (i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); if (uip_len > 0) { uip_arp_out(); network_send(); } } #endif /* UIP_UDP */ if (++arp_counter >= 50) { arp_counter = 0; uip_arp_timer(); } uip_len = enc28j60_recv_packet((uint8_t *)uip_buf, UIP_BUFSIZE); if (uip_len > 0) { if (((struct uip_eth_hdr *)&uip_buf[0])->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); if (uip_len > 0) { uip_arp_out(); enc28j60_send_packet((uint8_t *)uip_buf, uip_len); } } else if (((struct uip_eth_hdr *)&uip_buf[0])->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); if (uip_len > 0) { enc28j60_send_packet((uint8_t *)uip_buf, uip_len); } } }}
开发者ID:alemoke,项目名称:theLEDStripControl,代码行数:61,
示例10: TcpIpMain/** ******************************************************************************************* * @fn void TcpIpMain(void) * @brief Update the uIP stack. * @return None * @attention ******************************************************************************************* */void TcpIpMain(void){ uint8_t Index; uip_len = nic_poll(); if (uip_len == 0) { // If timed out, call periodic function for each connection if (TcpIpUipTimerCounter >= TCP_IP_CNT_TIME) { TcpIpUipTimerCounter = 0; for (Index = 0; Index < UIP_CONNS; Index++) { uip_periodic(Index); if (uip_len > 0) { uip_arp_out(); nic_send(); } } /* Call the ARP timer function every ~10 seconds. */ if (++TcpIpUipArpTimerCounter >= TCP_IP_ARP_CNT_TIME) { uip_arp_timer(); TcpIpUipArpTimerCounter = 0; } } } else // packet received { // process an IP packet if (TCP_IP_BUF->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); if (uip_len > 0) { uip_arp_out(); nic_send(); } } // process an ARP packet else if (TCP_IP_BUF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); if (uip_len > 0) nic_send(); } TcpIpUipTimerCounter = 0; }}
开发者ID:AndTH,项目名称:GCA,代码行数:61,
示例11: uip_timeout_entryvoid uip_timeout_entry(void* parameter)//由于TIMEOUT函数,不参与调度{ // struct timer periodic_timer, arp_timer; static uint8_t cnt; int i; /* post message to ethernet thread */ //if ((rt_sem_take(msg,RT_WAITING_NO)) != -RT_ETIMEOUT) //if (timer_expired(&periodic_timer)) //5s enter once { //timer_reset(&periodic_timer); for (i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); TransmitPacket(); } }#if UIP_UDP for (i = 0; i < UIP_UDP_CONNS; i++) // { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); TransmitPacket(); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ //if (timer_expired(&arp_timer)) if (++cnt >= 2) //t { //timer_reset(&arp_timer); uip_arp_timer(); cnt = 0; } } }
开发者ID:CollinsLiu,项目名称:rt-thread-pc,代码行数:49,
示例12: tcpip_inputerr_ttcpip_input(struct pbuf *p, struct netif *inp){ int i; u8_t *pdata; if (uip_len) { uip_arp_out(); if (( pdata =(u8_t*)malloc(1500*sizeof(u8_t))) == NULL) { pbuf_free(p); return 1; } for (i=0; i < (UIP_LLH_LEN + 40); ++i) // 14+40 =54 { pdata[i] = uip_buf[i]; /* get dest an src ipaddr */ } // Copy the data portion part for(; i < uip_len; ++i) { pdata[i] = uip_appdata[i - UIP_LLH_LEN - 40 ]; } p ->payload = pdata; p->len = uip_len; inp->linkoutput(inp,p); rt_free(pdata); return 1; } else { pbuf_free(p); return 0; }}
开发者ID:haitao52198,项目名称:HD-Elastos,代码行数:34,
示例13: vnet_uiptxpollstatic int vnet_uiptxpoll(struct uip_driver_s *dev){ FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private; /* If the polling resulted in data that should be sent out on the network, * the field d_len is set to a value > 0. */ if (vnet->sk_dev.d_len > 0) { uip_arp_out(&vnet->sk_dev); vnet_transmit(vnet); /* Check if there is room in the device to hold another packet. If not, * return a non-zero value to terminate the poll. */ if (vnet_is_txbuff_full(vnet->vnet)) return 1; } /* If zero is returned, the polling will continue until all connections have * been examined. */ return 0;}
开发者ID:l--putt,项目名称:nuttx-bb,代码行数:26,
示例14: netif_rxint netif_rx(u8_t *p, u16_t len){ /*avoid Rx packet length > UIP buffer size and cause UIP buffer overflow*/ if (len <= UIP_BUFSIZE + 2) { mt76xx_dev_read(p, len); } else { printf_high("netif_rx length error: %d > %d/n", len, UIP_BUFSIZE + 2); return -1; } if (uip_len > 0) { if (BUF->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); mt76xx_dev_send(); } } else if (BUF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { mt76xx_dev_send(); } } } return 0;}
开发者ID:Altizon,项目名称:Aliot-SDK-Examples,代码行数:33,
示例15: e1000_uiptxpollstatic int e1000_uiptxpoll(struct uip_driver_s *dev){ struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private; int tail = e1000->tx_ring.tail; /* If the polling resulted in data that should be sent out on the network, * the field d_len is set to a value > 0. */ if (e1000->uip_dev.d_len > 0) { uip_arp_out(&e1000->uip_dev); e1000_transmit(e1000); /* Check if there is room in the device to hold another packet. If not, * return a non-zero value to terminate the poll. */ if (!e1000->tx_ring.desc[tail].desc_status) return -1; } /* If zero is returned, the polling will continue until all connections have * been examined. */ return 0;}
开发者ID:1015472,项目名称:PX4NuttX,代码行数:26,
示例16: tapdev_outputuint8_ttapdev_output(void){ uip_arp_out(); tapdev_send(); return 0;}
开发者ID:200018171,项目名称:contiki,代码行数:7,
示例17: uip_arp_ipinvoid Network::handlePacket(void){ if (uip_len > 0) { /* received packet */ //printf("handlePacket: %d/n", uip_len); if (BUF->type == htons(UIP_ETHTYPE_IP)) { /* IP packet */ uip_arp_ipin(); uip_input(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); network_device_send(); } } else if (BUF->type == htons(UIP_ETHTYPE_ARP)) { /*ARP packet */ uip_arp_arpin(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { tapdev_send(uip_buf, uip_len); /* ARP ack*/ } } else { printf("Unknown ethernet packet type %04X/n", htons(BUF->type)); uip_len = 0; } }}
开发者ID:2thetop,项目名称:Smoothieware,代码行数:32,
示例18: output/*---------------------------------------------------------------------------*/static voidoutput(u8_t *hdr, u16_t hdrlen, u8_t *data, u16_t datalen){ uip_arp_out(); lan91c96_send(); dump_packet();}
开发者ID:ZhepingYang,项目名称:contiki-1.x,代码行数:8,
示例19: ethernet_output/*---------------------------------------------------------------------------*/uint8_tethernet_output(void){ uip_arp_out(); ethernet_send(); return 0;}
开发者ID:Contiki-leoqin,项目名称:contiki,代码行数:9,
示例20: wpcap_outputu8_twpcap_output(void){ uip_arp_out(); wpcap_send(); return 0;}
开发者ID:fanakin,项目名称:contiki-mirror,代码行数:8,
示例21: output/*---------------------------------------------------------------------------*/static u8_toutput(void){ uip_arp_out(); cs8900a_send(); return 0;}
开发者ID:EDAyele,项目名称:ptunes,代码行数:9,
示例22: rtl8019_output/*---------------------------------------------------------------------------*/u8_trtl8019_output(void){ uip_arp_out(); RTL8019dev_send(); return 0;}
开发者ID:Asterios,项目名称:contiki-econotag,代码行数:9,
示例23: maybe_sendstatic void maybe_send(void){ /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); nic_send(NULL); }}
开发者ID:BackupTheBerlios,项目名称:ecobridge,代码行数:10,
示例24: nethandler_periodicvoid nethandler_periodic(){ int i; times(UIP_CONNS, i) { uip_periodic(i); if (uip_len > 0) { uip_arp_out(); network_send(); } }
开发者ID:atalax,项目名称:avr-mqtt-board,代码行数:11,
示例25: output/*---------------------------------------------------------------------------*/static u8_toutput(void){ uip_arp_out(); lan91c96_send(); dump_packet(); return 0;}
开发者ID:EDAyele,项目名称:ptunes,代码行数:12,
示例26: xtcp_process_udp_acksvoid xtcp_process_udp_acks(chanend mac_tx){ for (int i = 0; i < UIP_UDP_CONNS; i++) { if (uip_udp_conn_has_ack(&uip_udp_conns[i])) { uip_udp_ackdata(i); if (uip_len > 0) { uip_arp_out(&uip_udp_conns[i]); xtcp_tx_buffer(mac_tx); } } }}
开发者ID:colinbroad,项目名称:sc_xtcp,代码行数:12,
示例27: PeriodicTimerHandler/* * TCP/IP periodic timer. */static void PeriodicTimerHandler(eventid_t id) { int i; (void)id; for (i = 0; i < UIP_CONNS; i++) { uip_periodic(i); if (uip_len > 0) { uip_arp_out(); network_device_send(); } }}
开发者ID:ColonelPanic42,项目名称:ChibiOS-RPi,代码行数:15,
示例28: timer/*-----------------------------------------------------------------------------------*/static voidtimer(void){ for(i = 0; i < UIP_CONNS; ++i) { uip_periodic(i); if(uip_len > 0) { uip_arp_out(); rtl8019as_send(); } } for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); rtl8019as_send(); } } }
开发者ID:EDAyele,项目名称:ptunes,代码行数:23,
示例29: xtcpd_check_connection_pollvoid xtcpd_check_connection_poll(chanend mac_tx){ for (int i = 0; i < UIP_CONNS; i++) { if (uip_conn_needs_poll(&uip_conns[i])) { uip_poll_conn(&uip_conns[i]); if (uip_len > 0) { uip_arp_out( NULL); xtcp_tx_buffer(mac_tx); } } } for (int i = 0; i < UIP_UDP_CONNS; i++) { if (uip_udp_conn_needs_poll(&uip_udp_conns[i])) { uip_udp_periodic(i); if (uip_len > 0) { uip_arp_out(&uip_udp_conns[i]); xtcp_tx_buffer(mac_tx); } } }}
开发者ID:colinbroad,项目名称:sc_xtcp,代码行数:22,
示例30: rtos_vnet_recvvoid rtos_vnet_recv(struct rgmp_vnet *vnet_dummy, char *data, int len){ // now only support 1 vnet struct vnet_driver_s *vnet = &g_vnet[0]; do { /* Check for errors and update statistics */ /* Check if the packet is a valid size for the uIP buffer configuration */ if (len > CONFIG_NET_BUFSIZE || len < 14) {#ifdef CONFIG_DEBUG cprintf("VNET: receive invalid packet of size %d/n", len);#endif return; } // Copy the data data from the hardware to vnet->sk_dev.d_buf. Set // amount of data in vnet->sk_dev.d_len memcpy(vnet->sk_dev.d_buf, data, len); vnet->sk_dev.d_len = len; /* We only accept IP packets of the configured type and ARP packets */#ifdef CONFIG_NET_IPv6 if (BUF->type == HTONS(UIP_ETHTYPE_IP6))#else if (BUF->type == HTONS(UIP_ETHTYPE_IP))#endif { uip_arp_ipin(&vnet->sk_dev); uip_input(&vnet->sk_dev); // If the above function invocation resulted in data that should be // sent out on the network, the field d_len will set to a value > 0. if (vnet->sk_dev.d_len > 0) { uip_arp_out(&vnet->sk_dev); vnet_transmit(vnet); } } else if (BUF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(&vnet->sk_dev); // If the above function invocation resulted in data that should be // sent out on the network, the field d_len will set to a value > 0. if (vnet->sk_dev.d_len > 0) { vnet_transmit(vnet); } } } while (0); /* While there are more packets to be processed */}
开发者ID:l--putt,项目名称:nuttx-bb,代码行数:51,
注:本文中的uip_arp_out函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ uip_arp_timer函数代码示例 C++ uip_arp_ipin函数代码示例 |