Net::Libdnet - Perl interface to libdnet
use Net::Libdnet;
All the following functions return undef and print a warning message to the standard error when a problem occurs.
Some of the functions in the original dnet were omited, because we only deal with the string representation of addresses. We also avoid passing handlers to the user, as we open and subsequently close them for each request. Moreover, the XXX_loop() functions are not implemented yet.
addr_cmp($address_a, $address_b) -> $int_distance
Compares network addresses a and b, returning an integer less than, equal to, or greater than zero if a is found, respectively, to be less than, equal to, or greater than b. Both addresses must be of the same address type.
addr_bcast($address/netmask) -> $address_broadcast
Computes the broadcast address for the specified network.
addr_net($address/netmask) -> $address_network
Computes the network address for the specified network.
arp_add($protocol_address, $hardware_address) -> 1
Adds a new ARP entry.
arp_delete($protocol_address) -> 1
Deletes the ARP entry for the specified protocol address.
arp_get($protocol_address) -> $hardware_address
retrieves the ARP entry for the specified protocol address.
Not implemented yet.
Interfaces are manipulated as hashes with the following structure:
{ len => ... , name => ... , type => ... , flags => ... , mtu => ... , addr => ... , dst_addr => ... , link_addr => ... , # alias_num => ... , # alias_addrs => ... , };
Processing interface aliases is not implemented yet.
intf_get($name) -> %interface
Retrieves an interface configuration entry, keyed on name.
intf_get_src($local_address) -> %interface
Retrieves the configuration for the interface with the specified primary address.
intf_get_dst($remote_address) -> %interface
Retrieves the configuration for the best interface with which to reach the specified destination address.
intf_set(%interface) -> 1
Sets the interface configuration entry. Please retrieve first the configuration, and do not build from scratch.
route_add($destination_address, $gateway_address) -> 1
Adds a new route, to the specified destination prefix over the given gateway.
route_delete($destination_address) -> 1
Deletes the routing table entry for the destination prefix.
route_get($destination_address) -> $gateway_address
Retrieves the routing table entry for the destination prefix.
intf_set, hash2intf
dnet(3)
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install Net::Libdnet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Libdnet
CPAN shell
perl -MCPAN -e shell install Net::Libdnet
For more information on module installation, please visit the detailed CPAN module installation guide.