one that is guaranteed to always give you just one ip,
x->ips[0]
one ip4 ip,
filter(x->ips, lambda(string x) { return has_value(x, "."); })[0]
all ip4 ips.
filter(x->ips, lambda(string x) { return has_value(x, "."); })
one ip6
filter(x->ips, lambda(string x) { return has_value(x, ":"); })[0]
all ip6
filter(x->ips, lambda(string x) { return has_value(x, ":"); })
all ips.
x->ips
Since you normally don't need to differentiate between v4 and v6, it's acceptable that you need to do slightly more work in the cases where you do.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2004-09-12 00:06: Subject: Re: gethostip
i guess you want all of that: one that is guaranteed to always give you just one ip, one ip4 ip, all ip4 ips. one ip6 all ip6 all ips.
greetings, martin.
/ Brevbäraren