Print this page
inet_pton


   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
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */



  25 
  26 #ifndef _INET_IP6_H
  27 #define _INET_IP6_H
  28 
  29 #ifdef  __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <sys/isa_defs.h>
  34 
  35 #ifdef  _KERNEL
  36 /* icmp6_t is used in the prototype of icmp_inbound_error_fanout_v6() */
  37 #include <netinet/icmp6.h>
  38 #endif  /* _KERNEL */
  39 
  40 /* version number for IPv6 - hard to get this one wrong! */
  41 #define IPV6_VERSION            6
  42 
  43 #define IPV6_HDR_LEN            40
  44 


 209                                                 ILL_FRAG_HASH_TBL_COUNT)
 210 
 211 
 212 /*
 213  * GLOBAL EXTERNALS
 214  */
 215 extern const in6_addr_t ipv6_all_ones;
 216 extern const in6_addr_t ipv6_all_zeros;
 217 extern const in6_addr_t ipv6_loopback;
 218 extern const in6_addr_t ipv6_all_hosts_mcast;
 219 extern const in6_addr_t ipv6_all_rtrs_mcast;
 220 extern const in6_addr_t ipv6_all_v2rtrs_mcast;
 221 extern const in6_addr_t ipv6_solicited_node_mcast;
 222 extern const in6_addr_t ipv6_unspecified_group;
 223 
 224 /*
 225  * FUNCTION PROTOTYPES
 226  */
 227 
 228 extern void     convert2ascii(char *buf, const in6_addr_t *addr);
 229 extern char     *inet_ntop(int, const void *, char *, int);
 230 extern int      inet_pton(int, char *, void *);
 231 extern void     icmp_param_problem_nexthdr_v6(mblk_t *, boolean_t,
 232     ip_recv_attr_t *);
 233 extern void     icmp_pkt2big_v6(mblk_t *, uint32_t, boolean_t,
 234     ip_recv_attr_t *);
 235 extern void     icmp_time_exceeded_v6(mblk_t *, uint8_t, boolean_t,
 236     ip_recv_attr_t *);
 237 extern void     icmp_unreachable_v6(mblk_t *, uint8_t, boolean_t,
 238     ip_recv_attr_t *);
 239 extern mblk_t   *icmp_inbound_v6(mblk_t *, ip_recv_attr_t *);
 240 extern void     icmp_inbound_error_fanout_v6(mblk_t *, icmp6_t *,
 241     ip_recv_attr_t *);
 242 extern void     icmp_update_out_mib_v6(ill_t *, icmp6_t *);
 243 
 244 extern boolean_t conn_wantpacket_v6(conn_t *, ip_recv_attr_t *, ip6_t *);
 245 
 246 extern in6addr_scope_t  ip_addr_scope_v6(const in6_addr_t *);
 247 extern void     ip_build_hdrs_v6(uchar_t *, uint_t, const ip_pkt_t *, uint8_t,
 248     uint32_t);
 249 extern void     ip_fanout_udp_multi_v6(mblk_t *, ip6_t *, uint16_t, uint16_t,
 250     ip_recv_attr_t *);




   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
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 /*
  26  * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  27  */
  28 
  29 #ifndef _INET_IP6_H
  30 #define _INET_IP6_H
  31 
  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 #include <sys/isa_defs.h>
  37 
  38 #ifdef  _KERNEL
  39 /* icmp6_t is used in the prototype of icmp_inbound_error_fanout_v6() */
  40 #include <netinet/icmp6.h>
  41 #endif  /* _KERNEL */
  42 
  43 /* version number for IPv6 - hard to get this one wrong! */
  44 #define IPV6_VERSION            6
  45 
  46 #define IPV6_HDR_LEN            40
  47 


 212                                                 ILL_FRAG_HASH_TBL_COUNT)
 213 
 214 
 215 /*
 216  * GLOBAL EXTERNALS
 217  */
 218 extern const in6_addr_t ipv6_all_ones;
 219 extern const in6_addr_t ipv6_all_zeros;
 220 extern const in6_addr_t ipv6_loopback;
 221 extern const in6_addr_t ipv6_all_hosts_mcast;
 222 extern const in6_addr_t ipv6_all_rtrs_mcast;
 223 extern const in6_addr_t ipv6_all_v2rtrs_mcast;
 224 extern const in6_addr_t ipv6_solicited_node_mcast;
 225 extern const in6_addr_t ipv6_unspecified_group;
 226 
 227 /*
 228  * FUNCTION PROTOTYPES
 229  */
 230 
 231 extern void     convert2ascii(char *buf, const in6_addr_t *addr);


 232 extern void     icmp_param_problem_nexthdr_v6(mblk_t *, boolean_t,
 233     ip_recv_attr_t *);
 234 extern void     icmp_pkt2big_v6(mblk_t *, uint32_t, boolean_t,
 235     ip_recv_attr_t *);
 236 extern void     icmp_time_exceeded_v6(mblk_t *, uint8_t, boolean_t,
 237     ip_recv_attr_t *);
 238 extern void     icmp_unreachable_v6(mblk_t *, uint8_t, boolean_t,
 239     ip_recv_attr_t *);
 240 extern mblk_t   *icmp_inbound_v6(mblk_t *, ip_recv_attr_t *);
 241 extern void     icmp_inbound_error_fanout_v6(mblk_t *, icmp6_t *,
 242     ip_recv_attr_t *);
 243 extern void     icmp_update_out_mib_v6(ill_t *, icmp6_t *);
 244 
 245 extern boolean_t conn_wantpacket_v6(conn_t *, ip_recv_attr_t *, ip6_t *);
 246 
 247 extern in6addr_scope_t  ip_addr_scope_v6(const in6_addr_t *);
 248 extern void     ip_build_hdrs_v6(uchar_t *, uint_t, const ip_pkt_t *, uint8_t,
 249     uint32_t);
 250 extern void     ip_fanout_udp_multi_v6(mblk_t *, ip6_t *, uint16_t, uint16_t,
 251     ip_recv_attr_t *);