I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-10-30 22:24:05-08 by cmv
How to handle multiple Ethernet Interfaces?
Martin-
What are your thoughts on handling machines with multiple ethernet interfaces?
I would vote for returning an array of MAC addresses if there are more than one ethernet interfaces.
What about inactive interfaces vs active interfaces?
I would like the option to ask for all MAC addresses for all interfaces (even those which are not active), or only MAC addresses for active interfaces.
What are your thoughts?
Thanks!
-Craig
Direct Responses: 3479 | Write a response
Posted on 2006-11-10 19:17:22-08 by mthurn in response to 3387
Re: How to handle multiple Ethernet Interfaces?
All good ideas. I'll start working on that. Do you have any thoughts on what the API should look like? The first thing that comes to mind is extra functions such as: get_all_addresses, get_active_addresses, and get_inactive_addresses...
Direct Responses: 3482 | Write a response
Posted on 2006-11-10 21:56:24-08 by cmv in response to 3479
Re: How to handle multiple Ethernet Interfaces?
Martin- I'm an advocate of changing the existing interface as little as possible. If you agree with this route, here are some thoughts that come to my mind: my $sAddress = get_address; Assigning get_address to a scalar variable would work as it does today, but the definition of which address you get back in a multi-interface system is the first active one that shows up when doing the given command on the given OS. my @sAddress = get_address; Assigning get_address to a list would return an array of all the active interfaces in a multi-interface system. my %sAddress = get_address; Assigning get_address to a hash would return a hash of all the active or inactive interfaces where the hash value is an indicator, or bit flag, such as: sAddress{xx:xx:xx:xx} = 'Active'; sAddress{xx:xx:xx:xx} = 1; You could also put arguments on some of these to give the user more flexibility, such as: my $sAddress = get_address(state=>'Active'); my @sAddress = get_address(state=>'Inactive'); my %sAddress = get_address(state=>0); Just some thoughts. -Craig
Direct Responses: Write a response