Home
last modified time | relevance | path

Searched refs:rval (Results 1 – 25 of 58) sorted by relevance

123

/openthread-2.7.6/src/posix/platform/
Ddaemon.cpp61 int rval; in GetFilename() local
63 rval = snprintf(aFilename, sizeof(aFilename), aPattern, gNetifName); in GetFilename()
64 if (rval < 0 && static_cast<size_t>(rval) >= sizeof(aFilename)) in GetFilename()
75 int rval; in OutputFormatV() local
79 rval = vsnprintf(buf, sizeof(buf) - 1, aFormat, aArguments); in OutputFormatV()
81 VerifyOrExit(rval >= 0, otLogWarnPlat("Failed to format CLI output: %s", strerror(errno))); in OutputFormatV()
87 rval = send(mSessionSocket, buf, static_cast<size_t>(rval), MSG_NOSIGNAL); in OutputFormatV()
89 rval = static_cast<int>(write(mSessionSocket, buf, static_cast<size_t>(rval))); in OutputFormatV()
92 if (rval < 0) in OutputFormatV()
100 return rval; in OutputFormatV()
[all …]
Dinfra_if.cpp111 int rval; in CreateIcmp6Socket() local
126 rval = setsockopt(sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filter, sizeof(filter)); in CreateIcmp6Socket()
127 VerifyOrDie(rval == 0, OT_EXIT_ERROR_ERRNO); in CreateIcmp6Socket()
130 rval = setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &kEnable, sizeof(kEnable)); in CreateIcmp6Socket()
131 VerifyOrDie(rval == 0, OT_EXIT_ERROR_ERRNO); in CreateIcmp6Socket()
134rval = setsockopt(sock, IPPROTO_RAW, IPV6_CHECKSUM, &kIpv6ChecksumOffset, sizeof(kIpv6ChecksumOffs… in CreateIcmp6Socket()
136rval = setsockopt(sock, IPPROTO_IPV6, IPV6_CHECKSUM, &kIpv6ChecksumOffset, sizeof(kIpv6ChecksumOff… in CreateIcmp6Socket()
138 VerifyOrDie(rval == 0, OT_EXIT_ERROR_ERRNO); in CreateIcmp6Socket()
141 rval = setsockopt(sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &kEnable, sizeof(kEnable)); in CreateIcmp6Socket()
142 VerifyOrDie(rval == 0, OT_EXIT_ERROR_ERRNO); in CreateIcmp6Socket()
[all …]
Dhdlc_interface.cpp193 ssize_t rval; in Read() local
195 rval = read(mSockFd, buffer, sizeof(buffer)); in Read()
197 if (rval > 0) in Read()
199 Decode(buffer, static_cast<uint16_t>(rval)); in Read()
201 else if ((rval < 0) && (errno != EAGAIN) && (errno != EINTR)) in Read()
236 ssize_t rval = write(mSockFd, aFrame, aLength); in Write() local
238 if (rval == aLength) in Write()
242 else if (rval > 0) in Write()
244 aLength -= static_cast<uint16_t>(rval); in Write()
245 aFrame += static_cast<uint16_t>(rval); in Write()
[all …]
Dmisc.cpp101 int rval = 0; in SocketWithCloseExec() local
107 VerifyOrExit((rval = fcntl(fd, F_GETFD, 0)) != -1, perror("fcntl(F_GETFD)")); in SocketWithCloseExec()
108 rval |= aBlockOption == kSocketNonBlock ? O_NONBLOCK | FD_CLOEXEC : FD_CLOEXEC; in SocketWithCloseExec()
109 VerifyOrExit((rval = fcntl(fd, F_SETFD, rval)) != -1, perror("fcntl(F_SETFD)")); in SocketWithCloseExec()
116 if (rval == -1) in SocketWithCloseExec()
Dsettings.cpp132 ssize_t rval = read(sSettingsFd, buffer, count); in swapWrite() local
134 VerifyOrDie(rval > 0, OT_EXIT_FAILURE); in swapWrite()
135 count = static_cast<uint16_t>(rval); in swapWrite()
136 rval = write(aFd, buffer, count); in swapWrite()
137 assert(rval == count); in swapWrite()
138 VerifyOrDie(rval == count, OT_EXIT_FAILURE); in swapWrite()
197 ssize_t rval; in otPlatSettingsInit() local
199 rval = read(sSettingsFd, &key, sizeof(key)); in otPlatSettingsInit()
200 VerifyOrExit(rval == sizeof(key), error = OT_ERROR_PARSE); in otPlatSettingsInit()
202 rval = read(sSettingsFd, &length, sizeof(length)); in otPlatSettingsInit()
[all …]
Dvirtual_time.cpp110 ssize_t rval; in virtualTimeSendEvent() local
118 rval = sendto(sSockFd, aEvent, aLength, 0, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); in virtualTimeSendEvent()
120 if (rval < 0) in virtualTimeSendEvent()
128 ssize_t rval = recvfrom(sSockFd, aEvent, sizeof(*aEvent), 0, nullptr, nullptr); in virtualTimeReceiveEvent() local
130 if (rval < 0 || (uint16_t)rval < offsetof(struct VirtualTimeEvent, mData)) in virtualTimeReceiveEvent()
132 DieNowWithMessage("recvfrom", (rval < 0) ? OT_EXIT_ERROR_ERRNO : OT_EXIT_FAILURE); in virtualTimeReceiveEvent()
Dsystem.cpp270 int rval; in trySelect() local
272 rval = select(aMaxFd + 1, aReadFdSet, aWriteFdSet, aErrorFdSet, &timeout); in trySelect()
274 if (rval == 0) in trySelect()
281 return rval; in trySelect()
313 int rval; in otSysMainloopPoll() local
319rval = trySelect(&aMainloop->mReadFdSet, &aMainloop->mWriteFdSet, &aMainloop->mErrorFdSet, aMainlo… in otSysMainloopPoll()
321 if (rval == 0) in otSysMainloopPoll()
340 rval = select(aMainloop->mMaxFd + 1, &aMainloop->mReadFdSet, &aMainloop->mWriteFdSet, in otSysMainloopPoll()
347rval = select(aMainloop->mMaxFd + 1, &aMainloop->mReadFdSet, &aMainloop->mWriteFdSet, &aMainloop->… in otSysMainloopPoll()
351 return rval; in otSysMainloopPoll()
/openthread-2.7.6/src/core/meshcop/
Ddtls.cpp246 int rval; in Setup() local
249 VerifyOrExit(mState == kStateOpen, rval = MBEDTLS_ERR_SSL_TIMEOUT); in Setup()
266rval = mbedtls_ssl_config_defaults(&mConf, aClient ? MBEDTLS_SSL_IS_CLIENT : MBEDTLS_SSL_IS_SERVER, in Setup()
268 VerifyOrExit(rval == 0); in Setup()
303rval = mbedtls_ssl_cookie_setup(&mCookieCtx, mbedtls_ctr_drbg_random, Random::Crypto::MbedTlsConte… in Setup()
304 VerifyOrExit(rval == 0); in Setup()
310 rval = mbedtls_ssl_setup(&mSsl, &mConf); in Setup()
311 VerifyOrExit(rval == 0); in Setup()
318 rval = mbedtls_ssl_set_hs_ecjpake_password(&mSsl, mPsk, mPskLength); in Setup()
323 rval = SetApplicationCoapSecureKeys(); in Setup()
[all …]
Dtimestamp.cpp45 int rval; in Compare() local
49 rval = 1; in Compare()
53 rval = -1; in Compare()
57 rval = 1; in Compare()
61 rval = -1; in Compare()
65 rval = 0; in Compare()
68 return rval; in Compare()
Dmeshcop_tlvs.cpp45 bool rval = true; in IsValid() local
50 rval = static_cast<const ChannelTlv &>(aTlv).IsValid(); in IsValid()
54 rval = static_cast<const PanIdTlv &>(aTlv).IsValid(); in IsValid()
58 rval = static_cast<const ExtendedPanIdTlv &>(aTlv).IsValid(); in IsValid()
62 rval = static_cast<const NetworkNameTlv &>(aTlv).IsValid(); in IsValid()
66 rval = static_cast<const NetworkKeyTlv &>(aTlv).IsValid(); in IsValid()
70 rval = static_cast<const PskcTlv &>(aTlv).IsValid(); in IsValid()
74 rval = static_cast<const MeshLocalPrefixTlv &>(aTlv).IsValid(); in IsValid()
78 rval = static_cast<const SecurityPolicyTlv &>(aTlv).IsValid(); in IsValid()
82 rval = static_cast<const ChannelMaskTlv &>(aTlv).IsValid(); in IsValid()
[all …]
/openthread-2.7.6/examples/apps/cli/
Dcli_uart.cpp302 int rval; in CliUartOutput() local
306 rval = vsnprintf(sTxBuffer, kTxBufferSize, aFormat, aArguments); in CliUartOutput()
307 …VerifyOrExit(rval >= 0 && rval < kTxBufferSize, otLogWarnPlat("Failed to format CLI output `%s`", … in CliUartOutput()
309 sTxLength = static_cast<uint16_t>(rval); in CliUartOutput()
320 rval = vsnprintf(&sTxBuffer[tail], remaining, aFormat, aArguments); in CliUartOutput()
322 if (rval < 0) in CliUartOutput()
326 else if (rval < remaining) in CliUartOutput()
328 sTxLength += rval; in CliUartOutput()
330 else if (rval < kTxBufferSize) in CliUartOutput()
352 rval = vsnprintf(sTxBuffer, kTxBufferSize, aFormat, retryArguments); in CliUartOutput()
[all …]
/openthread-2.7.6/examples/platforms/simulation/
Dflash.c107 ssize_t rval; in otPlatFlashErase() local
114 rval = pwrite(sFlashFd, buffer, sizeof(buffer), (off_t)address); in otPlatFlashErase()
115 VerifyOrDie(rval == SWAP_SIZE, OT_EXIT_ERROR_ERRNO); in otPlatFlashErase()
123 ssize_t rval; in otPlatFlashRead() local
129 rval = pread(sFlashFd, aData, aSize, (off_t)(address + aOffset)); in otPlatFlashRead()
130 VerifyOrDie((uint32_t)rval == aSize, OT_EXIT_ERROR_ERRNO); in otPlatFlashRead()
139 ssize_t rval; in otPlatFlashWrite() local
148 rval = pread(sFlashFd, &byte, sizeof(byte), (off_t)(address + offset)); in otPlatFlashWrite()
149 VerifyOrDie(rval == sizeof(byte), OT_EXIT_ERROR_ERRNO); in otPlatFlashWrite()
154 rval = pwrite(sFlashFd, &byte, sizeof(byte), (off_t)(address + offset)); in otPlatFlashWrite()
[all …]
Duart.c241 ssize_t rval; in platformUartProcess() local
250 rval = poll(pollfd, sizeof(pollfd) / sizeof(*pollfd), 0); in platformUartProcess()
252 if (rval < 0) in platformUartProcess()
258 if (rval > 0) in platformUartProcess()
274 rval = read(s_in_fd, s_receive_buffer, sizeof(s_receive_buffer)); in platformUartProcess()
276 if (rval <= 0) in platformUartProcess()
282 otPlatUartReceived(s_receive_buffer, (uint16_t)rval); in platformUartProcess()
287 rval = write(s_out_fd, s_write_buffer, s_write_length); in platformUartProcess()
289 if (rval >= 0) in platformUartProcess()
291 s_write_buffer += (uint16_t)rval; in platformUartProcess()
[all …]
/openthread-2.7.6/tests/scripts/expect/
D_common.exp161 set rval [expect_line {([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}}]
164 return $rval
169 set rval [expect_line {[0-9a-fA-F]{16}}]
172 return $rval
178 set rval $expect_out(1,string)
181 return $rval
187 set rval [expect_line {[0-9a-fA-F]{4}}]
190 return $rval
/openthread-2.7.6/src/posix/
Dclient.cpp140 ssize_t rval = write(aFile, aBuffer, aSize); in DoWrite() local
141 if (rval <= 0) in DoWrite()
143 VerifyOrExit((rval == -1) && (errno == EINTR), perror("write"); ret = false); in DoWrite()
147 aBuffer = reinterpret_cast<const uint8_t *>(aBuffer) + rval; in DoWrite()
148 aSize -= static_cast<size_t>(rval); in DoWrite()
194 int rval; in ReconnectSession() local
199 rval = ConnectSession(aConfig); in ReconnectSession()
201 VerifyOrExit(rval == -1, ok = true); in ReconnectSession()
367 ssize_t rval = read(sSessionFd, buffer, sizeof(buffer)); in main() local
368 VerifyOrExit(rval != -1, perror("read"); ret = OT_EXIT_FAILURE); in main()
[all …]
/openthread-2.7.6/src/core/net/
Dip6_filter.cpp59 bool rval = false; in Accept() local
68 ExitNow(rval = true); in Accept()
80 ExitNow(rval = true); in Accept()
94 ExitNow(rval = true); in Accept()
102 ExitNow(rval = true); in Accept()
125 ExitNow(rval = true); in Accept()
130 return rval; in Accept()
Dicmp6.cpp153 bool rval = false; in ShouldHandleEchoRequest() local
158 rval = false; in ShouldHandleEchoRequest()
161 rval = !aMessageInfo.GetSockAddr().IsMulticast(); in ShouldHandleEchoRequest()
164 rval = aMessageInfo.GetSockAddr().IsMulticast(); in ShouldHandleEchoRequest()
167 rval = true; in ShouldHandleEchoRequest()
171 return rval; in ShouldHandleEchoRequest()
/openthread-2.7.6/examples/platforms/simulation/virtual_time/
Dplatform-sim.c75 ssize_t rval; in otSimSendEvent() local
83rval = sendto(sSockFd, aEvent, offsetof(struct Event, mData) + aEvent->mDataLength, 0, (struct soc… in otSimSendEvent()
86 if (rval < 0) in otSimSendEvent()
96 ssize_t rval = recvfrom(sSockFd, (char *)&event, sizeof(event), 0, NULL, NULL); in receiveEvent() local
98 if (rval < 0 || (uint16_t)rval < offsetof(struct Event, mData)) in receiveEvent()
273 int rval; in otSysProcessDrivers() local
295 rval = select(max_fd + 1, &read_fds, &write_fds, &error_fds, NULL); in otSysProcessDrivers()
297 if ((rval < 0) && (errno != EINTR)) in otSysProcessDrivers()
303 if (rval > 0 && FD_ISSET(sSockFd, &read_fds)) in otSysProcessDrivers()
/openthread-2.7.6/src/core/common/
Drandom_manager.cpp174 int rval = MBEDTLS_ERR_ENTROPY_SOURCE_FAILED; in HandleMbedtlsEntropyPoll() local
177 rval = 0; in HandleMbedtlsEntropyPoll()
184 return rval; in HandleMbedtlsEntropyPoll()
194 int rval; in Init() local
198 rval = in Init()
201 if (rval != 0) in Init()
206 OT_ASSERT(rval == 0); in Init()
Dbit_vector.hpp110 bool rval = false; in HasAny() local
116 ExitNow(rval = true); in HasAny()
121 return rval; in HasAny()
/openthread-2.7.6/src/core/thread/
Drouter_table.cpp202 Router *rval = nullptr; in Allocate() local
230 rval = Allocate(routerId); in Allocate()
231 OT_ASSERT(rval != nullptr); in Allocate()
239 return rval; in Allocate()
244 Router *rval = nullptr; in Allocate() local
252 rval = GetRouter(aRouterId); in Allocate()
253 rval->SetLastHeard(TimerMilli::GetNow()); in Allocate()
262 return rval; in Allocate()
462 uint8_t rval = Mle::kMaxRouteCost; in GetLinkCost() local
466 rval = aRouter.GetLinkInfo().GetLinkQuality(); in GetLinkCost()
[all …]
Dtmf.cpp55 bool rval = true; in IsTmfMessage() local
67 rval = false); in IsTmfMessage()
69 return rval; in IsTmfMessage()
Dnetwork_data_leader.cpp182 bool rval = false; in IsOnMesh() local
184 VerifyOrExit(!Get<Mle::MleRouter>().IsMeshLocalAddress(aAddress), rval = true); in IsOnMesh()
203 ExitNow(rval = true); in IsOnMesh()
210 return rval; in IsOnMesh()
426 const MeshCoP::Tlv * rval = nullptr; in GetCommissioningDataSubTlv() local
432rval = MeshCoP::Tlv::FindTlv(commissioningDataTlv->GetValue(), commissioningDataTlv->GetLength(), … in GetCommissioningDataSubTlv()
435 return rval; in GetCommissioningDataSubTlv()
441 bool rval = false; in IsJoiningEnabled() local
452 ExitNow(rval = true); in IsJoiningEnabled()
457 return rval; in IsJoiningEnabled()
/openthread-2.7.6/tests/unit/
Dtest_child_table.cpp72 bool rval = false; in StateMatchesFilter() local
80 rval = (aState != Child::kStateInvalid); in StateMatchesFilter()
84 rval = (aState == Child::kStateValid); in StateMatchesFilter()
88 rval = child.IsStateValidOrRestoring(); in StateMatchesFilter()
92 rval = (aState == Child::kStateChildIdRequest); in StateMatchesFilter()
96 rval = child.IsStateValidOrAttaching(); in StateMatchesFilter()
100 rval = child.IsStateInvalid(); in StateMatchesFilter()
104 rval = !child.IsStateValidOrRestoring(); in StateMatchesFilter()
108 rval = true; in StateMatchesFilter()
112 return rval; in StateMatchesFilter()
/openthread-2.7.6/src/core/mac/
Dmac_filter.cpp56 FilterEntry *rval = nullptr; in FindEntry() local
62 ExitNow(rval = &entry); in FindEntry()
67 return rval; in FindEntry()
72 FilterEntry *rval = nullptr; in FindAvailableEntry() local
78 ExitNow(rval = &entry); in FindAvailableEntry()
83 return rval; in FindAvailableEntry()

123