tor  0.4.1.0-alpha-dev
alertsock.h
Go to the documentation of this file.
1 /* Copyright (c) 2003-2004, Roger Dingledine
2  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3  * Copyright (c) 2007-2019, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
5 
12 #ifndef TOR_ALERTSOCK_H
13 #define TOR_ALERTSOCK_H
14 
15 #include "orconfig.h"
16 #include "lib/net/nettypes.h"
17 #include "lib/cc/torint.h"
18 
21 typedef struct alert_sockets_t {
22  /* XXXX This structure needs a better name. */
34 
35 /* Flags to disable one or more alert_sockets backends. */
36 #define ASOCKS_NOEVENTFD2 (1u<<0)
37 #define ASOCKS_NOEVENTFD (1u<<1)
38 #define ASOCKS_NOPIPE2 (1u<<2)
39 #define ASOCKS_NOPIPE (1u<<3)
40 #define ASOCKS_NOSOCKETPAIR (1u<<4)
41 
42 int alert_sockets_create(alert_sockets_t *socks_out, uint32_t flags);
44 
45 #endif
Integer definitions used throughout Tor.
tor_socket_t write_fd
Definition: alertsock.h:28
Declarations for types used throughout the Tor networking system.
void alert_sockets_close(alert_sockets_t *socks)
Definition: alertsock.c:283
#define tor_socket_t
Definition: nettypes.h:36
struct alert_sockets_t alert_sockets_t
int(* alert_fn)(tor_socket_t write_fd)
Definition: alertsock.h:30
int alert_sockets_create(alert_sockets_t *socks_out, uint32_t flags)
Definition: alertsock.c:191
tor_socket_t read_fd
Definition: alertsock.h:26
int(* drain_fn)(tor_socket_t read_fd)
Definition: alertsock.h:32