Code

ff29b9a95dd5890f26df3b8a0ae9fbe5f9ab74f8
[collectd.git] / src / libcollectdclient / collectd / network.h
1 /**
2  * collectd - src/libcollectdclient/network.h
3  * Copyright (C) 2005-2010  Florian octo Forster
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation; only version 2.1 of the License is
8  * applicable.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  *
19  * Authors:
20  *   Florian octo Forster <octo at verplant.org>
21  **/
23 #ifndef LIBCOLLECTDCLIENT_NETWORK_H
24 #define LIBCOLLECTDCLIENT_NETWORK_H 1
26 #include <stdint.h>
27 #include <inttypes.h>
29 #include "client.h"
31 #define NET_DEFAULT_V4_ADDR "239.192.74.66"
32 #define NET_DEFAULT_V6_ADDR "ff18::efc0:4a42"
33 #define NET_DEFAULT_PORT    "25826"
35 struct lcc_network_s;
36 typedef struct lcc_network_s lcc_network_t;
38 struct lcc_server_s;
39 typedef struct lcc_server_s lcc_server_t;
41 enum lcc_security_level_e
42 {
43   NONE,
44   SIGN,
45   ENCRYPT
46 };
47 typedef enum lcc_security_level_e lcc_security_level_t;
49 /*
50  * Create / destroy object
51  */
52 lcc_network_t *lcc_network_create (void);
53 void lcc_network_destroy (lcc_network_t *net);
55 /* 
56  * Add servers
57  */
58 lcc_server_t *lcc_server_create (lcc_network_t *net,
59     const char *node, const char *service);
60 int lcc_server_destroy (lcc_network_t *net, lcc_server_t *srv);
62 /* Configure servers */
63 int lcc_server_set_ttl (lcc_server_t *srv, uint8_t ttl);
64 int lcc_server_set_security_level (lcc_server_t *srv,
65     lcc_security_level_t level,
66     const char *username, const char *password);
68 /*
69  * Send data
70  */
71 int lcc_network_values_send (lcc_network_t *net,
72     const lcc_value_list_t *vl);
73 #if 0
74 int lcc_network_notification_send (lcc_network_t *net,
75     const lcc_notification_t *notif);
76 #endif
78 /* vim: set sw=2 sts=2 et : */
79 #endif /* LIBCOLLECTDCLIENT_NETWORK_H */