Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] How to get allocated ip number

From: michel:goasampis:free at: 15-Oct-2002 21:55

Hi all, excuse my bad english... I need to manipulate the ip number my PC obtain from the provider when connect to internet. To get it, I hack something with the 'get-modes function which give this result on my linux pc :
>>probe get-modes tcp:// 'interfaces
[ make object! [ name: "lo" addr: netmask: broadcast: none dest-addr: none flags: [loopback] ] make object! [ name: "eth0" addr: netmask: broadcast: dest-addr: none flags: [broadcast multicast] ] make object! [ name: "ppp0" addr: netmask: none broadcast: none dest-addr: flags: [multicast point-to-point] ]] so I do : all-interfaces: get-modes tcp:// 'interfaces internet-interf: all-interfaces/3 my-ip: copy to-string internet-interf/addr but it isn't verry elegant, and does'nt work on all pc (if more or less interfaces are found). Please help me, I hope there is a more efficient way like my-ip: copy some/voodoo/path... Thank-You Michel, newbie but addicted