Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

hook_pkt_event(9s) [opensolaris man page]

hook_pkt_event(9S)					    Data Structures for Drivers 					hook_pkt_event(9S)

NAME
hook_pkt_event - packet event structure passed through to hooks SYNOPSIS
#include <sys/neti.h> #include <sys/hook.h> #include <sys/hook_event.h> INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). DESCRIPTION
The hook_pkt_event structure contains fields that relate to a packet in a network protocol handler. This structure is passed through to a callback for NH_PRE_ROUTING, NH_POST_ROUTING, NH_FORWARDING, NH_LOOPBACK_IN and NH_LOOPBACK_OUT events. A callback may only modify the hpe_hdr, hpe_mp and hpe_mb fields. 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 hne_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; The following fields are set for each event: hne_family The protocol family for this packet. This value matches the corresponding value returned from a call to net_proto- col_lookup(9F). hpe_ifp The inbound interface for a packet. hpe_ofp The outbound interface for a packet. hpe_hdr Pointer to the start of the network protocol header within an mblk_t structure. hpe_mp Pointer to the mblk_t pointer that points to the first mblk_t structure in this packet. hpe_mb Pointer to the mblk_t structure that contains hpe_hdr. hpe_flags This field is used to carry additional properties of packets. The current collection of defined bits available is: HPE_BROADCAST This bit is set if the packet was recognized as a broadcast packet from the link layer. The bit cannot be set if HPE_MULTICAST is set, currently only possible with physical in packet events. HPE_MULTICAST This set if the packet was recognized as a multicast packet from the link layer. This bit cannot be set if HPE_BROADCAST is set, currently only possible with physical in packet events. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
net_protocol_lookup(9F), netinfo(9F) SunOS 5.11 1 May 2008 hook_pkt_event(9S)

Check Out this Related Man Page

net_isvalidchecksum(9F) 				   Kernel Functions for Drivers 				   net_isvalidchecksum(9F)

NAME
net_isvalidchecksum - verify layer 3 and layer 4 checksums SYNOPSIS
#include <sys/neti.h> int net_isvalidchecksum(const net_data_t net, mblk_t *mb); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
net value returned from a successful call to net_protocol_lookup(9F). mb the mblk structure holding a packet that is the subject of this query. DESCRIPTION
The net_isvalidchecksum() function verifies the layer 3 checksum (and, in some case, the layer 4 checksum) in the packet. If possible, fields that are used by hardware checksum'ing are examined rather than manually verifying that the checksums are present for packets received from a network interface. For both IPv4 and IPv6, TCP, UDP and ICMP (including ICMPV6 for IPv6) layer 4 checksums are currently validated. RETURN VALUES
The net_isvalidchecksum() function returns: -1 The network protocol does not support this function. 0 The packet does not contain partial checksums. 1 The packet does contain partial checksums. CONTEXT
The net_isvalidchecksum() function may be called from user, kernel, or interrupt context. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
net_ispartialchecksum(9F), net_protocol_lookup(9F), attributes(5) SunOS 5.11 1 May 2008 net_isvalidchecksum(9F)
Man Page