tst.inet_ntop.d (178529) | tst.inet_ntop.d (178534) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 14 unchanged lines hidden (view full) --- 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27#pragma ident "%Z%%M% %I% %E% SMI" 28 29#pragma D option quiet 30 | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 14 unchanged lines hidden (view full) --- 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27#pragma ident "%Z%%M% %I% %E% SMI" 28 29#pragma D option quiet 30 |
31ipaddr_t *ip4a; 32ipaddr_t *ip4b; 33ipaddr_t *ip4c; 34ipaddr_t *ip4d; | 31inline int AF_INET = 2; 32inline int AF_INET6 = 28; 33 34in_addr_t *ip4a; 35in_addr_t *ip4b; 36in_addr_t *ip4c; 37in_addr_t *ip4d; |
35struct in6_addr *ip6a; 36struct in6_addr *ip6b; 37struct in6_addr *ip6c; 38struct in6_addr *ip6d; 39struct in6_addr *ip6e; 40struct in6_addr *ip6f; 41struct in6_addr *ip6g; 42struct in6_addr *ip6h; 43 44BEGIN 45{ | 38struct in6_addr *ip6a; 39struct in6_addr *ip6b; 40struct in6_addr *ip6c; 41struct in6_addr *ip6d; 42struct in6_addr *ip6e; 43struct in6_addr *ip6f; 44struct in6_addr *ip6g; 45struct in6_addr *ip6h; 46 47BEGIN 48{ |
46 this->buf4a = alloca(sizeof (ipaddr_t)); 47 this->buf4b = alloca(sizeof (ipaddr_t)); 48 this->buf4c = alloca(sizeof (ipaddr_t)); 49 this->buf4d = alloca(sizeof (ipaddr_t)); | 49 this->buf4a = alloca(sizeof (in_addr_t)); 50 this->buf4b = alloca(sizeof (in_addr_t)); 51 this->buf4c = alloca(sizeof (in_addr_t)); 52 this->buf4d = alloca(sizeof (in_addr_t)); |
50 this->buf6a = alloca(sizeof (struct in6_addr)); 51 this->buf6b = alloca(sizeof (struct in6_addr)); 52 this->buf6c = alloca(sizeof (struct in6_addr)); 53 this->buf6d = alloca(sizeof (struct in6_addr)); 54 this->buf6e = alloca(sizeof (struct in6_addr)); 55 this->buf6f = alloca(sizeof (struct in6_addr)); 56 this->buf6g = alloca(sizeof (struct in6_addr)); 57 this->buf6h = alloca(sizeof (struct in6_addr)); --- 9 unchanged lines hidden (view full) --- 67 ip6f = this->buf6f; 68 ip6g = this->buf6g; 69 ip6h = this->buf6h; 70 71 *ip4a = htonl(0xc0a80117); 72 *ip4b = htonl(0x7f000001); 73 *ip4c = htonl(0xffffffff); 74 *ip4d = htonl(0x00000000); | 53 this->buf6a = alloca(sizeof (struct in6_addr)); 54 this->buf6b = alloca(sizeof (struct in6_addr)); 55 this->buf6c = alloca(sizeof (struct in6_addr)); 56 this->buf6d = alloca(sizeof (struct in6_addr)); 57 this->buf6e = alloca(sizeof (struct in6_addr)); 58 this->buf6f = alloca(sizeof (struct in6_addr)); 59 this->buf6g = alloca(sizeof (struct in6_addr)); 60 this->buf6h = alloca(sizeof (struct in6_addr)); --- 9 unchanged lines hidden (view full) --- 70 ip6f = this->buf6f; 71 ip6g = this->buf6g; 72 ip6h = this->buf6h; 73 74 *ip4a = htonl(0xc0a80117); 75 *ip4b = htonl(0x7f000001); 76 *ip4c = htonl(0xffffffff); 77 *ip4d = htonl(0x00000000); |
75 ip6a->_S6_un._S6_u8[0] = 0xfe; 76 ip6a->_S6_un._S6_u8[1] = 0x80; 77 ip6a->_S6_un._S6_u8[8] = 0x02; 78 ip6a->_S6_un._S6_u8[9] = 0x14; 79 ip6a->_S6_un._S6_u8[10] = 0x4f; 80 ip6a->_S6_un._S6_u8[11] = 0xff; 81 ip6a->_S6_un._S6_u8[12] = 0xfe; 82 ip6a->_S6_un._S6_u8[13] = 0x0b; 83 ip6a->_S6_un._S6_u8[14] = 0x76; 84 ip6a->_S6_un._S6_u8[15] = 0xc8; 85 ip6b->_S6_un._S6_u8[0] = 0x10; 86 ip6b->_S6_un._S6_u8[1] = 0x80; 87 ip6b->_S6_un._S6_u8[10] = 0x08; 88 ip6b->_S6_un._S6_u8[11] = 0x08; 89 ip6b->_S6_un._S6_u8[13] = 0x20; 90 ip6b->_S6_un._S6_u8[13] = 0x0c; 91 ip6b->_S6_un._S6_u8[14] = 0x41; 92 ip6b->_S6_un._S6_u8[15] = 0x7a; 93 ip6c->_S6_un._S6_u8[15] = 0x01; 94 ip6e->_S6_un._S6_u8[12] = 0x7f; 95 ip6e->_S6_un._S6_u8[15] = 0x01; 96 ip6f->_S6_un._S6_u8[10] = 0xff; 97 ip6f->_S6_un._S6_u8[11] = 0xff; 98 ip6f->_S6_un._S6_u8[12] = 0x7f; 99 ip6f->_S6_un._S6_u8[15] = 0x01; 100 ip6g->_S6_un._S6_u8[10] = 0xff; 101 ip6g->_S6_un._S6_u8[11] = 0xfe; 102 ip6g->_S6_un._S6_u8[12] = 0x7f; 103 ip6g->_S6_un._S6_u8[15] = 0x01; 104 ip6h->_S6_un._S6_u8[0] = 0xff; 105 ip6h->_S6_un._S6_u8[1] = 0xff; 106 ip6h->_S6_un._S6_u8[2] = 0xff; 107 ip6h->_S6_un._S6_u8[3] = 0xff; 108 ip6h->_S6_un._S6_u8[4] = 0xff; 109 ip6h->_S6_un._S6_u8[5] = 0xff; 110 ip6h->_S6_un._S6_u8[6] = 0xff; 111 ip6h->_S6_un._S6_u8[7] = 0xff; 112 ip6h->_S6_un._S6_u8[8] = 0xff; 113 ip6h->_S6_un._S6_u8[9] = 0xff; 114 ip6h->_S6_un._S6_u8[10] = 0xff; 115 ip6h->_S6_un._S6_u8[11] = 0xff; 116 ip6h->_S6_un._S6_u8[12] = 0xff; 117 ip6h->_S6_un._S6_u8[13] = 0xff; 118 ip6h->_S6_un._S6_u8[14] = 0xff; 119 ip6h->_S6_un._S6_u8[15] = 0xff; | 78 ip6a->__u6_addr.__u6_addr8[0] = 0xfe; 79 ip6a->__u6_addr.__u6_addr8[1] = 0x80; 80 ip6a->__u6_addr.__u6_addr8[8] = 0x02; 81 ip6a->__u6_addr.__u6_addr8[9] = 0x14; 82 ip6a->__u6_addr.__u6_addr8[10] = 0x4f; 83 ip6a->__u6_addr.__u6_addr8[11] = 0xff; 84 ip6a->__u6_addr.__u6_addr8[12] = 0xfe; 85 ip6a->__u6_addr.__u6_addr8[13] = 0x0b; 86 ip6a->__u6_addr.__u6_addr8[14] = 0x76; 87 ip6a->__u6_addr.__u6_addr8[15] = 0xc8; 88 ip6b->__u6_addr.__u6_addr8[0] = 0x10; 89 ip6b->__u6_addr.__u6_addr8[1] = 0x80; 90 ip6b->__u6_addr.__u6_addr8[10] = 0x08; 91 ip6b->__u6_addr.__u6_addr8[11] = 0x08; 92 ip6b->__u6_addr.__u6_addr8[13] = 0x20; 93 ip6b->__u6_addr.__u6_addr8[13] = 0x0c; 94 ip6b->__u6_addr.__u6_addr8[14] = 0x41; 95 ip6b->__u6_addr.__u6_addr8[15] = 0x7a; 96 ip6c->__u6_addr.__u6_addr8[15] = 0x01; 97 ip6e->__u6_addr.__u6_addr8[12] = 0x7f; 98 ip6e->__u6_addr.__u6_addr8[15] = 0x01; 99 ip6f->__u6_addr.__u6_addr8[10] = 0xff; 100 ip6f->__u6_addr.__u6_addr8[11] = 0xff; 101 ip6f->__u6_addr.__u6_addr8[12] = 0x7f; 102 ip6f->__u6_addr.__u6_addr8[15] = 0x01; 103 ip6g->__u6_addr.__u6_addr8[10] = 0xff; 104 ip6g->__u6_addr.__u6_addr8[11] = 0xfe; 105 ip6g->__u6_addr.__u6_addr8[12] = 0x7f; 106 ip6g->__u6_addr.__u6_addr8[15] = 0x01; 107 ip6h->__u6_addr.__u6_addr8[0] = 0xff; 108 ip6h->__u6_addr.__u6_addr8[1] = 0xff; 109 ip6h->__u6_addr.__u6_addr8[2] = 0xff; 110 ip6h->__u6_addr.__u6_addr8[3] = 0xff; 111 ip6h->__u6_addr.__u6_addr8[4] = 0xff; 112 ip6h->__u6_addr.__u6_addr8[5] = 0xff; 113 ip6h->__u6_addr.__u6_addr8[6] = 0xff; 114 ip6h->__u6_addr.__u6_addr8[7] = 0xff; 115 ip6h->__u6_addr.__u6_addr8[8] = 0xff; 116 ip6h->__u6_addr.__u6_addr8[9] = 0xff; 117 ip6h->__u6_addr.__u6_addr8[10] = 0xff; 118 ip6h->__u6_addr.__u6_addr8[11] = 0xff; 119 ip6h->__u6_addr.__u6_addr8[12] = 0xff; 120 ip6h->__u6_addr.__u6_addr8[13] = 0xff; 121 ip6h->__u6_addr.__u6_addr8[14] = 0xff; 122 ip6h->__u6_addr.__u6_addr8[15] = 0xff; |
120 121 printf("%s\n", inet_ntop(AF_INET, ip4a)); 122 printf("%s\n", inet_ntop(AF_INET, ip4b)); 123 printf("%s\n", inet_ntop(AF_INET, ip4c)); 124 printf("%s\n", inet_ntop(AF_INET, ip4d)); 125 printf("%s\n", inet_ntop(AF_INET6, ip6a)); 126 printf("%s\n", inet_ntop(AF_INET6, ip6b)); 127 printf("%s\n", inet_ntop(AF_INET6, ip6c)); 128 printf("%s\n", inet_ntop(AF_INET6, ip6d)); 129 printf("%s\n", inet_ntop(AF_INET6, ip6e)); 130 printf("%s\n", inet_ntop(AF_INET6, ip6f)); 131 printf("%s\n", inet_ntop(AF_INET6, ip6g)); 132 printf("%s\n", inet_ntop(AF_INET6, ip6h)); 133 134 exit(0); 135} | 123 124 printf("%s\n", inet_ntop(AF_INET, ip4a)); 125 printf("%s\n", inet_ntop(AF_INET, ip4b)); 126 printf("%s\n", inet_ntop(AF_INET, ip4c)); 127 printf("%s\n", inet_ntop(AF_INET, ip4d)); 128 printf("%s\n", inet_ntop(AF_INET6, ip6a)); 129 printf("%s\n", inet_ntop(AF_INET6, ip6b)); 130 printf("%s\n", inet_ntop(AF_INET6, ip6c)); 131 printf("%s\n", inet_ntop(AF_INET6, ip6d)); 132 printf("%s\n", inet_ntop(AF_INET6, ip6e)); 133 printf("%s\n", inet_ntop(AF_INET6, ip6f)); 134 printf("%s\n", inet_ntop(AF_INET6, ip6g)); 135 printf("%s\n", inet_ntop(AF_INET6, ip6h)); 136 137 exit(0); 138} |