Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/gemesa/rgaas

RGaaS - Random Generator as a Service
https://github.com/gemesa/rgaas

c clang clang-format clang-tidy cmake cmocka heap linux socket tcp tcp-client tcp-client-server tcp-ip tcp-protocol tcp-server tcp-socket valgrind

Last synced: 3 days ago
JSON representation

RGaaS - Random Generator as a Service

Awesome Lists containing this project

README

        

# RGaaS - Random Generator as a Service

`rgaas-server` is a service that generates random bytes (using rand() which is not a cryptographically secure generator). The length of the random byte sequence can be specified by the client. The server can handle multiple
random number requests per connection, can handle multiple connections, serves the clients via TCP/IP and can be run as a daemon.

`rgaas-client` is a client to test `rgaas-server` (connect, request and display multiple random byte
sequences of a user-specified length).

## Installation from source

### Prerequisites

The following tools are necessary for building:

- `cmake` (3.23)
- `clang` (14.0.5)

### How to build

Invoke the following commands:

```bash
$ cmake .
$ cmake --build .
```

which will build `rgaas-server` and `rgaas-client` executables. You can find them in the _build_ folder.

## Quickstart

Invoke the following commands (daemon mode):

```bash
$ ./build/rgaas-server -p 8000 -v -d
$ ./build/rgaas-client -n -p 8000 -v
```

Note: you will need to send SIGINT to the process of `rgaas-server` to kill it:

```bash
$ kill -INT $(pidof ./build/rgaas-server)
```

Invoke the following commands (foreground mode):

```bash
$ ./build/rgaas-server -p 8000 -v
```
Open an other terminal:

```bash
$ ./build/rgaas-client -n -p 8000 -v
```
## Example

```bash
$ ./build/rgaas-server -p 8000 -v
15 rgaas - program started
15 rgaas - tcp setup successful
```

```bash
$ ./build/rgaas-client -n fedora -p 8000 -v
15 rgaas - program started
13 rgaas - please enter the number of random bytes to be requested:
100
13 rgaas - received from server:
�1X�Z%]X�^ԫ��ƛ�T�tA!=܇p�>�A��g>~���k��8\*�;�2� .clang-tidy
```

and is being constantly tailored during the development.

Invoke the following command to run dynamic analysis:

```bash
$ chmod +x ./test/valgrind/valgrind.sh
$ ./test/valgrind/valgrind.sh
```

which will generate the following files in the _build_ folder:

- _valgrind-server.log_
- _valgrind-client.log_
- _rgaas-server.log_
- _rgaas-client.log_

and also print analysis information to stdout.

Invoke `./build/unit-test` to run the unit tests:

```bash
$ ./build/unit-test
```