diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2015-10-30 22:08:39 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-11-20 10:15:33 (GMT) |
commit | d1c019024101687303eeed4c4e369a69ca90e739 (patch) | |
tree | 35cf24aedaea878dc4d989ae75f799da32afe539 /lib/route/link/api.c | |
parent | acdeaf498d53d04ef4ca0e744b6c47e07e76c121 (diff) | |
download | libnl-d1c019024101687303eeed4c4e369a69ca90e739.zip libnl-d1c019024101687303eeed4c4e369a69ca90e739.tar.gz libnl-d1c019024101687303eeed4c4e369a69ca90e739.tar.bz2 |
route/link: add link info compare operation
Signed-off-by: Balki Raman <ramanb@cumulusnetworks.com>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/route/link/api.c')
-rw-r--r-- | lib/route/link/api.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/route/link/api.c b/lib/route/link/api.c index 6d1e12f..00893ad 100644 --- a/lib/route/link/api.c +++ b/lib/route/link/api.c @@ -391,6 +391,28 @@ out: return ret; } +/** + * Compare link info data + * @arg a Link object a + * @arg b Link object b + * + * This function will compare link_info data between two links + * a and b + * + * @return 0 if link_info data matches or is not present + * or != 0 if it mismatches. + */ +int rtnl_link_info_data_compare(struct rtnl_link *a, struct rtnl_link *b) +{ + if (a->l_info_ops != b->l_info_ops) + return ~0; + + if (!a->l_info_ops || !a->l_info_ops->io_compare) + return 0; + + return a->l_info_ops->io_compare(a, b, ~0, 0); +} + /** @} */ /** @} */ |