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