Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The error code is a 32-bit unsigned integer formatted as a hexadecimal string. Synchronous error replies always will have a request ID returned. Asynchronous error replies only will return a request ID if the reply is associated with an asynchronous request. Optionally, all commands immediately return an acknowledgment reply. If the Acks option is turned on, the client receives an immediate reply "@ReqID;OK;" followed by the command that was recognized.

The API Sets

There are four are three API sets available in the Fairmount SSH Server: the Fairmount Network Data Access (FANDA) APIs, the Design Pad APIs, the Configuration APIs, and the internal use APIs.

...

Sets the value of the variable VariableName to Base64Value. Base64Value is a little-endian binary value encoded as a Base64 string. At this point, VariableName must be defined in Design Pad as a global variable with network access enabled. The second form of the command may be used for structure type variables. In that case, the requested structure member value is set. Returns "@ReqID;SetVar=Success” or “@ReqID;Error=code;error message”.

The Design Pad APIs

...


Configuration APIs

These meta-commands affect the FANDA connection itself.

Echo

Panel

FairNET,Base64Value

Sends the bytes specified by Base64Value to the device's FANDA FairNET channel. The data is interpreted per the FairNET specification, as if the data had been received over the IR interface. The FANDA client acts as the FairNET master.

There is no reply to this command. Returned FairNET data arrives via asynchronous FairNET messages:

Panel

FairNET,Base64Value

Returns the bytes specified by Base64Value from the device's FANDA FairNET channel. The data is interpreted per the FairNET specification, as if the data had been received by the client from the IR interface. The FANDA client is the FairNET master, so this message will only occur in response to an earlier FairNET message sent from the client.

A single FairNET incoming packet may be split into multiple FANDA FairNET messagess, and a single FANDA FairNET message may contain data from multiple FairNET packets.

ShowFile

Panel

ShowFile,Moniker

Returns the contents of file aliased by Moniker and return it as one or more Base64 encoded strings of the format:

Panel

@ReqID;File=Base64Value

After the entire file contents are returned, either "@ReqID;ShowFile=Success” is returned if the file was returned successfully, or “@ReqID;Error=code;error message” if an error was encountered while reading the file. The only file moniker currently supported is Messages and refers to Linux and LynxOS syslog messages.

Update

Panel

UpdateSubcommand

The UpdateSubcommand command set allows uploading and executing a self-extracting update program, which may include a control code update or a kernel update. There are several sub-commands, which are typically issued in the order shown below.

UpdateStart

Panel

UpdateStart,Size=ImageSize

Start an update. The server will ensure that sufficient space is available to store an image of the specified size before proceeding. If sufficient space is available, the server will respond with:

Panel

UpdateStart=Success

otherwise, the server will return an error and cancel the update:

Panel

@ReqID;Error=code;error message

UpdateData

Panel

UpdateData,Offset=CurrentOffset,Base64Data

Transfers a chunk of the update program. CurrentOffset indicates the offset within the updater program at which Base64Data should be written. If the data is written out successfully the response is:

Panel

@ReqID;UpdateData=Success;Offset=CurrentOffset,Bytes=NumBytes

otherwise, an error response is returned and the client may retry the failed chunk:

Panel

@ReqID;Error=code;error message

UpdateApply

Panel

UpdateApply[,DigestType=DigestValue][,Arg=UpdateArg]

Verify the message digest of the transferred data and apply the update. If no digest is provided or the provided digest is not supported, the total amount of data transferred in successful UpdateData commands is compared to the size given in the UpdateStart command. If a digest or length mismatch is detected, an error response is returned and the update is canceled:

Panel

@ReqID;Error=code;error message

If validation succeeds, the UpdateApply=Success message is returned, followed by an EOF:

Panel

@ReqID;UpdateApply=Success
EOF;Update

at which point no more FANDA data is passed over the connection. The SSH connection is connected to the update program's stdin, stdout, and stderr. Messages from the update program should be displayed to the user to confirm progress. When the update completes (successfully or otherwise) the SSH connection will be closed.

Each UpdateArg is passed as as a command-line argument to the update program. If no UpdateArg parameters are passed, the default is -- -n (preserve node configuration) to maintain network parameters. To run the updater with no arguments, pass Arg= (empty string).

If the update process proceeds to stop or restart the control code, any other connected clients will receive:

Panel

EOF;Shutdown

Currently supported DigestType values are MD5 and SHA1. The DigestValue is Base64 encoded. Multiple digests types may be included in a single command, in any order.

The SC1 supports all digest types. The NIM2 does not support message digests and performs length validation only. Any digest provided is ignored.

UpdateCancel

Panel

UpdateCancel

Cancel an in-progress update, typically in response to a user action. Any data already transferred is discarded. The response is:

Panel

@ReqID;UpdateCancel=Success

Lock

Panel

Lock,ID=LockID[,ID=LockID...][,Wait=AcquireTimeout][,Hold=HoldTimeout]

Acquire the lock(s) specified by the LockID parameters. Return an error if the lock can not be acquired after AcquireTimeout seconds (may be zero or omitted, in which case the command returns a result immediately). If the locked capability is not used for HoldTimeout seconds the lock is automatically released. All held locks are released when a FANDA session ends. If HoldTimeout is zero or omitted, the lock is held until the session ends.

If more than one lock is specified, they are all acquired atomically or, if one or more cannot be acquired, then none are acquired.

Repeated Lock commands may be used to verify that the caller is still holding the lock. This will also reset the HoldTimeout to the value specified in the most recent Lock command. This is not a nested lock, only one Unlock call is needed to release the lock, regardless of the number of Lock commands that were executed.

The currently defined locks are:

Panel
borderColor#ccc
bgColor#fff
titleLock Identifiers
borderStyledashed

LockID

Definition

1

Lock Fairnet Network Commands

2

Lock Fairnet IR Port

3

Lock Firmware Update Commands

The response is either

Panel

@ReqID;Lock=Success;LockID[PDG:,LockID.]

for success or

Panel

@ReqID;Error=code;error message

if an error occurs.

LockIDs are C-style numeric values (parsed with scanf "%d" modifier or strtol with base 0).

Unlock

Panel

Unlock,LockID[,LockID.]

..

Unlock the lock(s) with the IDs specified in the LockID parameters. If no error occurs, the response is:

Panel

@ReqID;Unlock=Success;LockID[,LockID...]

with a comma-separated list of all locks that were released (locks that were abandoned due to timeout will not appear in the list). If an error occurs the response is

Panel

@ReqID;Error=code;error message

If LockID is the string "all", all locks currently held by the caller are released, and the response is:

Panel

@ReqID;Unlock=Success;[LockID(,LockID.)]

with a comma-separated list of all locks that were released. If no locks were held the ID list is empty.

LockIDs are C-style numeric values (parsed with scanf "%d" modifier or strtol with base 0), or the string "all".

Configuration APIs

These meta-commands affect the FANDA connection itself.

Echo

Panel

Echo[,On|Off]

...

Echo[,On|Off]

The Echo command turns on or off echoing of all characters received by the server back to the client before processing. This is useful during debugging when using a command shell SSH client to talk to the server directly. No reply is given to this command.

...

Panel
borderColor#ccc
bgColor#fff
borderStyledashed
titleGetCaps Response DefinitionborderStyledashed


Byte

Bit

Mask

Definition

0

0

01,00

1: GetNDL Command Supported

0

1

02,00

1: GetVar Command Supported

0

2

04,00

1: SetVar Command Supported

0

3

08,00

1: Fairnet Command Supported

0

4

10,00

1: Firmware Update Commands Supported

0

5

20,00

1: Lock/Unlock Commands Supported

0

6

40,00

1: Multicast Monitoring Enabled

1

0

00,01

1: SetDataFormat,Base64 Supported

1

1

00,02

1: SetDataFormat,XML Supported

1

2

00,04

1: SetDataFormat,String Supported

1

3

00,08

1: GetMulticastKey Supported

1

4

00,10

1: ShowFile Supported


The current max-capability response is

...