VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/include/mac_client_priv.h@ 25302

Last change on this file since 25302 was 25302, checked in by vboxsync, 15 years ago

Solaris/VBoxBow: crossbow netfilter initial commit, rx works, no tx.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
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/*
28 * This file contains *private* MAC API definitions. This header file
29 * should only be included by kernel components which are part of the
30 * GLDv3 stack (dld, dls, aggr, softmac).
31 */
32
33#ifndef _SYS_MAC_CLIENT_PRIV_H
34#define _SYS_MAC_CLIENT_PRIV_H
35
36#include <sys/mac.h>
37#include <sys/mac_flow.h>
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43#ifdef _KERNEL
44
45#ifdef DEBUG
46#define MAC_PERIM_HELD(mph) mac_perim_held(mph)
47#else
48#define MAC_PERIM_HELD(mph)
49#endif
50
51extern boolean_t mac_rx_bypass_set(mac_client_handle_t, mac_direct_rx_t,
52 void *);
53extern void mac_rx_bypass_enable(mac_client_handle_t);
54extern void mac_rx_bypass_disable(mac_client_handle_t);
55
56extern const mac_info_t *mac_info(mac_handle_t);
57extern boolean_t mac_info_get(const char *, mac_info_t *);
58extern boolean_t mac_promisc_get(mac_handle_t);
59
60extern int mac_start(mac_handle_t);
61extern void mac_stop(mac_handle_t);
62
63extern void mac_ioctl(mac_handle_t, queue_t *, mblk_t *);
64extern link_state_t mac_link_get(mac_handle_t);
65extern void mac_resource_set(mac_client_handle_t, mac_resource_add_t, void *);
66extern dev_info_t *mac_devinfo_get(mac_handle_t);
67extern void *mac_driver(mac_handle_t);
68extern boolean_t mac_capab_get(mac_handle_t, mac_capab_t, void *);
69extern boolean_t mac_sap_verify(mac_handle_t, uint32_t, uint32_t *);
70extern mblk_t *mac_header(mac_handle_t, const uint8_t *, uint32_t, mblk_t *,
71 size_t);
72extern int mac_header_info(mac_handle_t, mblk_t *, mac_header_info_t *);
73extern int mac_vlan_header_info(mac_handle_t, mblk_t *, mac_header_info_t *);
74extern mblk_t *mac_header_cook(mac_handle_t, mblk_t *);
75extern mblk_t *mac_header_uncook(mac_handle_t, mblk_t *);
76
77extern void mac_resource_set_common(mac_client_handle_t,
78 mac_resource_add_t, mac_resource_remove_t, mac_resource_quiesce_t,
79 mac_resource_restart_t, mac_resource_bind_t, void *);
80
81extern void mac_perim_enter_by_mh(mac_handle_t, mac_perim_handle_t *);
82extern int mac_perim_enter_by_macname(const char *, mac_perim_handle_t *);
83extern int mac_perim_enter_by_linkid(datalink_id_t, mac_perim_handle_t *);
84extern void mac_perim_exit(mac_perim_handle_t);
85extern boolean_t mac_perim_held(mac_handle_t);
86
87extern uint16_t mac_client_vid(mac_client_handle_t);
88extern int mac_vnic_unicast_set(mac_client_handle_t, const uint8_t *);
89extern boolean_t mac_client_is_vlan_vnic(mac_client_handle_t);
90
91extern void mac_client_poll_enable(mac_client_handle_t);
92extern void mac_client_poll_disable(mac_client_handle_t);
93
94extern int mac_resource_ctl_set(mac_client_handle_t, mac_resource_props_t *);
95extern void mac_resource_ctl_get(mac_client_handle_t, mac_resource_props_t *);
96
97/*
98 * Flow-related APIs for MAC clients.
99 */
100
101extern void mac_link_init_flows(mac_client_handle_t);
102extern void mac_link_release_flows(mac_client_handle_t);
103extern int mac_link_flow_add(datalink_id_t, char *, flow_desc_t *,
104 mac_resource_props_t *);
105extern int mac_link_flow_remove(char *);
106extern int mac_link_flow_modify(char *, mac_resource_props_t *);
107extern boolean_t mac_link_has_flows(mac_client_handle_t);
108
109typedef struct {
110 char fi_flow_name[MAXFLOWNAMELEN];
111 datalink_id_t fi_link_id;
112 flow_desc_t fi_flow_desc;
113 mac_resource_props_t fi_resource_props;
114} mac_flowinfo_t;
115
116extern int mac_link_flow_walk(datalink_id_t,
117 int (*)(mac_flowinfo_t *, void *), void *);
118extern int mac_link_flow_info(char *, mac_flowinfo_t *);
119
120extern void *mac_tx_hold(mac_client_handle_t);
121extern void mac_tx_rele(mac_client_handle_t, void *);
122extern void mac_rx_client_quiesce(mac_client_handle_t);
123extern void mac_rx_client_restart(mac_client_handle_t);
124extern void mac_srs_perm_quiesce(mac_client_handle_t, boolean_t);
125extern int mac_hwrings_get(mac_client_handle_t, mac_group_handle_t *,
126 mac_ring_handle_t *, mac_ring_type_t);
127extern void mac_hwring_setup(mac_ring_handle_t, mac_resource_handle_t);
128extern void mac_hwring_teardown(mac_ring_handle_t);
129extern int mac_hwring_disable_intr(mac_ring_handle_t);
130extern int mac_hwring_enable_intr(mac_ring_handle_t);
131extern int mac_hwring_start(mac_ring_handle_t);
132extern void mac_hwring_stop(mac_ring_handle_t);
133extern mblk_t *mac_hwring_poll(mac_ring_handle_t, int);
134#define MAC_HWRING_POLL(ring, bytes) \
135 (((ring)->mr_info.mri_poll) \
136 ((ring)->mr_info.mri_driver, (bytes)))
137
138extern int mac_hwgroup_addmac(mac_group_handle_t, const uint8_t *);
139extern int mac_hwgroup_remmac(mac_group_handle_t, const uint8_t *);
140
141extern void mac_set_upper_mac(mac_client_handle_t, mac_handle_t);
142
143extern int mac_mark_exclusive(mac_handle_t);
144extern void mac_unmark_exclusive(mac_handle_t);
145
146extern int32_t mac_client_intr_cpu(mac_client_handle_t);
147extern void mac_client_set_intr_cpu(void *, mac_client_handle_t, int32_t);
148extern void *mac_get_devinfo(mac_handle_t);
149
150#endif /* _KERNEL */
151
152#ifdef __cplusplus
153}
154#endif
155
156#endif /* _SYS_MAC_CLIENT_PRIV_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette