ainfo->ai_socktype = SOCK_DGRAM;
ainfo->ai_protocol = IPPROTO_UDP;
void connection_attributes_to_addrinfo(struct addrinfo *ainfo,		const connection_attributes *attrs){	switch (attrs->proto) {		case PROTO_IPv6:			ainfo->ai_family = AF_INET6;			break;		case PROTO_IPv4:			ainfo->ai_family = AF_INET;			break;		case PROTO_UNSPECIFIED:			ainfo->ai_family = AF_UNSPEC;			break;		default:			fatal("internal error: unknown socket domain");	}		switch (attrs->type) {		case UDP_SOCKET:			ainfo->ai_socktype = SOCK_DGRAM;			break;		case TCP_SOCKET:			ainfo->ai_socktype = SOCK_STREAM;			break;		default:			fatal("internal error: unknown socket type");	}}