#include "parser.h" #include #ifndef H_LIBNDIFF #define H_LIBNDIFF class libndiff { private: nmap::parser _old_scan; nmap::parser _new_scan; //hosts that have come up std::vector _up_hosts; //hosts that have gone down std::vector _down_hosts; //the from->to of hosts that have changed std::vector > _chg_hosts; std::string _xml; XMLNode _xml_node; std::ostringstream _simple; //output helpers void _init_xml(); void _add_scan( XMLNode & root, std::string start, std::string end); void _add_host_up(XMLNode & parent, XMLNode & child, nmap::nHost &host); void _add_host_down(XMLNode &parent, XMLNode & child, nmap::nHost &host); void _add_host_chg(XMLNode &parent, XMLNode & child, nmap::nHost &host); //for extra addresses void _add_addr(XMLNode &parent, std::string addr, std::string addrtype, std::string vendor); void _add_port(XMLNode &parent, std::string proto, unsigned int port, std::string oldState, std::string newState); void _add_service(XMLNode &parent, nmap::nService *oldService, nmap::nService *newService); //these are the main function void _findDiff(); void _addhost(XMLNode &root); void _delhost(XMLNode &root); void _chghost(XMLNode &root); //options //display hostnames bool displayHosts; public: void purge(); void init(){ displayHosts=false; } libndiff() {} libndiff(std::string pathOLD, std::string pathNEW); void setPath(std::string pathOLD, std::string pathNEW); void showNames(bool boolean){ if(boolean==true){ displayHosts=true; }else{ displayHosts=false; } } std::string getSimple(); std::string getXML(); }; #endif