Commit 3737925a authored by Weibin Sun's avatar Weibin Sun
Browse files

Add getUsedListenerPorts in HP snmpit module, it gives the used ports of...

Add getUsedListenerPorts in HP snmpit module, it gives the used ports of existing listeners. This function is for automatic listener port assigning.
parent 06c2f12b
......@@ -1849,6 +1849,32 @@ sub setListener($$$) {
return 1;
}
#
# Get used listener ports
#
sub getUsedListenerPorts($$) {
my $self = shift;
my $ports = shift;
my $listener = [$ofListenerOID,0];
#
# Get all listeners and gather their ports
#
my ($varname, $vlan, $connstr);
$self->{SESS}->getnext($listener);
do {
($varname, $vlan, $connstr) = @{$listener};
$self->debug("listener: $varname $vlan $connstr \n");
if ($varname =~ /11.2.14.11.5.1.7.1.35.1.1.4/) {
my ($proto, $port) = split(":", $connstr);
$ports->{$port} = 1;
}
$self->{SESS}->getnext($listener);
} while ($varname =~ /11.2.14.11.5.1.7.1.35.1.1.4/);
}
#
# Check if Openflow is supported on this switch
#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment