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 */
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
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 */
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 */
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 */
45 PortForwardingAutoSetupStatus newStatus; ///< The new port-forwarding auto-setup status
46 };
47
48 /** Interface for running the port-forwarding auto-setup */
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 */
88
89 /**
90 * Cancel a running port-forwarding auto-setup
91 */
92 void cancel();
93 };
94
95}
Interface for running the port-forwarding auto-setup.
PortForwardingAutoSetupStatus getStatus()
Get the status of a port-forwarding auto-setup.
int start(in int numberOfExpansionUnits, in string username, in string password, in string newPassword, in boolean disableStrongPasswordReq)
Start the port-forwarding auto-setup.
void cancel()
Cancel a running port-forwarding auto-setup.
Basic IDL definitions.
Definition Event.idl:10
Network Configuration.
PortForwardingAutoSetupExpansionUnitState
The state of a specific expansion unit during a port-forwarding auto-setup run.
@ PF_AUTO_SETUP_UNIT_ADDED
Expansion unit was successfully added.
@ PF_AUTO_SETUP_UNIT_ERROR
Could not add this expansion unit.
@ PF_AUTO_SETUP_UNIT_PENDING
Currently trying to discover and setup this unit.
@ PF_AUTO_SETUP_UNIT_ALREADY_EXISTS
Expansion unit already exists, no further setup needed.
PortForwardingAutoSetupRunningState
The state of a port-forwarding auto-setup run.
@ PF_AUTO_SETUP_FINISHED_SUCCESSFULLY
Port-forwarding auto-setup finished successfully.
@ PF_AUTO_SETUP_CANCELED
Port-forwarding auto-setup was canceled.
@ PF_AUTO_SETUP_NONE
No port-forwarding auto-setup run available.
@ PF_AUTO_SETUP_RUNNING
Port-forwarding auto-setup is currently running.
@ PF_AUTO_SETUP_FINISHED_WITH_ERROR
Port-forwarding auto-setup finished with an error.
Common base for all events.
Definition Event.idl:13
string errMsg
If state is PF_AUTO_SETUP_UNIT_ERROR this describes the error.
PortForwardingAutoSetupExpansionUnitState state
The state of this unit in this auto-setup.
PortForwardingAutoSetupStatus newStatus
The new port-forwarding auto-setup status.
The status and expansion units of a port-forwarding auto-setup run.
map< int, PortForwardingAutoSetupExpansionUnit > expansionUnits
Results per expansion unit, mapped by their node index.
PortForwardingAutoSetupRunningState runningState
The state of the last available auto-setup run.
time startTime
UNIX timestamp (UTC) when the auto-setup was started.
int remainingExpansionUnits
Number of expansion units that still need to be discovered.