summaryrefslogtreecommitdiff
path: root/src/ftp_decoder_util.h
blob: 4e831283e96cf06ffce57af2243a15e489464108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once
#include <sys/stat.h>
#include <sys/types.h>
#include <string.h>
#include <bits/types/struct_iovec.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(const fstring *src, fstring *dst);
void fstring_safe_dup(const fstring *src, fstring *dst);
void ftp_strtolower(char *str, size_t len);
int ftp_mkdir_p(const char *path, mode_t mode);
int ftp_session_get_pkt_dir(struct session *sess);
struct ftp_context *ftp_decoder_context_deep_dup(const struct ftp_context *src);
long ftp_skip_tail_crlf(const char *payload, long len);
void ftp_parse_result_free(struct ftp_parse_result *parse_result);