From e6eb65be0041bbf38be38219765bda0f92fae978 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 17 Oct 2013 16:49:31 -0400 Subject: Netconf support for ARP and NDP caching TTLs. --- netconf-service/netconf.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'netconf-service') diff --git a/netconf-service/netconf.cpp b/netconf-service/netconf.cpp index 71cf38b9..c061c98d 100644 --- a/netconf-service/netconf.cpp +++ b/netconf-service/netconf.cpp @@ -245,11 +245,13 @@ int main(int argc,char **argv) unsigned int multicastDepth = 0; bool emulateArp = false; bool emulateNdp = false; + unsigned int arpCacheTtl = 0; + unsigned int ndpCacheTtl = 0; std::string name; std::string desc; { Query q = dbCon->query(); - q << "SELECT name,`desc`,isOpen,multicastPrefixBits,multicastDepth,emulateArp,emulateNdp FROM Network WHERE id = " << nwid; + q << "SELECT name,`desc`,isOpen,multicastPrefixBits,multicastDepth,emulateArp,emulateNdp,arpCacheTtl,ndpCacheTtl FROM Network WHERE id = " << nwid; StoreQueryResult rs = q.store(); if (rs.num_rows() > 0) { name = rs[0]["name"].c_str(); @@ -257,6 +259,8 @@ int main(int argc,char **argv) isOpen = ((int)rs[0]["isOpen"] > 0); emulateArp = ((int)rs[0]["emulateArp"] > 0); emulateNdp = ((int)rs[0]["emulateNdp"] > 0); + arpCacheTtl = (unsigned int)rs[0]["arpCacheTtl"]; + ndpCacheTtl = (unsigned int)rs[0]["ndpCacheTtl"]; multicastPrefixBits = (unsigned int)rs[0]["multicastPrefixBits"]; multicastDepth = (unsigned int)rs[0]["multicastDepth"]; } else { @@ -427,6 +431,10 @@ int main(int argc,char **argv) netconf["ts"] = buf; netconf["eARP"] = (emulateArp ? "1" : "0"); netconf["eNDP"] = (emulateNdp ? "1" : "0"); + sprintf(buf,"%x",arpCacheTtl); + netconf["cARP"] = buf; + sprintf(buf,"%x",ndpCacheTtl); + netconf["cNDP"] = buf; if (multicastPrefixBits) { sprintf(buf,"%x",multicastPrefixBits); netconf["mpb"] = buf; -- cgit v1.2.3