PERFORCE change 138380 for review
John Birrell
jb at FreeBSD.org
Sun Mar 23 20:18:31 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=138380
Change 138380 by jb at 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 <sys/isa_defs.h>
+#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));
More information about the p4-projects
mailing list