You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 10, 2022. It is now read-only.
I'd like to use libnyoci on an Espressif ESP32 system (SparkFun's ESP32 Thing.) The software stack for this is the ESP IoT Development Framework, ESP-IDF, which uses lwIP for IP networking. This is apparently a pretty widespread IP stack; Wikipedia says "lwIP is used by many manufacturers of embedded systems. Examples include Altera (in the Nios II operating system), Analog Devices (for the Blackfin DSP chip), Xilinx, Honeywell ... and Freescale."
Most of libnyoci builds fine, but there are a bunch of errors in plat-net/posix/ due to missing functionality in lwIP:
poll isn't supported, so nyoci_plat_update_pollfds needs to be #ifdef'd out, but then nyoci_plat_wait and nyoci_plat_process break because they call it.
cmsgheader and all its ancillary types and constants aren't defined. This breaks sendtofrom.
ipv6_mreq is called ip6_mreq for some reason, and its ipv6mr_interface field is of type in6_addr not int, i.e. it wants the IP address of the interface, not its index in the interface list (which doesn't seem to exist; there is no getifaddrs.)
in_pktinfo and in6_pktinfo aren't defined. This breaks the pktinfo field of nyoci_plat_s (which seems to be unused. It's written to in nyoci_plat_process, but never read.)
IN6_IS_ADDR_V4MAPPED is not defined. I worked around this by copying in the definition from macOS's <in6.h>.
Some supported APIs are in different headers; for example there is no <sys/select.h> for some reason, instead select is in <lwip/sockets.h>.
The first issue is the hardest one for me, since I don't know much about either poll or select. Looks like I need to reimplement nyoci_plat_wait and nyoci_plat_process using nyoci_plat_update_fdsets. Probably easy, but I'd appreciate any clues.
The second and third issues seem to be related to multihoming; not a problem for my use case because my board only has a single (WiFi) interface.
I'd like to use libnyoci on an Espressif ESP32 system (SparkFun's ESP32 Thing.) The software stack for this is the ESP IoT Development Framework, ESP-IDF, which uses lwIP for IP networking. This is apparently a pretty widespread IP stack; Wikipedia says "lwIP is used by many manufacturers of embedded systems. Examples include Altera (in the Nios II operating system), Analog Devices (for the Blackfin DSP chip), Xilinx, Honeywell ... and Freescale."
Most of libnyoci builds fine, but there are a bunch of errors in
plat-net/posix/due to missing functionality in lwIP:pollisn't supported, sonyoci_plat_update_pollfdsneeds to be#ifdef'd out, but thennyoci_plat_waitandnyoci_plat_processbreak because they call it.cmsgheaderand all its ancillary types and constants aren't defined. This breakssendtofrom.ipv6_mreqis calledip6_mreqfor some reason, and itsipv6mr_interfacefield is of typein6_addrnotint, i.e. it wants the IP address of the interface, not its index in the interface list (which doesn't seem to exist; there is nogetifaddrs.)in_pktinfoandin6_pktinfoaren't defined. This breaks thepktinfofield ofnyoci_plat_s(which seems to be unused. It's written to innyoci_plat_process, but never read.)IN6_IS_ADDR_V4MAPPEDis not defined. I worked around this by copying in the definition from macOS's<in6.h>.<sys/select.h>for some reason, insteadselectis in<lwip/sockets.h>.The first issue is the hardest one for me, since I don't know much about either poll or select. Looks like I need to reimplement
nyoci_plat_waitandnyoci_plat_processusingnyoci_plat_update_fdsets. Probably easy, but I'd appreciate any clues.The second and third issues seem to be related to multihoming; not a problem for my use case because my board only has a single (WiFi) interface.
The other issues I think I've fixed locally.