From owner-p4-projects@FreeBSD.ORG Sun Mar 23 20:18:30 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9E3601065713; Sun, 23 Mar 2008 20:18:30 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33618106564A for ; Sun, 23 Mar 2008 20:18:30 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1BCF78FC28 for ; Sun, 23 Mar 2008 20:18:30 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2NKIUPK093595 for ; Sun, 23 Mar 2008 20:18:30 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2NKIUYK093593 for perforce@freebsd.org; Sun, 23 Mar 2008 20:18:30 GMT (envelope-from jb@freebsd.org) Date: Sun, 23 Mar 2008 20:18:30 GMT Message-Id: <200803232018.m2NKIUYK093593@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 138380 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2008 20:18:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=138380 Change 138380 by jb@jb_freebsd1 on 2008/03/23 20:18:27 Port the in_addr and in6_addr tests to FreeBSD. Affected files ... .. //depot/projects/dtrace/src/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.hton.d#5 edit .. //depot/projects/dtrace/src/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d#4 edit .. //depot/projects/dtrace/src/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d#4 edit .. //depot/projects/dtrace/src/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d#4 edit Differences ... ==== //depot/projects/dtrace/src/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.hton.d#5 (text+ko) ==== @@ -30,7 +30,9 @@ * ASSERTION: Test network byte-ordering routines. */ -#include +#if defined(__amd64__) || defined(__i386__) +#define _LITTLE_ENDIAN +#endif BEGIN { ==== //depot/projects/dtrace/src/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d#4 (text+ko) ==== @@ -28,17 +28,17 @@ #pragma D option quiet -ipaddr_t *ip4a; -ipaddr_t *ip4b; -ipaddr_t *ip4c; -ipaddr_t *ip4d; +in_addr_t *ip4a; +in_addr_t *ip4b; +in_addr_t *ip4c; +in_addr_t *ip4d; BEGIN { - this->buf4a = alloca(sizeof (ipaddr_t)); - this->buf4b = alloca(sizeof (ipaddr_t)); - this->buf4c = alloca(sizeof (ipaddr_t)); - this->buf4d = alloca(sizeof (ipaddr_t)); + this->buf4a = alloca(sizeof (in_addr_t)); + this->buf4b = alloca(sizeof (in_addr_t)); + this->buf4c = alloca(sizeof (in_addr_t)); + this->buf4d = alloca(sizeof (in_addr_t)); ip4a = this->buf4a; ip4b = this->buf4b; ip4c = this->buf4c; ==== //depot/projects/dtrace/src/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d#4 (text+ko) ==== @@ -53,35 +53,35 @@ ip6f = this->buf6f; ip6g = this->buf6g; - ip6a->_S6_un._S6_u8[0] = 0xfe; - ip6a->_S6_un._S6_u8[1] = 0x80; - ip6a->_S6_un._S6_u8[8] = 0x02; - ip6a->_S6_un._S6_u8[9] = 0x14; - ip6a->_S6_un._S6_u8[10] = 0x4f; - ip6a->_S6_un._S6_u8[11] = 0xff; - ip6a->_S6_un._S6_u8[12] = 0xfe; - ip6a->_S6_un._S6_u8[13] = 0x0b; - ip6a->_S6_un._S6_u8[14] = 0x76; - ip6a->_S6_un._S6_u8[15] = 0xc8; - ip6b->_S6_un._S6_u8[0] = 0x10; - ip6b->_S6_un._S6_u8[1] = 0x80; - ip6b->_S6_un._S6_u8[10] = 0x08; - ip6b->_S6_un._S6_u8[11] = 0x08; - ip6b->_S6_un._S6_u8[13] = 0x20; - ip6b->_S6_un._S6_u8[13] = 0x0c; - ip6b->_S6_un._S6_u8[14] = 0x41; - ip6b->_S6_un._S6_u8[15] = 0x7a; - ip6c->_S6_un._S6_u8[15] = 0x01; - ip6e->_S6_un._S6_u8[12] = 0x7f; - ip6e->_S6_un._S6_u8[15] = 0x01; - ip6f->_S6_un._S6_u8[10] = 0xff; - ip6f->_S6_un._S6_u8[11] = 0xff; - ip6f->_S6_un._S6_u8[12] = 0x7f; - ip6f->_S6_un._S6_u8[15] = 0x01; - ip6g->_S6_un._S6_u8[10] = 0xff; - ip6g->_S6_un._S6_u8[11] = 0xfe; - ip6g->_S6_un._S6_u8[12] = 0x7f; - ip6g->_S6_un._S6_u8[15] = 0x01; + ip6a->__u6_addr.__u6_addr8[0] = 0xfe; + ip6a->__u6_addr.__u6_addr8[1] = 0x80; + ip6a->__u6_addr.__u6_addr8[8] = 0x02; + ip6a->__u6_addr.__u6_addr8[9] = 0x14; + ip6a->__u6_addr.__u6_addr8[10] = 0x4f; + ip6a->__u6_addr.__u6_addr8[11] = 0xff; + ip6a->__u6_addr.__u6_addr8[12] = 0xfe; + ip6a->__u6_addr.__u6_addr8[13] = 0x0b; + ip6a->__u6_addr.__u6_addr8[14] = 0x76; + ip6a->__u6_addr.__u6_addr8[15] = 0xc8; + ip6b->__u6_addr.__u6_addr8[0] = 0x10; + ip6b->__u6_addr.__u6_addr8[1] = 0x80; + ip6b->__u6_addr.__u6_addr8[10] = 0x08; + ip6b->__u6_addr.__u6_addr8[11] = 0x08; + ip6b->__u6_addr.__u6_addr8[13] = 0x20; + ip6b->__u6_addr.__u6_addr8[13] = 0x0c; + ip6b->__u6_addr.__u6_addr8[14] = 0x41; + ip6b->__u6_addr.__u6_addr8[15] = 0x7a; + ip6c->__u6_addr.__u6_addr8[15] = 0x01; + ip6e->__u6_addr.__u6_addr8[12] = 0x7f; + ip6e->__u6_addr.__u6_addr8[15] = 0x01; + ip6f->__u6_addr.__u6_addr8[10] = 0xff; + ip6f->__u6_addr.__u6_addr8[11] = 0xff; + ip6f->__u6_addr.__u6_addr8[12] = 0x7f; + ip6f->__u6_addr.__u6_addr8[15] = 0x01; + ip6g->__u6_addr.__u6_addr8[10] = 0xff; + ip6g->__u6_addr.__u6_addr8[11] = 0xfe; + ip6g->__u6_addr.__u6_addr8[12] = 0x7f; + ip6g->__u6_addr.__u6_addr8[15] = 0x01; printf("%s\n", inet_ntoa6(ip6a)); printf("%s\n", inet_ntoa6(ip6b)); ==== //depot/projects/dtrace/src/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d#4 (text+ko) ==== @@ -28,10 +28,13 @@ #pragma D option quiet -ipaddr_t *ip4a; -ipaddr_t *ip4b; -ipaddr_t *ip4c; -ipaddr_t *ip4d; +inline int AF_INET = 2; +inline int AF_INET6 = 28; + +in_addr_t *ip4a; +in_addr_t *ip4b; +in_addr_t *ip4c; +in_addr_t *ip4d; struct in6_addr *ip6a; struct in6_addr *ip6b; struct in6_addr *ip6c; @@ -43,10 +46,10 @@ BEGIN { - this->buf4a = alloca(sizeof (ipaddr_t)); - this->buf4b = alloca(sizeof (ipaddr_t)); - this->buf4c = alloca(sizeof (ipaddr_t)); - this->buf4d = alloca(sizeof (ipaddr_t)); + this->buf4a = alloca(sizeof (in_addr_t)); + this->buf4b = alloca(sizeof (in_addr_t)); + this->buf4c = alloca(sizeof (in_addr_t)); + this->buf4d = alloca(sizeof (in_addr_t)); this->buf6a = alloca(sizeof (struct in6_addr)); this->buf6b = alloca(sizeof (struct in6_addr)); this->buf6c = alloca(sizeof (struct in6_addr)); @@ -72,51 +75,51 @@ *ip4b = htonl(0x7f000001); *ip4c = htonl(0xffffffff); *ip4d = htonl(0x00000000); - ip6a->_S6_un._S6_u8[0] = 0xfe; - ip6a->_S6_un._S6_u8[1] = 0x80; - ip6a->_S6_un._S6_u8[8] = 0x02; - ip6a->_S6_un._S6_u8[9] = 0x14; - ip6a->_S6_un._S6_u8[10] = 0x4f; - ip6a->_S6_un._S6_u8[11] = 0xff; - ip6a->_S6_un._S6_u8[12] = 0xfe; - ip6a->_S6_un._S6_u8[13] = 0x0b; - ip6a->_S6_un._S6_u8[14] = 0x76; - ip6a->_S6_un._S6_u8[15] = 0xc8; - ip6b->_S6_un._S6_u8[0] = 0x10; - ip6b->_S6_un._S6_u8[1] = 0x80; - ip6b->_S6_un._S6_u8[10] = 0x08; - ip6b->_S6_un._S6_u8[11] = 0x08; - ip6b->_S6_un._S6_u8[13] = 0x20; - ip6b->_S6_un._S6_u8[13] = 0x0c; - ip6b->_S6_un._S6_u8[14] = 0x41; - ip6b->_S6_un._S6_u8[15] = 0x7a; - ip6c->_S6_un._S6_u8[15] = 0x01; - ip6e->_S6_un._S6_u8[12] = 0x7f; - ip6e->_S6_un._S6_u8[15] = 0x01; - ip6f->_S6_un._S6_u8[10] = 0xff; - ip6f->_S6_un._S6_u8[11] = 0xff; - ip6f->_S6_un._S6_u8[12] = 0x7f; - ip6f->_S6_un._S6_u8[15] = 0x01; - ip6g->_S6_un._S6_u8[10] = 0xff; - ip6g->_S6_un._S6_u8[11] = 0xfe; - ip6g->_S6_un._S6_u8[12] = 0x7f; - ip6g->_S6_un._S6_u8[15] = 0x01; - ip6h->_S6_un._S6_u8[0] = 0xff; - ip6h->_S6_un._S6_u8[1] = 0xff; - ip6h->_S6_un._S6_u8[2] = 0xff; - ip6h->_S6_un._S6_u8[3] = 0xff; - ip6h->_S6_un._S6_u8[4] = 0xff; - ip6h->_S6_un._S6_u8[5] = 0xff; - ip6h->_S6_un._S6_u8[6] = 0xff; - ip6h->_S6_un._S6_u8[7] = 0xff; - ip6h->_S6_un._S6_u8[8] = 0xff; - ip6h->_S6_un._S6_u8[9] = 0xff; - ip6h->_S6_un._S6_u8[10] = 0xff; - ip6h->_S6_un._S6_u8[11] = 0xff; - ip6h->_S6_un._S6_u8[12] = 0xff; - ip6h->_S6_un._S6_u8[13] = 0xff; - ip6h->_S6_un._S6_u8[14] = 0xff; - ip6h->_S6_un._S6_u8[15] = 0xff; + ip6a->__u6_addr.__u6_addr8[0] = 0xfe; + ip6a->__u6_addr.__u6_addr8[1] = 0x80; + ip6a->__u6_addr.__u6_addr8[8] = 0x02; + ip6a->__u6_addr.__u6_addr8[9] = 0x14; + ip6a->__u6_addr.__u6_addr8[10] = 0x4f; + ip6a->__u6_addr.__u6_addr8[11] = 0xff; + ip6a->__u6_addr.__u6_addr8[12] = 0xfe; + ip6a->__u6_addr.__u6_addr8[13] = 0x0b; + ip6a->__u6_addr.__u6_addr8[14] = 0x76; + ip6a->__u6_addr.__u6_addr8[15] = 0xc8; + ip6b->__u6_addr.__u6_addr8[0] = 0x10; + ip6b->__u6_addr.__u6_addr8[1] = 0x80; + ip6b->__u6_addr.__u6_addr8[10] = 0x08; + ip6b->__u6_addr.__u6_addr8[11] = 0x08; + ip6b->__u6_addr.__u6_addr8[13] = 0x20; + ip6b->__u6_addr.__u6_addr8[13] = 0x0c; + ip6b->__u6_addr.__u6_addr8[14] = 0x41; + ip6b->__u6_addr.__u6_addr8[15] = 0x7a; + ip6c->__u6_addr.__u6_addr8[15] = 0x01; + ip6e->__u6_addr.__u6_addr8[12] = 0x7f; + ip6e->__u6_addr.__u6_addr8[15] = 0x01; + ip6f->__u6_addr.__u6_addr8[10] = 0xff; + ip6f->__u6_addr.__u6_addr8[11] = 0xff; + ip6f->__u6_addr.__u6_addr8[12] = 0x7f; + ip6f->__u6_addr.__u6_addr8[15] = 0x01; + ip6g->__u6_addr.__u6_addr8[10] = 0xff; + ip6g->__u6_addr.__u6_addr8[11] = 0xfe; + ip6g->__u6_addr.__u6_addr8[12] = 0x7f; + ip6g->__u6_addr.__u6_addr8[15] = 0x01; + ip6h->__u6_addr.__u6_addr8[0] = 0xff; + ip6h->__u6_addr.__u6_addr8[1] = 0xff; + ip6h->__u6_addr.__u6_addr8[2] = 0xff; + ip6h->__u6_addr.__u6_addr8[3] = 0xff; + ip6h->__u6_addr.__u6_addr8[4] = 0xff; + ip6h->__u6_addr.__u6_addr8[5] = 0xff; + ip6h->__u6_addr.__u6_addr8[6] = 0xff; + ip6h->__u6_addr.__u6_addr8[7] = 0xff; + ip6h->__u6_addr.__u6_addr8[8] = 0xff; + ip6h->__u6_addr.__u6_addr8[9] = 0xff; + ip6h->__u6_addr.__u6_addr8[10] = 0xff; + ip6h->__u6_addr.__u6_addr8[11] = 0xff; + ip6h->__u6_addr.__u6_addr8[12] = 0xff; + ip6h->__u6_addr.__u6_addr8[13] = 0xff; + ip6h->__u6_addr.__u6_addr8[14] = 0xff; + ip6h->__u6_addr.__u6_addr8[15] = 0xff; printf("%s\n", inet_ntop(AF_INET, ip4a)); printf("%s\n", inet_ntop(AF_INET, ip4b));