]> git.meshlink.io Git - meshlink/blob - src/meshlink_internal.h
Start of implementation of meshlink_open().
[meshlink] / src / meshlink_internal.h
1 /*
2     meshlink_internal.h -- Internal parts of the public API.
3     Copyright (C) 2014 Guus Sliepen <guus@meshlink.io>
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License along
16     with this program; if not, write to the Free Software Foundation, Inc.,
17     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef MESHLINK_INTERNAL_H
21 #define MESHLINK_INTERNAL_H
22
23 #include "system.h"
24
25 #include "meshlink.h"
26
27 /// A handle for an instance of MeshLink.
28 struct meshlink_handle {
29         char *confbase;
30         char *name;
31
32         meshlink_receive_cb_t receive_cb;
33         meshlink_node_status_cb_t node_status_cb;
34         meshlink_log_cb_t log_cb;
35         meshlink_log_level_t log_level;
36
37         pthread_t thread;
38         struct list_t *sockets;
39
40         struct node_t *self;
41
42         struct splay_tree_t *config;
43         struct splay_tree_t *edges;
44         struct splay_tree_t *nodes;
45
46         struct list_t *outgoing_connections;
47 };
48
49 /// A handle for a MeshLink node.
50 struct meshlink_node {
51         const char *name;
52         void *priv;
53 };
54
55 #endif // MESHLINK_INTERNAL_H