2 * libcollectdclient - src/libcollectdclient/collectd/types.h
3 * Copyright (C) 2008-2017 Florian octo Forster
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 * Florian octo Forster <octo at collectd.org>
27 #ifndef LIBCOLLECTD_COLLECTD_TYPES_H
28 #define LIBCOLLECTD_COLLECTD_TYPES_H 1
30 #include "collectd/lcc_features.h"
32 #include <stdint.h> /* for uint64_t */
33 #include <sys/types.h> /* for size_t */
38 #define LCC_NAME_LEN 64
39 #define LCC_DEFAULT_PORT "25826"
44 #define LCC_TYPE_COUNTER 0
45 #define LCC_TYPE_GAUGE 1
46 #define LCC_TYPE_DERIVE 2
47 #define LCC_TYPE_ABSOLUTE 3
51 typedef uint64_t counter_t;
52 typedef double gauge_t;
53 typedef uint64_t derive_t;
54 typedef uint64_t absolute_t;
62 typedef union value_u value_t;
64 struct lcc_identifier_s {
65 char host[LCC_NAME_LEN];
66 char plugin[LCC_NAME_LEN];
67 char plugin_instance[LCC_NAME_LEN];
68 char type[LCC_NAME_LEN];
69 char type_instance[LCC_NAME_LEN];
71 typedef struct lcc_identifier_s lcc_identifier_t;
72 #define LCC_IDENTIFIER_INIT \
73 { "localhost", "", "", "", "" }
75 struct lcc_value_list_s {
81 lcc_identifier_t identifier;
83 typedef struct lcc_value_list_s lcc_value_list_t;
84 #define LCC_VALUE_LIST_INIT \
85 { NULL, NULL, 0, 0, 0, LCC_IDENTIFIER_INIT }
87 /* lcc_value_list_writer_t is a write callback to which value lists are
89 typedef int (*lcc_value_list_writer_t)(lcc_value_list_t const *);
91 /* lcc_password_lookup_t is a callback for looking up the password for a given
92 * user. Must return NULL if the user is not known. */
93 typedef char const *(*lcc_password_lookup_t)(char const *);
97 #endif /* LIBCOLLECTD_COLLECTD_TYPES_H */