diff --git a/modules/openthread/Kconfig b/modules/openthread/Kconfig index 2bb53572047b2..d3c6498e2dffe 100644 --- a/modules/openthread/Kconfig +++ b/modules/openthread/Kconfig @@ -394,13 +394,42 @@ config OPENTHREAD_ZEPHYR_BORDER_ROUTER_MODEL_NAME This value represents Border Agent's product model. config OPENTHREAD_ZEPHYR_BORDER_ROUTER_MAX_UDP_SERVICES - int "The maximum number of pollable UDP sockets to be registered in platform UDP." - depends on OPENTHREAD_ZEPHYR_BORDER_ROUTER + int "The maximum number of pollable UDP sockets to be registered in platform code." default 5 help This configuration defines the maximum number of pollable UDP sockets to be used within platform UDP module. +config OPENTHREAD_ZEPHYR_BORDER_ROUTER_MAX_MDNS_SERVICES + int "The maximum number of pollable mDNS sockets to be registered in platform code." + default 1 if NET_IPV6 && !NET_IPV4 + default 2 if NET_IPV6 && NET_IPV4 + help + This configuration defines the maximum number of pollable mDNS sockets + to be used within platform mDNS module. + +config OPENTHREAD_ZEPHYR_BORDER_ROUTER_TREL_SERVICES + int "The maximum number of pollable TREL sockets to be registered in platform code." + default 1 + help + This configuration defines the maximum number of pollable TREL sockets + to be used within platform TREL module. + +config OPENTHREAD_ZEPHYR_BORDER_ROUTER_DHCP6_PD_SERVICES + int "The maximum number of pollable DHCP6_PD sockets to be registered in platform code." + default 1 + help + This configuration defines the maximum number of pollable DHCP6_PD sockets + to be used within platform DHCP6_PD module. + +config OPENTHREAD_ZEPHYR_BORDER_ROUTER_NAT64_SERVICES + int "The maximum number of pollable RAW IPV4 sockets to be registered in platform code." + depends on OPENTHREAD_NAT64_TRANSLATOR + default 1 + help + This configuration defines the maximum number of pollable RAW IPV4 sockets + to be used within platform Infrastructure Interface module. + config OPENTHREAD_ZEPHYR_BORDER_ROUTER_MSG_POOL_NUM int "Maximum entries of backbone message pool." default 10 diff --git a/modules/openthread/platform/dhcp6_pd.c b/modules/openthread/platform/dhcp6_pd.c index 5b0cf93c8139d..419960be72db7 100644 --- a/modules/openthread/platform/dhcp6_pd.c +++ b/modules/openthread/platform/dhcp6_pd.c @@ -17,7 +17,7 @@ #define DHCPV6_SERVER_PORT 547 #define DHCPV6_CLIENT_PORT 546 -#define DHCPV6_PD_CLIENT_NUM_SERVICES 1 +#define DHCPV6_PD_CLIENT_NUM_SERVICES CONFIG_OPENTHREAD_ZEPHYR_BORDER_ROUTER_DHCP6_PD_SERVICES static struct zsock_pollfd sockfd_udp[DHCPV6_PD_CLIENT_NUM_SERVICES]; static struct otInstance *ot_instance_ptr; diff --git a/modules/openthread/platform/infra_if.c b/modules/openthread/platform/infra_if.c index 6f3db98d42605..6f31ebab75bfa 100644 --- a/modules/openthread/platform/infra_if.c +++ b/modules/openthread/platform/infra_if.c @@ -39,7 +39,7 @@ static struct net_icmp_ctx na_ctx; static void infra_if_handle_backbone_icmp6(struct otbr_msg_ctx *msg_ctx_ptr); static void handle_ra_from_ot(const uint8_t *buffer, uint16_t buffer_length); #if defined(CONFIG_OPENTHREAD_NAT64_TRANSLATOR) -#define MAX_SERVICES 1 +#define MAX_SERVICES CONFIG_OPENTHREAD_ZEPHYR_BORDER_ROUTER_NAT64_SERVICES static struct zsock_pollfd sockfd_raw[MAX_SERVICES]; static void raw_receive_handler(struct net_socket_service_event *evt); diff --git a/modules/openthread/platform/mdns_socket.c b/modules/openthread/platform/mdns_socket.c index 71abb3150c3ba..5f93db299f417 100644 --- a/modules/openthread/platform/mdns_socket.c +++ b/modules/openthread/platform/mdns_socket.c @@ -22,11 +22,7 @@ #include "sockets_internal.h" #define MULTICAST_PORT 5353 -#if defined(CONFIG_NET_IPV4) && defined(CONFIG_NET_IPV6) -#define MAX_SERVICES 2 -#else -#define MAX_SERVICES 1 -#endif +#define MAX_SERVICES CONFIG_OPENTHREAD_ZEPHYR_BORDER_ROUTER_MAX_MDNS_SERVICES static struct zsock_pollfd sockfd_udp[MAX_SERVICES]; static int mdns_sock_v6 = -1; diff --git a/modules/openthread/platform/trel.c b/modules/openthread/platform/trel.c index 58ae1a559e58b..aeca9ae79137c 100644 --- a/modules/openthread/platform/trel.c +++ b/modules/openthread/platform/trel.c @@ -15,7 +15,7 @@ #include #include "sockets_internal.h" -#define MAX_SERVICES 1 +#define MAX_SERVICES CONFIG_OPENTHREAD_ZEPHYR_BORDER_ROUTER_TREL_SERVICES static struct zsock_pollfd sockfd_udp[MAX_SERVICES]; static int trel_sock = -1;