Lines Matching +full:ip +full:- +full:addr
11 * SPDX-License-Identifier: Apache-2.0
23 int modem_context_sprint_ip_addr(const struct sockaddr *addr, char *buf, size_t buf_size) in modem_context_sprint_ip_addr() argument
27 if (addr->sa_family == AF_INET6) { in modem_context_sprint_ip_addr()
29 return -ENOMEM; in modem_context_sprint_ip_addr()
32 if (net_addr_ntop(AF_INET6, &net_sin6(addr)->sin6_addr, in modem_context_sprint_ip_addr()
34 return -ENOMEM; in modem_context_sprint_ip_addr()
39 if (addr->sa_family == AF_INET) { in modem_context_sprint_ip_addr()
41 return -ENOMEM; in modem_context_sprint_ip_addr()
43 if (net_addr_ntop(AF_INET, &net_sin(addr)->sin_addr, in modem_context_sprint_ip_addr()
45 return -ENOMEM; in modem_context_sprint_ip_addr()
50 LOG_ERR("Unknown IP address family:%d", addr->sa_family); in modem_context_sprint_ip_addr()
53 return -ENOMEM; in modem_context_sprint_ip_addr()
59 int modem_context_get_addr_port(const struct sockaddr *addr, uint16_t *port) in modem_context_get_addr_port() argument
61 if (!addr || !port) { in modem_context_get_addr_port()
62 return -EINVAL; in modem_context_get_addr_port()
65 if (addr->sa_family == AF_INET6) { in modem_context_get_addr_port()
66 *port = ntohs(net_sin6(addr)->sin6_port); in modem_context_get_addr_port()
68 } else if (addr->sa_family == AF_INET) { in modem_context_get_addr_port()
69 *port = ntohs(net_sin(addr)->sin_port); in modem_context_get_addr_port()
73 return -EPROTONOSUPPORT; in modem_context_get_addr_port()
88 if (contexts[i] && contexts[i]->iface.dev == dev) { in modem_context_from_iface_dev()
117 return -ENOMEM; in modem_context_get()
132 return -EINVAL; in modem_context_register()