GNUnet  0.10.x
Data Fields
GNUNET_SERVICE_Handle Struct Reference

Handle to a service. More...

Collaboration diagram for GNUNET_SERVICE_Handle:
[legend]

Data Fields

const struct GNUNET_CONFIGURATION_Handlecfg
 Our configuration. More...
 
const char * service_name
 Name of our service. More...
 
GNUNET_SERVICE_InitCallback service_init_cb
 Main service-specific task to run. More...
 
GNUNET_SERVICE_ConnectHandler connect_cb
 Function to call when clients connect. More...
 
GNUNET_SERVICE_DisconnectHandler disconnect_cb
 Function to call when clients disconnect / are disconnected. More...
 
void * cb_cls
 Closure for service_init_cb, connect_cb, disconnect_cb. More...
 
struct ServiceListenContextslc_head
 DLL of listen sockets used to accept new connections. More...
 
struct ServiceListenContextslc_tail
 DLL of listen sockets used to accept new connections. More...
 
struct GNUNET_SERVICE_Clientclients_head
 Our clients, kept in a DLL. More...
 
struct GNUNET_SERVICE_Clientclients_tail
 Our clients, kept in a DLL. More...
 
struct GNUNET_MQ_MessageHandlerhandlers
 Message handlers to use for all clients. More...
 
void * task_cls
 Closure for task. More...
 
struct GNUNET_STRINGS_IPv4NetworkPolicyv4_denied
 IPv4 addresses that are not allowed to connect. More...
 
struct GNUNET_STRINGS_IPv6NetworkPolicyv6_denied
 IPv6 addresses that are not allowed to connect. More...
 
struct GNUNET_STRINGS_IPv4NetworkPolicyv4_allowed
 IPv4 addresses that are allowed to connect (if not set, all are allowed). More...
 
struct GNUNET_STRINGS_IPv6NetworkPolicyv6_allowed
 IPv6 addresses that are allowed to connect (if not set, all are allowed). More...
 
int match_uid
 Do we require a matching UID for UNIX domain socket connections? GNUNET_NO means that the UID does not have to match (however, match_gid may still impose other access control checks). More...
 
int match_gid
 Do we require a matching GID for UNIX domain socket connections? Ignored if match_uid is GNUNET_YES. More...
 
enum SuspendReason suspend_state
 Are we suspended, and if so, why? More...
 
enum GNUNET_SERVICE_Options options
 Our options. More...
 
int ready_confirm_fd
 If we are daemonizing, this FD is set to the pipe to the parent. More...
 
int ret
 Overall success/failure of the service start. More...
 
int require_found
 If GNUNET_YES, consider unknown message types an error where the client is disconnected. More...
 

Detailed Description

Handle to a service.

Definition at line 116 of file service.c.

Field Documentation

◆ cfg

const struct GNUNET_CONFIGURATION_Handle* GNUNET_SERVICE_Handle::cfg

◆ service_name

const char* GNUNET_SERVICE_Handle::service_name

◆ service_init_cb

GNUNET_SERVICE_InitCallback GNUNET_SERVICE_Handle::service_init_cb

Main service-specific task to run.

Definition at line 131 of file service.c.

Referenced by GNUNET_SERVICE_run_(), and service_main().

◆ connect_cb

GNUNET_SERVICE_ConnectHandler GNUNET_SERVICE_Handle::connect_cb

Function to call when clients connect.

Definition at line 136 of file service.c.

Referenced by GNUNET_SERVICE_run_(), GNUNET_SERVICE_start(), and start_client().

◆ disconnect_cb

GNUNET_SERVICE_DisconnectHandler GNUNET_SERVICE_Handle::disconnect_cb

Function to call when clients disconnect / are disconnected.

Definition at line 141 of file service.c.

Referenced by GNUNET_SERVICE_client_drop(), GNUNET_SERVICE_run_(), and GNUNET_SERVICE_start().

◆ cb_cls

void* GNUNET_SERVICE_Handle::cb_cls

Closure for service_init_cb, connect_cb, disconnect_cb.

Definition at line 146 of file service.c.

Referenced by GNUNET_SERVICE_client_drop(), GNUNET_SERVICE_run_(), GNUNET_SERVICE_start(), service_main(), and start_client().

◆ slc_head

struct ServiceListenContext* GNUNET_SERVICE_Handle::slc_head

DLL of listen sockets used to accept new connections.

Definition at line 151 of file service.c.

Referenced by do_resume(), do_suspend(), setup_service(), and teardown_service().

◆ slc_tail

struct ServiceListenContext* GNUNET_SERVICE_Handle::slc_tail

DLL of listen sockets used to accept new connections.

Definition at line 156 of file service.c.

Referenced by setup_service(), and teardown_service().

◆ clients_head

struct GNUNET_SERVICE_Client* GNUNET_SERVICE_Handle::clients_head

Our clients, kept in a DLL.

Definition at line 161 of file service.c.

Referenced by GNUNET_SERVICE_client_drop(), GNUNET_SERVICE_shutdown(), GNUNET_SERVICE_stop(), have_non_monitor_clients(), and start_client().

◆ clients_tail

struct GNUNET_SERVICE_Client* GNUNET_SERVICE_Handle::clients_tail

Our clients, kept in a DLL.

Definition at line 166 of file service.c.

Referenced by GNUNET_SERVICE_client_drop(), and start_client().

◆ handlers

struct GNUNET_MQ_MessageHandler* GNUNET_SERVICE_Handle::handlers

Message handlers to use for all clients.

Definition at line 171 of file service.c.

Referenced by GNUNET_SERVICE_run_(), GNUNET_SERVICE_start(), GNUNET_SERVICE_stop(), and start_client().

◆ task_cls

void* GNUNET_SERVICE_Handle::task_cls

Closure for task.

Definition at line 176 of file service.c.

◆ v4_denied

struct GNUNET_STRINGS_IPv4NetworkPolicy* GNUNET_SERVICE_Handle::v4_denied

IPv4 addresses that are not allowed to connect.

Definition at line 181 of file service.c.

Referenced by accept_client(), setup_service(), and teardown_service().

◆ v6_denied

struct GNUNET_STRINGS_IPv6NetworkPolicy* GNUNET_SERVICE_Handle::v6_denied

IPv6 addresses that are not allowed to connect.

Definition at line 186 of file service.c.

Referenced by accept_client(), setup_service(), and teardown_service().

◆ v4_allowed

struct GNUNET_STRINGS_IPv4NetworkPolicy* GNUNET_SERVICE_Handle::v4_allowed

IPv4 addresses that are allowed to connect (if not set, all are allowed).

Definition at line 192 of file service.c.

Referenced by accept_client(), setup_service(), and teardown_service().

◆ v6_allowed

struct GNUNET_STRINGS_IPv6NetworkPolicy* GNUNET_SERVICE_Handle::v6_allowed

IPv6 addresses that are allowed to connect (if not set, all are allowed).

Definition at line 198 of file service.c.

Referenced by accept_client(), setup_service(), and teardown_service().

◆ match_uid

int GNUNET_SERVICE_Handle::match_uid

Do we require a matching UID for UNIX domain socket connections? GNUNET_NO means that the UID does not have to match (however, match_gid may still impose other access control checks).

Definition at line 205 of file service.c.

Referenced by setup_service().

◆ match_gid

int GNUNET_SERVICE_Handle::match_gid

Do we require a matching GID for UNIX domain socket connections? Ignored if match_uid is GNUNET_YES.

Note that this is about checking that the client's UID is in our group OR that the client's GID is our GID. If both "match_gid" and match_uid are GNUNET_NO, all users on the local system have access.

Definition at line 214 of file service.c.

Referenced by setup_service().

◆ suspend_state

enum SuspendReason GNUNET_SERVICE_Handle::suspend_state

◆ options

enum GNUNET_SERVICE_Options GNUNET_SERVICE_Handle::options

Our options.

Definition at line 224 of file service.c.

Referenced by GNUNET_SERVICE_run_(), service_main(), and service_shutdown().

◆ ready_confirm_fd

int GNUNET_SERVICE_Handle::ready_confirm_fd

If we are daemonizing, this FD is set to the pipe to the parent.

Send '.' if we started ok, '!' if not. -1 if we are not daemonizing.

Definition at line 231 of file service.c.

Referenced by detach_terminal(), GNUNET_SERVICE_run_(), and service_main().

◆ ret

int GNUNET_SERVICE_Handle::ret

Overall success/failure of the service start.

Definition at line 236 of file service.c.

Referenced by GNUNET_SERVICE_run_().

◆ require_found

int GNUNET_SERVICE_Handle::require_found

If GNUNET_YES, consider unknown message types an error where the client is disconnected.

Definition at line 242 of file service.c.

Referenced by service_mq_error_handler(), and setup_service().


The documentation for this struct was generated from the following file: