platform: Add support for IPv6 tokenized identifiers

(cherry picked from commit db5603e615)
This commit is contained in:
Lubomir Rintel 2014-09-27 09:03:56 +02:00 committed by Thomas Haller
parent 06b30ad690
commit 3cbd7cdc03
2 changed files with 29 additions and 0 deletions

View file

@ -779,6 +779,31 @@ nm_platform_link_uses_arp (int ifindex)
return klass->link_uses_arp (platform, ifindex);
}
/**
* nm_platform_link_get_ipv6_token:
* @ifindex: Interface index
* @iid: Tokenized interface identifier
*
* Returns IPv6 tokenized interface identifier. If the platform or OS doesn't
* support IPv6 tokenized interface identifiers, or the token is not set
* this call will fail and return %FALSE.
*
* Returns: %TRUE a tokenized identifier was available
*/
gboolean
nm_platform_link_get_ipv6_token (int ifindex, NMUtilsIPv6IfaceId *iid)
{
reset_error ();
g_return_val_if_fail (ifindex >= 0, FALSE);
g_return_val_if_fail (iid, FALSE);
if (klass->link_get_ipv6_token)
return klass->link_get_ipv6_token (platform, ifindex, iid);
return FALSE;
}
/**
* nm_platform_link_get_user_ip6vll_enabled:
* @ifindex: Interface index

View file

@ -379,6 +379,8 @@ typedef struct {
gboolean (*link_is_connected) (NMPlatform *, int ifindex);
gboolean (*link_uses_arp) (NMPlatform *, int ifindex);
gboolean (*link_get_ipv6_token) (NMPlatform *, int ifindex, NMUtilsIPv6IfaceId *iid);
gboolean (*link_get_user_ipv6ll_enabled) (NMPlatform *, int ifindex);
gboolean (*link_set_user_ipv6ll_enabled) (NMPlatform *, int ifindex, gboolean enabled);
@ -528,6 +530,8 @@ gboolean nm_platform_link_is_up (int ifindex);
gboolean nm_platform_link_is_connected (int ifindex);
gboolean nm_platform_link_uses_arp (int ifindex);
gboolean nm_platform_link_get_ipv6_token (int ifindex, NMUtilsIPv6IfaceId *iid);
gboolean nm_platform_link_get_user_ipv6ll_enabled (int ifindex);
gboolean nm_platform_link_set_user_ipv6ll_enabled (int ifindex, gboolean enabled);