xref: /titanic_41/usr/src/uts/common/inet/ip2mac.h (revision 4b7cbb468ccaa93f260f3964b823da34e5b0e1e5)
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
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 /*
23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _IP2MAC_H
28 #define	_IP2MAC_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <sys/types.h>
34 #include <sys/socket_impl.h>
35 #include <net/if_dl.h>
36 
37 #ifdef _KERNEL
38 /*
39  * IP address -> link layer address conversion routines and structures.
40  */
41 typedef struct ip2mac {
42 	struct sockaddr_storage	ip2mac_pa;
43 	struct sockaddr_dl	ip2mac_ha;
44 	uint_t			ip2mac_err;
45 	uint_t			ip2mac_ifindex;
46 } ip2mac_t;
47 
48 #define	IP2MAC_RESOLVE	0x01	/* Asynchronously resolve, if needed */
49 #define	IP2MAC_LOOKUP	0x02	/* Lookup only */
50 
51 typedef void *ip2mac_id_t;
52 typedef	void (ip2mac_callback_t)(ip2mac_t *, void *);
53 
54 extern	ip2mac_id_t ip2mac(uint_t, ip2mac_t *, ip2mac_callback_t *,
55     void *, zoneid_t);
56 extern	int ip2mac_cancel(ip2mac_id_t, zoneid_t);
57 #endif /* _KERNEL */
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif /* _IP2MAC_H */
64