summaryrefslogtreecommitdiff
path: root/decoders/ftp/ftp_decoder_stat.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoders/ftp/ftp_decoder_stat.h')
-rw-r--r--decoders/ftp/ftp_decoder_stat.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/decoders/ftp/ftp_decoder_stat.h b/decoders/ftp/ftp_decoder_stat.h
new file mode 100644
index 0000000..b477950
--- /dev/null
+++ b/decoders/ftp/ftp_decoder_stat.h
@@ -0,0 +1,43 @@
+#pragma once
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <fieldstat/fieldstat_easy.h>
+#include "stellar/ftp.h"
+
+ enum ftp_decoder_stat_type
+ {
+ FTPD_STAT_CTRL_LINK_NEW = 0,
+ FTPD_STAT_CTRL_LINK_FREE,
+ FTPD_STAT_DATA_LINK_NEW,
+ FTPD_STAT_DATA_LINK_FREE,
+ FTPD_STAT_NEGOTIATE_DATA_LINK, // Negotiating by PORT or PASV command in ctrl link
+ FTPD_STAT_CTRL_LINK_BYTES_C2S,
+ FTPD_STAT_CTRL_LINK_BYTES_S2C,
+ FTPD_STAT_DATA_LINK_BYTES_C2S,
+ FTPD_STAT_DATA_LINK_BYTES_S2C,
+ FTPD_STAT_DATA_LINK_HTABLE_ITEMS,
+ FTPD_STAT_CTRL_CMD,
+ FTPD_STAT_MAX,
+ };
+
+ struct ftpd_stat_name_id_tuple
+ {
+ enum ftp_decoder_stat_type type;
+ const char *name;
+ };
+
+ struct ftp_decoder_stat
+ {
+ struct fieldstat_easy *fs4_instance;
+ int fs4_counter_id[FTPD_STAT_MAX];
+ };
+ int ftp_decoder_stat_init(struct module_manager *mod_mgr, struct ftp_decoder *ftp_env);
+ void ftp_decoder_stat_free(struct ftp_decoder *ftp_env);
+ void ftp_decoder_stat_incrby(int thread_idx, struct ftp_decoder *ftp_env, enum ftp_decoder_stat_type stattype, long long increment);
+
+#ifdef __cplusplus
+}
+#endif