coap_resolve_address_info: Add in support for defining WebSocket ports

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2023-07-26 13:01:42 +01:00
1 parent 59892918cd
commit 3f8bb33807
11 files changed
+30 -17

No files matched your search

+2 -2
View File
@@ -1541,7 +1541,7 @@ get_session(coap_context_t *ctx,
local.s = (const uint8_t *)local_addr;
local.length = strlen(local_addr);
/* resolve local address where data should be sent from */
info_list = coap_resolve_address_info(&local, port, port,
info_list = coap_resolve_address_info(&local, port, port, port, port,
AI_PASSIVE | AI_NUMERICHOST | AI_NUMERICSERV | AI_ALL,
1 << scheme,
COAP_RESOLVE_TYPE_LOCAL);
@@ -1806,7 +1806,7 @@ main(int argc, char **argv) {
}
/* resolve destination address where data should be sent */
info_list = coap_resolve_address_info(&server, port, port,
info_list = coap_resolve_address_info(&server, port, port, port, port,
0,
1 << scheme,
COAP_RESOLVE_TYPE_REMOTE);
+1
View File
@@ -716,6 +716,7 @@ get_context(const char *node, const char *port) {
coap_get_available_scheme_hint_bits(cert_file != NULL || key_defined != 0,
enable_ws, COAP_PROTO_NONE);
info_list = coap_resolve_address_info(node ? &local : NULL, u_s_port, s_port,
ws_port, wss_port,
AI_PASSIVE | AI_NUMERICHOST,
scheme_hint_bits,
COAP_RESOLVE_TYPE_LOCAL);
+2 -1
View File
@@ -909,7 +909,7 @@ get_ongoing_proxy_session(coap_session_t *session,
}
/* resolve destination address where data should be sent */
info_list = coap_resolve_address_info(&server, port, port,
info_list = coap_resolve_address_info(&server, port, port, port, port,
0,
1 << scheme,
COAP_RESOLVE_TYPE_REMOTE);
@@ -2327,6 +2327,7 @@ get_context(const char *node, const char *port) {
coap_get_available_scheme_hint_bits(cert_file != NULL || key_defined != 0,
enable_ws, use_unix_proto);
info_list = coap_resolve_address_info(node ? &local : NULL, u_s_port, s_port,
ws_port, wss_port,
AI_PASSIVE | AI_NUMERICHOST,
scheme_hint_bits,
COAP_RESOLVE_TYPE_LOCAL);
+2 -2
View File
@@ -86,8 +86,8 @@ resolve_address(const char *host, const char *service, coap_address_t *dst,
str_host.s = (const uint8_t *)host;
str_host.length = strlen(host);
addr_info = coap_resolve_address_info(&str_host, port, port, AF_UNSPEC,
scheme_hint_bits,
addr_info = coap_resolve_address_info(&str_host, port, port, port, port,
AF_UNSPEC, scheme_hint_bits,
COAP_RESOLVE_TYPE_REMOTE);
if (addr_info) {
ret = 1;
+1
View File
@@ -171,6 +171,7 @@ server_coap_init(coap_lwip_input_wait_handler_t input_wait,
coap_get_available_scheme_hint_bits(use_psk[0],
0, COAP_PROTO_NONE);
info_list = coap_resolve_address_info(&node, 0, 0,
0, 0,
0,
scheme_hint_bits,
COAP_RESOLVE_TYPE_LOCAL);
@@ -105,8 +105,8 @@ resolve_address(const char *host, const char *service, coap_address_t *dst,
str_host.s = (const uint8_t *)host;
str_host.length = strlen(host);
addr_info = coap_resolve_address_info(&str_host, port, port, AF_UNSPEC,
scheme_hint_bits,
addr_info = coap_resolve_address_info(&str_host, port, port, port, port,
AF_UNSPEC, scheme_hint_bits,
COAP_RESOLVE_TYPE_REMOTE);
if (addr_info) {
ret = 1;
@@ -166,6 +166,7 @@ init_coap_context_endpoints(const char *use_psk) {
local.length = strlen(addr_str);
info_list = coap_resolve_address_info(&local, COAP_DEFAULT_PORT,
COAPS_DEFAULT_PORT,
0, 0,
0,
scheme_hint_bits,
COAP_RESOLVE_TYPE_REMOTE);
+2 -2
View File
@@ -1,6 +1,6 @@
PKG_NAME=libcoap
PKG_URL=https://github.com/obgm/libcoap
PKG_VERSION=cb78d5fd857c7bc244ca056ac3c989eeeb2954bf
PKG_URL=https://github.com/mrdeep1/libcoap
PKG_VERSION=6769f9f893e9143d33782ce3602f947a8f2cf521
PKG_LICENSE=BSD-2-Clause
LIBCOAP_BUILD_DIR=$(BINDIR)/pkg/$(PKG_NAME)