particle-iot / lwip Goto Github PK
View Code? Open in Web Editor NEWA fork of https://git.savannah.nongnu.org/git/lwip.git
License: Other
A fork of https://git.savannah.nongnu.org/git/lwip.git
License: Other
INTRODUCTION lwIP is a small independent implementation of the TCP/IP protocol suite. The focus of the lwIP TCP/IP implementation is to reduce the RAM usage while still having a full scale TCP. This making lwIP suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM. lwIP was originally developed by Adam Dunkels at the Computer and Networks Architectures (CNA) lab at the Swedish Institute of Computer Science (SICS) and is now developed and maintained by a worldwide network of developers. FEATURES * IP (Internet Protocol, IPv4 and IPv6) including packet forwarding over multiple network interfaces * ICMP (Internet Control Message Protocol) for network maintenance and debugging * IGMP (Internet Group Management Protocol) for multicast traffic management * MLD (Multicast listener discovery for IPv6). Aims to be compliant with RFC 2710. No support for MLDv2 * ND (Neighbor discovery and stateless address autoconfiguration for IPv6). Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 (Address autoconfiguration) * DHCP, AutoIP/APIPA (Zeroconf), ACD (Address Conflict Detection) and (stateless) DHCPv6 * UDP (User Datagram Protocol) including experimental UDP-lite extensions * TCP (Transmission Control Protocol) with congestion control, RTT estimation fast recovery/fast retransmit and sending SACKs * raw/native API for enhanced performance * Optional Berkeley-like socket API * TLS: optional layered TCP ("altcp") for nearly transparent TLS for any TCP-based protocol (ported to mbedTLS) (see changelog for more info) * PPPoS and PPPoE (Point-to-point protocol over Serial/Ethernet) * DNS (Domain name resolver incl. mDNS) * 6LoWPAN (via IEEE 802.15.4, BLE or ZEP) APPLICATIONS * HTTP server with SSI and CGI (HTTPS via altcp) * SNMPv2c agent with MIB compiler (Simple Network Management Protocol), v3 via altcp * SNTP (Simple network time protocol) * NetBIOS name service responder * MDNS (Multicast DNS) responder * iPerf server implementation * MQTT client (TLS support via altcp) LICENSE lwIP is freely available under a BSD license. DEVELOPMENT lwIP has grown into an excellent TCP/IP stack for embedded devices, and developers using the stack often submit bug fixes, improvements, and additions to the stack to further increase its usefulness. Development of lwIP is hosted on Savannah, a central point for software development, maintenance and distribution. Everyone can help improve lwIP by use of Savannah's interface, Git and the mailing list. A core team of developers will commit changes to the Git source tree. The lwIP TCP/IP stack is maintained in the 'lwip' Git module and contributions (such as platform ports) are in the 'contrib' Git module. See doc/savannah.txt for details on Git server access for users and developers. The current Git trees are web-browsable: http://git.savannah.gnu.org/cgit/lwip.git http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git Submit patches and bugs via the lwIP project page: http://savannah.nongnu.org/projects/lwip/ Continuous integration builds (GCC, clang): https://travis-ci.org/lwip-tcpip/lwip DOCUMENTATION Self documentation of the source code is regularly extracted from the current Git sources and is available from this web page: http://www.nongnu.org/lwip/ Also, there are mailing lists you can subscribe at http://savannah.nongnu.org/mail/?group=lwip plus searchable archives: http://lists.nongnu.org/archive/html/lwip-users/ http://lists.nongnu.org/archive/html/lwip-devel/ There is a wiki about lwIP at http://lwip.wikia.com/wiki/LwIP_Wiki You might get questions answered there, but unfortunately, it is not as well maintained as it should be. lwIP was originally written by Adam Dunkels: http://dunkels.com/adam/ Reading Adam's papers, the files in docs/, browsing the source code documentation and browsing the mailing list archives is a good way to become familiar with the design of lwIP. Adam Dunkels <[email protected]> Leon Woestenberg <[email protected]>
We met the case of that value of "entry->state" in function, dns_check_entry(u8_t i) was 58 or 59.
Our test env.:
< Problem Description >
When we tested our target without no antenna (it seems to be without wifi connection.),
the following happened.
So after we debugged with JTAG debugger, we found the following debugged fact.
The debugged fact is as followings:
I met the case of that value of "entry->state"
in dns_check_entry(u8_t i) function in the source, dns.c was 58 or 59.
So our program went to the default in case statement and met the LWIP_ASSERT() and fianally paniced.
In the end, we didn't know why
but first of all, we added the following codes in the case of the value, 58 and 59 in the function, dns_check_entry(u8_t i).
case 58:
case 59:
{
LWIP_DEBUGF(DNS_DEBUG, ("dns_check_entry: \"%s\": flush\n", entry->name));
/* flush this entry, there cannot be any related pending entries in this state */
entry->state = DNS_STATE_UNUSED;
}
break;
As you know, we added the same code as the case, DNS_STATE_DONE in the switch statement.
Then the above refered problem didn't happened.
But we still don't know why the case of the value 58 or 59 happend when without anntenna (wifi connection)
so anyone, please explain to us about this problem and give us more solutions if exist.
In the lwip_getsockopt_impl() function, the following case is missing:
switch (level) {
case IPPROTO_IP:
switch (optname) {
#if LWIP_NETBUF_RECVINFO
case IP_PKTINFO:
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, int);
if ((sock->conn->flags & NETCONN_FLAG_PKTINFO) != 0) {
*(int*)optval = 1;
}
else {
*(int*)optval = 0;
}
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_PKTINFO) = %d\n",
s, *(int *)optval));
break;
#endif /* LWIP_NETBUF_RECVINFO */
void
mqtt_example_init(void)
{
#if LWIP_TCP
mqtt_client = mqtt_client_new();
mqtt_set_inpub_callback(mqtt_client,
mqtt_incoming_publish_cb,
mqtt_incoming_data_cb,
LWIP_CONST_CAST(void*, &mqtt_client_info));
mqtt_client_connect(mqtt_client,
&mqtt_ip, MQTT_PORT,
mqtt_connection_cb, LWIP_CONST_CAST(void*, &mqtt_client_info),
&mqtt_client_info);
#endif /* LWIP_TCP */
}
mqtt_set_inpub_callback: This function should be called after mqtt_client_connect() is done!
Due to it will be wipe clean inside mqtt_client_connect() function
https://github.com/particle-iot/lwip/blob/master/src/apps/mqtt/mqtt.c#L1311
then whenever mqtt messages come => it got crashed at line: https://github.com/particle-iot/lwip/blob/master/src/apps/mqtt/mqtt.c#L773 NULL_PTR Callback
So it should be like this:
void
mqtt_example_init(void)
{
#if LWIP_TCP
mqtt_client = mqtt_client_new();
mqtt_client_connect(mqtt_client,
&mqtt_ip, MQTT_PORT,
mqtt_connection_cb, LWIP_CONST_CAST(void*, &mqtt_client_info),
&mqtt_client_info);
mqtt_set_inpub_callback(mqtt_client,
mqtt_incoming_publish_cb,
mqtt_incoming_data_cb,
LWIP_CONST_CAST(void*, &mqtt_client_info));
#endif /* LWIP_TCP */
}
Hi, I want to use mDNS in my particle photon and use it the resolve the IP of a host from its .local domain name. I found that this library has some functionality in support of that but I couldn't find enough instructions on how to use it.
I am using an offline toolchain to compile my programs. And I am not sure how to call or include this library in the code. The instructions in the code are not very helpful and also there are no comments in the code to figure out.
As stated in RFC 9110 headers name should be considered case-insensitive.
HTTP servers consider them case-insensitive putting lowercase headers name and this brokes the lwip http client parsing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.