Hypha IP is a tiny IP stack coded in C17/C23 which seeks to implement the bare minimum of features to enable libudpard to operate in a resource constrained environment.
- Single Network Interface
- Ethernet Multicast (
01:00:5E:xx:xx:xx) - IPv4, no optional headers
- IPv4 Checksum
- IPv4 Multicast
- UDP
- IGMPv2 (Join/Leave)
- Software MAC Filter (incomplete)
- Software IP Filter (incomplete)
- Preloading ARP cache (incomplete)
- ARP Request/Response (incomplete)
- UDP Checksum (incomplete)
- ICMP Echo/Response (incomplete)
- VLAN Tagging (incomplete)
- IPv6
Users will simply need to provide a set of functions with the following features:
- an Ethernet PHY driver capable of receiving raw frames and sending the frames which Hypha IP fills in. Hypha IP assumes that the CRC32 is handled by the Ethernet PHY Driver or Peripheral Hardware.
- A frame acquire and release mechanism. Users are free to use static or dynamic memory or DMA memory to implement this.
- A printing function to enable debugging. The lack of a printing function indicates that the debugging is disabled.
- A Monotonic Time source (in whatever granularity you wish).
- A reporting function which can receive asynchronous error reports.
Users can statically configure Hypha IP in several regards
- IP TTL using
HYPHA_IP_TTLset to a number > 0 - MTU Size using
HYPHA_IP_MTUset to a number >= 64. - ARP Cache (define
HYPHA_IP_USE_ARP_CACHEas 1 or 0) and ARP Cache Size (HYPHA_IP_ARP_TABLE_SIZEset to a number > 0) - IPv4 Checksum Enablement (
HYPHA_IP_USE_IP_CHECKSUMset totrueorfalse) - UDP Checksum Enablement (
HYPHA_IP_USE_UDP_CHECKSUMset totrueorfalse) - Ethernet MAC Filter (define
HYPHA_IP_USE_MAC_FILTERto 1 or 0) and number of Filter Elements (HYPHA_IP_MAC_FILTER_TABLE_SIZEset to a number > 0) - Allow any IP Localhost into the stack (define
HYPHA_IP_ALLOW_ANY_LOCALHOSTto 1 or 0) - Allow any IP Broadcast into the stack (define
HYPHA_IP_ALLOW_ANY_BROADCASTto 1 or 0) - Allow any IP Multicast into the stack (define
HYPHA_IP_ALLOW_ANY_MULTICASTto 1 or 0) - Multicast IP Filter (define
HYPHA_IP_USE_IP_FILTERto 1 or 0) and Number of Filter Elements (HYPHA_IP_IPv4_FILTER_TABLE_SIZEset to a number > 0) - Use VLAN (define
HYPHA_IP_USE_VLANas 1 or 0) and assign VLAN ID usingHYPHA_IP_VLAN_IDset to a number between 0 and 2^12-1 inclusive. - Default expiration time for items to stay in the various Cache and Filters. Use
HYPHA_IP_EXPIRATION_TIMEwhich must be in the units ofHyphaIpTimestamp_t.
You can optionally add a CMAKE_INSTALL_PREFIX to indicate where you'd like to install the headers, libs, cmake, etc.
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=../install
cmake --build build --target allcmake --build build --target installUsing a host compiler, build
cmake -B build -S .
cmake --build build --target all
cmake --build build --target testCreates a coverage report on the Unity Test.
cmake -B build -S .
cmake --build build --target all
cmake --build build --target test
cmake --build build --target coverage
open build/coverage/coverage-hypha_ip_test/index.htmldoxygen documentation/Doxyfile
open build/documentation/html/index.html