1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2020 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from Net.idl.
use strict;
package Raritan::RPC::net::LanInterfaceParameters_2_0_0;
use Raritan::RPC::net::LanLinkMode;
sub encode {
my ($in) = @_;
my $encoded = {};
$encoded->{'speed'} = $in->{'speed'};
$encoded->{'duplex'} = $in->{'duplex'};
$encoded->{'autonegotiation'} = ($in->{'autonegotiation'}) ? JSON::true : JSON::false;
$encoded->{'link'} = ($in->{'link'}) ? JSON::true : JSON::false;
$encoded->{'supportedModes'} = [];
for (my $i0 = 0; $i0 <= $#{$in->{'supportedModes'}}; $i0++) {
$encoded->{'supportedModes'}->[$i0] = Raritan::RPC::net::LanLinkMode::encode($in->{'supportedModes'}->[$i0]);
}
return $encoded;
}
sub decode {
my ($agent, $in) = @_;
my $decoded = {};
$decoded->{'speed'} = $in->{'speed'};
$decoded->{'duplex'} = $in->{'duplex'};
$decoded->{'autonegotiation'} = ($in->{'autonegotiation'}) ? 1 : 0;
$decoded->{'link'} = ($in->{'link'}) ? 1 : 0;
$decoded->{'supportedModes'} = [];
for (my $i0 = 0; $i0 <= $#{$in->{'supportedModes'}}; $i0++) {
$decoded->{'supportedModes'}->[$i0] = Raritan::RPC::net::LanLinkMode::decode($agent, $in->{'supportedModes'}->[$i0]);
}
return $decoded;
}
1;
|