David Cermak acf5333b1e esp_netif: Fix dhcps state transitions il y a 4 ans
..
include c1fe7fe230 slip: Fix the definition of cplusplus in the code il y a 4 ans
loopback 507c08251e esp_netif: Enable use of the ESP-IDF with a non-LWIP (and non-BSD-style) IP stack. il y a 5 ans
lwip acf5333b1e esp_netif: Fix dhcps state transitions il y a 4 ans
private_include f839a1328c esp_netif: added locking for netif list management, unit tests to use unique if_keys, updated comments il y a 6 ans
test d1356bca68 esp-netif: Added methods for conversion IP4/IP6 addresses from their string interpretation il y a 5 ans
test_apps ed6a30a9de CI: component_ut: fix esp_netif test path unmatch issue il y a 5 ans
CMakeLists.txt 00d84a3bb2 esp_netif: Add CONFIG_PPP_SUPPORT and CONFIG_LWIP_SLIP_SUPPORT to sperate the code il y a 4 ans
Kconfig ba13275c6b esp_netif: update default DHCP IP addresses to be in line with old interface, added loopback implementation, explicit esp-netif init, sanity checks for parameters added il y a 6 ans
README.md f839a1328c esp_netif: added locking for netif list management, unit tests to use unique if_keys, updated comments il y a 6 ans
component.mk 00d84a3bb2 esp_netif: Add CONFIG_PPP_SUPPORT and CONFIG_LWIP_SLIP_SUPPORT to sperate the code il y a 4 ans
esp_netif_defaults.c 266be00254 esp-netif: Added esp_netif slip support, slip_modem component and example il y a 5 ans
esp_netif_handlers.c 66fb5a29bb Whitespace: Automated whitespace fixes (large commit) il y a 5 ans
esp_netif_objects.c 1a41545c3e esp-netif: SLIP interface refactor to isolate interface from drivers il y a 5 ans

README.md

ESP-NETIF architecture

                 |          (A) USER CODE                 |
                 |                                        |
    .............| init          settings      events     |
    .            +----------------------------------------+          
    .               .                |           *
    .               .                V           *                                   
--------+        +===========================+   *     +-----------------------+
        |        | new/config     get/set    |   *     |                       |
        |        |                           |...*.....| init                  |
        |        |---------------------------|   *     |                       |
  init  |        |                           |****     |                       |
  start |********|  event handler            |*********|  DHCP                 |
  stop  |        |                           |         |                       |
        |        |---------------------------|         |                       | 
        |        |                           |         |    NETIF              |
  +-----|        |                           |         +-----------------+     |   
  | glue|----<---|  esp_netif_transmit       |--<------| netif_output    |     |
  |     |        |                           |         |                 |     |
  |     |---->---|  esp_netif_receive        |-->------| netif_input     |     |
  |     |        |                           |         + ----------------+     |
  |     |....<...|  esp_netif_free_rx_buffer |...<.....| packet buffer         |
  +-----|        |                           |         |                       |  
        |        |                           |         |                       |  
  (B)   |        |                           |         +-----------------------+
--------+        +===========================+
communication                                                NETWORK STACK
DRIVER                   ESP-NETIF                          

Components:

A) User code, boiler plate

Overall application interaction with communication media and network stack

  • initialization code
    • create a new instance of ESP-NETIF
    • configure the object with 1) netif specific options (flags, behaviour, name) 2) network stack options (netif init and input functions, not publicly available) 3) IO driver specific options (transmit, tx_free functions, IO driver handle)
    • setup event handlers
    • use default handlers for common interfaces defined in IO drivers; or define a specific handlers for customised behaviour/new interfaces
    • register handlers for app related events (such as IP lost/acquired)
  • interact with network interfaces using ESP-NETIF API

B) Communication driver, IO driver, media driver

  • event handler
    • define behaviour patterns of interaction with ESP-NETIF (example: ehternet link-up -> turn netif on)
  • glue IO layer: adapt the input/output functions to use esp-netif transmit/input/free_rx
    • install driver_transmit to appropriate ESP-NETIF object, so that outgoing packets from network stack are passed to the IO driver
    • calls esp_netif_receive to pass incoming data to network stack

C) ESP-NETIF, former tcpip_adapter

  • init API (new, configure)
  • IO API: for passing data between IO driver and network stack
  • event/action API (esp-netif lifecycle management)
    • building blocks for designing event handlers
  • setters, getters
  • network stack abstraction: enabling user interaction with TCP/IP stack
    • netif up/down
    • DHCP server, client
    • DNS API
  • driver conversion utilities

D) Network stack: no public interaction with user code (wrtt interfaces)

Data/event flow:

  • ........ Initialization line from user code to esp-netif and comm driver

  • --<--->-- Data packets going from communication media to TCP/IP stack and back

  • ******** Events agregated in ESP-NETIP propagates to driver, user code and network stack

  • | User settings and runtime configuration