summaryrefslogtreecommitdiff
path: root/decoders/ftp/ftp_decoder_util.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_util.h
parentd0a868591470a4a9d71a65a5d540058e72c8d92c (diff)
ftp decoder rebase develop-2.0dev-ftp-v2.0
Diffstat (limited to 'decoders/ftp/ftp_decoder_util.h')
-rw-r--r--decoders/ftp/ftp_decoder_util.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/decoders/ftp/ftp_decoder_util.h b/decoders/ftp/ftp_decoder_util.h
new file mode 100644
index 0000000..004b922
--- /dev/null
+++ b/decoders/ftp/ftp_decoder_util.h
@@ -0,0 +1,35 @@
+#pragma once
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <string.h>
+#include <bits/types/struct_iovec.h>
+#include "stellar/ftp.h"
+
+#ifndef MAX
+#define MAX(a, b) ((a) >= (b) ? (a) : (b))
+#endif
+#ifndef MIN
+#define MIN(a, b) ((a) >= (b) ? (b) : (a))
+#endif
+
+#ifndef fstring
+ typedef struct iovec fstring;
+#endif
+
+ void fstring_dup(fstring *dst, const fstring *src);
+ void fstring_safe_dup(fstring *dst, const fstring *src);
+ void ftp_strtolower(char *str, size_t len);
+ int ftp_mkdir_p(const char *path, mode_t mode);
+ struct ftp_decoder_exdata *ftp_exdata_deep_clone(const struct ftp_decoder_exdata *src);
+ size_t ftp_strip_crlf(const char *payload, size_t len);
+ const char *ftp_command_type_to_string(enum ftp_command cmd_type);
+ const char *ftp_reply_type_to_string(enum ftp_reply_code reply_type);
+ struct ftp_dtp *ftp_dtp_deep_clone(const struct ftp_dtp *src);
+ void ftp_join_absolute_path(const char *dir, const char *file, char *result, size_t size);
+#ifdef __cplusplus
+}
+#endif \ No newline at end of file