summaryrefslogtreecommitdiff
path: root/common/include/kafka.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/include/kafka.h')
-rw-r--r--common/include/kafka.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/common/include/kafka.h b/common/include/kafka.h
new file mode 100644
index 0000000..4a242ed
--- /dev/null
+++ b/common/include/kafka.h
@@ -0,0 +1,31 @@
+#ifndef _KAFKA_H
+#define _KAFKA_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+enum topic_idx
+{
+ TOPIC_RULE_HITS,
+ TOPIC_PROXY_EVENT,
+ TOPIC_FILE_STREAM,
+ TOPIC_EXCH_CERT,
+
+ // add more topic here
+
+ MAX_TOPIC_NUM,
+};
+
+struct kafka *kafka_create(const char *profile);
+void kafka_destroy(struct kafka *handle);
+// return 0: if success
+// return -1: if failed
+int kafka_send(struct kafka *handle, enum topic_idx idx, const char *data, int len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif