Lines Matching +full:- +full:- +full:exit +full:- +full:code

4  * SPDX-License-Identifier: Apache-2.0
28 #define FAILED (-1)
34 #define OBJ_TO_SD(obj) (((int)obj) - 1)
50 * code to BSD ones. The #ifdef in each case are made in order to in getErrno()
51 * reduce code footprint: These cases are compiled if and only if in getErrno()
53 * code returned by the NWP. in getErrno()
180 * code and the code returned by the NWP are either identical, in getErrno()
199 return -EAFNOSUPPORT; in simplelink_socket_family_from_posix()
218 return -ESOCKTNOSUPPORT; in simplelink_socket_type_from_posix()
230 return -EPROTONOSUPPORT; in simplelink_socket_proto_from_zephyr()
240 return -EPROTONOSUPPORT; in simplelink_socket_proto_from_zephyr()
259 retval = slcb_SetErrno(-err); in simplelink_socket()
260 goto exit; in simplelink_socket()
267 retval = slcb_SetErrno(-err); in simplelink_socket()
268 goto exit; in simplelink_socket()
275 retval = slcb_SetErrno(-err); in simplelink_socket()
276 goto exit; in simplelink_socket()
284 sec_method = (proto - IPPROTO_TLS_1_0) + in simplelink_socket()
292 goto exit; in simplelink_socket()
303 exit: in simplelink_socket()
351 sl_addr_in->sin_family = SL_AF_INET; in translate_z_to_sl_addrs()
352 sl_addr_in->sin_port = z_sockaddr_in->sin_port; in translate_z_to_sl_addrs()
353 sl_addr_in->sin_addr.s_addr = in translate_z_to_sl_addrs()
354 z_sockaddr_in->sin_addr.s_addr; in translate_z_to_sl_addrs()
362 sl_addr_in6->sin6_family = SL_AF_INET6; in translate_z_to_sl_addrs()
363 sl_addr_in6->sin6_port = z_sockaddr_in6->sin6_port; in translate_z_to_sl_addrs()
364 memcpy(sl_addr_in6->sin6_addr._S6_un._S6_u32, in translate_z_to_sl_addrs()
365 z_sockaddr_in6->sin6_addr.s6_addr, in translate_z_to_sl_addrs()
366 sizeof(sl_addr_in6->sin6_addr._S6_un._S6_u32)); in translate_z_to_sl_addrs()
382 if (sl_addr->sa_family == SL_AF_INET) { in translate_sl_to_z_addr()
388 z_sockaddr_in->sin_family = AF_INET; in translate_sl_to_z_addr()
389 z_sockaddr_in->sin_port = sl_addr_in->sin_port; in translate_sl_to_z_addr()
390 z_sockaddr_in->sin_addr.s_addr = in translate_sl_to_z_addr()
391 sl_addr_in->sin_addr.s_addr; in translate_sl_to_z_addr()
396 } else if (sl_addr->sa_family == SL_AF_INET6) { in translate_sl_to_z_addr()
402 z_sockaddr_in6->sin6_family = AF_INET6; in translate_sl_to_z_addr()
403 z_sockaddr_in6->sin6_port = sl_addr_in6->sin6_port; in translate_sl_to_z_addr()
404 z_sockaddr_in6->sin6_scope_id = in translate_sl_to_z_addr()
405 (uint8_t)sl_addr_in6->sin6_scope_id; in translate_sl_to_z_addr()
406 memcpy(z_sockaddr_in6->sin6_addr.s6_addr, in translate_sl_to_z_addr()
407 sl_addr_in6->sin6_addr._S6_un._S6_u32, in translate_sl_to_z_addr()
408 sizeof(z_sockaddr_in6->sin6_addr.s6_addr)); in translate_sl_to_z_addr()
428 goto exit; in simplelink_accept()
436 goto exit; in simplelink_accept()
441 goto exit; in simplelink_accept()
447 exit: in simplelink_accept()
476 goto exit; in simplelink_bind()
481 exit: in simplelink_bind()
521 goto exit; in simplelink_connect()
547 exit: in simplelink_connect()
570 goto exit; in simplelink_poll()
599 /* Non-offloaded socket, return an error. */ in simplelink_poll()
601 goto exit; in simplelink_poll()
640 exit: in simplelink_poll()
662 goto exit; in map_credentials()
673 switch (cert->type) { in map_credentials()
689 goto exit; in map_credentials()
692 cert->buf, in map_credentials()
693 (SlSocklen_t)cert->len); in map_credentials()
702 exit: in map_credentials()
729 goto exit; in simplelink_setsockopt()
751 goto exit; in simplelink_setsockopt()
757 goto exit; in simplelink_setsockopt()
764 goto exit; in simplelink_setsockopt()
767 goto exit; in simplelink_setsockopt()
781 goto exit; in simplelink_setsockopt()
786 * EINVAL in order to not break "off-the-shelf" BSD in simplelink_setsockopt()
787 * code. in simplelink_setsockopt()
793 goto exit; in simplelink_setsockopt()
805 exit: in simplelink_setsockopt()
823 goto exit; in simplelink_getsockopt()
826 goto exit; in simplelink_getsockopt()
838 goto exit; in simplelink_getsockopt()
842 * errno to EINVAL in order to not break "off-the-shelf" in simplelink_getsockopt()
843 * BSD code. in simplelink_getsockopt()
849 goto exit; in simplelink_getsockopt()
861 exit: in simplelink_getsockopt()
969 goto exit; in simplelink_sendto()
978 exit: in simplelink_sendto()
989 errno = -ENOTSUP; in simplelink_sendmsg()
990 return -1; in simplelink_sendmsg()
1004 goto exit; in set_addr_info()
1011 goto exit; in set_addr_info()
1016 ai->ai_family = (sl_ai->ai_family == SL_AF_INET6 ? AF_INET6 : AF_INET); in set_addr_info()
1017 ai->ai_socktype = (sl_ai->ai_socktype == SLNETSOCK_SOCK_DGRAM ? in set_addr_info()
1019 ai->ai_protocol = (sl_ai->ai_protocol == SLNETSOCK_PROTO_UDP ? in set_addr_info()
1023 if (ai->ai_family == AF_INET) { in set_addr_info()
1025 (SlNetSock_AddrIn_t *)sl_ai->ai_addr; in set_addr_info()
1027 net_sin(ai_addr)->sin_family = ai->ai_family; in set_addr_info()
1028 net_sin(ai_addr)->sin_addr.s_addr = sl_addr->sin_addr.s_addr; in set_addr_info()
1029 net_sin(ai_addr)->sin_port = sl_addr->sin_port; in set_addr_info()
1030 ai->ai_addrlen = sizeof(struct sockaddr_in); in set_addr_info()
1033 (SlNetSock_AddrIn6_t *)sl_ai->ai_addr; in set_addr_info()
1035 net_sin6(ai_addr)->sin6_family = ai->ai_family; in set_addr_info()
1036 net_sin6(ai_addr)->sin6_addr.s6_addr32[0] = in set_addr_info()
1037 sl_addr->sin6_addr._S6_un._S6_u32[0]; in set_addr_info()
1038 net_sin6(ai_addr)->sin6_addr.s6_addr32[1] = in set_addr_info()
1039 sl_addr->sin6_addr._S6_un._S6_u32[1]; in set_addr_info()
1040 net_sin6(ai_addr)->sin6_addr.s6_addr32[2] = in set_addr_info()
1041 sl_addr->sin6_addr._S6_un._S6_u32[2]; in set_addr_info()
1042 net_sin6(ai_addr)->sin6_addr.s6_addr32[3] = in set_addr_info()
1043 sl_addr->sin6_addr._S6_un._S6_u32[3]; in set_addr_info()
1044 net_sin6(ai_addr)->sin6_port = sl_addr->sin6_port; in set_addr_info()
1045 ai->ai_addrlen = sizeof(struct sockaddr_in6); in set_addr_info()
1047 ai->ai_addr = ai_addr; in set_addr_info()
1048 ai->ai_next = *res; in set_addr_info()
1051 exit: in set_addr_info()
1069 goto exit; in simplelink_getaddrinfo()
1077 sl_hints.ai_flags |= ((hints->ai_flags & AI_PASSIVE) ? in simplelink_getaddrinfo()
1079 sl_hints.ai_flags |= ((hints->ai_flags & AI_NUMERICHOST) ? in simplelink_getaddrinfo()
1081 if (hints->ai_family == AF_UNSPEC) { in simplelink_getaddrinfo()
1084 sl_hints.ai_family = (hints->ai_family == AF_INET6 ? in simplelink_getaddrinfo()
1087 if (hints->ai_socktype == 0) { in simplelink_getaddrinfo()
1091 (hints->ai_socktype == SOCK_DGRAM ? in simplelink_getaddrinfo()
1094 if (hints->ai_protocol == 0) { in simplelink_getaddrinfo()
1098 (hints->ai_protocol == IPPROTO_UDP ? in simplelink_getaddrinfo()
1112 goto exit; in simplelink_getaddrinfo()
1122 goto exit; in simplelink_getaddrinfo()
1124 sl_ai = sl_ai->ai_next; in simplelink_getaddrinfo()
1127 exit: in simplelink_getaddrinfo()
1135 free(res->ai_addr); in simplelink_freeaddrinfo()
1167 goto exit; in simplelink_fcntl()
1174 exit: in simplelink_fcntl()
1184 return -EXDEV; in simplelink_ioctl()
1187 return -EOPNOTSUPP; in simplelink_ioctl()
1267 return -1; in simplelink_socket_create()
1273 return -1; in simplelink_socket_create()
1290 return -1; in simplelink_socket_accept()
1296 return -1; in simplelink_socket_accept()