summaryrefslogtreecommitdiff
path: root/decoders/ftp/ftp_decoder_util.h
diff options
context:
space:
mode:
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