NetLib question

View: New views
3 Messages — Rating Filter:   Alert me  

NetLib question

by nescivi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hiho,

while I am fixing some stuff in the Network extension of the NetLib quark...
I came across this thing:

        *broadcastIP { |prefix=""|
                var  res;
                res = Pipe.findValuesForKey(prefix++"ifconfig", "broadcast");
                //res = res.add( Pipe.findValuesForKey(prefix++"ifconfig", "Bcast"); );

                if(res.size > 1) { postln("the first of those devices were chosen: " ++
res) };
                ^res.first
        }

(prefix is my addition)

Question:
What is the output of the ifconfig command that is parsed?

On Linux it looks like:
eth1      Link encap:Ethernet  HWaddr 00:1e:37:8a:4b:a0
          inet addr:74.59.253.108  Bcast:255.255.255.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:576  Metric:1

Which is why I thought doing this:
Pipe.findValuesForKey(prefix++"ifconfig", "Bcast")

would work, but it seems it doesn't...

sincerely,
Marije
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: NetLib question

by nescivi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hiho,

seems I found a fix to get it working on Linux...

but then... if the broadcast address is 255.255.255.255, it should still give
the right IP back with myIP, right?

Sincerely,
Marije

On Monday 21 April 2008 18:51:50 nescivi wrote:

> Hiho,
>
> while I am fixing some stuff in the Network extension of the NetLib
> quark... I came across this thing:
>
> *broadcastIP { |prefix=""|
> var  res;
> res = Pipe.findValuesForKey(prefix++"ifconfig", "broadcast");
> //res = res.add( Pipe.findValuesForKey(prefix++"ifconfig", "Bcast"); );
>
> if(res.size > 1) { postln("the first of those devices were chosen: " ++
> res) };
> ^res.first
> }
>
> (prefix is my addition)
>
> Question:
> What is the output of the ifconfig command that is parsed?
>
> On Linux it looks like:
> eth1      Link encap:Ethernet  HWaddr 00:1e:37:8a:4b:a0
>           inet addr:74.59.253.108  Bcast:255.255.255.255
> Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST  MTU:576  Metric:1
>
> Which is why I thought doing this:
> Pipe.findValuesForKey(prefix++"ifconfig", "Bcast")
>
> would work, but it seems it doesn't...
>
> sincerely,
> Marije
> _______________________________________________
> Sc-devel mailing list
> Sc-devel@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-devel


_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: NetLib question

by Julian Rohrhuber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ah, thanks for looking into this. I think the best solution would be
to use the POSIX way to retrieve the address. My solution was an ugly
hack.


>Hiho,
>
>while I am fixing some stuff in the Network extension of the NetLib quark...
>I came across this thing:
>
> *broadcastIP { |prefix=""|
> var  res;
> res = Pipe.findValuesForKey(prefix++"ifconfig", "broadcast");
> //res = res.add(
>Pipe.findValuesForKey(prefix++"ifconfig", "Bcast"); );
>
> if(res.size > 1) { postln("the first of those devices
>were chosen: " ++
>res) };
> ^res.first
> }
>
>(prefix is my addition)
>
>Question:
>What is the output of the ifconfig command that is parsed?
>
>On Linux it looks like:
>eth1      Link encap:Ethernet  HWaddr 00:1e:37:8a:4b:a0
>           inet addr:74.59.253.108  Bcast:255.255.255.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:576  Metric:1
>
>Which is why I thought doing this:
>Pipe.findValuesForKey(prefix++"ifconfig", "Bcast")
>
>would work, but it seems it doesn't...
>
>sincerely,
>Marije
>_______________________________________________
>Sc-devel mailing list
>Sc-devel@...
>http://lists.create.ucsb.edu/mailman/listinfo/sc-devel


--





.
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel