- std::string optional = argv[3] ? argv[3] : "";
- bool ignoreFlags = ((argc == 4) && (optional == "--ignore-flags"));
- std::cout << "Dictionary(ies) provided: " << dictionaries << std::endl;
- std::cout << "Input file provided: " << inputFile << std::endl;
- std::cout << "Validation kindness: "
- << (ignoreFlags ? "non strict" : "strict") << std::endl;
- // Logger and engines:
- Logger::setLevel(Logger::Debug);
- Logger::initialize("pcapDecoder", new TraceWriter("file.trace", 2048000));
- anna::diameter::codec::Engine *codecEngine =
- new anna::diameter::codec::Engine();
- anna::diameter::stack::Engine &stackEngine =
- anna::diameter::stack::Engine::instantiate();
-
- try {
- anna::diameter::stack::Dictionary * d = stackEngine.createDictionary(
- 0 /* stack id */);
- // Analyze comma-separated list:
- anna::Tokenizer lst;
- lst.apply(dictionaries, ",");
-
- if(lst.size() >= 1) { // always true (at least one, because -dictionary is mandatory)
- anna::Tokenizer::const_iterator tok_min(lst.begin());
- anna::Tokenizer::const_iterator tok_max(lst.end());
- anna::Tokenizer::const_iterator tok_iter;
- std::string pathFile;
- d->allowUpdates();
-
- for(tok_iter = tok_min; tok_iter != tok_max; tok_iter++) {
- pathFile = anna::Tokenizer::data(tok_iter);
- d->load(pathFile);
- }
- }