Home
last modified time | relevance | path

Searched refs:nla (Results 1 – 25 of 90) sorted by relevance

1234

/net/netfilter/
Dnf_tables_api.c138 const struct nlattr * const *nla) in nft_ctx_init() argument
145 ctx->nla = nla; in nft_ctx_init()
431 if (ctx->nla[NFTA_CHAIN_ID]) { in nft_trans_chain_add()
433 ntohl(nla_get_be32(ctx->nla[NFTA_CHAIN_ID])); in nft_trans_chain_add()
504 if (msg_type == NFT_MSG_NEWRULE && ctx->nla[NFTA_RULE_ID] != NULL) { in nft_trans_rule_add()
506 ntohl(nla_get_be32(ctx->nla[NFTA_RULE_ID])); in nft_trans_rule_add()
570 if (msg_type == NFT_MSG_NEWSET && ctx->nla[NFTA_SET_ID] && !desc) { in __nft_trans_set_add()
572 ntohl(nla_get_be32(ctx->nla[NFTA_SET_ID])); in __nft_trans_set_add()
782 const struct nlattr *nla, in nft_table_lookup() argument
788 if (nla == NULL) in nft_table_lookup()
[all …]
Dnfnetlink_hook.c291 const struct nlattr * const *nla = cb->data; in nfnl_hook_dump_start() local
299 hooknum = ntohl(nla_get_be32(nla[NFNLA_HOOK_HOOKNUM])); in nfnl_hook_dump_start()
304 if (!nla[NFNLA_HOOK_DEV]) in nfnl_hook_dump_start()
307 nla_strscpy(name, nla[NFNLA_HOOK_DEV], sizeof(name)); in nfnl_hook_dump_start()
340 const struct nlattr * const nla[]) in nfnl_hook_get() argument
342 if (!nla[NFNLA_HOOK_HOOKNUM]) in nfnl_hook_get()
351 .data = (void *)nla, in nfnl_hook_get()
Dnft_log.c151 const struct nlattr *nla; in nft_log_init() local
164 nla = tb[NFTA_LOG_PREFIX]; in nft_log_init()
165 if (nla != NULL) { in nft_log_init()
166 priv->prefix = kmalloc(nla_len(nla) + 1, GFP_KERNEL); in nft_log_init()
169 nla_strscpy(priv->prefix, nla, nla_len(nla) + 1); in nft_log_init()
Dnf_tables_trace.c32 struct nlattr *nla; in trace_fill_header() local
37 nla = nla_reserve(nlskb, type, len); in trace_fill_header()
38 if (!nla || skb_copy_bits(skb, off, nla_data(nla), len)) in trace_fill_header()
Dnft_compat.c257 if (ctx->nla[NFTA_RULE_COMPAT]) { in nft_target_init()
258 ret = nft_parse_compat(ctx->nla[NFTA_RULE_COMPAT], &proto, &inv); in nft_target_init()
321 struct nlattr *nla; in nft_extension_dump_info() local
323 nla = nla_reserve(skb, attr, aligned_size); in nft_extension_dump_info()
324 if (!nla) in nft_extension_dump_info()
328 memcpy(nla_data(nla), info, info_size); in nft_extension_dump_info()
329 memset(nla_data(nla) + info_size, 0, aligned_size - info_size); in nft_extension_dump_info()
500 if (ctx->nla[NFTA_RULE_COMPAT]) { in __nft_match_init()
501 ret = nft_parse_compat(ctx->nla[NFTA_RULE_COMPAT], &proto, &inv); in __nft_match_init()
/net/sched/
Dact_tunnel_key.c86 tunnel_key_copy_geneve_opt(const struct nlattr *nla, void *dst, int dst_len, in tunnel_key_copy_geneve_opt() argument
95 nla, geneve_opt_policy, extack); in tunnel_key_copy_geneve_opt()
138 tunnel_key_copy_vxlan_opt(const struct nlattr *nla, void *dst, int dst_len, in tunnel_key_copy_vxlan_opt() argument
144 err = nla_parse_nested(tb, TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX, nla, in tunnel_key_copy_vxlan_opt()
165 tunnel_key_copy_erspan_opt(const struct nlattr *nla, void *dst, int dst_len, in tunnel_key_copy_erspan_opt() argument
172 err = nla_parse_nested(tb, TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX, nla, in tunnel_key_copy_erspan_opt()
204 nla = tb[TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_INDEX]; in tunnel_key_copy_erspan_opt()
205 md->u.index = nla_get_be32(nla); in tunnel_key_copy_erspan_opt()
207 nla = tb[TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_DIR]; in tunnel_key_copy_erspan_opt()
208 md->u.md2.dir = nla_get_u8(nla); in tunnel_key_copy_erspan_opt()
[all …]
Dact_bpf.c100 struct nlattr *nla; in tcf_bpf_dump_bpf_info() local
105 nla = nla_reserve(skb, TCA_ACT_BPF_OPS, prog->bpf_num_ops * in tcf_bpf_dump_bpf_info()
107 if (nla == NULL) in tcf_bpf_dump_bpf_info()
110 memcpy(nla_data(nla), prog->bpf_ops, nla_len(nla)); in tcf_bpf_dump_bpf_info()
118 struct nlattr *nla; in tcf_bpf_dump_ebpf_info() local
127 nla = nla_reserve(skb, TCA_ACT_BPF_TAG, sizeof(prog->filter->tag)); in tcf_bpf_dump_ebpf_info()
128 if (nla == NULL) in tcf_bpf_dump_ebpf_info()
131 memcpy(nla_data(nla), prog->filter->tag, nla_len(nla)); in tcf_bpf_dump_ebpf_info()
277 static int tcf_bpf_init(struct net *net, struct nlattr *nla, in tcf_bpf_init() argument
293 if (!nla) in tcf_bpf_init()
[all …]
Dsch_fifo.c229 struct nlattr *nla; in fifo_set_limit() local
239 nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL); in fifo_set_limit()
240 if (nla) { in fifo_set_limit()
241 nla->nla_type = RTM_NEWQDISC; in fifo_set_limit()
242 nla->nla_len = nla_attr_size(sizeof(struct tc_fifo_qopt)); in fifo_set_limit()
243 ((struct tc_fifo_qopt *)nla_data(nla))->limit = limit; in fifo_set_limit()
245 ret = q->ops->change(q, nla, NULL); in fifo_set_limit()
246 kfree(nla); in fifo_set_limit()
Dem_meta.c695 static int meta_var_change(struct meta_value *dst, struct nlattr *nla) in meta_var_change() argument
697 int len = nla_len(nla); in meta_var_change()
699 dst->val = (unsigned long)kmemdup(nla_data(nla), len, GFP_KERNEL); in meta_var_change()
748 static int meta_int_change(struct meta_value *dst, struct nlattr *nla) in meta_int_change() argument
750 if (nla_len(nla) >= sizeof(unsigned long)) { in meta_int_change()
751 dst->val = *(unsigned long *) nla_data(nla); in meta_int_change()
753 } else if (nla_len(nla) == sizeof(u32)) { in meta_int_change()
754 dst->val = nla_get_u32(nla); in meta_int_change()
885 static inline int meta_change_data(struct meta_value *dst, struct nlattr *nla) in meta_change_data() argument
887 if (nla) { in meta_change_data()
[all …]
Dcls_bpf.c539 struct nlattr *nla; in cls_bpf_dump_bpf_info() local
544 nla = nla_reserve(skb, TCA_BPF_OPS, prog->bpf_num_ops * in cls_bpf_dump_bpf_info()
546 if (nla == NULL) in cls_bpf_dump_bpf_info()
549 memcpy(nla_data(nla), prog->bpf_ops, nla_len(nla)); in cls_bpf_dump_bpf_info()
557 struct nlattr *nla; in cls_bpf_dump_ebpf_info() local
566 nla = nla_reserve(skb, TCA_BPF_TAG, sizeof(prog->filter->tag)); in cls_bpf_dump_ebpf_info()
567 if (nla == NULL) in cls_bpf_dump_ebpf_info()
570 memcpy(nla_data(nla), prog->filter->tag, nla_len(nla)); in cls_bpf_dump_ebpf_info()
Dematch.c171 struct tcf_ematch *em, struct nlattr *nla, int idx) in tcf_em_validate() argument
174 struct tcf_ematch_hdr *em_hdr = nla_data(nla); in tcf_em_validate()
175 int data_len = nla_len(nla) - sizeof(*em_hdr); in tcf_em_validate()
305 int tcf_em_tree_validate(struct tcf_proto *tp, struct nlattr *nla, in tcf_em_tree_validate() argument
315 if (!nla) in tcf_em_tree_validate()
318 err = nla_parse_nested_deprecated(tb, TCA_EMATCH_TREE_MAX, nla, in tcf_em_tree_validate()
Dact_ipt.c93 static int __tcf_ipt_init(struct net *net, unsigned int id, struct nlattr *nla, in __tcf_ipt_init() argument
109 if (nla == NULL) in __tcf_ipt_init()
112 err = nla_parse_nested_deprecated(tb, TCA_IPT_MAX, nla, ipt_policy, in __tcf_ipt_init()
214 static int tcf_ipt_init(struct net *net, struct nlattr *nla, in tcf_ipt_init() argument
219 return __tcf_ipt_init(net, act_ipt_ops.net_id, nla, est, in tcf_ipt_init()
223 static int tcf_xt_init(struct net *net, struct nlattr *nla, in tcf_xt_init() argument
228 return __tcf_ipt_init(net, act_xt_ops.net_id, nla, est, in tcf_xt_init()
Dact_pedit.c40 static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla, in tcf_pedit_keys_ex_parse() argument
49 if (!nla) in tcf_pedit_keys_ex_parse()
58 nla_for_each_nested(ka, nla, rem) { in tcf_pedit_keys_ex_parse()
151 static int tcf_pedit_init(struct net *net, struct nlattr *nla, in tcf_pedit_init() argument
168 if (!nla) { in tcf_pedit_init()
173 err = nla_parse_nested_deprecated(tb, TCA_PEDIT_MAX, nla, in tcf_pedit_init()
Dsch_mqprio.c119 static int parse_attr(struct nlattr *tb[], int maxtype, struct nlattr *nla, in parse_attr() argument
122 int nested_len = nla_len(nla) - NLA_ALIGN(len); in parse_attr()
126 nla_data(nla) + NLA_ALIGN(len), in parse_attr()
429 struct nlattr *nla = (struct nlattr *)skb_tail_pointer(skb); in mqprio_dump() local
481 return nla_nest_end(skb, nla); in mqprio_dump()
483 nlmsg_trim(skb, nla); in mqprio_dump()
/net/ipv4/
Dmetrics.c15 struct nlattr *nla; in ip_metrics_convert() local
21 nla_for_each_attr(nla, fc_mx, fc_mx_len, remaining) { in ip_metrics_convert()
22 int type = nla_type(nla); in ip_metrics_convert()
36 nla_strscpy(tmp, nla, sizeof(tmp)); in ip_metrics_convert()
43 if (nla_len(nla) != sizeof(u32)) { in ip_metrics_convert()
44 NL_SET_ERR_MSG_ATTR(extack, nla, in ip_metrics_convert()
48 val = nla_get_u32(nla); in ip_metrics_convert()
Dfib_semantics.c677 static int fib_gw_from_attr(__be32 *gw, struct nlattr *nla, in fib_gw_from_attr() argument
680 if (nla_len(nla) < sizeof(*gw)) { in fib_gw_from_attr()
685 *gw = nla_get_in_addr(nla); in fib_gw_from_attr()
722 struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); in fib_get_nhs() local
724 nla = nla_find(attrs, attrlen, RTA_GATEWAY); in fib_get_nhs()
726 if (nla && nlav) { in fib_get_nhs()
731 if (nla) { in fib_get_nhs()
732 ret = fib_gw_from_attr(&fib_cfg.fc_gw4, nla, in fib_get_nhs()
745 nla = nla_find(attrs, attrlen, RTA_FLOW); in fib_get_nhs()
746 if (nla) { in fib_get_nhs()
[all …]
Dinet_diag.c209 struct nlattr *nla; in inet_diag_parse_attrs() local
212 nlmsg_for_each_attr(nla, nlh, hdrlen, remaining) { in inet_diag_parse_attrs()
213 int type = nla_type(nla); in inet_diag_parse_attrs()
215 if (type == INET_DIAG_REQ_PROTOCOL && nla_len(nla) != sizeof(u32)) in inet_diag_parse_attrs()
219 req_nlas[type] = nla; in inet_diag_parse_attrs()
1206 struct nlattr *nla; in __inet_diag_dump_start() local
1218 nla = cb_data->inet_diag_nla_bc; in __inet_diag_dump_start()
1219 if (nla) { in __inet_diag_dump_start()
1220 err = inet_diag_bc_audit(nla, skb); in __inet_diag_dump_start()
1227 nla = cb_data->inet_diag_nla_bpf_stgs; in __inet_diag_dump_start()
[all …]
/net/xfrm/
Dxfrm_compat.c292 const struct nlattr *nla, *attrs; in xfrm_xlate64() local
303 nla_for_each_attr(nla, attrs, len, remaining) { in xfrm_xlate64()
308 err = xfrm_nla_cpy(dst, nla, nla_len(nla)); in xfrm_xlate64()
311 err = xfrm_xlate64_attr(dst, nla); in xfrm_xlate64()
403 struct nlattr *nla; in xfrm_attr_cpy32() local
415 nla = dst + *pos; in xfrm_attr_cpy32()
417 memcpy(nla, src, nla_attr_size(copy_len)); in xfrm_attr_cpy32()
418 nla->nla_len = nla_attr_size(payload); in xfrm_attr_cpy32()
420 nlmsg->nlmsg_len += nla->nla_len; in xfrm_attr_cpy32()
428 static int xfrm_xlate32_attr(void *dst, const struct nlattr *nla, in xfrm_xlate32_attr() argument
[all …]
/net/openvswitch/
Dflow_netlink.c54 struct nlattr *nla; in actions_may_change_flow() local
57 nla_for_each_nested(nla, actions, rem) { in actions_may_change_flow()
58 u16 action = nla_type(nla); in actions_may_change_flow()
471 const struct nlattr *nla; in __parse_flow_nlattrs() local
476 nla_for_each_nested(nla, attr, rem) { in __parse_flow_nlattrs()
477 u16 type = nla_type(nla); in __parse_flow_nlattrs()
499 if (!check_attr_len(nla_len(nla), expected_len)) { in __parse_flow_nlattrs()
501 type, nla_len(nla), expected_len); in __parse_flow_nlattrs()
505 if (!nz || !is_all_zero(nla_data(nla), nla_len(nla))) { in __parse_flow_nlattrs()
507 a[type] = nla; in __parse_flow_nlattrs()
[all …]
Dmeter.c237 struct nlattr *nla; in ovs_meter_cmd_reply_stats() local
252 nla = nla_nest_start_noflag(reply, OVS_METER_ATTR_BANDS); in ovs_meter_cmd_reply_stats()
253 if (!nla) in ovs_meter_cmd_reply_stats()
268 nla_nest_end(reply, nla); in ovs_meter_cmd_reply_stats()
279 struct nlattr *nla, *band_nla; in ovs_meter_cmd_features() local
305 nla = nla_nest_start_noflag(reply, OVS_METER_ATTR_BANDS); in ovs_meter_cmd_features()
306 if (!nla) in ovs_meter_cmd_features()
316 nla_nest_end(reply, nla); in ovs_meter_cmd_features()
330 struct nlattr *nla; in dp_meter_create() local
341 nla_for_each_nested(nla, a[OVS_METER_ATTR_BANDS], rem) in dp_meter_create()
[all …]
Dvport.c305 struct nlattr *nla; in ovs_vport_get_options() local
311 nla = nla_nest_start_noflag(skb, OVS_VPORT_ATTR_OPTIONS); in ovs_vport_get_options()
312 if (!nla) in ovs_vport_get_options()
317 nla_nest_cancel(skb, nla); in ovs_vport_get_options()
321 nla_nest_end(skb, nla); in ovs_vport_get_options()
/net/mpls/
Daf_mpls.c719 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()
[all …]
/net/psample/
Dpsample.c292 struct nlattr *nla; in psample_ip_tun_to_nlattr() local
295 nla = nla_nest_start_noflag(skb, PSAMPLE_ATTR_TUNNEL); in psample_ip_tun_to_nlattr()
296 if (!nla) in psample_ip_tun_to_nlattr()
301 nla_nest_cancel(skb, nla); in psample_ip_tun_to_nlattr()
305 nla_nest_end(skb, nla); in psample_ip_tun_to_nlattr()
469 struct nlattr *nla; in psample_sample_packet() local
471 nla = skb_put(nl_skb, nla_len); in psample_sample_packet()
472 nla->nla_type = PSAMPLE_ATTR_DATA; in psample_sample_packet()
473 nla->nla_len = nla_attr_size(data_len); in psample_sample_packet()
475 if (skb_copy_bits(skb, 0, nla_data(nla), data_len)) in psample_sample_packet()
/net/ipv6/
Drpl_iptunnel.c67 static int rpl_build_state(struct net *net, struct nlattr *nla, in rpl_build_state() argument
81 err = nla_parse_nested(tb, RPL_IPTUNNEL_MAX, nla, in rpl_build_state()
301 struct nlattr *nla; in nla_put_rpl_srh() local
306 nla = nla_reserve(skb, attrtype, len); in nla_put_rpl_srh()
307 if (!nla) in nla_put_rpl_srh()
310 data = nla_data(nla); in nla_put_rpl_srh()
/net/core/
Dnet_namespace.c740 struct nlattr *nla; in rtnl_net_newid() local
756 nla = tb[NETNSA_PID]; in rtnl_net_newid()
759 nla = tb[NETNSA_FD]; in rtnl_net_newid()
765 NL_SET_BAD_ATTR(extack, nla); in rtnl_net_newid()
774 NL_SET_BAD_ATTR(extack, nla); in rtnl_net_newid()
890 struct nlattr *nla; in rtnl_net_getid() local
899 nla = tb[NETNSA_PID]; in rtnl_net_getid()
902 nla = tb[NETNSA_FD]; in rtnl_net_getid()
907 nla = tb[NETNSA_NSID]; in rtnl_net_getid()
914 NL_SET_BAD_ATTR(extack, nla); in rtnl_net_getid()

1234