FOSSology
4.4.0
Open Source License Compliance by Open Source Software
|
Scheduler interface operations. More...
#include <agent.h>
#include <database.h>
#include <event.h>
#include <interface.h>
#include <job.h>
#include <logging.h>
#include <scheduler.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <fcntl.h>
#include <pthread.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <glib.h>
#include <gio/gio.h>
Go to the source code of this file.
Classes | |
struct | interface_connection |
Macros | |
#define | FIELD_WIDTH 10 |
#define | BUFFER_SIZE 1024 |
#define | netw g_output_stream_write |
#define | PROXY_PROTOCOL "socks5" |
#define | PROXY_DEFAULT_PORT 1080 |
Typedefs | |
typedef struct interface_connection | interface_connection |
Functions | |
static interface_connection * | interface_conn_init (GSocketConnection *conn, GThreadPool *threads) |
static void | interface_conn_destroy (interface_connection *inter) |
Free the memory associated with an interface connection. More... | |
void | interface_thread (interface_connection *conn, scheduler_t *scheduler) |
Function that will run the thread associated with a particular interface instance. More... | |
void * | interface_listen_thread (scheduler_t *scheduler) |
Function that will listen for new connections to the server sockets. More... | |
void | interface_init (scheduler_t *scheduler) |
Create the interface thread and thread pool that handle UI connections. More... | |
void | interface_destroy (scheduler_t *scheduler) |
Closes the server socket and thread pool that service UI connections. More... | |
Scheduler interface operations.
Definition in file interface.c.
typedef struct interface_connection interface_connection |
Data needed to manage the connection between the scheduler any type of interface. This includes the thread, the socket and the GInputStream and GOutputStream
|
static |
Free the memory associated with an interface connection.
inter | the interface_connection that should be freed |
Definition at line 92 of file interface.c.
|
static |
Given a new socket, this will create the interface connection structure.
conn | The socket that this interface is connected to |
threads | Thread pool handling sockets |
Definition at line 71 of file interface.c.
void interface_destroy | ( | scheduler_t * | scheduler | ) |
Closes the server socket and thread pool that service UI connections.
Definition at line 588 of file interface.c.
void interface_init | ( | scheduler_t * | scheduler | ) |
Create the interface thread and thread pool that handle UI connections.
The GUI and the CLI use a socket connection to communicate with the scheduler. This function creates the socket connection as well as everything needed to handle incoming connections and messages.
Definition at line 554 of file interface.c.
void* interface_listen_thread | ( | scheduler_t * | scheduler | ) |
Function that will listen for new connections to the server sockets.
This creates a g_socket_listener and will loop waiting for new connections until the scheduler is closed.
scheduler | Relevant scheduler structure |
Definition at line 494 of file interface.c.
void interface_thread | ( | interface_connection * | conn, |
scheduler_t * | scheduler | ||
) |
Function that will run the thread associated with a particular interface instance.
Since multiple different command line a graphical user interfaces can exists simultaneously, this allows the scheduler to quickly perform any requests.
Handle commands:
Command | Description |
---|---|
exit | Close connection with scheduler |
kill | Kill a particular job |
load | Get the host status |
close | Shutdown the scheduler |
pause | Pause a job that is currently running |
reload | Reload configuration information |
status | Request status for scheduler or job |
restart | Restart a paused job |
verbose | Change verbose level for scheduler or job |
priority | Change the priority of job |
database | Check the database job queue |
conn | Pointer to the interface_connection structure |
scheduler | Pointer to the relevant scheduler structure |
Definition at line 126 of file interface.c.