summaryrefslogtreecommitdiff
path: root/decoders/ftp/ftp_decoder_stat.h
diff options
context:
space:
mode:
authorlijia <[email protected]>2024-11-07 09:52:08 +0800
committerlijia <[email protected]>2024-11-18 11:10:22 +0800
commita3d3efc5490c59684036a794b8f63f81b59685ea (patch)
treee4283d083e1172b814412f3af826f1cf1784068e /decoders/ftp/ftp_decoder_stat.h
parentd0a868591470a4a9d71a65a5d540058e72c8d92c (diff)
ftp decoder rebase develop-2.0dev-ftp-v2.0
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