xref: /titanic_52/usr/src/uts/common/inet/ip2mac.h (revision 4b7cbb468ccaa93f260f3964b823da34e5b0e1e5)
1*4b7cbb46SSowmini Varadhan /*
2*4b7cbb46SSowmini Varadhan  * CDDL HEADER START
3*4b7cbb46SSowmini Varadhan  *
4*4b7cbb46SSowmini Varadhan  * The contents of this file are subject to the terms of the
5*4b7cbb46SSowmini Varadhan  * Common Development and Distribution License (the "License").
6*4b7cbb46SSowmini Varadhan  * You may not use this file except in compliance with the License.
7*4b7cbb46SSowmini Varadhan  *
8*4b7cbb46SSowmini Varadhan  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*4b7cbb46SSowmini Varadhan  * or http://www.opensolaris.org/os/licensing.
10*4b7cbb46SSowmini Varadhan  * See the License for the specific language governing permissions
11*4b7cbb46SSowmini Varadhan  * and limitations under the License.
12*4b7cbb46SSowmini Varadhan  *
13*4b7cbb46SSowmini Varadhan  * When distributing Covered Code, include this CDDL HEADER in each
14*4b7cbb46SSowmini Varadhan  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*4b7cbb46SSowmini Varadhan  * If applicable, add the following below this CDDL HEADER, with the
16*4b7cbb46SSowmini Varadhan  * fields enclosed by brackets "[]" replaced with your own identifying
17*4b7cbb46SSowmini Varadhan  * information: Portions Copyright [yyyy] [name of copyright owner]
18*4b7cbb46SSowmini Varadhan  *
19*4b7cbb46SSowmini Varadhan  * CDDL HEADER END
20*4b7cbb46SSowmini Varadhan  */
21*4b7cbb46SSowmini Varadhan 
22*4b7cbb46SSowmini Varadhan /*
23*4b7cbb46SSowmini Varadhan  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24*4b7cbb46SSowmini Varadhan  * Use is subject to license terms.
25*4b7cbb46SSowmini Varadhan  */
26*4b7cbb46SSowmini Varadhan 
27*4b7cbb46SSowmini Varadhan #ifndef _IP2MAC_H
28*4b7cbb46SSowmini Varadhan #define	_IP2MAC_H
29*4b7cbb46SSowmini Varadhan #ifdef __cplusplus
30*4b7cbb46SSowmini Varadhan extern "C" {
31*4b7cbb46SSowmini Varadhan #endif
32*4b7cbb46SSowmini Varadhan 
33*4b7cbb46SSowmini Varadhan #include <sys/types.h>
34*4b7cbb46SSowmini Varadhan #include <sys/socket_impl.h>
35*4b7cbb46SSowmini Varadhan #include <net/if_dl.h>
36*4b7cbb46SSowmini Varadhan 
37*4b7cbb46SSowmini Varadhan #ifdef _KERNEL
38*4b7cbb46SSowmini Varadhan /*
39*4b7cbb46SSowmini Varadhan  * IP address -> link layer address conversion routines and structures.
40*4b7cbb46SSowmini Varadhan  */
41*4b7cbb46SSowmini Varadhan typedef struct ip2mac {
42*4b7cbb46SSowmini Varadhan 	struct sockaddr_storage	ip2mac_pa;
43*4b7cbb46SSowmini Varadhan 	struct sockaddr_dl	ip2mac_ha;
44*4b7cbb46SSowmini Varadhan 	uint_t			ip2mac_err;
45*4b7cbb46SSowmini Varadhan 	uint_t			ip2mac_ifindex;
46*4b7cbb46SSowmini Varadhan } ip2mac_t;
47*4b7cbb46SSowmini Varadhan 
48*4b7cbb46SSowmini Varadhan #define	IP2MAC_RESOLVE	0x01	/* Asynchronously resolve, if needed */
49*4b7cbb46SSowmini Varadhan #define	IP2MAC_LOOKUP	0x02	/* Lookup only */
50*4b7cbb46SSowmini Varadhan 
51*4b7cbb46SSowmini Varadhan typedef void *ip2mac_id_t;
52*4b7cbb46SSowmini Varadhan typedef	void (ip2mac_callback_t)(ip2mac_t *, void *);
53*4b7cbb46SSowmini Varadhan 
54*4b7cbb46SSowmini Varadhan extern	ip2mac_id_t ip2mac(uint_t, ip2mac_t *, ip2mac_callback_t *,
55*4b7cbb46SSowmini Varadhan     void *, zoneid_t);
56*4b7cbb46SSowmini Varadhan extern	int ip2mac_cancel(ip2mac_id_t, zoneid_t);
57*4b7cbb46SSowmini Varadhan #endif /* _KERNEL */
58*4b7cbb46SSowmini Varadhan 
59*4b7cbb46SSowmini Varadhan #ifdef __cplusplus
60*4b7cbb46SSowmini Varadhan }
61*4b7cbb46SSowmini Varadhan #endif
62*4b7cbb46SSowmini Varadhan 
63*4b7cbb46SSowmini Varadhan #endif /* _IP2MAC_H */
64