/* * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. */ #pragma D depends_on library net.d inline int MAX_INET6_LEN = 46; #pragma D binding "1.6.3" MAX_INET6_LEN inline int MAX_CLID_LEN = 8; #pragma D binding "1.6.3" MAX_CLID_LEN /* * ndmpproto_t: Data structure internal to ndmp passed to "op" probes. This * must be kept in sync with ndmpproto_t defined in ndmp_provider_impl.h. */ typedef struct ndmpproto { uint64_t ndmp_offset; uint64_t ndmp_rwbytes; uint32_t ndmp_fname; uint32_t ndmp_iotype; char ndmp_laddr[MAX_INET6_LEN]; char ndmp_raddr[MAX_INET6_LEN]; char ndmp_clid[MAX_CLID_LEN]; } ndmpproto_t; /* * ndmpinfo_t: Data translated from ndmpproto_t. */ typedef struct ndmpinfo { uint64_t ni_off; /* file offset */ uint64_t ni_rwbytes; /* last number of bytes read/written */ string ni_dma; /* client DMA IP address */ string ni_clid; /* id for active connection */ string ni_fname; /* file name */ string ni_iotype; /* device we are reading/writing to/from */ } ndmpinfo_t; #pragma D binding "1.6.3" translator translator conninfo_t < ndmpproto_t *P > { ci_protocol = "tcp"; ci_local = copyinstr((uintptr_t)(char *)P->ndmp_laddr); ci_remote = copyinstr((uintptr_t)(char *)P->ndmp_raddr); }; #pragma D binding "1.6.3" translator translator ndmpinfo_t < ndmpproto_t *P > { ni_off = *(uint64_t *)copyin((uintptr_t)&P->ndmp_offset, sizeof (uint64_t)); ni_rwbytes = *(uint64_t *)copyin((uintptr_t)&P->ndmp_rwbytes, sizeof (uint64_t)); ni_dma = copyinstr((uintptr_t)(char *)P->ndmp_raddr); ni_clid = copyinstr((uintptr_t)(char *)P->ndmp_clid); ni_fname = copyinstr((uintptr_t) *(uint32_t *)copyin((uintptr_t)&P->ndmp_fname, sizeof (uint32_t))); ni_iotype = copyinstr((uintptr_t) *(uint32_t *)copyin((uintptr_t)&P->ndmp_iotype, sizeof (uint32_t))); };