Browse Source

tidy namespace snf_sync

master
Pete McNeil 4 years ago
parent
commit
c109f59a3b
2 changed files with 16 additions and 16 deletions
  1. 4
    4
      snf_sync.cpp
  2. 12
    12
      snf_sync.hpp

+ 4
- 4
snf_sync.cpp View File

@@ -1,5 +1,5 @@
// snf_sync.cpp
// Copyright (C) 2006 - 2009 ARM Research Labs, LLC.
// Copyright (C) 2006 - 2020 ARM Research Labs, LLC.
// See www.armresearch.com for the copyright terms.
// See snf_sync.hpp for details.

@@ -29,7 +29,7 @@ snf_sync::snf_sync(const char* bfr, int len) :
Reader.interpret(Data); // the buffer and interpret it.
}

snf_sync::snf_sync(string& input) : // Constructing with a string.
snf_sync::snf_sync(std::string& input) : // Constructing with a string.
Reader("snf"), // Start with our blank construction.
ReadWasGood(false) {
construct(); // Internal wiring & initialization.
@@ -96,7 +96,7 @@ bool snf_sync::read(const char* bfr, int len) {
return good(); // Return true if it looked good.
}

bool snf_sync::read(string& input) { // To read from a string we
bool snf_sync::read(std::string& input) { // To read from a string we
return read(input.c_str(), input.length()); // get the strings buffer and hand off
} // to our buffer read()

@@ -111,7 +111,7 @@ bool snf_sync::bad() {
void GBUAlertHandler::operator()(
cd::ConfigurationElement& E, cd::ConfigurationData& D) { // Add an alert.
GBUdbAlert NewAlert; // Create an alert object.
SocketAddress IPAddress; // Grab one of these for a converter.
cd::SocketAddress IPAddress; // Grab one of these for a converter.
IPAddress.setAddress(const_cast<char*>(Alert_ip.c_str())); // Conver the IP address to an int.
NewAlert.IP = IPAddress.getAddress(); // Put the IP into it's place.
NewAlert.R.Bad(Alert_b); // Set the bad count on the record.

+ 12
- 12
snf_sync.hpp View File

@@ -1,5 +1,5 @@
// snf_sync.hpp
// Copyright (C) 2006 - 2009 ARM Research Labs, LLC.
// Copyright (C) 2006 - 2020 ARM Research Labs, LLC.
// See www.armresearch.com for the copyright terms.
//
// SNF engine communications protocol interpreter.
@@ -22,13 +22,13 @@ class GBUAlertHandler : public cd::Configurator {

void reset(); // Resets the list for a new run.

list<GBUdbAlert> AlertList; // Our list of alerts.
std::list<GBUdbAlert> AlertList; // Our list of alerts.

// Input variables.

string Alert_time; // time='YYYYMMDDhhmmss'
string Alert_ip; // ip='12.34.56.78'
string Alert_t; // t='Ugly', Good, Bad, Ignore
std::string Alert_time; // time='YYYYMMDDhhmmss'
std::string Alert_ip; // ip='12.34.56.78'
std::string Alert_t; // t='Ugly', Good, Bad, Ignore
int Alert_b; // b='0'
int Alert_g; // g='0'
};
@@ -59,20 +59,20 @@ class snf_sync {
public:
snf_sync(); // Construct empty.
snf_sync(const char* bfr, int len); // Construct from buffer.
snf_sync(string& input); // Construct from string.
snf_sync(std::string& input); // Construct from string.
bool read(const char* bfr, int len); // Read from buffer.
bool read(string& input); // Read from string.
bool read(std::string& input); // Read from string.

//// And now the interpreted results ////
bool good(); // True if read was good.
bool bad(); // True if read was not good.

string snf_sync_challenge_txt;
string snf_sync_response_nodeid;
string snf_sync_response_text;
string snf_sync_error_message;
std::string snf_sync_challenge_txt;
std::string snf_sync_response_nodeid;
std::string snf_sync_response_text;
std::string snf_sync_error_message;
int snf_sync_error_code;
string snf_sync_rulebase_utc;
std::string snf_sync_rulebase_utc;
int snf_sync_server_resync_secs;

GBUAlertHandler ClientGBUAlertHandler; // GBU Alerts received from client

Loading…
Cancel
Save