X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FLauncher.cpp;h=30ae63f2a8da3ff5ca442f0650534e902f675d04;hb=9366377ca75fe1678f32b8e208022dab6163da16;hp=5ae6f8771e1de6d566ba3a4b0735ada958472394;hpb=4e2e5e6df510cfba2a716b5ee9b745a157d4d0fb;p=anna.git diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 5ae6f87..30ae63f 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -1272,7 +1272,8 @@ std::string Launcher::help() const throw() { result += "\n source file (xml representation). Fix mode must be enabled to avoid"; result += "\n unexpected matching behaviour. If you need a strict matching you"; result += "\n must add parameter 'strict', if not, regexp is built ignoring sequence"; - result += "\n information (hop-by-hop-id=\"[0-9]+\" end-to-end-id=\"[0-9]+\")."; + result += "\n information (hop-by-hop-id=\"[0-9]+\" end-to-end-id=\"[0-9]+\") and"; + result += "\n Origin-State-Id value."; result += "\n All LF codes will be internally removed when comparison is executed"; result += "\n in order to ease xml content configuration."; result += "\n"; @@ -2289,35 +2290,41 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons /* std::string s_from = "hop-by-hop-id=\"[0-9]+\" end-to-end-id=\"[0-9]+\""; std::string s_to = s_from; + std::string s_from2 = "avp name=\"Origin-State-Id\" data=\"[0-9]+\""; + std::string s_to2 = s_from2; try { regexp = std::regex_replace (regexp, std::regex(s_from), s_to); + regexp = std::regex_replace (regexp, std::regex(s_from2), s_to2); } catch (const std::regex_error& e) { throw anna::RuntimeException(e.what(), ANNA_FILE_LOCATION); } + */ - std::string::size_type pos = 0u; - std::string::size_type pos_hbh_1, pos_hbh_2; - std::string::size_type pos_ete_1, pos_ete_2; + std::string::size_type pos, pos_1, pos_2; - pos = regexp.find("hop-by-hop-id=", pos); + pos = regexp.find("hop-by-hop-id=", 0u); pos = regexp.find("\"", pos); - pos_hbh_1 = pos; + pos_1 = pos; pos = regexp.find("\"", pos+1); - pos_hbh_2 = pos; + pos_2 = pos; + regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+"); - pos = regexp.find("end-to-end-id=", pos); + pos = regexp.find("end-to-end-id=", 0u); pos = regexp.find("\"", pos); - pos_ete_1 = pos; + pos_1 = pos; pos = regexp.find("\"", pos+1); - pos_ete_2 = pos; - - std::string hbh = regexp.substr(pos_hbh_1 + 1, pos_hbh_2 - pos_hbh_1 - 1); - std::string ete = regexp.substr(pos_ete_1 + 1, pos_ete_2 - pos_ete_1 - 1); + pos_2 = pos; + regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+"); - regexp.replace(pos_hbh_1 + 1, pos_hbh_2 - pos_hbh_1 - 1, "[0-9]+"); - regexp.replace(pos_ete_1 + 1, pos_ete_2 - pos_ete_1 - 1, "[0-9]+"); + pos = regexp.find("Origin-State-Id", 0u); + pos = regexp.find("\"", pos); + pos = regexp.find("\"", pos+1); + pos_1 = pos; + pos = regexp.find("\"", pos+1); + pos_2 = pos; + regexp.replace(pos_1 + 1, pos_2 - pos_1 - 1, "[0-9]+"); //regexp.insert(0, "^"); //regexp += "$";