Giter VIP home page Giter VIP logo

lwip's Introduction

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]>

lwip's People

Contributors

ajaybhargav avatar ambrop72 avatar armink avatar axellin avatar bossjisu avatar bwijen avatar chrysn avatar danielkitta avatar dcvmoole avatar dfgweb avatar dhmat avatar dziegel avatar edgar-bonet avatar freddiechopin avatar goldsimon avatar gradator avatar idelamer avatar j123b567 avatar jcunningham10 avatar jkroon81 avatar jlledom avatar kalleolaviniemitalo avatar miri64 avatar nonapode avatar ourairquality avatar pavmick avatar rexut avatar tabascoeye avatar tferrin avatar yarrick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lwip's Issues

We met the case of that value of "entry->state" in function, dns_check_entry(u8_t i) was 58 or 59.

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.:

  • hw: ESP32,
  • sw: esp-idf ,
  • condition: use SNTP and test with/without internet connection.

< 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.

Missing case IP_PKTINFO in lwip_getsockopt_impl()

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 */

mqtt_example_init() -> Invalid initialize sequence

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 */
}

Trouble using the library

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.