# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2024 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from Net.idl.

use strict;

package Raritan::RPC::net::LanInterfaceParameters;


sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'speed'} = 1 * $in->{'speed'};
    $encoded->{'duplex'} = 1 * $in->{'duplex'};
    $encoded->{'autonegotiation'} = ($in->{'autonegotiation'}) ? JSON::true : JSON::false;
    $encoded->{'link'} = ($in->{'link'}) ? JSON::true : JSON::false;
    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;
    return $decoded;
}

1;
