summaryrefslogtreecommitdiff
path: root/lib/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/socket.h')
-rw-r--r--lib/socket.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/socket.h b/lib/socket.h
index 96fedeeb..89398edf 100644
--- a/lib/socket.h
+++ b/lib/socket.h
@@ -12,6 +12,7 @@
#include <errno.h>
#include "lib/resource.h"
+#include "lib/event.h"
#ifdef HAVE_LIBSSH
#define LIBSSH_LEGACY_0_4
#include <libssh/libssh.h>
@@ -39,6 +40,7 @@ struct ssh_sock {
typedef struct birdsock {
resource r;
pool *pool; /* Pool where incoming connections should be allocated (for SK_xxx_PASSIVE) */
+ struct birdloop *loop; /* The birdloop where this socket belongs to */
int type; /* Socket type */
int subtype; /* Socket subtype */
void *data; /* User data */
@@ -56,6 +58,8 @@ typedef struct birdsock {
uint fast_rx; /* RX has higher priority in event loop */
uint rbsize;
int (*rx_hook)(struct birdsock *, uint size); /* NULL=receiving turned off, returns 1 to clear rx buffer */
+ struct event_cork *cork; /* Cork to temporarily stop receiving data */
+ node cork_node; /* Node in cork list */
byte *tbuf, *tpos; /* NULL=allocate automatically */
byte *ttx; /* Internal */
@@ -79,6 +83,7 @@ typedef struct birdsock {
const char *password; /* Password for MD5 authentication */
const char *err; /* Error message */
struct ssh_sock *ssh; /* Used in SK_SSH */
+ struct event reloop; /* Reloop event */
} sock;
sock *sock_new(pool *); /* Allocate new socket */
@@ -128,6 +133,7 @@ extern int sk_priority_control; /* Suggested priority for control traffic, shou
#define SKF_TRUNCATED 0x200 /* Received packet was truncated, set by IO layer */
#define SKF_HDRINCL 0x400 /* Used internally */
#define SKF_PKTINFO 0x800 /* Used internally */
+#define SKF_PASSIVE_THREAD 0x1000 /* Child sockets used in thread, do not add to main loop */
/*
* Socket types SA SP DA DP IF TTL SendTo (?=may, -=must not, *=must)