X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FIPAddressV6.h;h=a1d0c7cbd3a9cd20d1e5cca951dccd64119fc939;hb=de821c225980359651a07b670174ae90d4f655c8;hp=8e29f80489b8737ffbd3b450e8ac1a8da6b11a77;hpb=ed8c80a0e0988e4ce687f51ca832a00e4a6b7930;p=folly.git diff --git a/folly/IPAddressV6.h b/folly/IPAddressV6.h index 8e29f804..a1d0c7cb 100644 --- a/folly/IPAddressV6.h +++ b/folly/IPAddressV6.h @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -209,6 +210,16 @@ class IPAddressV6 { */ bool isLinkLocal() const; + /** + * Return the mac address if this is a link-local IPv6 address. + * + * @return an Optional union representing the mac address. + * + * If the address is not a link-local one it will return an empty Optional. + * You can use Optional::value() to check whether the mac address is not null. + */ + Optional getMacAddressFromLinkLocal() const; + /** * Return true if this is a multicast address. */