typedef struct PcapFileThreadVars_
{
+ uint32_t tenant_id;
+
/* counters */
uint32_t pkts;
uint64_t bytes;
p->datalink = pcap_g.datalink;
p->pcap_cnt = ++pcap_g.cnt;
+ p->pcap_v.tenant_id = ptv->tenant_id;
ptv->pkts++;
ptv->bytes += h->caplen;
SCReturnInt(TM_ECODE_FAILED);
memset(ptv, 0, sizeof(PcapFileThreadVars));
+ intmax_t tenant = 0;
+ if (ConfGetInt("pcap-file.tenant-id", &tenant) == 1) {
+ if (tenant > 0 && tenant < UINT_MAX) {
+ ptv->tenant_id = (uint32_t)tenant;
+ SCLogInfo("tenant %u", ptv->tenant_id);
+ } else {
+ SCLogError(SC_ERR_INVALID_ARGUMENT, "tenant out of range");
+ }
+ }
+
char errbuf[PCAP_ERRBUF_SIZE] = "";
pcap_g.pcap_handle = pcap_open_offline((char *)initdata, errbuf);
if (pcap_g.pcap_handle == NULL) {
/* per packet Pcap vars */
typedef struct PcapPacketVars_
{
+ uint32_t tenant_id;
} PcapPacketVars;
/** needs to be able to contain Windows adapter id's, so