author | Tomas Klacko <tomas.klacko@oracle.com> |
Mon, 18 May 2015 01:59:30 -0700 | |
branch | s11-update |
changeset 4303 | fe962209b82f |
permissions | -rw-r--r-- |
4303
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
1 |
/* |
fe962209b82f
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. |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
3 |
*/ |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
4 |
|
fe962209b82f
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 |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
6 |
|
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
7 |
typedef struct ftpinfo { |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
8 |
string fti_user; /* user name */ |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
9 |
string fti_cmd; /* FTP command */ |
fe962209b82f
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 */ |
fe962209b82f
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 */ |
fe962209b82f
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 */ |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
13 |
} ftpinfo_t; |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
14 |
|
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
15 |
/* |
fe962209b82f
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. |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
17 |
*/ |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
18 |
typedef struct ftpproto { |
fe962209b82f
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 */ |
fe962209b82f
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 */ |
fe962209b82f
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 */ |
fe962209b82f
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 */ |
fe962209b82f
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 */ |
fe962209b82f
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() */ |
fe962209b82f
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 */ |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
26 |
} ftpproto_t; |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
27 |
|
fe962209b82f
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 |
fe962209b82f
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> { |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
30 |
ci_protocol = "tcp"; |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
31 |
ci_remote = copyinstr((uintptr_t) |
fe962209b82f
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))); |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
33 |
ci_local = "<unknown>"; |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
34 |
}; |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
35 |
|
fe962209b82f
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 |
fe962209b82f
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> { |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
38 |
fti_user = copyinstr((uintptr_t) |
fe962209b82f
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))); |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
40 |
fti_cmd = copyinstr((uintptr_t) |
fe962209b82f
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))); |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
42 |
fti_pathname = copyinstr((uintptr_t) |
fe962209b82f
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, |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
44 |
sizeof (uint32_t))); |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
45 |
fti_nbytes = |
fe962209b82f
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)); |
fe962209b82f
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)); |
fe962209b82f
20553228 add proftpd dtrace provider from AK to Userland
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff
changeset
|
48 |
}; |