Skip Navigation Links | |
Exit Print View | |
man pages section 9: DDI and DKI Kernel Functions Oracle Solaris 11.1 Information Library |
csx_AccessConfigurationRegister(9F)
csx_Parse_CISTPL_BYTEORDER(9F)
csx_Parse_CISTPL_CFTABLE_ENTRY(9F)
csx_Parse_CISTPL_DEVICEGEO(9F)
csx_Parse_CISTPL_DEVICEGEO_A(9F)
csx_Parse_CISTPL_DEVICE_OA(9F)
csx_Parse_CISTPL_DEVICE_OC(9F)
csx_Parse_CISTPL_LINKTARGET(9F)
csx_Parse_CISTPL_LONGLINK_A(9F)
csx_Parse_CISTPL_LONGLINK_C(9F)
csx_Parse_CISTPL_LONGLINK_MFC(9F)
ddi_get_soft_iblock_cookie(9F)
ddi_intr_get_supported_types(9F)
ddi_prop_lookup_byte_array(9F)
ddi_prop_lookup_int64_array(9F)
ddi_prop_lookup_string_array(9F)
ddi_prop_update_byte_array(9F)
ddi_prop_update_int64_array(9F)
ddi_prop_update_string_array(9F)
ldi_prop_lookup_byte_array(9F)
ldi_prop_lookup_int64_array(9F)
ldi_prop_lookup_string_array(9F)
mac_prop_info_set_default_link_flowctrl(9F)
mac_prop_info_set_default_str(9F)
mac_prop_info_set_default_uint8(9F)
mac_prop_info_set_range_uint32(9F)
net_event_notify_unregister(9F)
net_instance_notify_register(9F)
net_instance_notify_unregister(9F)
net_instance_protocol_unregister(9F)
net_protocol_notify_register(9F)
nvlist_lookup_boolean_array(9F)
nvlist_lookup_boolean_value(9F)
nvlist_lookup_nvlist_array(9F)
nvlist_lookup_string_array(9F)
nvlist_lookup_uint16_array(9F)
nvlist_lookup_uint32_array(9F)
nvlist_lookup_uint64_array(9F)
nvpair_value_boolean_array(9F)
pci_plist_lookup_int16_array(9F)
pci_plist_lookup_int32_array(9F)
pci_plist_lookup_int64_array(9F)
pci_plist_lookup_int8_array(9F)
pci_plist_lookup_string_array(9F)
pci_plist_lookup_uint16_array(9F)
pci_plist_lookup_uint32_array(9F)
pci_plist_lookup_uint64_array(9F)
pci_plist_lookup_uint8_array(9F)
scsi_get_device_type_scsi_options(9F)
scsi_get_device_type_string(9F)
scsi_sense_cmdspecific_uint64(9F)
usb_get_current_frame_number(9F)
usb_get_max_pkts_per_isoc_request(9F)
usb_pipe_get_max_bulk_transfer_size(9F)
usb_pipe_stop_intr_polling(9F)
usb_pipe_stop_isoc_polling(9F)
- access and create control messages
#include <sys/sockfilter.h> boolean_t sof_mblk_msghdr(sof_handle_t hdl, mblk_t *mp, struct msghdr *msg, int flags);
mblk_t *sof_mblk_create(sof_handle_t hdl, struct msghdr *msg, int flags);
per-socket filter handle
pointer to a message header structure, as defined in socket.h(3HEAD)
pointer to a msgb(9S) structure
either 0 or SOF_MBLK_CMSG
The sof_mblk_msghdr() function is used to obtain message header information from a message block. On success, msg_name will point to a location within the message block containing address information, and msg_namelen will reflect the size of the address. Any changes made to the content pointed to by msg_name will be made to the underlying message block. The content pointed to by msg_control should be treated as opaque data unless SOF_MBLK_CMSG is specified. If SOF_MBLK_CMSG is specified, then the caller must also provide a buffer, pointed to by msg_control, where ancillary data will be stored. msg_controllen is updated on return to reflect the amount of ancillary data. If there is not enough room in the provided buffer to copy out all control data, then none of it will be copied, and MSG_CTRUNC will be set on msg_flags.
The sof_mblk_create() function tries to allocate a message block that is large enough to contain the address and control data provided in the message header, and copies the information into the newly created message block. If SOF_MBLK_CMSG is not specified, then msg_control should either be NULL, or point to the opaque data returned in msg_control by a previous call to sof_mblk_msghdr(). If SOF_MBLK_CMSG is specified, then msg_control points to a buffer containing cmsghdr structures.
The sof_mblk_msghdr() function returns B_TRUE if a message header was found, and B_FALSE otherwise.
If successful, sof_mblk_create() returns a pointer to the allocated message block. On failure, sof_mblk_create() returns a null pointer.
Example 1 Access and modify address information
mblk_t *xx_data_in(sof_handle_t hdl, void *cookie, mblk_t *mp) { xxpriv_t *priv = cookie; struct msghdr msg; /* * Extract name information. The filter is not interested in * control data. */ if (sof_mblk_msghdr(hdl, mp, &msg, 0)) { (void) strncpy(msg.msg_name, priv->xx_addr, msg.msg_namelen); } return (mp); }
Example 2 Update ancillary data
mblk_t *xx_data_in(sof_handle_t hdl, void *cookie, mblk_t *mp) { xxpriv_t *priv = cookie; struct msghdr msg; char buf[XX_BUFLEN]; msg.msg_control = buf; msg.msg_controllen = sizeof (buf); /* Process any ancillary data. */ if (sof_mblk_msghdr(hdl, mp, &msg, SOF_MBLK_CMSG)) { mblk_t *nmp; xx_proc_ctrl(&msg); /* msghdr has cmsghdr control data. */ nmp = sof_mblk_create(hdl, &msg, SOF_MBLK_CMSG); if (nmp != NULL) { nmp->b_cont = mp->b_cont; freeb(mp); mp = nmp; } } return (mp); }
The sof_mblk_msghdr() and sof_mblk_create() functions can be called from any context.
See attributes(5) for descriptions of the following attributes:
|
socket.h(3HEAD), attributes(5), sofop_data_in(9E), sof_inject_data_in(9F), msgb(9S)