3820N/A/*
3820N/A * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
3820N/A */
3820N/A
3820N/A#pragma D depends_on library net.d
3820N/A#pragma D depends_on library io.d
3820N/A#pragma D depends_on module lofs
3820N/A
3820N/Atypedef struct sftpinfo {
3820N/A string sfi_user; /* user name */
3820N/A string sfi_operation; /* SFTP Operation */
3820N/A ssize_t sfi_nbytes; /* bytes transferred, if any */
3820N/A string sfi_pathname; /* pathname of transfer */
3820N/A string sfi_fsresource; /* Dataset(ZFS) or resource name */
3820N/A} sftpinfo_t;
3820N/A
3820N/A/*
3820N/A * This structure must match the definition of same in sftp_provider_impl.h.
3820N/A */
3820N/Atypedef struct sftpproto {
3820N/A int64_t sftp_nbytes; /* bytes written or read */
3820N/A uint64_t sftp_user; /* user name */
3820N/A uint64_t sftp_operation; /* SFTP operation */
3820N/A uint64_t sftp_raddr; /* remote address */
3820N/A uint64_t sftp_pathname; /* path with file name */
3820N/A int32_t sftp_fd; /* fd for transfer, if any */
3820N/A} sftpproto_t;
3820N/A
3820N/A#pragma D binding "1.6.1" translator
3820N/Atranslator conninfo_t <sftpproto_t *s> {
3820N/A ci_protocol = "tcp";
3820N/A ci_remote = copyinstr((uintptr_t)
3820N/A *(uint64_t *)copyin((uintptr_t)&s->sftp_raddr, sizeof (uint64_t)));
3820N/A ci_local = "<unknown>";
3820N/A};
3820N/A
3820N/A#pragma D binding "1.6.1" translator
3820N/Atranslator sftpinfo_t <sftpproto_t *s> {
3820N/A sfi_user = copyinstr((uintptr_t)
3820N/A *(uint64_t *)copyin((uintptr_t)&s->sftp_user, sizeof (uint64_t)));
3820N/A sfi_operation = copyinstr((uintptr_t)
3820N/A *(uint64_t *)copyin((uintptr_t)&s->sftp_operation,
3820N/A sizeof (uint64_t)));
3820N/A sfi_nbytes =
3820N/A *(uint64_t *)copyin((uintptr_t)&s->sftp_nbytes, sizeof (uint64_t));
3820N/A sfi_fsresource = stringof(fds[*(int32_t *)copyin((uintptr_t)&s->sftp_fd,
3820N/A sizeof (int32_t))].fi_fs) == "lofs" ? stringof(((struct loinfo *)
3820N/A curthread->t_procp->p_user.u_finfo.fi_list[*(int32_t *)copyin(
3820N/A (uintptr_t)&s->sftp_fd, sizeof (int32_t))].uf_file->f_vnode->
3820N/A v_vfsp->vfs_data)->li_realvfs->vfs_resource->rs_string) :
3820N/A stringof(curthread->t_procp->p_user.u_finfo.fi_list[
3820N/A *(int32_t *)copyin((uintptr_t)&s->sftp_fd, sizeof (int32_t))].
3820N/A uf_file->f_vnode->v_vfsp->vfs_resource->rs_string);
3820N/A sfi_pathname = copyinstr((uintptr_t)*(uint64_t *)copyin(
3820N/A (uintptr_t)&s->sftp_pathname, sizeof (uint64_t)));
3820N/A};