Kernel functions hook_pkt_event(9s) NAME hook_pkt_event - packet event structure passed through to hooks SYNOPSIS #include #include #include INTERFACE LEVEL Solaris DDI specific (Solaris DDI) DESCRIPTION hook_pkt_event contains fields that relate to a packet as is in a network protocol handler. This structure is passed through to a callback for NH_PRE_ROUTING, NH_FORWARDING, NH_POST_ROUTING, NH_LOOPBACK_IN and NH_LOOPBACK_OUT events. A callback may modify the hpe_hdr, hpe_mp and hpe_mb fields. A callback may not modify either of hpe_ifp or hpe_ofp. The following table documents which fields can be safely used as a result of each event. _________________________________________________________________ | Event | hpe_ifp | hpe_ofp | hpe_hdr | hpe_mp | hpe_mb | |_________________|_________|_________|_________|________|________| | NH_PRE_ROUTING | Yes | | Yes | Yes | Yes | | NH_POST_ROUTING | | Yes | Yes | Yes | Yes | | NH_FORWARDING | Yes | Yes | Yes | Yes | Yes | | NH_LOOPBACK_IN | Yes | | Yes | Yes | Yes | | NH_LOOPBACK_OUT | | Yes | Yes | Yes | Yes | |_________________|_________|_________|_________|________|________| STRUCTURE MEMBERS net_data_t hpe_family; phy_if_t hpe_ifp; phy_if_t hpe_ofp; void *hpe_hdr; mblk_t **hpe_mp; mblk_t *hpe_mb; uint32_t hpe_flags; hpe_family The protocol family for this packet. The value found here will match the corresponding value returned from a call to net_protocol_lookup(9f). hpe_ifp The inbound interface for a packet. hpe_ofp The outbound interface for a packet. SunOS 5.10 Last change: DD Month 2007 1 Kernel functions hook_pkt_event(9s) hpe_hdr Pointer to the start of the network protocol header, within an mblk_t. hpe_mp Pointer to the mblk_t pointer that points to the first mblk_t in this packet. hpe_mb Pointer to the mblk_t that contains hpe_hdr. The relationship of hpe_hdr, hpe_mp and hpe_mb can be illus- trated as follows. hpe_mp | V mb hpe_mb | | V V +--------+ +----------+ +--------+ __-------->+-------+ | mblk_t | | mblk_t | | b_rptr--/ |data | | b_cont----->| db_datap----->| b_wptr--\ hpe_hdr->|header | +--------+ +----------+ +--------+ \ |data | \ +-------+ \________________^ hpe_flags This field is used to carry additional properties of packets. THe current collection of defined bits is: HPE_BROADCAST Set if the packet was recognised as a broadcast packet from the link layer. Cannot be set if HPE_MULTICAST is set, currently oly possible with physical in packat events. HPE_MULTICAST Set if the packet was recognised as a multicast packet from the link layer. Cannot be set if HPE_BROADCAST is set, currently oly possible with physical in packat events. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| SunOS 5.10 Last change: DD Month 2007 2 Kernel functions hook_pkt_event(9s) SEE ALSO netinfo(9f), SunOS 5.10 Last change: DD Month 2007 3