Type: improvement
This patch implements support for retrieving private data length via ioctl.
The private data pointer is set in the message header,
and when Snort processes the packet, it can request the length
of this private data through the ioctl interface.
Signed-off-by: Mohsin Kazmi <[email protected]>
Change-Id: I02a831557b349bab7c9c8fe2e00cd8b085d3e5f7
return DAQ_ERROR_NODEV;
}
+ else if (cmd == DIOCTL_GET_PRIV_DATA_LEN)
+ {
+ DIOCTL_GetPrivDataLen *gpl = (DIOCTL_GetPrivDataLen *) arg;
+
+ if (arglen != sizeof (DIOCTL_GetPrivDataLen))
+ return DAQ_ERROR_NOTSUP;
+ if (gpl->msg->priv != NULL)
+ gpl->priv_data_len = sizeof (daq_vpp_msg_pool_entry_t);
+ else
+ gpl->priv_data_len = 0;
+
+ DEBUG ("ioctl cmd %s %u", daq_vpp_ioctl_cmd_to_str (cmd),
+ gpl->priv_data_len);
+ return DAQ_SUCCESS;
+ }
return DAQ_ERROR_NOTSUP;
}