From: Mohsin Kazmi Date: Fri, 19 Sep 2025 16:07:56 +0000 (+0000) Subject: snort: add support for DIOCTL_GET_PRIV_DATA_LEN X-Git-Tag: v26.02-rc0~7 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F09%2F43609%2F2;p=vpp.git snort: add support for DIOCTL_GET_PRIV_DATA_LEN 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 Change-Id: I02a831557b349bab7c9c8fe2e00cd8b085d3e5f7 --- diff --git a/src/plugins/snort/daq/main.c b/src/plugins/snort/daq/main.c index 8c03ede6487..448ad83b376 100644 --- a/src/plugins/snort/daq/main.c +++ b/src/plugins/snort/daq/main.c @@ -787,6 +787,21 @@ daq_vpp_ioctl (void *handle, DAQ_IoctlCmd cmd, void *arg, size_t arglen) 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; }