components/proftpd/dtrace/ftp_provider_impl.h
branchs11u2-sru
changeset 4311 3a33895438c9
equal deleted inserted replaced
4294:427b52500a3a 4311:3a33895438c9
       
     1 /*
       
     2  * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
       
     3  */
       
     4 
       
     5 #ifndef _FTP_PROVIDER_IMPL_H
       
     6 #define	_FTP_PROVIDER_IMPL_H
       
     7 
       
     8 /*
       
     9  * This structure must match the definition of same in ftp.d.
       
    10  */
       
    11 typedef struct ftpproto {
       
    12 	uint32_t ftp_user;	/* user name */
       
    13 	uint32_t ftp_cmd;	/* FTP command */
       
    14 	uint32_t ftp_pathname;  /* path of file being operated upon */
       
    15 	uint32_t ftp_raddr;	/* remote address, as IPv6 address */
       
    16 	uint32_t ftp_fd;	/* fd for transfer, if any */
       
    17 	uint32_t ftp_pad;	/* padding for copyin() */
       
    18 	uint64_t ftp_nbytes;	/* bytes transferred, if any */
       
    19 } ftpproto_t;
       
    20 
       
    21 #define	FTP_TRANSFER_PROTO(proto, fh, len) \
       
    22 do { \
       
    23 	bzero((proto), sizeof (struct ftpproto)); \
       
    24 	(proto)->ftp_user = (uint32_t)session.user; \
       
    25 	(proto)->ftp_cmd = (uint32_t)session.curr_cmd; \
       
    26 	(proto)->ftp_pathname = (uint32_t)((fh)->fh_path); \
       
    27 	(proto)->ftp_raddr = \
       
    28 	    (int32_t)pr_netaddr_get_ipstr(session.c->remote_addr); \
       
    29 	(proto)->ftp_fd = (uint32_t)((fh)->fh_fd); \
       
    30 	(proto)->ftp_nbytes = (len); \
       
    31 } while (0)
       
    32 
       
    33 extern int ftp_transfer_start_enabled(void);
       
    34 extern int ftp_transfer_done_enabled(void);
       
    35 extern void ftp_transfer_start(struct ftpproto *);
       
    36 extern void ftp_transfer_done(struct ftpproto *);
       
    37 
       
    38 #endif /* _FTP_PROVIDER_IMPL_H */