CLI interface for scheduler.
More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <libfossology.h>
#include <glib.h>
Go to the source code of this file.
|
#define | P_WIDTH 27 |
|
#define | F_WIDTH 10 |
|
#define | vprintf(...) if(verbose) printf(__VA_ARGS__); |
|
|
int | response = 1 |
| Is a response expected from the scheduler.
|
|
int | s |
| The socket that the CLI will use to communicate.
|
|
int | verbose |
| The verbose flag for the cli.
|
|
fo_conf * | conf |
| The loaded configuration data.
|
|
CLI interface for scheduler.
Definition in file fo_cli.c.
◆ interface_usage()
Interface usage print.
Prints the usage message for the interface on stdout.
Definition at line 162 of file fo_cli.c.
◆ receive()
uint8_t receive |
( |
int |
s, |
|
|
char * |
buffer, |
|
|
size_t |
max, |
|
|
uint8_t |
end |
|
) |
| |
Performs the actions necessary to receive from the scheduler.
- Parameters
-
s | the socket that is connected to the scheduler |
buffer | buffer that is used to store messages from the scheduler |
max | the capacity of the buffer |
end | used to determine when this function should return |
- Returns
Definition at line 102 of file fo_cli.c.
◆ socket_connect()
int socket_connect |
( |
char * |
host, |
|
|
char * |
port |
|
) |
| |
Create a socket connection.
Creates a new socket that connects to the given host and port.
- Parameters
-
host | Cstring name of the host to connect to |
port | Cstring representation of the port to connect to |
- Returns
- The file descriptor of the new socket
Definition at line 54 of file fo_cli.c.