Lines Matching refs:cmptr
60 struct cmsghdr *cmptr; in send_from() local
63 cmptr = CMSG_FIRSTHDR(&msg); in send_from()
68 struct in_pktinfo *pkt = (struct in_pktinfo *)CMSG_DATA(cmptr); in send_from()
71 msg.msg_controllen = cmptr->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo)); in send_from()
72 cmptr->cmsg_level = SOL_IP; in send_from()
73 cmptr->cmsg_type = IP_PKTINFO; in send_from()
75 struct in_addr *a = (struct in_addr *)CMSG_DATA(cmptr); in send_from()
77 msg.msg_controllen = cmptr->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); in send_from()
78 cmptr->cmsg_level = IPPROTO_IP; in send_from()
79 cmptr->cmsg_type = IP_SENDSRCADDR; in send_from()
85 struct in6_pktinfo *pkt = (struct in6_pktinfo *)CMSG_DATA(cmptr); in send_from()
88 msg.msg_controllen = cmptr->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); in send_from()
89 cmptr->cmsg_type = IPV6_PKTINFO; in send_from()
90 cmptr->cmsg_level = IPV6_LEVEL; in send_from()
586 struct cmsghdr *cmptr; in receive_query() local
651 for (cmptr = CMSG_FIRSTHDR(&msg); cmptr; cmptr = CMSG_NXTHDR(&msg, cmptr)) in receive_query()
652 if (cmptr->cmsg_level == SOL_IP && cmptr->cmsg_type == IP_PKTINFO) in receive_query()
654 dst_addr_4 = dst_addr.addr.addr4 = ((struct in_pktinfo *)CMSG_DATA(cmptr))->ipi_spec_dst; in receive_query()
655 if_index = ((struct in_pktinfo *)CMSG_DATA(cmptr))->ipi_ifindex; in receive_query()
660 for (cmptr = CMSG_FIRSTHDR(&msg); cmptr; cmptr = CMSG_NXTHDR(&msg, cmptr)) in receive_query()
661 if (cmptr->cmsg_level == IPPROTO_IP && cmptr->cmsg_type == IP_RECVDSTADDR) in receive_query()
662 dst_addr_4 = dst_addr.addr.addr4 = *((struct in_addr *)CMSG_DATA(cmptr)); in receive_query()
663 else if (cmptr->cmsg_level == IPPROTO_IP && cmptr->cmsg_type == IP_RECVIF) in receive_query()
665 if_index = *((unsigned int *)CMSG_DATA(cmptr)); in receive_query()
667 if_index = ((struct sockaddr_dl *)CMSG_DATA(cmptr))->sdl_index; in receive_query()
675 for (cmptr = CMSG_FIRSTHDR(&msg); cmptr; cmptr = CMSG_NXTHDR(&msg, cmptr)) in receive_query()
676 if (cmptr->cmsg_level == IPV6_LEVEL && cmptr->cmsg_type == IPV6_PKTINFO) in receive_query()
678 dst_addr.addr.addr6 = ((struct in6_pktinfo *)CMSG_DATA(cmptr))->ipi6_addr; in receive_query()
679 if_index =((struct in6_pktinfo *)CMSG_DATA(cmptr))->ipi6_ifindex; in receive_query()