summaryrefslogtreecommitdiff
path: root/src/ftp_decoder_stat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ftp_decoder_stat.h')
-rw-r--r--src/ftp_decoder_stat.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ftp_decoder_stat.h b/src/ftp_decoder_stat.h
new file mode 100644
index 0000000..bfca60c
--- /dev/null
+++ b/src/ftp_decoder_stat.h
@@ -0,0 +1,28 @@
+#pragma once
+#include <fieldstat/fieldstat_easy.h>
+
+enum ftp_decoder_stat_type{
+ FTPD_STAT_CTRL_LINK_OPEN = 0,
+ FTPD_STAT_CTRL_LINK_CLOSE,
+ FTPD_STAT_DATA_LINK_OPEN,
+ FTPD_STAT_DATA_LINK_CLOSE,
+ 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_CTRL_CMD,
+
+ FTPD_STAT_MAX,
+};
+
+
+struct ftpd_stat_config_tuple
+{
+ enum ftp_decoder_stat_type type;
+ const char *name;
+};
+
+int ftp_decoder_stat_init(struct ftp_decoder_env *fenv);
+void ftp_decoder_stat_free(struct ftp_decoder_env *fenv);
+void ftp_decoder_stat_incrby(int thread_idx, struct ftp_decoder_env *fenv, enum ftp_decoder_stat_type stattype, long long increment); \ No newline at end of file