]> git.meshlink.io Git - meshlink/blob - src/meshlink_internal.h
Rename variable handle to mesh.
[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 #include "list.h"
27 #include "splay_tree.h"
28
29 #define MAXSOCKETS 16
30
31 /// A handle for an instance of MeshLink.
32 struct meshlink_handle {
33         char *confbase;
34         char *name;
35
36         meshlink_receive_cb_t receive_cb;
37         meshlink_node_status_cb_t node_status_cb;
38         meshlink_log_cb_t log_cb;
39         meshlink_log_level_t log_level;
40
41         pthread_t thread;
42         struct list_t *sockets;
43
44         struct node_t *myself;
45
46         struct splay_tree_t *config;
47         struct splay_tree_t *edges;
48         struct splay_tree_t *nodes;
49
50         struct list_t *outgoing_connections;
51 };
52
53 /// A handle for a MeshLink node.
54 struct meshlink_node {
55         const char *name;
56         void *priv;
57 };
58
59 #endif // MESHLINK_INTERNAL_H