Searched refs:sSocket (Results 1 – 4 of 4) sorted by relevance
/openthread-latest/src/posix/platform/ |
D | trel.cpp | 76 static int sSocket = -1; variable 175 sSocket = SocketWithCloseExec(AF_INET6, SOCK_DGRAM, 0, kSocketNonBlock); in PrepareSocket() 176 VerifyOrDie(sSocket >= 0, OT_EXIT_ERROR_ERRNO); in PrepareSocket() 179 val = fcntl(sSocket, F_GETFL, 0); in PrepareSocket() 182 VerifyOrDie(fcntl(sSocket, F_SETFL, val) == 0, OT_EXIT_ERROR_ERRNO); in PrepareSocket() 191 if (bind(sSocket, (struct sockaddr *)&sockAddr, sizeof(sockAddr)) == -1) in PrepareSocket() 199 … if (setsockopt(sSocket, SOL_SOCKET, SO_BINDTODEVICE, sInterfaceName, strlen(sInterfaceName)) < 0) in PrepareSocket() 208 if (getsockname(sSocket, (struct sockaddr *)&sockAddr, &sockLen) == -1) in PrepareSocket() 223 VerifyOrExit(sSocket >= 0, error = OT_ERROR_INVALID_STATE); in SendPacket() 230 ret = sendto(sSocket, aBuffer, aLength, 0, (struct sockaddr *)&sockAddr, sizeof(sockAddr)); in SendPacket() [all …]
|
/openthread-latest/examples/platforms/simulation/ |
D | trel.c | 72 static utilsSocket sSocket; variable 134 utilsSendOverSocket(&sSocket, &sPendingTx[i], getMessageSize(&sPendingTx[i])); in sendPendingTxMessages() 190 otEXPECT(aMessage->mSockAddr.mPort == sSocket.mPort); in processMessage() 221 *aUdpPort = sSocket.mPort; in otPlatTrelEnable() 345 utilsInitSocket(&sSocket, TREL_SIM_PORT + sPortOffset); in platformTrelInit() 349 sSockAddr.mPort = sSocket.mPort; in platformTrelInit() 354 void platformTrelDeinit(void) { utilsDeinitSocket(&sSocket); } in platformTrelDeinit() 361 utilsAddSocketRxFd(&sSocket, aReadFdSet, aMaxFd); in platformTrelUpdateFdSet() 365 utilsAddSocketTxFd(&sSocket, aWriteFdSet, aMaxFd); in platformTrelUpdateFdSet() 371 if ((sNumPendingTx > 0) && utilsCanSocketSend(&sSocket, aWriteFdSet)) in platformTrelProcess() [all …]
|
D | infra_if.c | 71 static utilsSocket sSocket; variable 92 utilsSendOverSocket(&sSocket, &sPendingTx[i], getMessageSize(&sPendingTx[i])); in sendPendingTxMessages() 262 utilsInitSocket(&sSocket, INFRA_IF_SIM_PORT + sPortOffset); in platformInfraIfInit() 272 utilsDeinitSocket(&sSocket); in platformInfraIfDeinit() 282 utilsAddSocketRxFd(&sSocket, aReadFdSet, aMaxFd); in platformInfraIfUpdateFdSet() 286 utilsAddSocketTxFd(&sSocket, aWriteFdSet, aMaxFd); in platformInfraIfUpdateFdSet() 299 if ((sNumPendingTx > 0) && utilsCanSocketSend(&sSocket, aWriteFdSet)) in platformInfraIfProcess() 304 if (utilsCanSocketReceive(&sSocket, aReadFdSet)) in platformInfraIfProcess() 311 len = utilsReceiveFromSocket(&sSocket, &message, sizeof(message), NULL); in platformInfraIfProcess()
|
D | radio.c | 74 static utilsSocket sSocket; variable 411 utilsInitSocket(&sSocket, sPortBase + sPortOffset); in platformRadioInit() 708 utilsAddSocketRxFd(&sSocket, aReadFdSet, aMaxFd); in platformRadioUpdateFdSet() 713 utilsAddSocketTxFd(&sSocket, aWriteFdSet, aMaxFd); in platformRadioUpdateFdSet() 737 void platformRadioDeinit(void) { utilsDeinitSocket(&sSocket); } in platformRadioDeinit() 746 if (utilsCanSocketReceive(&sSocket, aReadFdSet)) in platformRadioProcess() 751 … len = utilsReceiveFromSocket(&sSocket, &sReceiveMessage, sizeof(sReceiveMessage), &senderNodeId); in platformRadioProcess() 776 utilsSendOverSocket(&sSocket, aMessage, aFrame->mLength + 1); // + 1 is for `mChannel` in radioTransmit()
|