Hi,

I have an Edimax broadband router at home and occasionally I would
like to access it programmatically.
So I started to write a module that can access the web interface of
this device. Something like this:


=head1 SYNOPSIS

 my $edimax = Edimax->login(host => '192.168.1.1', username =>
'admin', password => '1234');
 my $ref = $edimax->internet_connection;
 print $ref->{"IP Address"}
 print $ref->{"Default Gateway"}

 my @clients = $edimax->get_active_dhcp_clients;
 foreach my $c (@clients) {
    print $c->{"IP Address"};
 }

 my $text = $edimax->get_system_log;

 $edimax->reset;

=cut

So I wonder if you know any better way to do it?

What do you think about the API?

Are there modules on CPAN that do similar things to other similar devices?
I know Net::Telnet::Cisco could be in this group but it uses the
telnet interface,
this Edimax does not seem to have it enabled.
I also found RAS::AS5200 that also uses Net::Telnet and
Netgear::WGT624 http://search.cpan.org/dist/Netgear-WGT624/
which is a  web interface reader. That's probably the same as I am
planning to do.

Finally what should be the name of the module?

Gabor

ps. while looking at the source of its web pages I got a bit scared.
If this is how their code looks like in the web interface, how much can
I trust their router and firewall? Not a bit, right?
Look at the "Internet Connection" status page.


<form name="internetSta">
<table width=400 border="0">
  <tr>
    <td width=40% class="table1"><font size=2><b>Attain IP Protocol
:&nbsp;</b></td>
    <td width=60% class="table2"><font size=2>&nbsp;L2TP connected
</td>
        <input type="hidden" name="ip" value="192.117.99.100
">
        <input type="hidden" name="dns1" value="62.213.101.9
">

        <input type="hidden" name="dns2" value="198.113.16.25
">
        <input type="hidden" name="gw" value="170.41.121.1">
  </tr>
  <tr>
    <td class="table1"><font size=2><b>IP Address :&nbsp;</b></td>
    <td class="table2"><font size=2>&nbsp;192.117.99.100
</td>
  </tr>
  <tr>

    <td class="table1"><font size=2><b>Subnet Mask :&nbsp;</b></td>
    <td class="table2"><font size=2>&nbsp;255.255.255.255
</td>
  </tr>
  <tr>
    <td class="table1"><font size=2><b>Default Gateway :&nbsp;</b></td>
        <td class="table2"><script>
        var check = document.internetSta.ip.value;
        if ( check != "")
                document.write('<font 
size=2>&nbsp;'+document.internetSta.gw.value);
        else
                document.write('<font size=2>&nbsp;</td>');
</script>
  </tr>

  <tr>
    <td class="table1"><font size=2><b>MAC Address :&nbsp;</b></td>
    <td class="table2"><font size=2>&nbsp;00:0E:2A:1C:37:1E
</td>
  </tr>



  <tr>
    <td class="table1"><font size=2><b>Primary DNS :&nbsp;</b></td>

        <td class="table2"><script>
        if ( check != "")
        document.write('<font size=2>&nbsp;'+document.internetSta.dns1.value);
        else
        document.write('<font size=2>&nbsp;');
</script></td>
  </tr>
  <tr>
    <td class="table1"><font size=2><b>Secondary DNS :&nbsp;</b></td>
        <td class="table2"><script>
        if ( check != "")
            document.write('<font 
size=2>&nbsp;'+document.internetSta.dns2.value);
        else
            document.write('<font size=2>&nbsp;');
</script></td>
  </tr>
</table>
</form>

Reply via email to