tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: getaddrinfo: how to wildcard everything?



>> Not enumerating address families per se, but binding to a
>> kernel-selected port in each supported address family.
> But binding TCP right?   (I think I recall that from your previous
> message).

Well, SOCK_STREAM.  TCP is just the canonical protocol backing
SOCK_STREAM for AF_INET{,6}.

>>> I'm not sure it is worth it either ... there are just 2 (IPv4 and
>>> IPv6)
>> ...at the moment...
> If there's a replacement, who can tell what it might be like?

If it supports SOCK_STREAM and kernel-selected port-analogs, it's good
enough for my purposes here.

>>> You could also just try "0" as the service name, though I'm not
>>> sure how portable that would be, if it works.
>> It would, at a minimum, be specific to service implementations being
>> small integers,
> Yes, but you're using TCP (SOCK_STREAM) right?

SOCK_STREAM, yes.  TCP only because I don't have anything intra-machine
set up except IP; if I had DECnet or ISO/OSI or whatever, I'd want them
to show up too.

> Most other protocol stacks have no real equivalent.

Well, back in the day, I used DECnet on Ultrix, and I think it had a
SOCK_STREAM implementation.  It certainly had _something_ I used to
transport IP packets; it might have been SOCK_SEQPACKET, but I think it
was SOCK_STREAM.  (I'm moderately sure its port analog was a
(relatively short) string.  I don't recall whether it had an analog of
binding to a kernel-selected port.)

> The protocol that's used comes with all kinds of semantics that you
> cannot just ignore and pretend that anything will do.

If it provides SOCK_STREAM semantics, it's good enough for the purposes
of my original request.  TCP can't be the only thing providing that
(for example, under 5.2, I see what looks at a quick glance like
SOCK_STREAM support in netbt, netiso, and netnatm, as well as
netinet{,6}).

>> (For that matter, I don't see anything in 793 that singles out port
>> 0 for anything special,
> No, there isn't, but it has been a reserved port number since the
> beginning of time

Is this documented anywhere?  If not, I expect interoperability
problems.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index