Lines Matching refs:nlattr
415 static abi_long host_to_target_for_each_nlattr(struct nlattr *nlattr, in host_to_target_for_each_nlattr() argument
418 (struct nlattr *, in host_to_target_for_each_nlattr()
425 while (len > sizeof(struct nlattr)) { in host_to_target_for_each_nlattr()
426 nla_len = nlattr->nla_len; in host_to_target_for_each_nlattr()
427 if (nla_len < sizeof(struct nlattr) || in host_to_target_for_each_nlattr()
431 ret = host_to_target_nlattr(nlattr, context); in host_to_target_for_each_nlattr()
432 nlattr->nla_len = tswap16(nlattr->nla_len); in host_to_target_for_each_nlattr()
433 nlattr->nla_type = tswap16(nlattr->nla_type); in host_to_target_for_each_nlattr()
443 nlattr = (struct nlattr *)(((char *)nlattr) + aligned_nla_len); in host_to_target_for_each_nlattr()
482 static abi_long host_to_target_data_bridge_nlattr(struct nlattr *nlattr, in host_to_target_data_bridge_nlattr() argument
489 switch (nlattr->nla_type) { in host_to_target_data_bridge_nlattr()
519 u16 = NLA_DATA(nlattr); in host_to_target_data_bridge_nlattr()
533 u32 = NLA_DATA(nlattr); in host_to_target_data_bridge_nlattr()
547 u64 = NLA_DATA(nlattr); in host_to_target_data_bridge_nlattr()
556 u32 = NLA_DATA(nlattr); in host_to_target_data_bridge_nlattr()
562 nlattr->nla_type); in host_to_target_data_bridge_nlattr()
568 static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr, in host_to_target_slave_data_bridge_nlattr() argument
575 switch (nlattr->nla_type) { in host_to_target_slave_data_bridge_nlattr()
606 u16 = NLA_DATA(nlattr); in host_to_target_slave_data_bridge_nlattr()
614 u32 = NLA_DATA(nlattr); in host_to_target_slave_data_bridge_nlattr()
621 u64 = NLA_DATA(nlattr); in host_to_target_slave_data_bridge_nlattr()
630 nlattr->nla_type); in host_to_target_slave_data_bridge_nlattr()
636 static abi_long host_to_target_data_tun_nlattr(struct nlattr *nlattr, in host_to_target_data_tun_nlattr() argument
641 switch (nlattr->nla_type) { in host_to_target_data_tun_nlattr()
654 u32 = NLA_DATA(nlattr); in host_to_target_data_tun_nlattr()
659 nlattr->nla_type); in host_to_target_data_tun_nlattr()
672 static abi_long host_to_target_data_linkinfo_nlattr(struct nlattr *nlattr, in host_to_target_data_linkinfo_nlattr() argument
677 switch (nlattr->nla_type) { in host_to_target_data_linkinfo_nlattr()
680 li_context->name = NLA_DATA(nlattr); in host_to_target_data_linkinfo_nlattr()
681 li_context->len = nlattr->nla_len - NLA_HDRLEN; in host_to_target_data_linkinfo_nlattr()
684 li_context->slave_name = NLA_DATA(nlattr); in host_to_target_data_linkinfo_nlattr()
685 li_context->slave_len = nlattr->nla_len - NLA_HDRLEN; in host_to_target_data_linkinfo_nlattr()
695 return host_to_target_for_each_nlattr(NLA_DATA(nlattr), in host_to_target_data_linkinfo_nlattr()
696 nlattr->nla_len, in host_to_target_data_linkinfo_nlattr()
701 return host_to_target_for_each_nlattr(NLA_DATA(nlattr), in host_to_target_data_linkinfo_nlattr()
702 nlattr->nla_len, in host_to_target_data_linkinfo_nlattr()
713 return host_to_target_for_each_nlattr(NLA_DATA(nlattr), in host_to_target_data_linkinfo_nlattr()
714 nlattr->nla_len, in host_to_target_data_linkinfo_nlattr()
724 nlattr->nla_type); in host_to_target_data_linkinfo_nlattr()
731 static abi_long host_to_target_data_inet_nlattr(struct nlattr *nlattr, in host_to_target_data_inet_nlattr() argument
737 switch (nlattr->nla_type) { in host_to_target_data_inet_nlattr()
739 u32 = NLA_DATA(nlattr); in host_to_target_data_inet_nlattr()
740 for (i = 0; i < (nlattr->nla_len - NLA_HDRLEN) / sizeof(*u32); in host_to_target_data_inet_nlattr()
747 nlattr->nla_type); in host_to_target_data_inet_nlattr()
752 static abi_long host_to_target_data_inet6_nlattr(struct nlattr *nlattr, in host_to_target_data_inet6_nlattr() argument
760 switch (nlattr->nla_type) { in host_to_target_data_inet6_nlattr()
769 u32 = NLA_DATA(nlattr); in host_to_target_data_inet6_nlattr()
774 u32 = NLA_DATA(nlattr); in host_to_target_data_inet6_nlattr()
775 for (i = 0; i < (nlattr->nla_len - NLA_HDRLEN) / sizeof(*u32); in host_to_target_data_inet6_nlattr()
782 ci = NLA_DATA(nlattr); in host_to_target_data_inet6_nlattr()
791 u64 = NLA_DATA(nlattr); in host_to_target_data_inet6_nlattr()
792 for (i = 0; i < (nlattr->nla_len - NLA_HDRLEN) / sizeof(*u64); in host_to_target_data_inet6_nlattr()
799 nlattr->nla_type); in host_to_target_data_inet6_nlattr()
804 static abi_long host_to_target_data_spec_nlattr(struct nlattr *nlattr, in host_to_target_data_spec_nlattr() argument
807 switch (nlattr->nla_type) { in host_to_target_data_spec_nlattr()
809 return host_to_target_for_each_nlattr(NLA_DATA(nlattr), nlattr->nla_len, in host_to_target_data_spec_nlattr()
813 return host_to_target_for_each_nlattr(NLA_DATA(nlattr), nlattr->nla_len, in host_to_target_data_spec_nlattr()
818 nlattr->nla_type); in host_to_target_data_spec_nlattr()
824 static abi_long host_to_target_data_xdp_nlattr(struct nlattr *nlattr, in host_to_target_data_xdp_nlattr() argument
829 switch (nlattr->nla_type) { in host_to_target_data_xdp_nlattr()
835 u32 = NLA_DATA(nlattr); in host_to_target_data_xdp_nlattr()
840 LOG_UNIMP, "Unknown host XDP type: %d\n", nlattr->nla_type); in host_to_target_data_xdp_nlattr()
846 static abi_long host_to_target_data_vlan_list_nlattr(struct nlattr *nlattr, in host_to_target_data_vlan_list_nlattr() argument
851 switch (nlattr->nla_type) { in host_to_target_data_vlan_list_nlattr()
854 vlan_info = NLA_DATA(nlattr); in host_to_target_data_vlan_list_nlattr()
861 nlattr->nla_type); in host_to_target_data_vlan_list_nlattr()
867 static abi_long host_to_target_data_vf_stats_nlattr(struct nlattr *nlattr, in host_to_target_data_vf_stats_nlattr() argument
872 switch (nlattr->nla_type) { in host_to_target_data_vf_stats_nlattr()
883 u64 = NLA_DATA(nlattr); in host_to_target_data_vf_stats_nlattr()
888 nlattr->nla_type); in host_to_target_data_vf_stats_nlattr()
894 static abi_long host_to_target_data_vfinfo_nlattr(struct nlattr *nlattr, in host_to_target_data_vfinfo_nlattr() argument
907 switch (nlattr->nla_type) { in host_to_target_data_vfinfo_nlattr()
910 mac = NLA_DATA(nlattr); in host_to_target_data_vfinfo_nlattr()
918 vlan = NLA_DATA(nlattr); in host_to_target_data_vfinfo_nlattr()
925 vlan_info = NLA_DATA(nlattr); in host_to_target_data_vfinfo_nlattr()
932 spoofchk = NLA_DATA(nlattr); in host_to_target_data_vfinfo_nlattr()
938 rate = NLA_DATA(nlattr); in host_to_target_data_vfinfo_nlattr()
945 link_state = NLA_DATA(nlattr); in host_to_target_data_vfinfo_nlattr()
951 rss_query_en = NLA_DATA(nlattr); in host_to_target_data_vfinfo_nlattr()
957 trust = NLA_DATA(nlattr); in host_to_target_data_vfinfo_nlattr()
964 guid = NLA_DATA(nlattr); in host_to_target_data_vfinfo_nlattr()
970 return host_to_target_for_each_nlattr(RTA_DATA(nlattr), nlattr->nla_len, in host_to_target_data_vfinfo_nlattr()
974 return host_to_target_for_each_nlattr(RTA_DATA(nlattr), nlattr->nla_len, in host_to_target_data_vfinfo_nlattr()
979 nlattr->nla_type); in host_to_target_data_vfinfo_nlattr()
1287 static abi_long target_to_host_for_each_nlattr(struct nlattr *nlattr, in target_to_host_for_each_nlattr() argument
1290 (struct nlattr *)) in target_to_host_for_each_nlattr()
1295 while (len > sizeof(struct nlattr)) { in target_to_host_for_each_nlattr()
1296 if (tswap16(nlattr->nla_len) < sizeof(struct rtattr) || in target_to_host_for_each_nlattr()
1297 tswap16(nlattr->nla_len) > len) { in target_to_host_for_each_nlattr()
1300 nlattr->nla_len = tswap16(nlattr->nla_len); in target_to_host_for_each_nlattr()
1301 nlattr->nla_type = tswap16(nlattr->nla_type); in target_to_host_for_each_nlattr()
1302 ret = target_to_host_nlattr(nlattr); in target_to_host_for_each_nlattr()
1307 aligned_nla_len = NLA_ALIGN(nlattr->nla_len); in target_to_host_for_each_nlattr()
1312 nlattr = (struct nlattr *)(((char *)nlattr) + aligned_nla_len); in target_to_host_for_each_nlattr()
1317 static abi_long target_to_host_data_inet6_nlattr(struct nlattr *nlattr) in target_to_host_data_inet6_nlattr() argument
1319 switch (nlattr->nla_type) { in target_to_host_data_inet6_nlattr()
1325 nlattr->nla_type); in target_to_host_data_inet6_nlattr()
1360 static abi_long target_to_host_data_spec_nlattr(struct nlattr *nlattr) in target_to_host_data_spec_nlattr() argument
1362 switch (nlattr->nla_type & NLA_TYPE_MASK) { in target_to_host_data_spec_nlattr()
1364 return target_to_host_for_each_nlattr(NLA_DATA(nlattr), nlattr->nla_len, in target_to_host_data_spec_nlattr()
1368 nlattr->nla_type); in target_to_host_data_spec_nlattr()