File: ImageInfo.pm

package info (click to toggle)
raritan-json-rpc-sdk 3.6.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 41,748 kB
  • sloc: cs: 162,629; perl: 85,818; python: 24,275; javascript: 5,937; makefile: 21
file content (55 lines) | stat: -rw-r--r-- 2,444 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2020 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from Firmware.idl.

use strict;

package Raritan::RPC::firmware::ImageInfo;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'valid'} = ($in->{'valid'}) ? JSON::true : JSON::false;
    $encoded->{'version'} = "$in->{'version'}";
    $encoded->{'min_required_version'} = "$in->{'min_required_version'}";
    $encoded->{'product'} = "$in->{'product'}";
    $encoded->{'platform'} = "$in->{'platform'}";
    $encoded->{'oem'} = "$in->{'oem'}";
    $encoded->{'hwid_whitelist'} = "$in->{'hwid_whitelist'}";
    $encoded->{'hwid_blacklist'} = "$in->{'hwid_blacklist'}";
    $encoded->{'compatible'} = ($in->{'compatible'}) ? JSON::true : JSON::false;
    $encoded->{'signature_present'} = ($in->{'signature_present'}) ? JSON::true : JSON::false;
    $encoded->{'signed_by'} = "$in->{'signed_by'}";
    $encoded->{'signature_good'} = ($in->{'signature_good'}) ? JSON::true : JSON::false;
    $encoded->{'certified_by'} = "$in->{'certified_by'}";
    $encoded->{'certificate_good'} = ($in->{'certificate_good'}) ? JSON::true : JSON::false;
    $encoded->{'model_list_present'} = ($in->{'model_list_present'}) ? JSON::true : JSON::false;
    $encoded->{'model_supported'} = ($in->{'model_supported'}) ? JSON::true : JSON::false;
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'valid'} = ($in->{'valid'}) ? 1 : 0;
    $decoded->{'version'} = $in->{'version'};
    $decoded->{'min_required_version'} = $in->{'min_required_version'};
    $decoded->{'product'} = $in->{'product'};
    $decoded->{'platform'} = $in->{'platform'};
    $decoded->{'oem'} = $in->{'oem'};
    $decoded->{'hwid_whitelist'} = $in->{'hwid_whitelist'};
    $decoded->{'hwid_blacklist'} = $in->{'hwid_blacklist'};
    $decoded->{'compatible'} = ($in->{'compatible'}) ? 1 : 0;
    $decoded->{'signature_present'} = ($in->{'signature_present'}) ? 1 : 0;
    $decoded->{'signed_by'} = $in->{'signed_by'};
    $decoded->{'signature_good'} = ($in->{'signature_good'}) ? 1 : 0;
    $decoded->{'certified_by'} = $in->{'certified_by'};
    $decoded->{'certificate_good'} = ($in->{'certificate_good'}) ? 1 : 0;
    $decoded->{'model_list_present'} = ($in->{'model_list_present'}) ? 1 : 0;
    $decoded->{'model_supported'} = ($in->{'model_supported'}) ? 1 : 0;
    return $decoded;
}

1;