An open API service indexing awesome lists of open source software.

https://github.com/cwlowder/nettest

A simple command line tool that can be used to send/receive small packets over tcp
https://github.com/cwlowder/nettest

command-line-tool network tcp

Last synced: 12 months ago
JSON representation

A simple command line tool that can be used to send/receive small packets over tcp

Awesome Lists containing this project

README

          

# netTest
This python script allows for the sending and receiving of packets over tcp

This program can be run with `python3 netTest.py`

### Commands
commands can be joined together using an `&` like so:

`connect & listen`
#### list
Used to list either `commands` or `receives`.

example: `list commands`
#### connect
Used to connect to what ever host & port is set to
example: `connect`

#### disconnect
Used to disconnect from the current connection
#### listen
This command starts listening to the data being received. Requires an active connection.

example: `listen`

#### send
Sends whatever command is given as an argument. Requires an active connection.

example: `send test_command`

#### get
Used to get the properties and the format of the commands and receives

example: `get host`

example: `get receive 4`
#### set
Used to set the properties and the format of the commands and receives

example: `set port 25565`

example: `set command test 10`

###### Note:
setting receives is more complicated it involves three arguments
* `-l` the length of the the receive
* `-n` the name of the receive
* `-f` the format of the incoming receive

Together they can look like this:

`set receive -l 4 -n test_command -f [uint16]`
### Format of Receive
Formats are constructed using the following syntax:

`[type#number]`

type can be one of the following:
* uint8
* uint16
* uint32
* float
* double
* long
* char
* byte

The `#number` represents the number of consecutive numbers that will be received of that type.
When omitted, it is implied only a single value exists. Multiple of these types can be strung together.
An example of this: `[uint8#2][double][uint32#4]`. This statement implies that 2 uint8s, then a double, then 4 uint32s will be received.

### Properties
This is a list of the properties that can be set, what they affect, and what type(int, float, etc) can they be set to.
* host
* The host to be connected to
* Can be set to a string
* port
* The port to be connected to
* Can be set to an int
* print
* Should the data received when listening be printed?
* Can be set to a boolean
* outfile
* The file that will be printed to and overwritten
* Can be set to a string
* commandidbytes
* The number of bytes that make up the id for the sent command
* Can be set to an int
* receiveidbytes
* The number of bytes that make up the id for receives
* Can be set to an int

The rest of the properties should not be edited:
* sizeofuint8
* Number of bytes in an uint8
* Can be set to an int
* sizeofuint16
* Number of bytes in an uint16
* Can be set to an int
* sizeofuint32
* Number of bytes in an uint32
* Can be set to an int
* sizeoffloat
* Number of bytes in a float
* Can be set to an int
* sizeofdouble
* Number of bytes in a double
* Can be set to an int
* sizeoflong
* Number of bytes in a long
* Can be set to an int
* sizeofchar
* Number of bytes for a char, a series of chars make up a string
* Can be set to an int
* sizeofbyte
* Number of bytes in a byte
* Can be set to an int