Skip to content

OzanCansel/netsck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codacy

netsck

netsck is a network utility tool which is developed to prototype or test network things. It provides a shell inside which runs javascript engine. Makes possible to create, bind, send data through or receive data from a socket. Currently only udp_socket is implemented.

  • It is a terminal application.

  • Depends on QtQml, QtNetwork and QtCore.

  • Qt 5.12.8 and greater

  • GCC 7.3.1 and greater

  • Currently tested only on Linux but should work for Windows too.

Note that, netsck uses ansi color codes to colorize the terminal. On Windows, it is disabled by default so if you want 'netsck' to have a better look, you should enable virtual terminal with :

[HKEY_CURRENT_USER\Console]
"VirtualTerminalLevel"=dword:00000001

Documentation

In doc folder man pages and merged-pdf version of man pages exist.

Man pages are accessible from netsck in application, so just type help() to the console. On Linux, man pages are embedded. On Windows, netsck tells to the explorer.exe to open merged-pdf version.

Usage

Create udp echo server

var srv = new udp_socket()
srv.bind( AnyIPv4 , 10000 )
srv.enable_stdout( false )

while( wait_key( 30 ) != Key.ESC )
{
    srv.wait_a_bit()
    
    while ( srv.has_datagram() )
    {
        var dgram = srv.read_datagram()
        
        Hex.print( dgram.data )
        
        srv.send(
            dgram.data ,
            dgram.sender_addr ,
            dgram.sender_port
        )
    }
}

Create udp client

var cli = new udp_socket()

cli.send(
    "Hello, u there ?" ,
    "127.0.0.1" ,
    10000
)

cli.send(
    flat(
        [ 0x01 , 0x05 , 0x14 , ...beint32( 12345 ) , ...lefloat( 14.2 ) ]
    ) ,
    "127.0.0.1" ,
    10000
)

How to build ?

On Ubuntu 18.04 or 20.04

git clone https://github.com/OzanCansel/netsck.git
cd netsck
git submodule update --init
mkdir build && cd build
cmake ..
sudo cmake --build . --target install -- -j$(nproc)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

Network utility tool which enables to prototype or test network things.

Resources

License

Stars

Watchers

Forks

Packages

No packages published