2N/A/*
2N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A#pragma D depends_on library net.d
2N/A
2N/Ainline int MAX_INET6_LEN = 46;
2N/A#pragma D binding "1.6.3" MAX_INET6_LEN
2N/Ainline int MAX_CLID_LEN = 8;
2N/A#pragma D binding "1.6.3" MAX_CLID_LEN
2N/A
2N/A/*
2N/A * ndmpproto_t: Data structure internal to ndmp passed to "op" probes. This
2N/A * must be kept in sync with ndmpproto_t defined in ndmp_provider_impl.h.
2N/A */
2N/Atypedef struct ndmpproto {
2N/A uint64_t ndmp_offset;
2N/A uint64_t ndmp_rwbytes;
2N/A uint32_t ndmp_fname;
2N/A uint32_t ndmp_iotype;
2N/A char ndmp_laddr[MAX_INET6_LEN];
2N/A char ndmp_raddr[MAX_INET6_LEN];
2N/A char ndmp_clid[MAX_CLID_LEN];
2N/A} ndmpproto_t;
2N/A
2N/A/*
2N/A * ndmpinfo_t: Data translated from ndmpproto_t.
2N/A */
2N/Atypedef struct ndmpinfo {
2N/A uint64_t ni_off; /* file offset */
2N/A uint64_t ni_rwbytes; /* last number of bytes read/written */
2N/A string ni_dma; /* client DMA IP address */
2N/A string ni_clid; /* id for active connection */
2N/A string ni_fname; /* file name */
2N/A string ni_iotype; /* device we are reading/writing to/from */
2N/A} ndmpinfo_t;
2N/A
2N/A#pragma D binding "1.6.3" translator
2N/Atranslator conninfo_t < ndmpproto_t *P > {
2N/A ci_protocol = "tcp";
2N/A ci_local = copyinstr((uintptr_t)(char *)P->ndmp_laddr);
2N/A ci_remote = copyinstr((uintptr_t)(char *)P->ndmp_raddr);
2N/A};
2N/A
2N/A#pragma D binding "1.6.3" translator
2N/Atranslator ndmpinfo_t < ndmpproto_t *P > {
2N/A ni_off = *(uint64_t *)copyin((uintptr_t)&P->ndmp_offset,
2N/A sizeof (uint64_t));
2N/A ni_rwbytes = *(uint64_t *)copyin((uintptr_t)&P->ndmp_rwbytes,
2N/A sizeof (uint64_t));
2N/A ni_dma = copyinstr((uintptr_t)(char *)P->ndmp_raddr);
2N/A ni_clid = copyinstr((uintptr_t)(char *)P->ndmp_clid);
2N/A ni_fname = copyinstr((uintptr_t)
2N/A *(uint32_t *)copyin((uintptr_t)&P->ndmp_fname, sizeof (uint32_t)));
2N/A ni_iotype = copyinstr((uintptr_t)
2N/A *(uint32_t *)copyin((uintptr_t)&P->ndmp_iotype, sizeof (uint32_t)));
2N/A};