if (fc) {
if (fc->BypassUpdate) {
/* flow will be possibly updated */
+ uint64_t pkts_tosrc = fc->tosrcpktcnt;
+ uint64_t bytes_tosrc = fc->tosrcbytecnt;
+ uint64_t pkts_todst = fc->todstpktcnt;
+ uint64_t bytes_todst = fc->todstbytecnt;
bool update = fc->BypassUpdate(f, fc->bypass_data, ts->tv_sec);
/* FIXME do global accounting: store pkts and bytes before and add difference here to counter */
if (update) {
flow_times_out_at = (int32_t)(f->lastts.tv_sec + timeout);
if (*next_ts == 0 || flow_times_out_at < *next_ts)
*next_ts = flow_times_out_at;
+ pkts_tosrc = fc->tosrcpktcnt - pkts_tosrc;
+ bytes_tosrc = fc->tosrcbytecnt - bytes_tosrc;
+ pkts_todst = fc->todstpktcnt - pkts_todst;
+ bytes_todst = fc->todstbytecnt - bytes_todst;
+ if (f->livedev) {
+ SC_ATOMIC_ADD(f->livedev->bypassed,
+ pkts_tosrc + pkts_todst);
+ }
return 0;
} else {
SCLogDebug("No new packet, dead flow %ld", FlowGetId(f));
uint8_t vlan_idx;
/** Incoming interface */
- const struct LiveDevice_ *livedev;
+ struct LiveDevice_ *livedev;
/** flow hash - the flow hash before hash table size mod. */
uint32_t flow_hash;