summaryrefslogtreecommitdiff
path: root/extmod/modnetwork.h
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-02-01 14:19:45 +1100
committerDamien George <damien@micropython.org>2023-03-01 01:26:44 +1100
commitf78464c12ba97688e3d234d88362a90e38892f7c (patch)
tree7d5b7fbd5a63a4b020558236c125b768862961e2 /extmod/modnetwork.h
parenta3773026238c7c779cad79aa9d9c468e680e7004 (diff)
extmod/modnetwork: Allow more extensive port-specific customisation.
This allows for a port (e.g. esp8266/esp32) to use extmod/modnetwork.c and provide the globals dict, rather than just a list of interfaces. When this is used, the default implementation of `network.route` and the NIC list is not enabled. Also splits out the LWIP-specific helpers from modnetwork.c into network_lwip.c. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/modnetwork.h')
-rw-r--r--extmod/modnetwork.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/extmod/modnetwork.h b/extmod/modnetwork.h
index 0ef612d10..11691140f 100644
--- a/extmod/modnetwork.h
+++ b/extmod/modnetwork.h
@@ -65,7 +65,7 @@ struct netif;
void mod_network_lwip_init(void);
void mod_network_lwip_poll_wrapper(uint32_t ticks_ms);
mp_obj_t mod_network_nic_ifconfig(struct netif *netif, size_t n_args, const mp_obj_t *args);
-#else
+#elif defined(MICROPY_PORT_NETWORK_INTERFACES)
struct _mod_network_socket_obj_t;
@@ -107,11 +107,13 @@ typedef struct _mod_network_socket_obj_t {
#endif
} mod_network_socket_obj_t;
-#endif // MICROPY_PY_LWIP
+#endif // MICROPY_PY_LWIP / MICROPY_PORT_NETWORK_INTERFACES
+#ifdef MICROPY_PORT_NETWORK_INTERFACES
void mod_network_init(void);
void mod_network_deinit(void);
void mod_network_register_nic(mp_obj_t nic);
mp_obj_t mod_network_find_nic(const uint8_t *ip);
+#endif
#endif // MICROPY_INCLUDED_MODNETWORK_H