Skip to content

Commit 9a4b035

Browse files
committed
openthread: platform: Update code to use socket services config
Updated platform code to make use of number of socket services defined in Kconfig. In this way, hardcoded values are avoided. Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
1 parent 94713ef commit 9a4b035

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

modules/openthread/platform/dhcp6_pd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#define DHCPV6_SERVER_PORT 547
1919
#define DHCPV6_CLIENT_PORT 546
20-
#define DHCPV6_PD_CLIENT_NUM_SERVICES 1
20+
#define DHCPV6_PD_CLIENT_NUM_SERVICES CONFIG_OPENTHREAD_ZEPHYR_BORDER_ROUTER_DHCP6_PD_SERVICES
2121

2222
static struct zsock_pollfd sockfd_udp[DHCPV6_PD_CLIENT_NUM_SERVICES];
2323
static struct otInstance *ot_instance_ptr;

modules/openthread/platform/infra_if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static struct net_icmp_ctx na_ctx;
3939
static void infra_if_handle_backbone_icmp6(struct otbr_msg_ctx *msg_ctx_ptr);
4040
static void handle_ra_from_ot(const uint8_t *buffer, uint16_t buffer_length);
4141
#if defined(CONFIG_OPENTHREAD_NAT64_TRANSLATOR)
42-
#define MAX_SERVICES 1
42+
#define MAX_SERVICES CONFIG_OPENTHREAD_ZEPHYR_BORDER_ROUTER_NAT64_SERVICES
4343

4444
static struct zsock_pollfd sockfd_raw[MAX_SERVICES];
4545
static void raw_receive_handler(struct net_socket_service_event *evt);

modules/openthread/platform/mdns_socket.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@
2222
#include "sockets_internal.h"
2323

2424
#define MULTICAST_PORT 5353
25-
#if defined(CONFIG_NET_IPV4) && defined(CONFIG_NET_IPV6)
26-
#define MAX_SERVICES 2
27-
#else
28-
#define MAX_SERVICES 1
29-
#endif
25+
#define MAX_SERVICES CONFIG_OPENTHREAD_ZEPHYR_BORDER_ROUTER_MAX_MDNS_SERVICES
3026

3127
static struct zsock_pollfd sockfd_udp[MAX_SERVICES];
3228
static int mdns_sock_v6 = -1;

modules/openthread/platform/trel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <zephyr/net/net_ip.h>
1616
#include "sockets_internal.h"
1717

18-
#define MAX_SERVICES 1
18+
#define MAX_SERVICES CONFIG_OPENTHREAD_ZEPHYR_BORDER_ROUTER_TREL_SERVICES
1919

2020
static struct zsock_pollfd sockfd_udp[MAX_SERVICES];
2121
static int trel_sock = -1;

0 commit comments

Comments
 (0)