资源简介
lwip 2.1.2最新版
代码片段和文件信息
void
eth_mac_irq()
{
/* Service MAC IRQ here */
/* Allocate pbuf from pool (avoid using heap in interrupts) */
struct pbuf* p = pbuf_alloc(PBUF_RAW eth_data_count PBUF_POOL);
if(p != NULL) {
/* Copy ethernet frame into pbuf */
pbuf_take(p eth_data eth_data_count);
/* Put in a queue which is processed in main loop */
if(!queue_try_put(&queue p)) {
/* queue is full -> packet loss */
pbuf_free(p);
}
}
}
static err_t
netif_output(struct netif *netif struct pbuf *p)
{
link_STATS_INC(link.xmit);
/* Update SNMP stats (only if you use SNMP) */
MIB2_STATS_NETIF_ADD(netif ifoutoctets p->tot_len);
int unicast = ((p->payload[0] & 0x01) == 0);
if (unicast) {
MIB2_STATS_NETIF_INC(netif ifoutucastpkts);
} else {
MIB2_STATS_NETIF_INC(netif ifoutnucastpkts);
}
lock_interrupts();
pbuf_copy_partial(p mac_send_buffer p->tot_len 0);
/* Start MAC transmit here */
unlock_interrupts();
return ERR_OK;
}
static void
netif_status_callback(struct netif *netif)
{
printf(“netif status changed %s\n“ ip4addr_ntoa(netif_ip4_addr(netif)));
}
static err_t
netif_init(struct netif *netif)
{
netif->linkoutput = netif_output;
netif->output = etharp_output;
netif->output_ip6 = ethip6_output;
netif->mtu = ETHERNET_MTU;
netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET | NETIF_FLAG_IGMP | NETIF_FLAG_MLD6;
MIB2_INIT_NETIF(netif snmp_ifType_ethernet_csmacd 100000000);
SMEMCPY(netif->hwaddr your_mac_address_goes_here ETH_HWADDR_LEN);
netif->hwaddr_len = ETH_HWADDR_LEN;
return ERR_OK;
}
void
main(void)
{
struct netif netif;
lwip_init();
netif_add(&netif IP4_ADDR_ANY IP4_ADDR_ANY IP4_ADDR_ANY NULL netif_init netif_input);
netif.name[0] = ‘e‘;
netif.name[1] = ‘0‘;
netif_create_ip6_linklocal_address(&netif 1);
netif.ip6_autoconfig_enabled = 1;
netif_set_status_callback(&netif netif_status_callback);
netif_set_default(&netif);
netif_set_up(&netif);
/* Start DHCP and HTTPD */
dhcp_start(&netif );
httpd_init();
while(1) {
/* Check link state e.g. via MDIO communication with PHY */
if(link_state_changed()) {
if(link_is_up()) {
netif_set_link_up(&netif);
} else {
netif_set_link_down(&netif);
}
}
/* Check for received frames feed them to lwIP */
lock_interrupts();
struct pbuf* p = queue_try_get(&queue);
unlock_interrupts();
if(p != NULL) {
link_STATS_INC(link.recv);
/* Update SNMP stats (only if you use SNMP) */
MIB2_STATS_NETIF_ADD(netif ifinoctets p->tot_len);
int unicast = ((p->payload[0] & 0x01) == 0);
if (unicast) {
MIB2_STATS_NETIF_INC(netif ifinucastpkts);
} else {
MIB2_STATS_NETIF_INC(netif ifinnucastpkts);
}
if(netif.input(p &netif)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-08-14 10:30 lwip-2.1.2\
文件 11 2020-08-14 10:30 readme.txt
文件 189696 2018-11-22 19:55 lwip-2.1.2\CHANGELOG
文件 783 2018-10-24 18:32 lwip-2.1.2\CMakeLists.txt
文件 1644 2017-01-12 19:17 lwip-2.1.2\COPYING
目录 0 2018-11-22 19:57 lwip-2.1.2\doc\
文件 3051 2018-10-24 18:32 lwip-2.1.2\doc\contrib.txt
目录 0 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\
文件 23 2017-01-12 19:17 lwip-2.1.2\doc\doxygen\generate.bat
文件 36 2017-01-12 19:17 lwip-2.1.2\doc\doxygen\generate.sh
文件 113082 2018-11-22 19:47 lwip-2.1.2\doc\doxygen\lwip.Doxyfile
文件 113114 2018-07-03 18:30 lwip-2.1.2\doc\doxygen\lwip.Doxyfile.cmake.in
文件 17480 2018-10-24 18:32 lwip-2.1.2\doc\doxygen\main_page.h
目录 0 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\
目录 0 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\
文件 17302 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp_8c.html
文件 2082 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp_8c.js
文件 17472 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp_8h.html
文件 2100 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp_8h.js
文件 6104 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__alloc_8c.html
文件 211 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__alloc_8c.js
文件 7151 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__priv_8h.html
文件 195 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__priv_8h.js
文件 14384 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__proxyconnect_8c.html
文件 578 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__proxyconnect_8c.js
文件 12551 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__proxyconnect_8h.html
文件 464 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__proxyconnect_8h.js
文件 6772 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__tcp_8c.html
文件 112 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__tcp_8c.js
文件 6449 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__tcp_8h.html
文件 112 2018-11-22 19:57 lwip-2.1.2\doc\doxygen\output\html\altcp__tcp_8h.js
............此处省略1845个文件信息
- 上一篇:对图像的一维高斯滤波操作
- 下一篇:大华摄像头二次开发web3.0控件开发包
相关资源
- stm32f103VET6-FreeRTOS-enc28j60-Lwip
- tcp客户端数据收发工程
- PIDKey密钥检测工具v2.1.2.1017
- STM32F1 LWIP开发手册(DM9000版)
- stm32f407+mbed+lwip+lan8720 例程
- LwIP+freertos工程LwIP2.1.2最新版本
- STM32F107的socket
- vos2009 2.1.2.0 完美注册机linux
- stm32f103 RT_Thread lwip移植步骤说明
- 网络实验 LWIP无操作系统移植
- 喜鹊相亲交友平台V2.1.2.zip
- LPC1768 LwIP UDP Client 发送数据+测试网
- stm32_lwip.zip
- 1088586红包拓客生意宝2.1.2.zip
- rt-thread3.1.1-lwip2.0.2完整工程代码
- RAW_UDP实验
- NXP LPC1768 Rtthread/裸机+lwip WEB服务器
- STM32 LwIP UDP+Artnet
- STM32F107-lwip-UDP-client发送数据
- EntityDAC_2.1.22018.11.30.rar
- STM32_FreeRTOS+LwIP
- STM32F407+FreeRTOS+LAN8720+LWIP1.4.1+DHCP+UDP+标
- STM32F407+FreeRTOS+LAN8720+LWIP1.4.1+DHCP+标准
- VOS3000 2.1.2.4版本客户端
- STM32F4+ucosIII+LWIP+DP83848
- STM32F407+LWIP+DP83848移植例程
- STM32F4x7+freertos+lwip+ssl+MQTT完整代码
- stm32下的ftp服务器
- LWIP之TCP Client
- 微擎2.1.2-5gyun.zip
评论
共有 条评论