1 | =head1 NAME |
1 | =head1 NAME |
2 | |
2 | |
3 | AnyEvent::Porttracker - Porttracker/PortIQ API client interface. |
3 | AnyEvent::Porttracker - Porttracker API client interface. |
4 | |
4 | |
5 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
6 | |
6 | |
7 | use AnyEvent::Porttracker; |
7 | use AnyEvent::Porttracker; |
8 | |
8 | |
9 | my $api = new AnyEvent::Porttracker |
9 | my $api = new AnyEvent::Porttracker |
10 | host => "10.0.0.1", |
10 | host => "10.0.0.1", |
11 | user => "admin", |
11 | user => "admin", |
12 | pass => "31331", |
12 | pass => "31331", |
13 | tls => 1, |
13 | tls => 1, |
|
|
14 | on_error => sub { |
|
|
15 | die $_[1]; |
|
|
16 | }, |
14 | ; |
17 | ; |
15 | |
18 | |
16 | # Example 1 |
19 | # Example 1 |
17 | # a simple request: ping the server synchronously |
20 | # a simple request: ping the server synchronously |
18 | |
21 | |
… | |
… | |
64 | other things) scans switches and routers in a network and gives a coherent |
67 | other things) scans switches and routers in a network and gives a coherent |
65 | view of which end devices are connected to which switch ports on which |
68 | view of which end devices are connected to which switch ports on which |
66 | switches and routers. It also offers a JSON-based client API, for which |
69 | switches and routers. It also offers a JSON-based client API, for which |
67 | this module is an implementation. |
70 | this module is an implementation. |
68 | |
71 | |
69 | In addition to Porttracker, the PortIQ product is also supported, as it |
|
|
70 | uses the same protocol. |
|
|
71 | |
|
|
72 | If you do not have access to either a Porttracker or PortIQ box then this |
72 | If you do not have access to a Porttracker box then this module will be of |
73 | module will be of little value to you. |
73 | little value to you. |
74 | |
74 | |
75 | This module is an L<AnyEvent> user, you need to make sure that you use and |
75 | This module is an L<AnyEvent> user, you need to make sure that you use and |
76 | run a supported event loop. |
76 | run a supported event loop. |
77 | |
77 | |
78 | To quickly understand how this module works you should read how to |
78 | To quickly understand how this module works you should read how to |
… | |
… | |
152 | |
152 | |
153 | Enables or disables TLS (default: disables). When enabled, then the |
153 | Enables or disables TLS (default: disables). When enabled, then the |
154 | connection will try to handshake a TLS connection before logging in. If |
154 | connection will try to handshake a TLS connection before logging in. If |
155 | unsuccessful a fatal error will be raised. |
155 | unsuccessful a fatal error will be raised. |
156 | |
156 | |
157 | Since most Porttracker/PortIQ boxes will not have a sensible/verifiable |
157 | Since most Porttracker boxes will not have a sensible/verifiable |
158 | certificate, no attempt at verifying it will be done (which means |
158 | certificate, no attempt at verifying it will be done (which means |
159 | man-in-the-middle-attacks will be trivial). If you want some form of |
159 | man-in-the-middle-attacks will be trivial). If you want some form of |
160 | verification you need to provide your own C<tls_ctx> object with C<< |
160 | verification you need to provide your own C<tls_ctx> object with C<< |
161 | verify => 1, verify_peername => [1, 1, 1] >> or whatever verification mode |
161 | verify => 1, verify_peername => [1, 1, 1] >> or whatever verification mode |
162 | you wish to use. |
162 | you wish to use. |
… | |
… | |
583 | |
583 | |
584 | =back |
584 | =back |
585 | |
585 | |
586 | =head1 SEE ALSO |
586 | =head1 SEE ALSO |
587 | |
587 | |
588 | L<AnyEvent>, L<http://www.porttracker.com/>, L<http://www.infoblox.com/en/products/portiq.html>. |
588 | L<AnyEvent>, L<http://www.porttracker.com/>. |
589 | |
589 | |
590 | =head1 AUTHOR |
590 | =head1 AUTHOR |
591 | |
591 | |
592 | Marc Lehmann <marc@nethype.de> |
592 | Marc Lehmann <marc@nethype.de> |
593 | |
593 | |