#include "event.h"
#include "hash.h"
-#include "logger.h"
#include "meshlink.h"
+#include "meshlink_queue.h"
#include "sockaddr.h"
#include "sptps.h"
/// A handle for an instance of MeshLink.
struct meshlink_handle {
char *name;
+ char *appname;
+ dclass_t dclass;
void *priv;
char *confbase;
struct list_t *connections;
struct list_t *outgoings;
- struct list_t *outpacketqueue;
+ meshlink_queue_t outpacketqueue;
struct splay_tree_t *past_request_tree;
timeout_t past_request_timeout;
struct connection_t *everyone;
struct ecdsa *invitation_key;
- debug_t debug_level;
int pinginterval; /* seconds between pings */
int pingtimeout; /* seconds to wait for response */
int maxtimeout;
struct AvahiSServiceBrowser *avahi_browser;
struct AvahiSimplePoll *avahi_poll;
struct AvahiSEntryGroup *avahi_group;
+ char* avahi_servicetype;
};
/// A handle for a MeshLink node.
} __attribute__ ((__packed__)) meshlink_packethdr_t;
extern void meshlink_send_from_queue(event_loop_t* el,meshlink_handle_t *mesh);
+extern meshlink_log_level_t global_log_level;
+extern meshlink_log_cb_t global_log_cb;
+extern int cweight_from_dclass(dclass_t dclass);
+extern int max_ccount_from_dclass(dclass_t dclass);
+extern bool dclass_ccounts_satisfied(dclass_t dclass, splay_tree_t* counts, int total_count);
+
+typedef struct {
+ dclass_t dclass;
+ int ccount;
+} dclass_ccount_t;
+
+extern int dclass_ccount_compare(const void *a, const void *b);
+extern dclass_ccount_t* dclass_ccount_alloc();
+extern void dclass_ccount_delete(void *c);
#endif // MESHLINK_INTERNAL_H