chiark / gitweb /
sd-rtnl: use GREEDY_REALLOC for message queues
[elogind.git] / src / libsystemd / sd-rtnl / rtnl-internal.h
index 21a270aecdd53d5ee77f69111450623d014360fb..9003dad312c09b7b37191afe24abe9681732a54f 100644 (file)
@@ -29,6 +29,8 @@
 
 #include "sd-rtnl.h"
 
+#include "rtnl-types.h"
+
 #define RTNL_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC))
 
 #define RTNL_WQUEUE_MAX 1024
@@ -64,9 +66,11 @@ struct sd_rtnl {
 
         sd_rtnl_message **rqueue;
         unsigned rqueue_size;
+        size_t rqueue_allocated;
 
         sd_rtnl_message **wqueue;
         unsigned wqueue_size;
+        size_t wqueue_allocated;
 
         bool processing:1;
 
@@ -91,6 +95,7 @@ struct sd_rtnl_message {
         sd_rtnl *rtnl;
 
         struct nlmsghdr *hdr;
+        const struct NLTypeSystem *(container_type_system[RTNL_CONTAINER_DEPTH]); /* the type of the container and all its parents */
         size_t container_offsets[RTNL_CONTAINER_DEPTH]; /* offset from hdr to each container's start */
         unsigned n_containers; /* number of containers */
         size_t next_rta_offset; /* offset from hdr to next rta */
@@ -99,7 +104,7 @@ struct sd_rtnl_message {
         bool sealed:1;
 };
 
-int message_new(sd_rtnl *rtnl, sd_rtnl_message **ret, size_t initial_size);
+int message_new(sd_rtnl *rtnl, sd_rtnl_message **ret, uint16_t type);
 
 int socket_write_message(sd_rtnl *nl, sd_rtnl_message *m);
 int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret);