Legrand / Raritan / Server Technology Xerus™ JSON-RPC API

Loading...
Searching...
No Matches
PortForwardingAutoSetup.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2024 Raritan Inc. All rights reserved.
4 */
5
6#include <Event.idl>
7
8/**
9 * Port-forwarding auto-setup
10 */
11module net {
12
13 /** The state of a specific expansion unit during a port-forwarding auto-setup run */
14 enumeration PortForwardingAutoSetupExpansionUnitState {
15 PF_AUTO_SETUP_UNIT_ALREADY_EXISTS, ///< Expansion unit already exists, no further setup needed
16 PF_AUTO_SETUP_UNIT_PENDING, ///< Currently trying to discover and setup this unit
17 PF_AUTO_SETUP_UNIT_ADDED, ///< Expansion unit was successfully added
18 PF_AUTO_SETUP_UNIT_ERROR ///< Could not add this expansion unit
19 };
20
21 structure PortForwardingAutoSetupExpansionUnit {
22 PortForwardingAutoSetupExpansionUnitState state; ///< The state of this unit in this auto-setup
23 string errMsg; ///< If state is \c PF_AUTO_SETUP_UNIT_ERROR this describes the error
24 };
25
26 /** The state of a port-forwarding auto-setup run */
27 enumeration PortForwardingAutoSetupRunningState {
28 PF_AUTO_SETUP_NONE, ///< No port-forwarding auto-setup run available
29 PF_AUTO_SETUP_RUNNING, ///< Port-forwarding auto-setup is currently running
30 PF_AUTO_SETUP_CANCELED, ///< Port-forwarding auto-setup was canceled
31 PF_AUTO_SETUP_FINISHED_WITH_ERROR, ///< Port-forwarding auto-setup finished with an error
32 PF_AUTO_SETUP_FINISHED_SUCCESSFULLY ///< Port-forwarding auto-setup finished successfully
33 };
34
35 /** The status and expansion units of a port-forwarding auto-setup run */
36 structure PortForwardingAutoSetupStatus {
37 time startTime; ///< UNIX timestamp (UTC) when the auto-setup was started
38 int remainingExpansionUnits; ///< Number of expansion units that still need to be discovered
39 PortForwardingAutoSetupRunningState runningState; ///< The state of the last available auto-setup run
40 map<int, PortForwardingAutoSetupExpansionUnit> expansionUnits; ///< Results per expansion unit, mapped by their node index
41 };
42
43 /** The status of the auto-setup changed */
44 valueobject PortForwardingAutoSetupStatusChangedEvent extends idl.Event {
45 PortForwardingAutoSetupStatus newStatus; ///< The new port-forwarding auto-setup status
46 };
47
48 /** Interface for running the port-forwarding auto-setup */
49 interface PortForwardingAutoSetup {
50
51 /** Success code */
52 constant int SUCCESS = 0;
53 constant int ERR_PF_AUTO_SETUP_NOT_A_PRIMARY_UNIT = 1;
54 constant int ERR_PF_AUTO_SETUP_ALREADY_RUNNING = 2;
55 constant int ERR_PF_AUTO_SETUP_INVALID_PARAM = 3;
56
57 /**
58 * Start the port-forwarding auto-setup. This will try to discover
59 * units that are connected to a port-forwarding downstream interface
60 * and configure them as port-forwarding expansion units, one-by-one.
61 * The auto-setup will exit if any errors occured or the number of
62 * expansion units to discover was reached.
63 *
64 * The auto-setup can only be started on port-forwarding primary units.
65 * It does not work with the USB downstream interface (will return
66 * ERR_PF_AUTO_SETUP_INVALID_PARAM).
67 *
68 * @param numberOfExpansionUnits how many expansion units should this port-forwarding cascade have
69 * @param username the username that is used to login to the expansion units
70 * @param password the password to login to the expansion units
71 * @param newPassword set a new password if an expansion unit needs to change the default password
72 * @param disableStrongPasswordReq \c true to disable strong password requirements of the expansion unit
73 *
74 * @return 0 if OK
75 * @return ERR_PF_AUTO_SETUP_NOT_A_PRIMARY_UNIT this unit is not a port-forwarding primary unit
76 * @return ERR_PF_AUTO_SETUP_ALREADY_RUNNING an earlier run of the port-forwarding auto-setup is still running
77 * @return ERR_PF_AUTO_SETUP_INVALID_PARAM one of the parameters was invalid
78 */
79 int start(in int numberOfExpansionUnits, in string username,
80 in string password, in string newPassword, in boolean disableStrongPasswordReq);
81
82 /**
83 * Get the status of a port-forwarding auto-setup.
84 *
85 * @return the status
86 */
87 PortForwardingAutoSetupStatus getStatus();
88
89 /**
90 * Cancel a running port-forwarding auto-setup
91 */
92 void cancel();
93 };
94
95}
net::PortForwardingAutoSetup
Interface for running the port-forwarding auto-setup.
Definition PortForwardingAutoSetup.idl:49
net::PortForwardingAutoSetup::getStatus
PortForwardingAutoSetupStatus getStatus()
Get the status of a port-forwarding auto-setup.
net::PortForwardingAutoSetup::SUCCESS
constant int SUCCESS
Success code.
Definition PortForwardingAutoSetup.idl:52
net::PortForwardingAutoSetup::start
int start(in int numberOfExpansionUnits, in string username, in string password, in string newPassword, in boolean disableStrongPasswordReq)
Start the port-forwarding auto-setup.
net::PortForwardingAutoSetup::cancel
void cancel()
Cancel a running port-forwarding auto-setup.
idl
Basic IDL definitions.
Definition Event.idl:10
net
Network Configuration.
Definition Diagnostics.idl:9
net::PortForwardingAutoSetupExpansionUnitState
PortForwardingAutoSetupExpansionUnitState
The state of a specific expansion unit during a port-forwarding auto-setup run.
Definition PortForwardingAutoSetup.idl:14
net::PF_AUTO_SETUP_UNIT_ADDED
@ PF_AUTO_SETUP_UNIT_ADDED
Expansion unit was successfully added.
Definition PortForwardingAutoSetup.idl:17
net::PF_AUTO_SETUP_UNIT_ERROR
@ PF_AUTO_SETUP_UNIT_ERROR
Could not add this expansion unit.
Definition PortForwardingAutoSetup.idl:18
net::PF_AUTO_SETUP_UNIT_PENDING
@ PF_AUTO_SETUP_UNIT_PENDING
Currently trying to discover and setup this unit.
Definition PortForwardingAutoSetup.idl:16
net::PF_AUTO_SETUP_UNIT_ALREADY_EXISTS
@ PF_AUTO_SETUP_UNIT_ALREADY_EXISTS
Expansion unit already exists, no further setup needed.
Definition PortForwardingAutoSetup.idl:15
net::PortForwardingAutoSetupRunningState
PortForwardingAutoSetupRunningState
The state of a port-forwarding auto-setup run.
Definition PortForwardingAutoSetup.idl:27
net::PF_AUTO_SETUP_FINISHED_SUCCESSFULLY
@ PF_AUTO_SETUP_FINISHED_SUCCESSFULLY
Port-forwarding auto-setup finished successfully.
Definition PortForwardingAutoSetup.idl:32
net::PF_AUTO_SETUP_CANCELED
@ PF_AUTO_SETUP_CANCELED
Port-forwarding auto-setup was canceled.
Definition PortForwardingAutoSetup.idl:30
net::PF_AUTO_SETUP_NONE
@ PF_AUTO_SETUP_NONE
No port-forwarding auto-setup run available.
Definition PortForwardingAutoSetup.idl:28
net::PF_AUTO_SETUP_RUNNING
@ PF_AUTO_SETUP_RUNNING
Port-forwarding auto-setup is currently running.
Definition PortForwardingAutoSetup.idl:29
net::PF_AUTO_SETUP_FINISHED_WITH_ERROR
@ PF_AUTO_SETUP_FINISHED_WITH_ERROR
Port-forwarding auto-setup finished with an error.
Definition PortForwardingAutoSetup.idl:31
idl::Event
Common base for all events.
Definition Event.idl:13
net::PortForwardingAutoSetupExpansionUnit
Definition PortForwardingAutoSetup.idl:21
net::PortForwardingAutoSetupExpansionUnit::errMsg
string errMsg
If state is PF_AUTO_SETUP_UNIT_ERROR this describes the error.
Definition PortForwardingAutoSetup.idl:23
net::PortForwardingAutoSetupExpansionUnit::state
PortForwardingAutoSetupExpansionUnitState state
The state of this unit in this auto-setup.
Definition PortForwardingAutoSetup.idl:22
net::PortForwardingAutoSetupStatusChangedEvent
The status of the auto-setup changed.
Definition PortForwardingAutoSetup.idl:44
net::PortForwardingAutoSetupStatusChangedEvent::newStatus
PortForwardingAutoSetupStatus newStatus
The new port-forwarding auto-setup status.
Definition PortForwardingAutoSetup.idl:45
net::PortForwardingAutoSetupStatus
The status and expansion units of a port-forwarding auto-setup run.
Definition PortForwardingAutoSetup.idl:36
net::PortForwardingAutoSetupStatus::expansionUnits
map< int, PortForwardingAutoSetupExpansionUnit > expansionUnits
Results per expansion unit, mapped by their node index.
Definition PortForwardingAutoSetup.idl:40
net::PortForwardingAutoSetupStatus::runningState
PortForwardingAutoSetupRunningState runningState
The state of the last available auto-setup run.
Definition PortForwardingAutoSetup.idl:39
net::PortForwardingAutoSetupStatus::startTime
time startTime
UNIX timestamp (UTC) when the auto-setup was started.
Definition PortForwardingAutoSetup.idl:37
net::PortForwardingAutoSetupStatus::remainingExpansionUnits
int remainingExpansionUnits
Number of expansion units that still need to be discovered.
Definition PortForwardingAutoSetup.idl:38