1hook_pkt_event(9S)        Data Structures for Drivers       hook_pkt_event(9S)
2
3
4

NAME

6       hook_pkt_event - packet event structure passed through to hooks
7

SYNOPSIS

9       #include <sys/neti.h>
10       #include <sys/hook.h>
11       #include <sys/hook_event.h>
12
13

INTERFACE LEVEL

15       Solaris DDI specific (Solaris DDI).
16

DESCRIPTION

18       The hook_pkt_event structure contains fields that relate to a packet in
19       a network protocol handler. This structure is passed through to a call‐
20       back for NH_PRE_ROUTING, NH_POST_ROUTING, NH_FORWARDING, NH_LOOPBACK_IN
21       and NH_LOOPBACK_OUT events.
22
23
24       A callback may only modify the hpe_hdr, hpe_mp and hpe_mb fields.
25
26
27       The following table documents which fields can  be  safely  used  as  a
28       result of each event.
29
30         Event            hpe_ifp     hpe_ofp     hpe_hdr     hpe_mp     hpe_mb
31         -----            -------     -------     -------     ------     ------
32         NH_PRE_ROUTING      yes                     yes         yes       yes
33         NH_POST_ROUTING                 yes         yes         yes       yes
34         NH_FORWARDING       yes         yes         yes         yes       yes
35         NH_LOOPBACK_IN      yes                     yes         yes       yes
36         NH_LOOPBACK_OUT                 yes         yes         yes       yes
37
38
39

STRUCTURE MEMBERS

41         net_data_t           hne_family;
42         phy_if_t             hpe_ifp;
43         phy_if_t             hpe_ofp;
44         void                 *hpe_hdr;
45         mblk_t               *hpe_mp;
46         mblk_t               *hpe_mb;
47         uint32_t             hpe_flags;
48
49
50
51
52
53       The following fields are set for each event:
54
55       hne_family    The  protocol  family for this packet. This value matches
56                     the corresponding value returned from a call to  net_pro‐
57                     tocol_lookup(9F).
58
59
60       hpe_ifp       The inbound interface for a packet.
61
62
63       hpe_ofp       The outbound interface for a packet.
64
65
66       hpe_hdr       Pointer  to  the  start  of  the  network protocol header
67                     within an mblk_t structure.
68
69
70       hpe_mp        Pointer to the mblk_t pointer that points  to  the  first
71                     mblk_t structure in this packet.
72
73
74       hpe_mb        Pointer to the mblk_t structure that contains hpe_hdr.
75
76
77       hpe_flags    This field is used to carry additional properties of pack‐
78                    ets. The current collection of defined bits available is:
79
80                    HPE_BROADCAST    This bit is set if the packet was  recog‐
81                                     nized as a broadcast packet from the link
82                                     layer. The bit cannot be set if  HPE_MUL‐
83                                     TICAST  is  set,  currently only possible
84                                     with physical in packet events.
85
86
87                    HPE_MULTICAST    This set if the packet was recognized  as
88                                     a  multicast  packet from the link layer.
89                                     This bit cannot be set  if  HPE_BROADCAST
90                                     is  set,  currently  only  possible  with
91                                     physical in packet events.
92
93
94

ATTRIBUTES

96       See attributes(5) for descriptions of the following attributes:
97
98
99
100
101       ┌─────────────────────────────┬─────────────────────────────┐
102       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
103       ├─────────────────────────────┼─────────────────────────────┤
104       │Interface Stability          │Committed                    │
105       └─────────────────────────────┴─────────────────────────────┘
106

SEE ALSO

108       net_protocol_lookup(9F), netinfo(9F)
109
110
111
112SunOS 5.11                        1 May 2008                hook_pkt_event(9S)
Impressum