您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SNFIdentityConfig.hpp 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // \file SNFIdentityConfig.hpp
  2. //
  3. // Copyright (C) 2011 ARM Research Labs, LLC.
  4. // See www.armresearch.com for the copyright terms.
  5. //
  6. // This file defines the SNFIdentityConfig interface.
  7. //
  8. // $Id$
  9. //
  10. ///////////////////////////////////////////////////////////////////////////////////////////////////
  11. #ifndef SNFIdentityConfighpp_included
  12. #define SNFIdentityConfighpp_included
  13. #include <string>
  14. #include "UtilityConfig.hpp"
  15. /// Class to manage the sniffer credentials.
  16. //
  17. // This class creates the sniffer identity.xml file, and updates the
  18. // getRulebase script with the specified sniffer credentials.
  19. //
  20. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  21. class SNFIdentityConfig : public UtilityConfig {
  22. public:
  23. /// Structure to hold the command-line parameters.
  24. struct CommandLineInput {
  25. std::string ConfigFile; ///< Configuration file name.
  26. std::string LicenseID; ///< License ID credentials.
  27. std::string Authentication; ///< Authentication credentials.
  28. };
  29. /// Display usage.
  30. //
  31. // \param[in] Version is the SNFIdentity version.
  32. //
  33. // \param[in] DefaultConfigFile is the list of default locations of the
  34. // configuration file.
  35. //
  36. // \param[in] NumDefaultConfigFiles is the number of default configuration files.
  37. //
  38. void DisplayHelp(std::string Version, const std::string DefaultConfigFile[], int NumDefaultConfigFiles);
  39. /// Get the command-line input parameters for SNFIdentity.
  40. //
  41. // \param[in] argc is the number of parameters.
  42. //
  43. // \param[in] argv is the parameters.
  44. //
  45. // \returns true if all the required command line parameters are
  46. // present and there are no unknown command-line parameters, false
  47. // otherwise.
  48. //
  49. bool GetCommandLineInput(int argc, char* argv[]);
  50. /// Create the identity file.
  51. //
  52. // The file is created, the owner/group is changed by SetOwnerGroup(),
  53. // and the permissions are changed to readonly for the owner.
  54. //
  55. // \see SetOwnerGroup().
  56. //
  57. void CreateIdentityFile();
  58. /// Update the rulebase script with the credentials.
  59. //
  60. void UpdateRulebaseScriptCredentials();
  61. private:
  62. std::string LicenseID; ///< License ID string.
  63. std::string Authentication; ///< Authentication string.
  64. };
  65. #endif