Erlang futures

Raimo Niskanen raimo@REDACTED
Thu Apr 19 09:31:22 CEST 2001


You can try the following undocomented (and unsupported, but it is not
very likely that they will change much in the future :-) functions in
lib/kernel/src/inet.erl:

18>
inet:getiflist().                                                          
{ok,["lo0","hme0"]}
19> inet:ifget("lo0", [addr, broadaddr, dstaddr, mtu, netmask, flags,
hwaddr]). {ok,[{addr,{127,0,0,1}},
     {netmask,{255,0,0,0}},
     {flags,[up,loopback,running,multicast]}]}
20> inet:ifget("hme0", [addr, broadaddr, dstaddr, mtu, netmask, flags,
hwaddr]).  
{ok,[{addr,{134,138,177,99}},
     {broadaddr,{134,138,179,255}},
     {netmask,{255,255,252,0}},
     {flags,[up,broadcast,running,multicast]}]}

"Use the Source, Luke. Let it guide Your hands."

/ Raimo Niskanen, Ericsson UAB, Erlang/OTP.



Magnus Ahltorp wrote:
> 
> How can I get a list of the IP addresses on the machine the node is
> running on? There are two drivers named udp_inet and tcp_inet that
> seem to return that when INET_REQ_IFGET is requested.
> 
> Is this the correct way? In that case, how do I call this driver? If
> not, how do I get the list?
> 
> /Magnus



More information about the erlang-questions mailing list