NAME

PDK::Concern::Netdisco::H3c - Explore and manage LLDP topology for H3C devices

SYNOPSIS

use PDK::Concern::Netdisco::H3c;

my $h3c_device = PDK::Device::H3c->new(...);
my $netdisco = PDK::Concern::Netdisco::H3c->new(device => $h3c_device);
my $result = $netdisco->explore_topology();

DESCRIPTION

PDK::Concern::Netdisco::H3c provides functionality to explore LLDP (Link Layer Discovery Protocol) topology for H3C devices and generate interface descriptions based on the discovered neighbors. This module is designed to work with H3C network devices and automate the process of updating interface descriptions based on LLDP information.

METHODS

new(device => $h3c_device)

Creates a new instance of the PDK::Concern::Netdisco::H3c class.

  • device

    A required parameter. Must be an instance of PDK::Device::H3c.

my $netdisco = PDK::Concern::Netdisco::H3c->new(device => $h3c_device);

explore_topology()

Explores the LLDP topology of the device and send generated interface descriptions.

Returns a hashref with the result of executing the generated commands.

my $result = $netdisco->explore_topology();
if ($result->{success}) {
  print "Topology exploration and interface description update successful.\n";
} else {
  print "Failed: " . $result->{reason} . "\n";
}

gen_iface_desc($topology_data)

Generates interface description commands based on the provided topology data.

  • $topology_data

    An arrayref containing the raw LLDP neighbor information.

Returns an array of configuration commands.

my @topology_data = $device->get_lldp_data();
my @commands = $netdisco->gen_iface_desc(\@topology_data);

refine_if($name)

Refines the interface name by standardizing various interface name formats.

  • $name

    The original interface name to be refined.

Returns the refined interface name.

my $refined_name = $netdisco->refine_if('GigabitEthernet1/0/1');
# Returns: 'GE1/0/1'

DEPENDENCIES

This module requires the following modules:

  • Moose

  • PDK::Device::H3c

CONFIGURATION AND ENVIRONMENT

PDK::Concern::Netdisco::H3c requires no configuration files or environment variables.

AUTHOR

WENWU YAN <968828@gmail.com>

LICENSE AND COPYRIGHT

Copyright (C) 2024 WENWU YAN

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.