components/proftpd/dtrace/ftp.d
author Tomas Klacko <tomas.klacko@oracle.com>
Wed, 11 Mar 2015 03:50:20 -0700
changeset 3932 1b7dd68f6aa9
permissions -rw-r--r--
20553228 add proftpd dtrace provider from AK to Userland
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3932
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     1
/*
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     2
 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     3
 */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     4
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     5
#pragma D depends_on library net.d
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     6
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     7
typedef struct ftpinfo {
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     8
	string fti_user;                /* user name */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     9
	string fti_cmd;                 /* FTP command */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    10
	string fti_pathname;            /* path of file being operated upon */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    11
	uint64_t fti_nbytes;            /* bytes transferred, if any */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    12
	int fti_fd;                     /* fd for transfer, if any */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    13
} ftpinfo_t;
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    14
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    15
/*
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    16
 * This structure must match the definition of same in ftp_provider_impl.h.
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    17
 */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    18
typedef struct ftpproto {
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    19
	uint32_t ftp_user;              /* user name */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    20
	uint32_t ftp_cmd;               /* FTP command */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    21
	uint32_t ftp_pathname;          /* path of file being operated upon */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    22
	uint32_t ftp_raddr;             /* remote address, as IPv6 address */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    23
	uint32_t ftp_fd;                /* fd for transfer, if any */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    24
	uint32_t ftp_pad;               /* padding for copyin() */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    25
	uint64_t ftp_nbytes;            /* bytes transferred, if any */
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    26
} ftpproto_t;
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    27
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    28
#pragma D binding "1.6.1" translator
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    29
translator conninfo_t <ftpproto_t *f> {
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    30
	ci_protocol = "tcp";
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    31
	ci_remote = copyinstr((uintptr_t)
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    32
	*(uint32_t *)copyin((uintptr_t)&f->ftp_raddr, sizeof (uint32_t)));
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    33
	ci_local = "<unknown>";
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    34
};
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    35
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    36
#pragma D binding "1.6.1" translator
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    37
translator ftpinfo_t <ftpproto_t *f> {
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    38
	fti_user = copyinstr((uintptr_t)
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    39
	    *(uint32_t *)copyin((uintptr_t)&f->ftp_user, sizeof (uint32_t)));
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    40
	fti_cmd = copyinstr((uintptr_t)
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    41
	    *(uint32_t *)copyin((uintptr_t)&f->ftp_cmd, sizeof (uint32_t)));
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    42
	fti_pathname = copyinstr((uintptr_t)
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    43
	    *(uint32_t *)copyin((uintptr_t)&f->ftp_pathname,
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    44
	    sizeof (uint32_t)));
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    45
	fti_nbytes =
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    46
	    *(uint64_t *)copyin((uintptr_t)&f->ftp_nbytes, sizeof (uint64_t));
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    47
	fti_fd = *(uint32_t *)copyin((uintptr_t)&f->ftp_fd, sizeof (uint32_t));
1b7dd68f6aa9 20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    48
};