xref: /titanic_41/usr/src/stand/lib/inet/mac_impl.h (revision 4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2002-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  *
26  * mac_impl.h contains internal MAC layer independent definttions
27  */
28 
29 #ifndef _MAC_IMPL_H
30 #define	_MAC_IMPL_H
31 
32 #pragma ident	"%Z%%M%	%I%	%E% SMI"
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 extern boolean_t	initialized;	/* TRUE if network device initialized */
39 extern int	arp_index;	/* current arp table index */
40 
41 struct mac_type {
42 	int		mac_type;	/* if_types.h */
43 	int		mac_dev;
44 	int		mac_mtu;
45 	caddr_t		mac_buf;	/* MTU sized buffer */
46 	uint8_t		*mac_addr_buf;
47 	uint32_t	mac_arp_timeout;
48 	uint32_t	mac_in_timeout;
49 	uint32_t	mac_in_timeo_incr;
50 	int		mac_addr_len;
51 	int		(*mac_arp)(struct in_addr *, void *, uint32_t);
52 	void		(*mac_rarp)(void);
53 	int		(*mac_header_len)(struct inetgram *);
54 	int		(*mac_input)(int);
55 	int		(*mac_output)(int, struct inetgram *);
56 };
57 
58 #define	ARP_TABLE_SIZE		(3)	/* size of ARP table */
59 #define	HW_ADDR_SIZE		(128)	/* max size of hardware address */
60 #define	MAC_IN_TIMEOUT		(10)	/* collect IP grams for X mseconds. */
61 #define	MAC_IN_TIMEO_MULT	(8)	/* Multiplier to arrive at maximum */
62 
63 /* format of an arp table entry */
64 struct	arptable {
65 	struct in_addr	ia;
66 	uchar_t		ha[HW_ADDR_SIZE];
67 	int		hl;
68 };
69 
70 extern void	mac_set_arp(struct in_addr *, void *, int);
71 extern void	mac_socket_init(struct inetboot_socket *);
72 
73 #ifdef	__cplusplus
74 }
75 #endif
76 
77 #endif /* _MAC_IMPL_H */
78