Lines Matching refs:nla

719 static int nla_get_via(const struct nlattr *nla, u8 *via_alen, u8 *via_table,  in nla_get_via()  argument
722 struct rtvia *via = nla_data(nla); in nla_get_via()
726 if (nla_len(nla) < offsetof(struct rtvia, rtvia_addr)) { in nla_get_via()
727 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_via()
731 alen = nla_len(nla) - in nla_get_via()
734 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_via()
846 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in mpls_count_nexthops() local
851 nla = nla_find(attrs, attrlen, RTA_VIA); in mpls_count_nexthops()
852 if (nla && nla_len(nla) >= in mpls_count_nexthops()
854 int via_alen = nla_len(nla) - in mpls_count_nexthops()
862 nla = nla_find(attrs, attrlen, RTA_NEWDST); in mpls_count_nexthops()
863 if (nla && in mpls_count_nexthops()
864 nla_get_labels(nla, MAX_NEW_LABELS, &n_labels, in mpls_count_nexthops()
1103 struct nlattr *nla; in mpls_fill_stats_af() local
1109 nla = nla_reserve_64bit(skb, MPLS_STATS_LINK, in mpls_fill_stats_af()
1112 if (!nla) in mpls_fill_stats_af()
1115 stats = nla_data(nla); in mpls_fill_stats_af()
1682 struct nlattr *nla; in nla_put_via() local
1686 nla = nla_reserve(skb, RTA_VIA, alen + 2); in nla_put_via()
1687 if (!nla) in nla_put_via()
1693 via = nla_data(nla); in nla_put_via()
1702 struct nlattr *nla; in nla_put_labels() local
1706 nla = nla_reserve(skb, attrtype, labels*4); in nla_put_labels()
1707 if (!nla) in nla_put_labels()
1710 nla_label = nla_data(nla); in nla_put_labels()
1721 int nla_get_labels(const struct nlattr *nla, u8 max_labels, u8 *labels, in nla_get_labels() argument
1724 unsigned len = nla_len(nla); in nla_get_labels()
1734 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_labels()
1750 nla_label = nla_data(nla); in nla_get_labels()
1760 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_labels()
1766 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_labels()
1772 NL_SET_BAD_ATTR(extack, nla); in nla_get_labels()
1789 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_labels()
1872 struct nlattr *nla = tb[index]; in rtm_to_route_config() local
1873 if (!nla) in rtm_to_route_config()
1878 cfg->rc_ifindex = nla_get_u32(nla); in rtm_to_route_config()
1881 if (nla_get_labels(nla, MAX_NEW_LABELS, in rtm_to_route_config()
1889 if (nla_get_labels(nla, 1, &label_count, in rtm_to_route_config()
1903 if (nla_get_via(nla, &cfg->rc_via_alen, in rtm_to_route_config()
1911 cfg->rc_mp = nla_data(nla); in rtm_to_route_config()
1912 cfg->rc_mp_len = nla_len(nla); in rtm_to_route_config()
1917 u8 ttl_propagate = nla_get_u8(nla); in rtm_to_route_config()
1920 NL_SET_ERR_MSG_ATTR(extack, nla, in rtm_to_route_config()
1930 NL_SET_ERR_MSG_ATTR(extack, nla, "Unknown attribute"); in rtm_to_route_config()