// snf_xci.hpp // Copyright (C) 2006 - 2009 ARM Research Labs, LLC // See www.armresearch.com for the copyright terms. // // SNF XML Command Interface // // SNF clients communicate with the SNF server using one-line xml statements. // The server responds in kind. This module uses the configuration module to // interpret those communications. In practice, a line will be read from a // connected socket and then passed to an snf_xci object for interpretation. // The snf_xci object parses the xml and presents the results on it's surface // in easily used variables. #pragma once #include "../CodeDweller/configuration.hpp" namespace cd = codedweller; class snf_xci { // SNF XCI message interpreter. private: cd::ConfigurationElement Reader; // Our reader. void SetupReader(); // Configure the reader. cd::ConfiguratorSetTrueOnComplete SNFWasParsed; // Configurator sets the ReadWasGood bool ReadWasGood; // flag at the end of the snf element. void reset(); // Reset/initialize for the next read. public: snf_xci(); snf_xci(const char* bfr, int len); snf_xci(std::string& input); bool read(const char* bfr, int len); bool read(std::string& input); //// And now the interpreted results //// bool good(); bool bad(); std::string scanner_scan_file; bool scanner_scan_xhdr; bool scanner_scan_log; std::string scanner_scan_ip; int scanner_result_code; std::string scanner_result_xhdr; std::string scanner_result_log; std::string gbudb_set_ip; std::string gbudb_set_type; int gbudb_set_bad_count; int gbudb_set_good_count; std::string gbudb_good_ip; std::string gbudb_bad_ip; std::string gbudb_test_ip; std::string gbudb_drop_ip; std::string gbudb_result_ip; std::string gbudb_result_type; double gbudb_result_probability; double gbudb_result_confidence; int gbudb_result_bad_count; int gbudb_result_good_count; std::string gbudb_result_range; int gbudb_result_code; std::string report_request_status_class; std::string report_response; std::string xci_server_command; std::string xci_server_command_content; std::string xci_server_response; int xci_server_response_code; std::string xci_error_message; };