Create generic method to extract mac address from EUI-64 constructed addresses
[folly.git] / folly / IPAddressV6.h
index 05cc5bdc4b2dff7bd10e24bb2789553fecbd7537..23c19e50c011ac7dd85136532d7f613e5061217c 100644 (file)
@@ -231,6 +231,16 @@ class IPAddressV6 {
    */
   Optional<MacAddress> getMacAddressFromLinkLocal() const;
 
+  /**
+   * Return the mac address if this is an auto-configured IPv6 address based on
+   * EUI-64
+   *
+   * @return an Optional<MacAddress> union representing the mac address.
+   * If the address is not based on EUI-64 it will return an empty Optional.
+   * You can use Optional::value() to check whether the mac address is not null.
+   */
+  Optional<MacAddress> getMacAddressFromEUI64() const;
+
   /**
    * Return true if this is a multicast address.
    */