- // Register stacks:
- try {
- anna::Tokenizer stacksTok;
- stacksTok.apply(stacks, "#");
- anna::Tokenizer::const_iterator stacks_it, stack_it;
-
- for(stacks_it = stacksTok.begin(); stacks_it != stacksTok.end(); stacks_it++) {
- std::string stack = anna::Tokenizer::data(stacks_it);
- anna::Tokenizer stackTok;
- stackTok.apply(stack, ",");
-
- if(stackTok.size() == 1) {
- if(stacksTok.size() != 1)
- throw anna::RuntimeException("Application Id value is mandatory when more than one stack is going to be configured", ANNA_FILE_LOCATION);
-
- anna::diameter::stack::Dictionary * d = stackEngine.createDictionary(0 /* no matter */, stack); // the stack is the dictionary
- G_codecEngine->setDictionary(d);
- break;
- }
-
- if(stackTok.size() != 2)
- throw anna::RuntimeException("Each stack must be in the form '<application-id>#<xml dictionary pathfile>'", ANNA_FILE_LOCATION);
-
- stack_it = stackTok.begin();
- unsigned int stackId = atoll(anna::Tokenizer::data(stack_it));
- stack_it++;
- std::string file = anna::Tokenizer::data(stack_it);
- anna::diameter::stack::Dictionary * d = stackEngine.createDictionary(stackId, file);
- }
-
- std::cout << "Stacks provided: " << std::endl;
- std::cout << anna::functions::tab(stackEngine.asString(false /* light */));
- std::cout << std::endl;
- std::cout << "Input file provided: " << inputFile << std::endl;
- std::cout << "Validation: " << (!no_validation ? "yes" : "no") << std::endl;
- std::cout << "Ignore Flags: " << (ignore_flags ? "yes" : "no") << std::endl;
- std::cout << std::endl;
- } catch(anna::RuntimeException &ex) {
- _exit(ex.asString());
- }
-
- // Validation kindness
- G_codecEngine->setValidationDepth(anna::diameter::codec::EngineImpl::ValidationDepth::Complete); // complete validation for better reports
- if(no_validation) G_codecEngine->setValidationMode(anna::diameter::codec::EngineImpl::ValidationMode::Never);
-
- if(ignore_flags) G_codecEngine->ignoreFlagsOnValidation(true);
-
- // Tracing:
- //if (cl.exists("trace"))
- // anna::Logger::setLevel(anna::Logger::asLevel(cl.getValue("trace")));
- // Check hex content input file (look extension):