Lines Matching refs:mhdr
250 struct msghdr mhdr; in coap_network_send() local
258 memset(&mhdr, 0, sizeof(struct msghdr)); in coap_network_send()
259 mhdr.msg_name = (void *)&dst->addr; in coap_network_send()
260 mhdr.msg_namelen = dst->size; in coap_network_send()
262 mhdr.msg_iov = iov; in coap_network_send()
263 mhdr.msg_iovlen = 1; in coap_network_send()
270 mhdr.msg_control = buf; in coap_network_send()
271 mhdr.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo)); in coap_network_send()
273 cmsg = CMSG_FIRSTHDR(&mhdr); in coap_network_send()
299 mhdr.msg_control = buf; in coap_network_send()
300 mhdr.msg_controllen = CMSG_SPACE(sizeof(struct in_pktinfo)); in coap_network_send()
302 cmsg = CMSG_FIRSTHDR(&mhdr); in coap_network_send()
329 return sendmsg(ep->handle.fd, &mhdr, 0); in coap_network_send()
417 struct msghdr mhdr; in coap_network_read() local
438 memset(&mhdr, 0, sizeof(struct msghdr)); in coap_network_read()
440 mhdr.msg_name = &(*packet)->src.addr.st; in coap_network_read()
441 mhdr.msg_namelen = sizeof((*packet)->src.addr.st); in coap_network_read()
443 mhdr.msg_iov = iov; in coap_network_read()
444 mhdr.msg_iovlen = 1; in coap_network_read()
446 mhdr.msg_control = msg_control; in coap_network_read()
447 mhdr.msg_controllen = sizeof(msg_control); in coap_network_read()
450 len = recvmsg(ep->handle.fd, &mhdr, 0); in coap_network_read()
471 for (cmsg = CMSG_FIRSTHDR(&mhdr); cmsg; cmsg = CMSG_NXTHDR(&mhdr, cmsg)) { in coap_network_read()
485 (*packet)->src.size = mhdr.msg_namelen; in coap_network_read()
488 (*packet)->src.addr.sin6.sin6_family = SIN6(mhdr.msg_name)->sin6_family; in coap_network_read()
489 (*packet)->src.addr.sin6.sin6_addr = SIN6(mhdr.msg_name)->sin6_addr; in coap_network_read()
490 (*packet)->src.addr.sin6.sin6_port = SIN6(mhdr.msg_name)->sin6_port; in coap_network_read()
508 (*packet)->src.size = mhdr.msg_namelen; in coap_network_read()
509 memcpy(&(*packet)->src.addr.st, mhdr.msg_name, (*packet)->src.size); in coap_network_read()