Lines Matching refs:aUdpSocket
235 otError otPlatUdpSocket(otUdpSocket *aUdpSocket) in otPlatUdpSocket() argument
240 assert(aUdpSocket->mHandle == nullptr); in otPlatUdpSocket()
245 aUdpSocket->mHandle = FdToHandle(fd); in otPlatUdpSocket()
251 otError otPlatUdpClose(otUdpSocket *aUdpSocket) in otPlatUdpClose() argument
258 VerifyOrExit(aUdpSocket->mHandle != nullptr); in otPlatUdpClose()
260 fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpClose()
263 aUdpSocket->mHandle = nullptr; in otPlatUdpClose()
269 otError otPlatUdpBind(otUdpSocket *aUdpSocket) in otPlatUdpBind() argument
275 assert(aUdpSocket->mHandle != nullptr); in otPlatUdpBind()
276 VerifyOrExit(aUdpSocket->mSockName.mPort != 0, error = OT_ERROR_INVALID_ARGS); in otPlatUdpBind()
277 fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpBind()
283 sin6.sin6_port = htons(aUdpSocket->mSockName.mPort); in otPlatUdpBind()
285 memcpy(&sin6.sin6_addr, &aUdpSocket->mSockName.mAddress, sizeof(sin6.sin6_addr)); in otPlatUdpBind()
304 otError otPlatUdpBindToNetif(otUdpSocket *aUdpSocket, otNetifIdentifier aNetifIdentifier) in otPlatUdpBindToNetif() argument
307 int fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpBindToNetif()
362 otError otPlatUdpConnect(otUdpSocket *aUdpSocket) in otPlatUdpConnect() argument
367 …bool isDisconnect = memcmp(&aUdpSocket->mPeerName.mAddress, &in6addr_any, sizeof(in6addr_any)) == … in otPlatUdpConnect()
368 aUdpSocket->mPeerName.mPort == 0; in otPlatUdpConnect()
370 VerifyOrExit(aUdpSocket->mHandle != nullptr, error = OT_ERROR_INVALID_ARGS); in otPlatUdpConnect()
372 fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpConnect()
375 sin6.sin6_port = htons(aUdpSocket->mPeerName.mPort); in otPlatUdpConnect()
379 memcpy(&sin6.sin6_addr, &aUdpSocket->mPeerName.mAddress, sizeof(sin6.sin6_addr)); in otPlatUdpConnect()
397 SuccessOrExit(error = otPlatUdpClose(aUdpSocket)); in otPlatUdpConnect()
398 SuccessOrExit(error = otPlatUdpSocket(aUdpSocket)); in otPlatUdpConnect()
399 SuccessOrExit(error = otPlatUdpBind(aUdpSocket)); in otPlatUdpConnect()
403 fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpConnect()
419 …otLogWarnPlat("Failed to connect to [%s]:%u: %s", Ip6AddressString(&aUdpSocket->mPeerName.mAddress… in otPlatUdpConnect()
420 aUdpSocket->mPeerName.mPort, strerror(errno)); in otPlatUdpConnect()
428 otError otPlatUdpSend(otUdpSocket *aUdpSocket, otMessage *aMessage, const otMessageInfo *aMessageIn… in otPlatUdpSend() argument
435 VerifyOrExit(aUdpSocket->mHandle != nullptr, error = OT_ERROR_INVALID_ARGS); in otPlatUdpSend()
436 fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpSend()
466 otError otPlatUdpJoinMulticastGroup(otUdpSocket * aUdpSocket, in otPlatUdpJoinMulticastGroup() argument
474 VerifyOrExit(aUdpSocket->mHandle != nullptr, error = OT_ERROR_INVALID_ARGS); in otPlatUdpJoinMulticastGroup()
475 fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpJoinMulticastGroup()
506 otError otPlatUdpLeaveMulticastGroup(otUdpSocket * aUdpSocket, in otPlatUdpLeaveMulticastGroup() argument
514 VerifyOrExit(aUdpSocket->mHandle != nullptr, error = OT_ERROR_INVALID_ARGS); in otPlatUdpLeaveMulticastGroup()
515 fd = FdFromHandle(aUdpSocket->mHandle); in otPlatUdpLeaveMulticastGroup()