Merge remote branch 'origin/topic/robin/conn-ids'

* origin/topic/robin/conn-ids:
  Moving uid from conn_id to connection, and making output determistic if a hash seed is given.
  Extending conn_id with a globally unique identifiers.
This commit is contained in:
Robin Sommer 2011-04-22 22:09:44 -07:00
commit 59d6202104
16 changed files with 271 additions and 6 deletions

View file

@ -521,6 +521,8 @@ Connection* ConnCompressor::Instantiate(HashKey* key, PendingConn* pending)
return 0;
}
new_conn->SetUID(pending->uid);
DBG_LOG(DBG_COMPRESSOR, "%s instantiated", fmt_conn_id(pending));
++sizes.connections;
@ -608,6 +610,7 @@ void ConnCompressor::PktHdrToPendingConn(double time, const HashKey* key,
c->FIN = (tp->th_flags & TH_FIN) != 0;
c->RST = (tp->th_flags & TH_RST) != 0;
c->ACK = (tp->th_flags & TH_ACK) != 0;
c->uid = Connection::CalculateNextUID();
c->invalid = 0;
if ( TCP_Analyzer::ParseTCPOptions(tp, parse_tcp_options, 0, 0, c) < 0 )
@ -877,6 +880,9 @@ void ConnCompressor::Event(const PendingConn* pending, double t,
conn_val->Assign(7, new Val(0, TYPE_COUNT)); // hot
conn_val->Assign(8, new StringVal("")); // history
char tmp[20]; // uid.
conn_val->Assign(9, new StringVal(uitoa_n(pending->uid, tmp, sizeof(tmp), 62)));
conn_val->SetOrigin(0);
}