Index: head/share/man/man4/siftr.4 =================================================================== --- head/share/man/man4/siftr.4 +++ head/share/man/man4/siftr.4 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2010 +.Dd March 18, 2015 .Dt SIFTR 4 .Os .Sh NAME @@ -335,6 +335,13 @@ .It Va 26 The current number of segments in the reassembly queue. .El +.Bl -tag -offset indent -width Va +.It Va 27 +Flowid for the connection. +A caveat: Zero '0' either represents a valid flowid or a default value when it's +not being set. There is no easy way to differentiate without looking at actual +network interface card and drivers being used. +.El .Pp The third type of log message is written to the file when the module is disabled and ceases collecting data from the running kernel. Index: head/sys/netinet/siftr.c =================================================================== --- head/sys/netinet/siftr.c +++ head/sys/netinet/siftr.c @@ -227,6 +227,8 @@ u_int sent_inflight_bytes; /* Number of segments currently in the reassembly queue. */ int t_segqlen; + /* Flowid for the connection. */ + u_int flowid; /* Link to next pkt_node in the list. */ STAILQ_ENTRY(pkt_node) nodes; }; @@ -485,7 +487,8 @@ pkt_node->rcv_buf_hiwater, pkt_node->rcv_buf_cc, pkt_node->sent_inflight_bytes, - pkt_node->t_segqlen); + pkt_node->t_segqlen, + pkt_node->flowid); } else { /* IPv4 packet */ pkt_node->ip_laddr[0] = FIRST_OCTET(pkt_node->ip_laddr[3]); pkt_node->ip_laddr[1] = SECOND_OCTET(pkt_node->ip_laddr[3]); @@ -501,7 +504,7 @@ log_buf->ae_bytesused = snprintf(log_buf->ae_data, MAX_LOG_MSG_LEN, "%c,0x%08x,%jd.%06ld,%u.%u.%u.%u,%u,%u.%u.%u.%u,%u,%ld,%ld," - "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u\n", + "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u,%u\n", direction[pkt_node->direction], pkt_node->hash, (intmax_t)pkt_node->tval.tv_sec, @@ -534,7 +537,8 @@ pkt_node->rcv_buf_hiwater, pkt_node->rcv_buf_cc, pkt_node->sent_inflight_bytes, - pkt_node->t_segqlen); + pkt_node->t_segqlen, + pkt_node->flowid); #ifdef SIFTR_IPV6 } #endif @@ -787,6 +791,7 @@ pn->rcv_buf_cc = sbused(&inp->inp_socket->so_rcv); pn->sent_inflight_bytes = tp->snd_max - tp->snd_una; pn->t_segqlen = tp->t_segqlen; + pn->flowid = inp->inp_flowid; /* We've finished accessing the tcb so release the lock. */ if (inp_locally_locked)