Skip to content

Command Page

rebell1994 edited this page Feb 29, 2024 · 6 revisions

General

saveLog

Command for saving the log in a file.

arguments in following order:

  • fileName - String

example

saveLog lognumber1

showLog

Command for displaying the log history to the user.

This command requires no arguments.

exit

Command for terminating the messenger.

This command requires no arguments.

Messenger

sendMessage

This command sends a message into a channel.

arguments in following order:

  • channelIndex - int
  • sign - boolean
  • encrypt - boolean
  • message - String
  • receivers - String [comma seperated]

example

sendMessage 1 false false Hello! Bob,Alice

lsMessages

This command lists all known messages of a channel. arguments in following order:

  • channelIndex - int

example

lsMessages 1

getMessageDetails

This command returns the hops of a message.

arguments in following order:

  • channelURI - String
  • position - int

example

getMessageDetails Channel1 5

lsChannel

This command lists all known channels for the peer.

This command requires no arguments.

mkChannel

Create a channel for writing messages to it.

arguments in following order:

  • channelUri - String
  • channelName - String
  • channelMustNotExist - boolean

example

mkChannel Channel1 MyChannel true

setChannelAge

This command changes channel age.

arguments in following order:

  • channel - channelURI
  • channelAge - String

Ages: Stone age Messages are only exchanged within ad-hoc networks. Messages are routed. It is like a network that is based solely on oral communication – like in the stone age. Users can copy a message and forward it. That is called gossiping. An automated message routing is not provided.

Bronze age Messages are only exchanged in ad-hoc networks like in the stone age. Messages are also routed, though. User Alice could send a message to Bob. Bob would automatically forward the original message to another user, let’s say Clara. It is like exchanging paper written notes. Each peer would make forward an exact copy of each received note.

Iron age Message are exchanged even over long-range networks. Users can barely estimate risks of potential spies.

example

setChannelAge Channel1 bronze

rmChannel

This command removes a channel from the peers known channels.

arguments in following order:

  • channel - channelURI

example

rmChannel Channel1

PKI

ownerInfo

Returns information about a specific peer.

arguments in following order:

  • peer - peerID

example

ownerInfo PeerName

numPeers

Returns the number of known peers.

arguments in following order:

  • owner - peerID

example

numPeers PeerName

mkKeys

Creates a new pair of RSA keys.

This command requires no arguments.

keysTime

Returns the time at which the RSA keys were created.

arguments in following order:

  • peer - peerID

example

keysTime PeerName

certByIssuer

Returns all certificates from a specific issuer.

arguments in following order:

  • issuer - peerID

example

certByIssuer PeerName

certBySubject

Returns all certificates from a specific subject.

arguments in following order:

  • subject - peerID

example

certBySubject PeerName

ia

Returns the identity assurance of a specific peer.

arguments in following order:

  • subject - peerID

example

ia PeerName

getSF

Returns the signing failure rate of a specific peer.

arguments in following order:

  • subject - peerID

example

getSF PeerName

setSF

Sets the signing failure rate for a specific peer.

arguments in following order:

  • subject - peerID
  • failureRate - int

example

setSF PeerName 5

mkCredentialMsg

Creates a credential message which can be send to another peer.

This command requires no arguments.

exchCert

Exchanges the certificates between two peers.

arguments in following order:

  • subject - peerID

example

exchCert PeerName

certPath

Returns the path which a certificate took. arguments in following order:

  • subject - peerID

example

certPath PeerName

Hub control

lsHubDescr

List known hub information.

This command requires no arguments.

addHubDescr

Define a new asap hub by its hostname, port and if it supports multichannel.

arguments in following order:

  • hubHost - String
  • hubPort - int
  • multiChannel - boolean

example

addHubDescr hubHostName 2020 true

rmHubDescr

Remove hub description from list. arguments in following order:

  • hubIndex - int

lsHubs

List connected hubs.

This command requires no arguments.

connectHub

Connect to a hub. arguments in following order:

  • hubIndex - int

Test

openTCP

This command opens a port for a peer to connect to over TCP/IP. arguments in following order:

  • port - int

example

openTCP 8080

closeTCP

Close a TCP connection to another peer.

arguments in following order:

  • port - int

example

closeTCP 8080

connectTCP

Connect to a host on given port number.

arguments in following order:

  • port - int
  • host - String

example

connectTCP 8080 localhost

sendMessageTest

Send a specified amount of test messages with a specified delay.

arguments in following order:

  • repetitions - int
  • delayInMillis - int
  • channelIndex - int
  • sign - boolean
  • encrypt - boolean
  • message - String
  • receivers - String [comma seperated]

example

sendMessageTest 5 100 Channel1 false false Hello! Bob,Alice

resetTM

This command resets all IDs and information about sent messages. Use thiswhen running multiple tests without interruptions. But make sure to save the test results before resetting.

This command requires no arguments.

saveTestResults

This command produces two csv verification files used for evaluating the test results. One for all sent and one for all received messages. arguments in following order: *testID - String

example

saveTestResults Testrun1

exec

This command starts executing all commands given by a String or File. The commands will be sequentialy executed in order.

arguments in following order:

  • inSteps - boolean [If true, every other command execution waits for the user to press Enter before performing the next command.]

example

exec true