root/src/stratcon_iep.h

Revision 2ff4db5a6730270eb30827e23883ed354c42ddf6, 3.4 kB (checked in by Phil Maddox <philip.maddox@circonus.com>, 5 months ago)

Explicitly Initialize Mtev Hash Tables

Rather than using MTEV_HASH_EMPTY or not calling any initialization at
all, explicitly initialize hash tables.

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  * Copyright (c) 2015, Circonus, Inc. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Redistributions in binary form must reproduce the above
13  *       copyright notice, this list of conditions and the following
14  *       disclaimer in the documentation and/or other materials provided
15  *       with the distribution.
16  *     * Neither the name OmniTI Computer Consulting, Inc. nor the names
17  *       of its contributors may be used to endorse or promote products
18  *       derived from this software without specific prior written
19  *       permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #ifndef _NOIT_STRATCON_IEP_H
35 #define _NOIT_STRATCON_IEP_H
36
37 #include <mtev_defines.h>
38
39 #include <sys/types.h>
40 #include <sys/socket.h>
41
42 #include <eventer/eventer.h>
43 #include <mtev_hash.h>
44
45 #include "stratcon_datastore.h"
46 #include "stratcon_jlog_streamer.h"
47
48 API_EXPORT(void)
49   stratcon_iep_init();
50
51 API_EXPORT(void)
52   stratcon_iep_line_processor(stratcon_datastore_op_t op,
53                               struct sockaddr *remote, const char *remote_cn,
54                               void *operand, eventer_t completion);
55
56 API_EXPORT(jlog_streamer_ctx_t *)
57   stratcon_jlog_streamer_iep_ctx_alloc(void);
58
59 typedef enum { MQ_ACTION_SET, MQ_ACTION_FORGET } mq_action_t;
60
61 typedef struct mq_check {
62   char *uuid;
63   int metric_count;
64   char **metrics;
65 } mq_check_t;
66
67 typedef struct mq_command {
68   mq_action_t action;
69   mq_check_t check;
70 } mq_command_t;
71
72 typedef struct iep_thread_driver iep_thread_driver_t;
73
74 typedef struct mq_driver {
75   iep_thread_driver_t *(*allocate)(mtev_conf_section_t);
76
77   int (*connect)(iep_thread_driver_t *driver);
78   /* connect returns:
79       -1 for failure,
80        0 for successful new connection,
81        1 for already connected
82    */
83
84   int (*submit)(iep_thread_driver_t *driver, const char *payload, size_t payloadlen);
85   /* submit returns: 0 on success, -1 on failure */
86
87   int (*disconnect)(iep_thread_driver_t *driver);
88   /* disconnect returns:
89       -1 for already disconnected
90        0 successful discnonect
91    */
92
93   void (*deallocate)(iep_thread_driver_t *driver);
94   void (*set_filters) (mq_command_t *command, int count);
95 } mq_driver_t;
96
97 API_EXPORT(void)
98   stratcon_iep_mq_driver_register(const char *, mq_driver_t *);
99
100 API_EXPORT(int)
101   stratcon_iep_get_enabled();
102
103 API_EXPORT(void)
104   stratcon_iep_set_enabled(int);
105
106 API_EXPORT(void)
107   stratcon_iep_init_globals(void);
108
109 #endif
Note: See TracBrowser for help on using the browser.