3932N/A/*
3932N/A * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
3932N/A */
3932N/A
3932N/A#ifndef _FTP_PROVIDER_IMPL_H
3932N/A#define _FTP_PROVIDER_IMPL_H
3932N/A
3932N/A/*
3932N/A * This structure must match the definition of same in ftp.d.
3932N/A */
3932N/Atypedef struct ftpproto {
3932N/A uint32_t ftp_user; /* user name */
3932N/A uint32_t ftp_cmd; /* FTP command */
3932N/A uint32_t ftp_pathname; /* path of file being operated upon */
3932N/A uint32_t ftp_raddr; /* remote address, as IPv6 address */
3932N/A uint32_t ftp_fd; /* fd for transfer, if any */
3932N/A uint32_t ftp_pad; /* padding for copyin() */
3932N/A uint64_t ftp_nbytes; /* bytes transferred, if any */
3932N/A} ftpproto_t;
3932N/A
3932N/A#define FTP_TRANSFER_PROTO(proto, fh, len) \
3932N/Ado { \
3932N/A bzero((proto), sizeof (struct ftpproto)); \
3932N/A (proto)->ftp_user = (uint32_t)session.user; \
3932N/A (proto)->ftp_cmd = (uint32_t)session.curr_cmd; \
3932N/A (proto)->ftp_pathname = (uint32_t)((fh)->fh_path); \
3932N/A (proto)->ftp_raddr = \
3932N/A (int32_t)pr_netaddr_get_ipstr(session.c->remote_addr); \
3932N/A (proto)->ftp_fd = (uint32_t)((fh)->fh_fd); \
3932N/A (proto)->ftp_nbytes = (len); \
3932N/A} while (0)
3932N/A
3932N/Aextern int ftp_transfer_start_enabled(void);
3932N/Aextern int ftp_transfer_done_enabled(void);
3932N/Aextern void ftp_transfer_start(struct ftpproto *);
3932N/Aextern void ftp_transfer_done(struct ftpproto *);
3932N/A
3932N/A#endif /* _FTP_PROVIDER_IMPL_H */