summaryrefslogtreecommitdiff
path: root/shared/netutils
AgeCommit message (Collapse)Author
2025-07-25shared/netutils: Cast the ticks value before printing.Jeff Epler
Before, the compiler plugin produced an error in the PYBD_SF6 build, which is a nanboxing build with 64-bit ints. I made the decision here to cast the value even though some significant bits might be lost after 49.7 days. However, the format used is "% 8d", which produces a consistent width output for small ticks values (up to about 1.1 days). I judged that it was more valuable to preserve the fixed width display than to accurately represent long time periods. Signed-off-by: Jeff Epler <jepler@gmail.com>
2024-06-04extmod/network_ninaw10: Implement the ipconfig methods for ninaw10.robert-hh
This implements network.ipconfig() and network.WLAN.ipconfig() when the ninaw10 driver is used for WLAN. Due to a omission in the ninaw10 driver stack, setting the DNS address has no effect. But the interface is kept here just in case it's fixed eventually. dhcp4 and has_dhcp4 are dummy arguments. Ninaw10 seems to always use DHCP. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-02-16extmod/modlwip: Support IPv6.Felix Dörre
With these changes IPv6 works on the rp2 port (and possibly others that use the lwIP socket implementation). Things that have been tested and work: - Neighbour solicitation for v6 link local address. - Ping of v6 link-local address. - Receiving a SLAAC address via router advertisement. - Ping a v6 address allocated via SLAAC. - Perform an outgoing connection to a routed v6-address (via default gateway). - Create a listening IPv6 wildcard socked bound to ::, and trying to access it via link-local, SLAAC, and IPv4 (to ensure the dual-stack binding works). Things that could be improved: - socket.socket().getaddrinfo only returns the v4 address. It could also return v6 addresses (getaddrinfo is actively programmed to only return a single address, and this is the v4-address by default, with fallback to the v6 address if both are enabled). Signed-off-by: Felix Dörre <felix@dogcraft.de>
2023-09-29shared/netutils/dhcpserver: Reply on correct netif.Peter Harper
The DHCP server broadcasts messages. They are being sent via the default netif which might be completely the wrong network. We want to send messages to the netif we got the original message from. Original author: [Peter Harper](https://github.com/peterharperuk) Source: https://github.com/raspberrypi/pico-examples/pull/392 Signed-off-by: Samveen <samveen@samveen.in>
2023-04-27all: Fix spelling mistakes based on codespell check.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-11-11shared/netutils: Add "py/obj.h" header include.Damien George
So this header can be included by itself. Signed-off-by: Damien George <damien.p.george@gmail.com>
2022-07-12shared/netutils/dhcpserver: Match default DNS to server IP.Phil Howard
Change the default DNS to match the gateway IP of a board running in access point mode (or otherwise acting as a "server"). This fixes the rather meaningless use of "8.8.8.8" as the default DNS server address offered up to access point clients via the DHCP server. Since most devices wont be able to proxy access to the real "8.8.8.8". It allows for a DNS responder to run and provide a catchall response for captive portal functionality, or just a quality-of-life response to a friendly URL for access-point based configuration and other applications. Signed-off-by: Phil Howard <phil@gadgetoid.com>
2021-07-12all: Update to point to files in new shared/ directory.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-07-12shared: Introduce new top-level dir and move 1st party lib code there.Damien George
This commit moves all first-party code developed for this project from lib/ to shared/, so that lib/ now only contains third-party code. The following directories are moved as-is from lib to shared: lib/libc -> shared/libc lib/memzip -> shared/memzip lib/netutils -> shared/netutils lib/timeutils -> shared/timeutils lib/upytesthelper -> shared/upytesthelper All files in lib/embed/ have been moved to shared/libc/. lib/mp-readline has been moved to shared/readline. lib/utils has been moved to shared/runtime, with the exception of lib/utils/printf.c which has been moved to shared/libc/printf.c. Signed-off-by: Damien George <damien@micropython.org>