2 .\" Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH HOOK_PKT_EVENT 9S "May 1, 2008"
8 hook_pkt_event \- packet event structure passed through to hooks
14 #include <sys/hook_event.h>
20 Solaris DDI specific (Solaris DDI).
24 The \fBhook_pkt_event\fR structure contains fields that relate to a packet in a
25 network protocol handler. This structure is passed through to a callback for
26 \fBNH_PRE_ROUTING\fR, \fBNH_POST_ROUTING\fR, \fBNH_FORWARDING\fR,
27 \fBNH_LOOPBACK_IN\fR and \fBNH_LOOPBACK_OUT\fR events.
30 A callback may only modify the \fBhpe_hdr\fR, \fBhpe_mp\fR and \fBhpe_mb\fR
34 The following table documents which fields can be safely used as a result of
39 Event hpe_ifp hpe_ofp hpe_hdr hpe_mp hpe_mb
40 ----- ------- ------- ------- ------ ------
41 NH_PRE_ROUTING yes yes yes yes
42 NH_POST_ROUTING yes yes yes yes
43 NH_FORWARDING yes yes yes yes yes
44 NH_LOOPBACK_IN yes yes yes yes
45 NH_LOOPBACK_OUT yes yes yes yes
54 net_data_t hne_family;
68 The following fields are set for each event:
72 \fB\fBhne_family\fR\fR
75 The protocol family for this packet. This value matches the corresponding value
76 returned from a call to \fBnet_protocol_lookup\fR(9F).
85 The inbound interface for a packet.
94 The outbound interface for a packet.
103 Pointer to the start of the network protocol header within an \fBmblk_t\fR
113 Pointer to the \fBmblk_t\fR pointer that points to the first \fBmblk_t\fR
114 structure in this packet.
123 Pointer to the \fBmblk_t\fR structure that contains \fBhpe_hdr\fR.
129 \fB\fBhpe_flags\fR\fR
132 This field is used to carry additional properties of packets. The current
133 collection of defined bits available is:
137 \fB\fBHPE_BROADCAST\fR\fR
140 This bit is set if the packet was recognized as a broadcast packet from the
141 link layer. The bit cannot be set if \fBHPE_MULTICAST\fR is set, currently only
142 possible with physical in packet events.
148 \fB\fBHPE_MULTICAST\fR\fR
151 This set if the packet was recognized as a multicast packet from the link
152 layer. This bit cannot be set if \fBHPE_BROADCAST\fR is set, currently only
153 possible with physical in packet events.
161 See \fBattributes\fR(5) for descriptions of the following attributes:
169 ATTRIBUTE TYPE ATTRIBUTE VALUE
171 Interface Stability Committed
177 \fBnet_protocol_lookup\fR(9F), \fBnetinfo\fR(9F)