GNUnet  0.20.0
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 117 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

Name of our service.

Definition at line 127 of file service.c.

◆ service_init_cb

GNUNET_SERVICE_InitCallback GNUNET_SERVICE_Handle::service_init_cb

Main service-specific task to run.

Definition at line 132 of file service.c.

◆ connect_cb

GNUNET_SERVICE_ConnectHandler GNUNET_SERVICE_Handle::connect_cb

Function to call when clients connect.

Definition at line 137 of file service.c.

◆ disconnect_cb

GNUNET_SERVICE_DisconnectHandler GNUNET_SERVICE_Handle::disconnect_cb

Function to call when clients disconnect / are disconnected.

Definition at line 142 of file service.c.

◆ cb_cls

void* GNUNET_SERVICE_Handle::cb_cls

Closure for service_init_cb, connect_cb, disconnect_cb.

Definition at line 147 of file service.c.

◆ slc_head

struct ServiceListenContext* GNUNET_SERVICE_Handle::slc_head

DLL of listen sockets used to accept new connections.

Definition at line 152 of file service.c.

◆ slc_tail

struct ServiceListenContext* GNUNET_SERVICE_Handle::slc_tail

DLL of listen sockets used to accept new connections.

Definition at line 157 of file service.c.

◆ clients_head

struct GNUNET_SERVICE_Client* GNUNET_SERVICE_Handle::clients_head

Our clients, kept in a DLL.

Definition at line 162 of file service.c.

Referenced by GNUNET_SERVICE_stop().

◆ clients_tail

struct GNUNET_SERVICE_Client* GNUNET_SERVICE_Handle::clients_tail

Our clients, kept in a DLL.

Definition at line 167 of file service.c.

◆ handlers

struct GNUNET_MQ_MessageHandler* GNUNET_SERVICE_Handle::handlers

Message handlers to use for all clients.

Definition at line 172 of file service.c.

Referenced by GNUNET_SERVICE_stop().

◆ task_cls

void* GNUNET_SERVICE_Handle::task_cls

Closure for task.

Definition at line 177 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 183 of file service.c.

◆ v6_denied

struct GNUNET_STRINGS_IPv6NetworkPolicy* GNUNET_SERVICE_Handle::v6_denied

IPv6 addresses that are not allowed to connect.

Definition at line 188 of file service.c.

◆ 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 194 of file service.c.

◆ 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 200 of file service.c.

◆ 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 207 of file service.c.

◆ 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 216 of file service.c.

◆ suspend_state

enum SuspendReason GNUNET_SERVICE_Handle::suspend_state

Are we suspended, and if so, why?

Definition at line 216 of file service.c.

Referenced by GNUNET_SERVICE_client_mark_monitor().

◆ options

◆ 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 233 of file service.c.

◆ ret

int GNUNET_SERVICE_Handle::ret

Overall success/failure of the service start.

Definition at line 238 of file service.c.

◆ 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 244 of file service.c.


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