Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 38) sorted by relevance

12

/openthread-latest/third_party/mbedtls/repo/library/
Dnet_sockets.c56 #define read(fd, buf, len) recv(fd, (char *) (buf), (int) (len), 0) argument
57 #define write(fd, buf, len) send(fd, (char *) (buf), (int) (len), 0) argument
58 #define close(fd) closesocket(fd) argument
125 static int check_fd(int fd, int for_select) in check_fd() argument
127 if (fd < 0) { in check_fd()
139 if (for_select && fd >= FD_SETSIZE) { in check_fd()
152 ctx->fd = -1; in mbedtls_net_init()
181 ctx->fd = (int) socket(cur->ai_family, cur->ai_socktype, in mbedtls_net_connect()
183 if (ctx->fd < 0) { in mbedtls_net_connect()
188 if (connect(ctx->fd, cur->ai_addr, MSVC_INT_CAST cur->ai_addrlen) == 0) { in mbedtls_net_connect()
[all …]
/openthread-latest/src/posix/platform/
Dudp.cpp221 int fd; in otPlatUdpSocket() local
225 fd = SocketWithCloseExec(AF_INET6, SOCK_DGRAM, IPPROTO_UDP, kSocketNonBlock); in otPlatUdpSocket()
226 VerifyOrExit(fd >= 0, error = OT_ERROR_FAILED); in otPlatUdpSocket()
228 aUdpSocket->mHandle = FdToHandle(fd); in otPlatUdpSocket()
237 int fd; in otPlatUdpClose() local
243 fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpClose()
244 VerifyOrExit(0 == close(fd), error = OT_ERROR_FAILED); in otPlatUdpClose()
255 int fd; in otPlatUdpBind() local
260 fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpBind()
270 …VerifyOrExit(0 == bind(fd, reinterpret_cast<struct sockaddr *>(&sin6), sizeof(sin6)), error = OT_E… in otPlatUdpBind()
[all …]
Dmisc.cpp102 int fd = -1; in SocketWithCloseExec() local
105 VerifyOrExit((fd = socket(aDomain, aType, aProtocol)) != -1, perror("socket(SOCK_CLOEXEC)")); in SocketWithCloseExec()
107 VerifyOrExit((rval = fcntl(fd, F_GETFD, 0)) != -1, perror("fcntl(F_GETFD)")); in SocketWithCloseExec()
109 VerifyOrExit((rval = fcntl(fd, F_SETFD, rval)) != -1, perror("fcntl(F_SETFD)")); in SocketWithCloseExec()
112 VerifyOrExit((fd = socket(aDomain, aType, aProtocol)) != -1, perror("socket(SOCK_CLOEXEC)")); in SocketWithCloseExec()
118 VerifyOrDie(close(fd) == 0, OT_EXIT_ERROR_ERRNO); in SocketWithCloseExec()
119 fd = -1; in SocketWithCloseExec()
122 return fd; in SocketWithCloseExec()
Dmdns_socket.cpp496 int fd; in OpenIp4Socket() local
498 fd = socket(AF_INET, SOCK_DGRAM, 0); in OpenIp4Socket()
499 VerifyOrExit(fd >= 0, LogCrit("Failed to create IPv4 socket")); in OpenIp4Socket()
509 …error = SetSocketOptionValue(fd, SOL_SOCKET, SO_BINDTODEVICE, ifname, strlen(ifname), "SO_BINDTODE… in OpenIp4Socket()
516 … SuccessOrExit(error = SetSocketOption<int>(fd, IPPROTO_IP, IP_BOUND_IF, ifindex, "IP_BOUND_IF")); in OpenIp4Socket()
520 …SuccessOrExit(error = SetSocketOption<uint8_t>(fd, IPPROTO_IP, IP_MULTICAST_TTL, 255, "IP_MULTICAS… in OpenIp4Socket()
521 SuccessOrExit(error = SetSocketOption<int>(fd, IPPROTO_IP, IP_TTL, 255, "IP_TTL")); in OpenIp4Socket()
522 …SuccessOrExit(error = SetSocketOption<uint8_t>(fd, IPPROTO_IP, IP_MULTICAST_LOOP, 1, "IP_MULTICAST… in OpenIp4Socket()
523 SuccessOrExit(error = SetReuseAddrPortOptions(fd)); in OpenIp4Socket()
533 …error = SetSocketOptionValue(fd, IPPROTO_IP, IP_MULTICAST_IF, &mreqn, sizeof(mreqn), "IP_MULTICAST… in OpenIp4Socket()
[all …]
Dhdlc_interface.cpp452 int fd = -1; in OpenFile() local
455 fd = open(aRadioUrl.GetPath(), O_RDWR | O_NOCTTY | O_NONBLOCK | O_CLOEXEC); in OpenFile()
456 if (fd == -1) in OpenFile()
462 if (isatty(fd)) in OpenFile()
470 VerifyOrExit((rval = tcgetattr(fd, &tios)) == 0); in OpenFile()
615 VerifyOrExit(ioctl(fd, TIOCMBIC, &flags) != -1, perror("tiocmbic")); in OpenFile()
620 rval = tcsetattr(fd, TCSANOW, &tios); in OpenFile()
626 VerifyOrExit((rval = tcgetattr(fd, &orig_tios)) == 0, perror("tcgetattr")); in OpenFile()
629 VerifyOrExit((rval = tcsetattr(fd, TCSANOW, &tios)) == 0, perror("tcsetattr")); in OpenFile()
630 VerifyOrExit((rval = ioctl(fd, IOSSIOSPEED, &speed)) == 0, perror("ioctl IOSSIOSPEED")); in OpenFile()
[all …]
Dspi_interface.cpp216 return req.fd; in SetupGpioHandle()
237 return req.fd; in SetupGpioEvent()
259 int fd; in InitResetPin() local
264 VerifyOrDie((fd = open(aCharDev, O_RDWR)) != -1, OT_EXIT_ERROR_ERRNO); in InitResetPin()
265 mResetGpioValueFd = SetupGpioHandle(fd, aLine, GPIOHANDLE_REQUEST_OUTPUT, label); in InitResetPin()
267 close(fd); in InitResetPin()
273 int fd; in InitIntPin() local
278 VerifyOrDie((fd = open(aCharDev, O_RDWR)) != -1, OT_EXIT_ERROR_ERRNO); in InitIntPin()
280 …mIntGpioValueFd = SetupGpioEvent(fd, aLine, GPIOHANDLE_REQUEST_INPUT, GPIOEVENT_REQUEST_FALLING_ED… in InitIntPin()
282 close(fd); in InitIntPin()
[all …]
Dsettings.cpp99 int fd; in swapOpen() local
103 fd = open(fileName, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0600); in swapOpen()
104 VerifyOrDie(fd != -1, OT_EXIT_ERROR_ERRNO); in swapOpen()
106 return fd; in swapOpen()
/openthread-latest/examples/platforms/simulation/
Dsimul_utils.c69 int fd; in InitRxSocket() local
73 fd = socket(aIp4Address ? AF_INET : AF_INET6, SOCK_DGRAM, IPPROTO_UDP); in InitRxSocket()
74 otEXPECT_ACTION(fd != -1, perror("socket(RxFd)")); in InitRxSocket()
76 rval = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); in InitRxSocket()
79 rval = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)); in InitRxSocket()
87 rval = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, aIp4Address, sizeof(*aIp4Address)); in InitRxSocket()
99 rval = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); in InitRxSocket()
102 rval = bind(fd, (struct sockaddr *)sockaddr, sizeof(*sockaddr)); in InitRxSocket()
110 rval = setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF, &aIfIndex, sizeof(aIfIndex)); in InitRxSocket()
124 rval = setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)); in InitRxSocket()
[all …]
Dmdns_socket.c106 int fd; in OpenIp4Socket() local
111 fd = socket(AF_INET, SOCK_DGRAM, 0); in OpenIp4Socket()
112 VerifyOrDie(fd >= 0, "socket() failed"); in OpenIp4Socket()
122 ret = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, ifname, strlen(ifname)); in OpenIp4Socket()
127 ret = setsockopt(fd, IPPROTO_IP, IP_BOUND_IF, &value, sizeof(value)); in OpenIp4Socket()
131 ret = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &u8, sizeof(u8)); in OpenIp4Socket()
135 ret = setsockopt(fd, IPPROTO_IP, IP_TTL, &value, sizeof(value)); in OpenIp4Socket()
139 ret = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &u8, sizeof(u8)); in OpenIp4Socket()
142 SetReuseAddrPort(fd); in OpenIp4Socket()
151 ret = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, &mreqn, sizeof(mreqn)); in OpenIp4Socket()
[all …]
Dble.c52 int fd; in initFds() local
63 otEXPECT_ACTION((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) != -1, perror("socket(sFd)")); in initFds()
65 otEXPECT_ACTION(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) != -1, in initFds()
67 otEXPECT_ACTION(setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)) != -1, in initFds()
70 …otEXPECT_ACTION(bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) != -1, perror("bind(sFd)"… in initFds()
73 sFd = fd; in initFds()
/openthread-latest/tests/scripts/thread-cert/pktverify/
Dutils.py92 with open(disabled_protos_path, 'rt') as fd:
93 disabled_protos = set(l.strip() for l in fd if l.strip() != '')
107 with open(disabled_protos_path, 'wt') as fd:
108 fd.write('\n'.join(sorted(disabled_protos)))
109 fd.write('\n')
Dtest_info.py44 with open(filename, 'rt') as fd:
45 test_info = json.loads(fd.read())
/openthread-latest/third_party/mbedtls/repo/programs/test/
Dudp_proxy.c854 nb_fds = client_fd.fd; in main()
855 if (nb_fds < server_fd.fd) { in main()
856 nb_fds = server_fd.fd; in main()
858 if (nb_fds < listen_fd.fd) { in main()
859 nb_fds = listen_fd.fd; in main()
912 FD_SET(server_fd.fd, &read_fds); in main()
913 FD_SET(client_fd.fd, &read_fds); in main()
914 FD_SET(listen_fd.fd, &read_fds); in main()
921 if (FD_ISSET(listen_fd.fd, &read_fds)) { in main()
925 if (FD_ISSET(client_fd.fd, &read_fds)) { in main()
[all …]
/openthread-latest/third_party/mbedtls/repo/scripts/
Decp_comb_table.py160 fd, srcname = tempfile.mkstemp(prefix="mbedtls", suffix=".c")
161 srcfile = os.fdopen(fd, mode="w")
/openthread-latest/tools/spi-hdlc-adapter/
Dspi-hdlc-adapter.c1140 int fd = -1; in setup_spi_dev() local
1146 fd = open(path, O_RDWR | O_CLOEXEC); in setup_spi_dev()
1147 if (fd < 0) in setup_spi_dev()
1154 ret = ioctl(fd, SPI_IOC_WR_MODE, &sSpiMode); in setup_spi_dev()
1162 ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &sSpiSpeed); in setup_spi_dev()
1170 ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &spi_word_bits); in setup_spi_dev()
1178 if (flock(fd, LOCK_EX | LOCK_NB) < 0) in setup_spi_dev()
1184 sSpiDevFd = fd; in setup_spi_dev()
1185 fd = -1; in setup_spi_dev()
1188 if (fd >= 0) in setup_spi_dev()
[all …]
/openthread-latest/third_party/mbedtls/repo/programs/ssl/
Dmini_client.c230 if ((server_fd.fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { in main()
235 if (connect(server_fd.fd, in main()
Dssl_test_lib.c396 int idle(mbedtls_net_context *fd, in idle() argument
399 int idle(mbedtls_net_context *fd, in idle()
429 ret = mbedtls_net_poll(fd, poll_type, 0); in idle()
/openthread-latest/tools/harness-simulation/posix/sniffer_sim/
Dsniffer.py163 def _set_nonblocking(self, fd): argument
164 flags = fcntl.fcntl(fd, fcntl.F_GETFL)
169 if fcntl.fcntl(fd, fcntl.F_SETFL, flags) < 0:
/openthread-latest/tools/tcat_ble_client/auth-generate/ext/
DCommCert3.ext15 1.3.6.1.4.1.44970.5 = DER:04:08:ef:13:98:c2:fd:50:4b:67
DCommCert4.ext15 1.3.6.1.4.1.44970.5 = DER:04:08:ef:13:98:c2:fd:50:4b:68
DCommCert2.ext15 1.3.6.1.4.1.44970.5 = DER:04:08:ef:13:98:c2:fd:50:4b:67
/openthread-latest/third_party/mbedtls/repo/tests/suites/
Dtest_suite_debug.data63fd 36 ee 82 65 2e\nMyFile(0999)\: 15 61 5e 89 bf b8 e8 45 90 db ee 88 16 52 d3 f1\nMyFile(0999)\:…
/openthread-latest/third_party/mbedtls/repo/tests/data_files/
Ddh.optlen.pem9 43:57:e1:c4:ea:07:a7:ce:1e:38:1a:2f:ca:fd:ff:
13 31:84:13:44:3c:d2:44:21:5c:d7:fd:4c:be:79:6e:
Ddh.998.pem8 fd:84:05:b0:df:36:15:29:4e:3e:23:3b:c3:ae:6b:
/openthread-latest/third_party/mbedtls/repo/include/mbedtls/
Dnet_sockets.h90 int fd; member

12