xref: /onnv-gate/usr/src/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d (revision 4291:2650d270ece9)
1*4291Sbrendan /*
2*4291Sbrendan  * CDDL HEADER START
3*4291Sbrendan  *
4*4291Sbrendan  * The contents of this file are subject to the terms of the
5*4291Sbrendan  * Common Development and Distribution License (the "License").
6*4291Sbrendan  * You may not use this file except in compliance with the License.
7*4291Sbrendan  *
8*4291Sbrendan  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*4291Sbrendan  * or http://www.opensolaris.org/os/licensing.
10*4291Sbrendan  * See the License for the specific language governing permissions
11*4291Sbrendan  * and limitations under the License.
12*4291Sbrendan  *
13*4291Sbrendan  * When distributing Covered Code, include this CDDL HEADER in each
14*4291Sbrendan  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*4291Sbrendan  * If applicable, add the following below this CDDL HEADER, with the
16*4291Sbrendan  * fields enclosed by brackets "[]" replaced with your own identifying
17*4291Sbrendan  * information: Portions Copyright [yyyy] [name of copyright owner]
18*4291Sbrendan  *
19*4291Sbrendan  * CDDL HEADER END
20*4291Sbrendan  */
21*4291Sbrendan 
22*4291Sbrendan /*
23*4291Sbrendan  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24*4291Sbrendan  * Use is subject to license terms.
25*4291Sbrendan  */
26*4291Sbrendan 
27*4291Sbrendan #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*4291Sbrendan 
29*4291Sbrendan #pragma D option quiet
30*4291Sbrendan 
31*4291Sbrendan struct in6_addr *ip6a;
32*4291Sbrendan struct in6_addr *ip6b;
33*4291Sbrendan struct in6_addr *ip6c;
34*4291Sbrendan struct in6_addr *ip6d;
35*4291Sbrendan struct in6_addr *ip6e;
36*4291Sbrendan struct in6_addr *ip6f;
37*4291Sbrendan struct in6_addr *ip6g;
38*4291Sbrendan 
39*4291Sbrendan BEGIN
40*4291Sbrendan {
41*4291Sbrendan 	this->buf6a = alloca(sizeof (struct in6_addr));
42*4291Sbrendan 	this->buf6b = alloca(sizeof (struct in6_addr));
43*4291Sbrendan 	this->buf6c = alloca(sizeof (struct in6_addr));
44*4291Sbrendan 	this->buf6d = alloca(sizeof (struct in6_addr));
45*4291Sbrendan 	this->buf6e = alloca(sizeof (struct in6_addr));
46*4291Sbrendan 	this->buf6f = alloca(sizeof (struct in6_addr));
47*4291Sbrendan 	this->buf6g = alloca(sizeof (struct in6_addr));
48*4291Sbrendan 	ip6a = this->buf6a;
49*4291Sbrendan 	ip6b = this->buf6b;
50*4291Sbrendan 	ip6c = this->buf6c;
51*4291Sbrendan 	ip6d = this->buf6d;
52*4291Sbrendan 	ip6e = this->buf6e;
53*4291Sbrendan 	ip6f = this->buf6f;
54*4291Sbrendan 	ip6g = this->buf6g;
55*4291Sbrendan 
56*4291Sbrendan 	ip6a->_S6_un._S6_u8[0] = 0xfe;
57*4291Sbrendan 	ip6a->_S6_un._S6_u8[1] = 0x80;
58*4291Sbrendan 	ip6a->_S6_un._S6_u8[8] = 0x02;
59*4291Sbrendan 	ip6a->_S6_un._S6_u8[9] = 0x14;
60*4291Sbrendan 	ip6a->_S6_un._S6_u8[10] = 0x4f;
61*4291Sbrendan 	ip6a->_S6_un._S6_u8[11] = 0xff;
62*4291Sbrendan 	ip6a->_S6_un._S6_u8[12] = 0xfe;
63*4291Sbrendan 	ip6a->_S6_un._S6_u8[13] = 0x0b;
64*4291Sbrendan 	ip6a->_S6_un._S6_u8[14] = 0x76;
65*4291Sbrendan 	ip6a->_S6_un._S6_u8[15] = 0xc8;
66*4291Sbrendan 	ip6b->_S6_un._S6_u8[0] = 0x10;
67*4291Sbrendan 	ip6b->_S6_un._S6_u8[1] = 0x80;
68*4291Sbrendan 	ip6b->_S6_un._S6_u8[10] = 0x08;
69*4291Sbrendan 	ip6b->_S6_un._S6_u8[11] = 0x08;
70*4291Sbrendan 	ip6b->_S6_un._S6_u8[13] = 0x20;
71*4291Sbrendan 	ip6b->_S6_un._S6_u8[13] = 0x0c;
72*4291Sbrendan 	ip6b->_S6_un._S6_u8[14] = 0x41;
73*4291Sbrendan 	ip6b->_S6_un._S6_u8[15] = 0x7a;
74*4291Sbrendan 	ip6c->_S6_un._S6_u8[15] = 0x01;
75*4291Sbrendan 	ip6e->_S6_un._S6_u8[12] = 0x7f;
76*4291Sbrendan 	ip6e->_S6_un._S6_u8[15] = 0x01;
77*4291Sbrendan 	ip6f->_S6_un._S6_u8[10] = 0xff;
78*4291Sbrendan 	ip6f->_S6_un._S6_u8[11] = 0xff;
79*4291Sbrendan 	ip6f->_S6_un._S6_u8[12] = 0x7f;
80*4291Sbrendan 	ip6f->_S6_un._S6_u8[15] = 0x01;
81*4291Sbrendan 	ip6g->_S6_un._S6_u8[10] = 0xff;
82*4291Sbrendan 	ip6g->_S6_un._S6_u8[11] = 0xfe;
83*4291Sbrendan 	ip6g->_S6_un._S6_u8[12] = 0x7f;
84*4291Sbrendan 	ip6g->_S6_un._S6_u8[15] = 0x01;
85*4291Sbrendan 
86*4291Sbrendan 	printf("%s\n", inet_ntoa6(ip6a));
87*4291Sbrendan 	printf("%s\n", inet_ntoa6(ip6b));
88*4291Sbrendan 	printf("%s\n", inet_ntoa6(ip6c));
89*4291Sbrendan 	printf("%s\n", inet_ntoa6(ip6d));
90*4291Sbrendan 	printf("%s\n", inet_ntoa6(ip6e));
91*4291Sbrendan 	printf("%s\n", inet_ntoa6(ip6f));
92*4291Sbrendan 	printf("%s\n", inet_ntoa6(ip6g));
93*4291Sbrendan 
94*4291Sbrendan 	exit(0);
95*4291Sbrendan }
96