Lines Matching defs:nBytes
34 static uint16_t GetCheckSum(uint16_t *pData, int nBytes)
39 while (nBytes >= DHCP_UINT16_BYTES) {
41 nBytes -= DHCP_UINT16_BYTES;
44 if (nBytes > 0) {
233 ssize_t nBytes = sendto(nFd, &udpPackets, sendLen, 0, (struct sockaddr *)&rawAddr, sizeof(rawAddr));
234 if (nBytes <= 0) {
241 optionLen, sendLen, dhcpPackLen, nFd, destIndex, static_cast<int>(nBytes));
244 return (nBytes <= 0) ? SOCKET_OPT_FAILED : SOCKET_OPT_SUCCESS;
271 ssize_t nBytes = write(nFd, sendPacket, sizeof(struct DhcpPacket));
272 if (nBytes <= 0) {
275 DHCP_LOGI("SendDhcpPacket fd:%{public}d, bytes:%{public}d.", nFd, static_cast<int>(nBytes));
278 return (nBytes <= 0) ? SOCKET_OPT_FAILED : SOCKET_OPT_SUCCESS;
407 int nBytes = read(rawFd, &udpPackets, sizeof(struct UdpDhcpPacket));
408 int nRet = CheckReadBytes(nBytes, (int)ntohs(udpPackets.ip.tot_len));
415 nBytes = (int)ntohs(udpPackets.ip.tot_len);
416 nRet = CheckPacketIpSum(&udpPackets, nBytes);
420 nRet = CheckPacketUdpSum(&udpPackets, nBytes);
425 int nDhcpPacket = nBytes - (int)(sizeof(udpPackets.ip) + sizeof(udpPackets.udp));
443 int nBytes = -1;
444 if ((nBytes = read(sockFd, getPacket, sizeof(struct DhcpPacket))) == -1) {
454 return nBytes;