tst.inet_ntoa.d revision 178529
143000Simp/* 243000Simp * CDDL HEADER START 350477Speter * 443000Simp * The contents of this file are subject to the terms of the 543000Simp * Common Development and Distribution License (the "License"). 643000Simp * You may not use this file except in compliance with the License. 743000Simp * 843000Simp * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 943000Simp * or http://www.opensolaris.org/os/licensing. 1043000Simp * See the License for the specific language governing permissions 1143000Simp * and limitations under the License. 1243000Simp * 1343000Simp * When distributing Covered Code, include this CDDL HEADER in each 1443000Simp * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1543000Simp * If applicable, add the following below this CDDL HEADER, with the 1643000Simp * fields enclosed by brackets "[]" replaced with your own identifying 1743000Simp * information: Portions Copyright [yyyy] [name of copyright owner] 1843000Simp * 1943000Simp * CDDL HEADER END 2043000Simp */ 2143000Simp 2243000Simp/* 2343000Simp * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 2443000Simp * Use is subject to license terms. 2543000Simp */ 2643000Simp 2743000Simp#pragma ident "%Z%%M% %I% %E% SMI" 2843000Simp 2943000Simp#pragma D option quiet 3043000Simp 3143000Simpipaddr_t *ip4a; 3243000Simpipaddr_t *ip4b; 3343000Simpipaddr_t *ip4c; 3443000Simpipaddr_t *ip4d; 3543000Simp 3643000SimpBEGIN 3743000Simp{ 3843000Simp this->buf4a = alloca(sizeof (ipaddr_t)); 39 this->buf4b = alloca(sizeof (ipaddr_t)); 40 this->buf4c = alloca(sizeof (ipaddr_t)); 41 this->buf4d = alloca(sizeof (ipaddr_t)); 42 ip4a = this->buf4a; 43 ip4b = this->buf4b; 44 ip4c = this->buf4c; 45 ip4d = this->buf4d; 46 47 *ip4a = htonl(0xc0a80117); 48 *ip4b = htonl(0x7f000001); 49 *ip4c = htonl(0xffffffff); 50 *ip4d = htonl(0x00000000); 51 52 printf("%s\n", inet_ntoa(ip4a)); 53 printf("%s\n", inet_ntoa(ip4b)); 54 printf("%s\n", inet_ntoa(ip4c)); 55 printf("%s\n", inet_ntoa(ip4d)); 56 57 exit(0); 58} 59