Lines Matching refs:to
13 * This asks kernel to let us know dst addr/port of incoming packets
31 const struct sockaddr *from, const struct sockaddr *to,
35 return sendto(fd, buf, len, flags, to, tolen);
52 return sendto(fd, buf, len, flags, to, tolen);
55 /* man recvmsg and man cmsg is needed to make sense of code below */
63 msg.msg_name = (void *)(struct sockaddr *)to; /* or compiler will annoy us */
72 if (to->sa_family == AF_INET && from->sa_family == AF_INET) {
82 else if (to->sa_family == AF_INET6 && from->sa_family == AF_INET6) {
97 /* NB: this will never set port# in 'to'!
98 * _Only_ IP/IPv6 address part of 'to' is _maybe_ modified.
99 * Typical usage is to preinit 'to' with "default" value
103 struct sockaddr *from, struct sockaddr *to,
109 /* man recvmsg and man cmsg is needed to make sense of code below */
134 /* Here we try to retrieve destination IP and memorize it */
143 to->sa_family = AF_INET;
144 ((struct sockaddr_in*)to)->sin_addr = pktinfo(cmsgptr)->ipi_addr;
145 /* ((struct sockaddr_in*)to)->sin_port = 123; */
154 to->sa_family = AF_INET6;
155 ((struct sockaddr_in6*)to)->sin6_addr = pktinfo(cmsgptr)->ipi6_addr;
156 /* ((struct sockaddr_in6*)to)->sin6_port = 123; */