Lines Matching refs:read_packet
46 if ((!s->read_packet || s->n_read < sizeof(s->read_size) + s->read_packet->size) && in dns_stream_update_io()
284 if (!s->read_packet) in dns_stream_take_read_packet()
294 return TAKE_PTR(s->read_packet); in dns_stream_take_read_packet()
356 (!s->read_packet || in on_stream_io()
357 s->n_read < sizeof(s->read_size) + s->read_packet->size)) { in on_stream_io()
383 if (!s->read_packet) { in on_stream_io()
384 … r = dns_packet_new(&s->read_packet, s->protocol, be16toh(s->read_size), DNS_PACKET_SIZE_MAX); in on_stream_io()
388 s->read_packet->size = be16toh(s->read_size); in on_stream_io()
389 s->read_packet->ipproto = IPPROTO_TCP; in on_stream_io()
390 s->read_packet->family = s->peer.sa.sa_family; in on_stream_io()
391 s->read_packet->ttl = s->ttl; in on_stream_io()
392 s->read_packet->ifindex = s->ifindex; in on_stream_io()
393 s->read_packet->timestamp = now(CLOCK_BOOTTIME); in on_stream_io()
395 if (s->read_packet->family == AF_INET) { in on_stream_io()
396 s->read_packet->sender.in = s->peer.in.sin_addr; in on_stream_io()
397 … s->read_packet->sender_port = be16toh(s->peer.in.sin_port); in on_stream_io()
398 … s->read_packet->destination.in = s->local.in.sin_addr; in on_stream_io()
399 … s->read_packet->destination_port = be16toh(s->local.in.sin_port); in on_stream_io()
401 assert(s->read_packet->family == AF_INET6); in on_stream_io()
402 s->read_packet->sender.in6 = s->peer.in6.sin6_addr; in on_stream_io()
403 … s->read_packet->sender_port = be16toh(s->peer.in6.sin6_port); in on_stream_io()
404 … s->read_packet->destination.in6 = s->local.in6.sin6_addr; in on_stream_io()
405 … s->read_packet->destination_port = be16toh(s->local.in6.sin6_port); in on_stream_io()
407 if (s->read_packet->ifindex == 0) in on_stream_io()
408 … s->read_packet->ifindex = s->peer.in6.sin6_scope_id; in on_stream_io()
409 if (s->read_packet->ifindex == 0) in on_stream_io()
410 … s->read_packet->ifindex = s->local.in6.sin6_scope_id; in on_stream_io()
415 … (uint8_t*) DNS_PACKET_DATA(s->read_packet) + s->n_read - sizeof(s->read_size), in on_stream_io()
486 dns_packet_unref(s->read_packet); in dns_stream_free()