Server Wait On Clients System - Full Internal Documentation v1.7.2
Server Wait On Clients System.
Loading...
Searching...
No Matches
internal.h
Go to the documentation of this file.
1
14#ifndef SWOCSERVERD_INTERNAL_H
15#define SWOCSERVERD_INTERNAL_H
16
17#include <limits.h>
18
19/* Standard GNU AC_HEADER_STDBOOL ifdeffery. */
20#ifdef HAVE_STDBOOL_H
21 #include <stdbool.h>
22#else
23 #ifndef HAVE__BOOL
24 #ifdef __cplusplus /* clang-format off */
25 typedef bool _Bool; /* clang-format on */
26 #else
27 #define _Bool signed char
28 #endif
29 #endif
30 #define bool _Bool
31 #define false 0
32 #define true 1
33 #define __bool_true_false_are_defined 1
34#endif
35
36#include <libmgec/mge-bstree.h>
37#include <libmgec/mge-message.h>
38#include <libmgec/mge-portability.h>
39#include <swoc/libswoccommon.h>
40
41BEGIN_C_DECLS
42
43#define MAX_LISTEN_PORTS 10
44#define MAX_EPOLL_EVENTS 64
49struct comm_spec {
50 int portno;
52};
53
54extern int swsd_err;
55extern char client[_POSIX_HOST_NAME_MAX];
56extern int debug;
57extern int end;
58extern int cursockfd;
59extern struct comm_spec *port_spec;
60extern bool srv_blocked;
61extern struct bstree *cli_locks, *cli_blocked, *port_sock;
62
63int swsd_validate_config(void);
64
65int prepare_sockets(void);
66
67int process_comms(void);
68
69int srv_end_req(struct mgemessage *msg, enum msg_arguments *msg_args);
70
71int srv_status_req(struct mgemessage *msg, enum msg_arguments *msg_args);
72
73int srv_cli_blocklist_req(struct mgemessage *msg, enum msg_arguments *msg_args);
74
75int srv_cli_block_req(struct mgemessage *msg, enum msg_arguments *msg_args);
76
77int srv_cli_unblock_req(struct mgemessage *msg, enum msg_arguments *msg_args);
78
79int srv_block_req(struct mgemessage *msg, enum msg_arguments *msg_args);
80
81int srv_unblock_req(struct mgemessage *msg, enum msg_arguments *msg_args);
82
83int srv_block_status_req(struct mgemessage *msg, enum msg_arguments *msg_args);
84
85int cli_block_req(struct mgemessage *msg, enum msg_arguments *msg_args);
86
87int cli_unblock_req(struct mgemessage *msg, enum msg_arguments *msg_args);
88
89int cli_srv_block_status_req(struct mgemessage *msg,
90 enum msg_arguments *msg_args);
91
92int srv_cli_rel_req(struct mgemessage *msg, enum msg_arguments *msg_args);
93
94int cli_lock_req(struct mgemessage *msg, enum msg_arguments *msg_args);
95
96int cli_rel_req(struct mgemessage *msg, enum msg_arguments *msg_args);
97
98int srv_reload_req(struct mgemessage *msg, enum msg_arguments *msg_args);
99
100int swsd_reload_config(void);
101
102int cli_status_req(struct mgemessage *msg, enum msg_arguments *msg_args);
103
104int cli_reset_req(struct mgemessage *msg, enum msg_arguments *msg_args);
105
106void id_req(struct mgemessage *msg, enum msg_arguments *msg_args);
107
108__attribute__((const)) const char *swocserverd_get_pkg_version(void);
109
110__attribute__((const)) const char *swocserverd_get_src_version(void);
111
113
115
116END_C_DECLS
117
118#endif /* ndef SWOCSERVERD_INTERNAL_H */
BEGIN_C_DECLS __attribute__((const)) const char *swocclient_get_pkg_version(void)
Get the git-describe based package version.
Definition version.c:24
Internal header file for Server Wait on Client common library.
msg_arguments
enum specifying error status of arguments.
Definition libswoccommon.h:63
int srv_reload_req(struct mgemessage *msg, enum msg_arguments *msg_args)
swocserver request to reload config file.
Definition request.c:90
int cli_block_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Client block further locks request.
Definition request.c:489
int cli_reset_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Reset request from client.
Definition request.c:763
int cli_srv_block_status_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Client requests status of server level blocking.
Definition request.c:583
int srv_cli_rel_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Server requests client lock release.
Definition request.c:264
int srv_cli_unblock_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Server requests client to be unblocked.
Definition request.c:358
void id_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Server or client submits id.
Definition request.c:810
struct bstree * cli_blocked
Definition internal.h:61
int swsd_validate_config(void)
Parse and validate the config file.
Definition validateconfig.c:34
int srv_cli_blocklist_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Server client block list request.
Definition request.c:212
bool srv_blocked
Server is blocked?
Definition main.c:57
char client[_POSIX_HOST_NAME_MAX]
Client name.
Definition main.c:52
int cli_status_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Status request from client.
Definition request.c:706
int srv_status_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Server status request.
Definition request.c:145
struct bstree * cli_locks
Clients and locks.
Definition main.c:58
struct comm_spec * port_spec
Port / socket config mappings.
Definition main.c:56
int srv_block_status_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Server requests status of server level blocking.
Definition request.c:459
int cursockfd
Socket file descriptor in use.
Definition main.c:55
int swsd_reload_config(void)
Reload the config file.
Definition request.c:118
struct bstree * port_sock
Definition internal.h:61
int srv_block_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Server requests server level blocking.
Definition request.c:404
int srv_cli_block_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Server requests client to be blocked.
Definition request.c:310
int cli_unblock_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Client unblock further locks request.
Definition request.c:538
int cli_lock_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Client lock request.
Definition request.c:596
int srv_unblock_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Server requests removal of server level blocking.
Definition request.c:431
int end
End pending.
Definition main.c:54
int debug
Debug - 0 false, 1 true.
Definition main.c:53
void swocserverd_print_src_version(void)
Print the source version string to stdout.
Definition version.c:49
int cli_rel_req(struct mgemessage *msg, enum msg_arguments *msg_args)
Release request from client.
Definition request.c:662
int srv_end_req(struct mgemessage *msg, enum msg_arguments *msg_args)
swocserver requesting the daemon to terminate.
Definition request.c:55
void swocserverd_print_pkg_version(void)
Print the package version string to stdout.
Definition version.c:40
int swsd_err
swoc daemon error number.
Definition main.c:51
#define _Bool
Definition internal.h:27
int process_comms(void)
Wait and then process communications.
Definition comms.c:158
int prepare_sockets(void)
Prepare all sockets.
Definition comms.c:60
Map sockets to ports.
Definition internal.h:49
int socketfd
Socket file descriptor.
Definition internal.h:51
int portno
Port number.
Definition internal.h:50