From e047dbe884f5288943d5ba2f8843a078d647d7ef Mon Sep 17 00:00:00 2001
From: gcontini <1121667+gcontini@users.noreply.github.com>
Date: 周六, 25 4月 2020 21:01:33 +0800
Subject: [PATCH] first docker & vm detection

---
 src/library/hw_identifier/hw_identifier.hpp |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/src/library/hw_identifier/hw_identifier.hpp b/src/library/hw_identifier/hw_identifier.hpp
index d7cec0e..73b3fc8 100644
--- a/src/library/hw_identifier/hw_identifier.hpp
+++ b/src/library/hw_identifier/hw_identifier.hpp
@@ -20,7 +20,7 @@
 namespace license {
 namespace hw_identifier {
 
-#define HW_IDENTIFIER_PROPRIETARY_DATA 8
+#define HW_IDENTIFIER_PROPRIETARY_DATA 7
 
 /**
  * data[0]
@@ -28,16 +28,9 @@
  *
  * if bit 7 = 0
  * bit 6 = environment variable was used to generate pc_id
- * bit 5-4 = execution environment information (0=BARE_TO_METAL,1=VM,2=CONTAINER)
- * bit 3 = 0 on premise vm 1 = cloud
- * if on premise vm bits 2-1-0 are virtualization technology
- * if cloud vm bits 2-1-0 identify cloud provider
- *
- * if bit 7 = 1 hardware identifier is used to enable some flag that we don't want to show openly in the license
- * bit 6 = 1 enable magic file/registry key
- * ----
- * data[1] bit 7-6-5 define identification strategy.
- * data[1] bits 4-0, data[2-8] are hardware identifier proprietary strategy data.
+ * bit 5-4-3 define identification strategy.
+ * bit 2-1-0 unused (crc?)
+ * data[1-7] are hardware identifier proprietary strategy data.
  */
 
 class HwIdentifier {
@@ -50,12 +43,9 @@
 	HwIdentifier(const std::string &param);
 	virtual ~HwIdentifier();
 	HwIdentifier(const HwIdentifier &other);
-	void set_identification_strategy(LCC_API_IDENTIFICATION_STRATEGY strategy);
-	LCC_API_IDENTIFICATION_STRATEGY get_identification_strategy() const;
+	void set_identification_strategy(LCC_API_HW_IDENTIFICATION_STRATEGY strategy);
+	LCC_API_HW_IDENTIFICATION_STRATEGY get_identification_strategy() const;
 	void set_use_environment_var(bool use_env_var);
-	void set_virtual_environment(VIRTUALIZATION virtualization);
-	void set_virtualization(VIRTUALIZATION_DETAIL virtualization_detail);
-	void set_cloud_provider(CLOUD_PROVIDER cloud_provider);
 	void set_data(const std::array<uint8_t, HW_IDENTIFIER_PROPRIETARY_DATA> &data);
 	bool data_match(const std::array<uint8_t, HW_IDENTIFIER_PROPRIETARY_DATA> &data) const;
 	std::string print() const;

--
Gitblit v1.9.1