summaryrefslogtreecommitdiff
path: root/src/core/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/socket.h')
-rw-r--r--src/core/socket.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/socket.h b/src/core/socket.h
index 6c32d67bef..2fe38ef2aa 100644
--- a/src/core/socket.h
+++ b/src/core/socket.h
@@ -20,6 +20,7 @@
***/
typedef struct Socket Socket;
+typedef struct SocketPeer SocketPeer;
#include "mount.h"
#include "service.h"
@@ -79,9 +80,12 @@ struct Socket {
LIST_HEAD(SocketPort, ports);
+ Hashmap *peers_by_address;
+
unsigned n_accepted;
unsigned n_connections;
unsigned max_connections;
+ unsigned max_connections_per_source;
unsigned backlog;
unsigned keep_alive_cnt;
@@ -164,6 +168,18 @@ struct Socket {
RateLimit trigger_limit;
};
+struct SocketPeer {
+ unsigned n_ref;
+
+ Socket *socket;
+ union sockaddr_union peer;
+};
+
+SocketPeer *socket_peer_ref(SocketPeer *p);
+SocketPeer *socket_peer_unref(SocketPeer *p);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(SocketPeer*, socket_peer_unref);
+
/* Called from the service code when collecting fds */
int socket_collect_fds(Socket *s, int **fds);