1*0f4c859eSApple OSS Distributions /* 2*0f4c859eSApple OSS Distributions * Copyright (c) 2013 Apple Computer, Inc. All Rights Reserved. 3*0f4c859eSApple OSS Distributions * 4*0f4c859eSApple OSS Distributions * @APPLE_LICENSE_HEADER_START@ 5*0f4c859eSApple OSS Distributions * 6*0f4c859eSApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code 7*0f4c859eSApple OSS Distributions * as defined in and that are subject to the Apple Public Source License 8*0f4c859eSApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in 9*0f4c859eSApple OSS Distributions * compliance with the License. Please obtain a copy of the License at 10*0f4c859eSApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this 11*0f4c859eSApple OSS Distributions * file. 12*0f4c859eSApple OSS Distributions * 13*0f4c859eSApple OSS Distributions * The Original Code and all software distributed under the License are 14*0f4c859eSApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15*0f4c859eSApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16*0f4c859eSApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17*0f4c859eSApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18*0f4c859eSApple OSS Distributions * Please see the License for the specific language governing rights and 19*0f4c859eSApple OSS Distributions * limitations under the License. 20*0f4c859eSApple OSS Distributions * 21*0f4c859eSApple OSS Distributions * @APPLE_LICENSE_HEADER_END@ 22*0f4c859eSApple OSS Distributions */ 23*0f4c859eSApple OSS Distributions 24*0f4c859eSApple OSS Distributions #pragma D depends_on library darwin.d 25*0f4c859eSApple OSS Distributions #pragma D depends_on module mach_kernel 26*0f4c859eSApple OSS Distributions 27*0f4c859eSApple OSS Distributions typedef struct socketbuf { 28*0f4c859eSApple OSS Distributions uint32_t cc; 29*0f4c859eSApple OSS Distributions uint32_t hiwat; 30*0f4c859eSApple OSS Distributions uint32_t lowat; 31*0f4c859eSApple OSS Distributions uint32_t mbcnt; 32*0f4c859eSApple OSS Distributions uint32_t mbmax; 33*0f4c859eSApple OSS Distributions uint32_t flags; 34*0f4c859eSApple OSS Distributions struct sockbuf *sockbuf; 35*0f4c859eSApple OSS Distributions } socketbuf_t; 36*0f4c859eSApple OSS Distributions 37*0f4c859eSApple OSS Distributions translator socketbuf_t < struct sockbuf *T > { 38*0f4c859eSApple OSS Distributions cc = T->sb_cc; 39*0f4c859eSApple OSS Distributions hiwat = T->sb_hiwat; 40*0f4c859eSApple OSS Distributions lowat = T->sb_lowat; 41*0f4c859eSApple OSS Distributions mbcnt = T->sb_mbcnt; 42*0f4c859eSApple OSS Distributions mbmax = T->sb_mbmax; 43*0f4c859eSApple OSS Distributions flags = T->sb_flags; 44*0f4c859eSApple OSS Distributions sockbuf = T; 45*0f4c859eSApple OSS Distributions }; 46*0f4c859eSApple OSS Distributions 47*0f4c859eSApple OSS Distributions typedef struct socketinfo { 48*0f4c859eSApple OSS Distributions int zone; 49*0f4c859eSApple OSS Distributions short type; 50*0f4c859eSApple OSS Distributions uint32_t options; 51*0f4c859eSApple OSS Distributions short linger; 52*0f4c859eSApple OSS Distributions short state; 53*0f4c859eSApple OSS Distributions short qlen; 54*0f4c859eSApple OSS Distributions short incqlen; 55*0f4c859eSApple OSS Distributions short qlimit; 56*0f4c859eSApple OSS Distributions short error; 57*0f4c859eSApple OSS Distributions uint32_t flags; 58*0f4c859eSApple OSS Distributions int traffic_class; 59*0f4c859eSApple OSS Distributions struct socket *socket; 60*0f4c859eSApple OSS Distributions } socketinfo_t; 61*0f4c859eSApple OSS Distributions 62*0f4c859eSApple OSS Distributions translator socketinfo_t < struct socket *T > { 63*0f4c859eSApple OSS Distributions zone = T->so_zone; 64*0f4c859eSApple OSS Distributions type = T->so_type; 65*0f4c859eSApple OSS Distributions options = T->so_options; 66*0f4c859eSApple OSS Distributions linger = T->so_linger; 67*0f4c859eSApple OSS Distributions state = T->so_state; 68*0f4c859eSApple OSS Distributions qlen = T->so_qlen; 69*0f4c859eSApple OSS Distributions incqlen = T->so_incqlen; 70*0f4c859eSApple OSS Distributions qlimit = T->so_qlimit; 71*0f4c859eSApple OSS Distributions error = T->so_error; 72*0f4c859eSApple OSS Distributions flags = T->so_flags; 73*0f4c859eSApple OSS Distributions traffic_class = T->so_traffic_class; 74*0f4c859eSApple OSS Distributions socket = T; 75*0f4c859eSApple OSS Distributions }; 76*0f4c859eSApple OSS Distributions 77*0f4c859eSApple OSS Distributions 78