Lines Matching refs:attrs
738 struct nl_parsed_nhop *attrs = (struct nl_parsed_nhop *)_attrs; in post_p_nh() local
740 set_scope6(attrs->nha_gw, attrs->nha_oif); in post_p_nh()
752 newnhg(struct unhop_ctl *ctl, struct nl_parsed_nhop *attrs, struct user_nhop *unhop) in newnhg() argument
754 struct nexthop_grp *grp = NLA_DATA(attrs->nha_group); in newnhg()
755 int count = NLA_DATA_LEN(attrs->nha_group) / sizeof(*grp); in newnhg()
819 newnhop(struct nl_parsed_nhop *attrs, struct user_nhop *unhop, struct nl_pstate *npt) in newnhop() argument
825 if (!attrs->nha_blackhole) { in newnhop()
826 if (attrs->nha_gw == NULL) { in newnhop()
830 if (attrs->nha_oif == NULL) { in newnhop()
835 ifa = ifaof_ifpforaddr(attrs->nha_gw, attrs->nha_oif); in newnhop()
842 int family = attrs->nha_gw != NULL ? attrs->nha_gw->sa_family : attrs->nh_family; in newnhop()
849 nhop_set_uidx(nh, attrs->nha_id); in newnhop()
850 nhop_set_origin(nh, attrs->nh_protocol); in newnhop()
852 if (attrs->nha_blackhole) in newnhop()
855 error = nl_set_nexthop_gw(nh, attrs->nha_gw, attrs->nha_oif, npt); in newnhop()
860 nhop_set_transmit_ifp(nh, attrs->nha_oif); in newnhop()
873 NL_LOG(LOG_DEBUG2, "Adding unhop %u: %s", attrs->nha_id, nhbuf); in newnhop()
892 struct nl_parsed_nhop attrs = {}; in rtnl_handle_newnhop() local
893 error = nl_parse_nlmsg(hdr, &nhmsg_parser, npt, &attrs); in rtnl_handle_newnhop()
901 if (attrs.nha_id == 0) { in rtnl_handle_newnhop()
902 attrs.nha_id = find_spare_uidx(ctl); in rtnl_handle_newnhop()
903 if (attrs.nha_id == 0) { in rtnl_handle_newnhop()
909 NL_LOG(LOG_DEBUG, "IFINDEX %d", attrs.nha_oif ? if_getindex(attrs.nha_oif) : 0); in rtnl_handle_newnhop()
916 unhop->un_idx = attrs.nha_id; in rtnl_handle_newnhop()
917 unhop->un_protocol = attrs.nh_protocol; in rtnl_handle_newnhop()
919 if (attrs.nha_group) in rtnl_handle_newnhop()
920 error = newnhg(ctl, &attrs, unhop); in rtnl_handle_newnhop()
922 error = newnhop(&attrs, unhop, npt); in rtnl_handle_newnhop()
935 NL_LOG(LOG_DEBUG, "nhop idx %u already exists", attrs.nha_id); in rtnl_handle_newnhop()
975 struct nl_parsed_nhop attrs = {}; in rtnl_handle_delnhop() local
976 error = nl_parse_nlmsg(hdr, &nhmsg_parser, npt, &attrs); in rtnl_handle_delnhop()
980 if (attrs.nha_id == 0) { in rtnl_handle_delnhop()
985 error = delete_unhop(ctl, hdr, attrs.nha_id); in rtnl_handle_delnhop()
991 match_unhop(const struct nl_parsed_nhop *attrs, struct user_nhop *unhop) in match_unhop() argument
993 if (attrs->nha_id != 0 && unhop->un_idx != attrs->nha_id) in match_unhop()
995 if (attrs->nha_groups != 0 && unhop->un_nhgrp_src == NULL) in match_unhop()
997 if (attrs->nha_oif != NULL && in match_unhop()
998 (unhop->un_nhop_src == NULL || unhop->un_nhop_src->nh_ifp != attrs->nha_oif)) in match_unhop()
1012 struct nl_parsed_nhop attrs = {}; in rtnl_handle_getnhop() local
1013 error = nl_parse_nlmsg(hdr, &nhmsg_parser, npt, &attrs); in rtnl_handle_getnhop()
1025 if (attrs.nha_id != 0) { in rtnl_handle_getnhop()
1027 struct user_nhop key = { .un_idx = attrs.nha_id }; in rtnl_handle_getnhop()
1032 NL_LOG(LOG_DEBUG2, "searching for uidx %u", attrs.nha_id); in rtnl_handle_getnhop()
1041 } else if (attrs.nhaf_kid != 0) { in rtnl_handle_getnhop()
1043 .fibnum = attrs.nhaf_table, in rtnl_handle_getnhop()
1044 .family = attrs.nhaf_family, in rtnl_handle_getnhop()
1048 NL_LOG(LOG_DEBUG2, "START table %u family %d", attrs.nhaf_table, attrs.nhaf_family); in rtnl_handle_getnhop()
1052 if (nhop_get_idx(nh) == attrs.nhaf_kid) { in rtnl_handle_getnhop()
1060 } else if (attrs.nhaf_knhops) { in rtnl_handle_getnhop()
1062 .fibnum = attrs.nhaf_table, in rtnl_handle_getnhop()
1063 .family = attrs.nhaf_family, in rtnl_handle_getnhop()
1066 NL_LOG(LOG_DEBUG2, "DUMP table %u family %d", attrs.nhaf_table, attrs.nhaf_family); in rtnl_handle_getnhop()
1083 if (UNHOP_IS_MASTER(unhop) && match_unhop(&attrs, unhop)) in rtnl_handle_getnhop()