Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

SNFIdentityConfig.hpp 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. #if 0
  51. /// Update the rulebase script with the credentials.
  52. //
  53. void UpdateRulebaseScriptCredentials();
  54. /// Download the rulebase.
  55. //
  56. void DownloadRulebase();
  57. /// Create the identity file.
  58. //
  59. // The file is created, the owner/group is changed by SetOwnerGroup(),
  60. // and the permissions are changed to readonly for the owner.
  61. //
  62. // \see SetOwnerGroup().
  63. //
  64. void CreateIdentityFile();
  65. private:
  66. /// Return the rulebase file name.
  67. //
  68. // \returns the name of the rulebase file, including the path.
  69. //
  70. std::string GetRulebaseFileName();
  71. std::string LicenseID; ///< License ID string.
  72. std::string Authentication; ///< Authentication string.
  73. static const std::string RulebaseDownloadCommand; ///< Command to download the rulebase.
  74. #endif
  75. };
  76. #endif