//=========================================================================== // $Name: cflowd-2-1-b1 $ // $Id: CflowdConfig.cc.in,v 1.1 1999/01/25 09:37:50 dwm Exp $ //=========================================================================== // CAIDA Copyright Notice // // By accessing this software, cflowd++, you are duly informed // of and agree to be bound by the conditions described below in this // notice: // // This software product, cflowd++, is developed by Daniel W. McRobb, and // copyrighted(C) 1998 by the University of California, San Diego // (UCSD), with all rights reserved. UCSD administers the CAIDA grant, // NCR-9711092, under which part of this code was developed. // // There is no charge for cflowd++ software. You can redistribute it // and/or modify it under the terms of the GNU General Public License, // v. 2 dated June 1991 which is incorporated by reference herein. // cflowd++ is distributed WITHOUT ANY WARRANTY, IMPLIED OR EXPRESS, OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE or that the use // of it will not infringe on any third party's intellectual property // rights. // // You should have received a copy of the GNU GPL along with cflowd++. // Copies can also be obtained from: // // http://www.gnu.org/copyleft/gpl.html // // or by writing to: // // University of California, San Diego // // SDSC/CAIDA // 9500 Gilman Dr., MS-0505 // La Jolla, CA 92093 - 0505 USA // // Or contact: // // info@caida.org //=========================================================================== #include "CflowdConfig.hh" static const string rcsid = "@(#) $Name: cflowd-2-1-b1 $ $Id: CflowdConfig.cc.in,v 1.1 1999/01/25 09:37:50 dwm Exp $"; //------------------------------------------------------------------------- // CflowdConfig::CflowdConfig() //......................................................................... // //------------------------------------------------------------------------- CflowdConfig::CflowdConfig() { this->_logFacility = LOG_LOCAL6; this->_tcpCollectPort = 2056; this->_pktBufSize = 1024 * 1024; this->_flowFileLength = 1048576; this->_numFlowFiles = 10; this->_minLogMissed = 300; } //------------------------------------------------------------------------- // CflowdConfig::~CflowdConfig() //......................................................................... // //------------------------------------------------------------------------- CflowdConfig::~CflowdConfig() { } //------------------------------------------------------------------------- // int CflowdConfig::LogFacility() const //......................................................................... // //------------------------------------------------------------------------- int CflowdConfig::LogFacility() const { return(this->_logFacility); } //------------------------------------------------------------------------- // int CflowdConfig::LogFacility(int logFacility) //......................................................................... // //------------------------------------------------------------------------- int CflowdConfig::LogFacility(int logFacility) { this->_logFacility = logFacility; return(this->_logFacility); } //------------------------------------------------------------------------- // int CflowdConfig::TcpCollectPort() const //......................................................................... // //------------------------------------------------------------------------- int CflowdConfig::TcpCollectPort() const { return(this->_tcpCollectPort); } //------------------------------------------------------------------------- // int CflowdConfig::TcpCollectPort(int tcpCollectPort) //......................................................................... // //------------------------------------------------------------------------- int CflowdConfig::TcpCollectPort(int tcpCollectPort) { this->_tcpCollectPort = tcpCollectPort; return(this->_tcpCollectPort); } //------------------------------------------------------------------------- // size_t CflowdConfig::PacketBufSize() const //......................................................................... // //------------------------------------------------------------------------- size_t CflowdConfig::PacketBufSize() const { return(this->_pktBufSize); } //------------------------------------------------------------------------- // size_t CflowdConfig::PacketBufSize(size_t pktBufSize) //......................................................................... // //------------------------------------------------------------------------- size_t CflowdConfig::PacketBufSize(size_t pktBufSize) { this->_pktBufSize = pktBufSize; return(this->_pktBufSize); } //------------------------------------------------------------------------- // const string & CflowdConfig::MapDirectory() const //......................................................................... // //------------------------------------------------------------------------- const string & CflowdConfig::MapDirectory() const { return(this->_mapDirectory); } //------------------------------------------------------------------------- // const string & CflowdConfig::MapDirectory(const string & mapDirectory) //......................................................................... // //------------------------------------------------------------------------- const string & CflowdConfig::MapDirectory(const string & mapDirectory) { this->_mapDirectory = mapDirectory; return(this->_mapDirectory); } //------------------------------------------------------------------------- // const string & CflowdConfig::RawFlowSockFile() const //......................................................................... // //------------------------------------------------------------------------- const string & CflowdConfig::RawFlowSockFile() const { return(this->_rawFlowSockFile); } //------------------------------------------------------------------------- // const string & // CflowdConfig::RawFlowSockFile(const string & rawFlowSockFile) //......................................................................... // //------------------------------------------------------------------------- const string & CflowdConfig::RawFlowSockFile(const string & rawFlowSockFile) { this->_rawFlowSockFile = rawFlowSockFile; return(this->_rawFlowSockFile); } //------------------------------------------------------------------------- // const string & CflowdConfig::TableSockFile() const //......................................................................... // //------------------------------------------------------------------------- const string & CflowdConfig::TableSockFile() const { return(this->_tableSockFile); } //------------------------------------------------------------------------- // const string & // CflowdConfig::TableSockFile(const string & tableSockFile) //......................................................................... // //------------------------------------------------------------------------- const string & CflowdConfig::TableSockFile(const string & tableSockFile) { this->_tableSockFile = tableSockFile; return(this->_tableSockFile); } //------------------------------------------------------------------------- // const string & CflowdConfig::FlowDirectory() const //......................................................................... // //------------------------------------------------------------------------- const string & CflowdConfig::FlowDirectory() const { return(this->_flowDirectory); } //------------------------------------------------------------------------- // const string & CflowdConfig::FlowDirectory(const string & flowDirectory) //......................................................................... // //------------------------------------------------------------------------- const string & CflowdConfig::FlowDirectory(const string & flowDirectory) { this->_flowDirectory = flowDirectory; return(this->_flowDirectory); } //------------------------------------------------------------------------- // uint32_t CflowdConfig::FlowFileLength() const //......................................................................... // //------------------------------------------------------------------------- uint32_t CflowdConfig::FlowFileLength() const { return(this->_flowFileLength); } //------------------------------------------------------------------------- // uint32_t CflowdConfig::FlowFileLength(uint32_t flowFileLength) //......................................................................... // //------------------------------------------------------------------------- uint32_t CflowdConfig::FlowFileLength(uint32_t flowFileLength) { this->_flowFileLength = flowFileLength; return(this->_flowFileLength); } //------------------------------------------------------------------------- // uint32_t CflowdConfig::NumFlowFiles() const //......................................................................... // //------------------------------------------------------------------------- uint32_t CflowdConfig::NumFlowFiles() const { return(this->_numFlowFiles); } //------------------------------------------------------------------------- // uint32_t CflowdConfig::NumFlowFiles(uint32_t numFlowFiles) //......................................................................... // //------------------------------------------------------------------------- uint32_t CflowdConfig::NumFlowFiles(uint32_t numFlowFiles) { this->_numFlowFiles = numFlowFiles; return(this->_numFlowFiles); } //------------------------------------------------------------------------- // uint32_t CflowdConfig::MinLogMissed() const //......................................................................... // //------------------------------------------------------------------------- uint32_t CflowdConfig::MinLogMissed() const { return(this->_minLogMissed); } //------------------------------------------------------------------------- // uint32_t CflowdConfig::MinLogMissed(uint32_t minLogMissed) //......................................................................... // //------------------------------------------------------------------------- uint32_t CflowdConfig::MinLogMissed(uint32_t minLogMissed) { this->_minLogMissed = minLogMissed; return(this->_minLogMissed); } //------------------------------------------------------------------------- // void CflowdConfig::Clear() //......................................................................... // //------------------------------------------------------------------------- void CflowdConfig::Clear() { if (this->_ciscoMap.size() > 0) this->_ciscoMap.erase(this->_ciscoMap.begin(),this->_ciscoMap.end()); if (this->_portList.size() > 0) this->_portList.erase(this->_portList.begin(),this->_portList.end()); if (this->_collectorMap.size() > 0) this->_collectorMap.erase(this->_collectorMap.begin(), this->_collectorMap.end()); return; } const string CflowdConfig::k_defaultCflowdConfigFile = "/usr/local/etc/cflowd.conf";