The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Libdnet - Perl interface to libdnet

SYNOPSIS

use Net::Libdnet;

DESCRIPTION

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.

Network addressing

  • 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.

Address Resolution Protocol

  • 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.

Binary buffers

Not implemented yet.

Ethernet

Not implemented yet.

Firewalling

Not implemented yet.

Network interfaces

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

    Not implemented yet.

    Sets the interface configuration entry. Please retrieve first the configuration, and do not build from scratch.

Internet Protocol

Not implemented yet.

Random number generation

Not implemented yet.

Routing

  • 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.

TODO

intf_set, hash2intf

SEE ALSO

dnet(3)

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 224:

'=item' outside of any '=over'

Around line 237:

You forgot a '=back' before '=head1'