Home
last modified time | relevance | path

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

1234

/linux/lib/
H A Dnlattr.c66 static int validate_nla_bitfield32(const struct nlattr *nla, in validate_nla_bitfield32() argument
69 const struct nla_bitfield32 *bf = nla_data(nla); in validate_nla_bitfield32()
171 const struct nlattr *nla, in nla_validate_range_unsigned() argument
180 value = nla_get_u8(nla); in nla_validate_range_unsigned()
183 value = nla_get_u16(nla); in nla_validate_range_unsigned()
186 value = nla_get_u32(nla); in nla_validate_range_unsigned()
189 value = nla_get_u64(nla); in nla_validate_range_unsigned()
192 value = nla_get_uint(nla); in nla_validate_range_unsigned()
195 value = nla_get_u64(nla); in nla_validate_range_unsigned()
198 value = nla_len(nla); in nla_validate_range_unsigned()
[all …]
/linux/include/net/
H A Dnetlink.h549 ssize_t nla_strscpy(char *dst, const struct nlattr *nla, size_t dstsize);
550 char *nla_strdup(const struct nlattr *nla, gfp_t flags);
552 int nla_memcmp(const struct nlattr *nla, const void *data, size_t size);
553 int nla_strcmp(const struct nlattr *nla, const char *str);
1276 static inline int nla_type(const struct nlattr *nla) in nla_type() argument
1278 return nla->nla_type & NLA_TYPE_MASK; in nla_type()
1285 static inline void *nla_data(const struct nlattr *nla) in nla_data() argument
1287 return (char *) nla + NLA_HDRLEN; in nla_data()
1294 static inline u16 nla_len(const struct nlattr *nla) in nla_len() argument
1296 return nla->nla_len - NLA_HDRLEN; in nla_len()
[all …]
/linux/tools/lib/bpf/
H A Dnlattr.c25 static struct nlattr *nla_next(const struct nlattr *nla, int *remaining) in nla_next() argument
27 int totlen = NLA_ALIGN(nla->nla_len); in nla_next()
30 return (struct nlattr *)((void *)nla + totlen); in nla_next()
33 static int nla_ok(const struct nlattr *nla, int remaining) in nla_ok() argument
35 return remaining >= (int)sizeof(*nla) && in nla_ok()
36 nla->nla_len >= sizeof(*nla) && in nla_ok()
37 nla->nla_len <= remaining; in nla_ok()
40 static int nla_type(const struct nlattr *nla) in nla_type() argument
42 return nla in nla_type()
45 validate_nla(struct nlattr * nla,int maxtype,struct libbpf_nla_policy * policy) validate_nla() argument
107 struct nlattr *nla; libbpf_nla_parse() local
150 libbpf_nla_parse_nested(struct nlattr * tb[],int maxtype,struct nlattr * nla,struct libbpf_nla_policy * policy) libbpf_nla_parse_nested() argument
[all...]
H A Dnlattr.h84 static inline void *libbpf_nla_data(const struct nlattr *nla) in libbpf_nla_data() argument
86 return (void *)nla + NLA_HDRLEN; in libbpf_nla_data()
89 static inline uint8_t libbpf_nla_getattr_u8(const struct nlattr *nla) in libbpf_nla_getattr_u8() argument
91 return *(uint8_t *)libbpf_nla_data(nla); in libbpf_nla_getattr_u8()
94 static inline uint16_t libbpf_nla_getattr_u16(const struct nlattr *nla) in libbpf_nla_getattr_u16() argument
96 return *(uint16_t *)libbpf_nla_data(nla); in libbpf_nla_getattr_u16()
99 static inline uint32_t libbpf_nla_getattr_u32(const struct nlattr *nla) in libbpf_nla_getattr_u32() argument
101 return *(uint32_t *)libbpf_nla_data(nla); in libbpf_nla_getattr_u32()
104 static inline uint64_t libbpf_nla_getattr_u64(const struct nlattr *nla) in libbpf_nla_getattr_u64() argument
106 return *(uint64_t *)libbpf_nla_data(nla); in libbpf_nla_getattr_u64()
[all …]
/linux/drivers/block/drbd/
H A Ddrbd_nla.c7 static int drbd_nla_check_mandatory(int maxtype, struct nlattr *nla) in drbd_nla_check_mandatory() argument
9 struct nlattr *head = nla_data(nla); in drbd_nla_check_mandatory()
10 int len = nla_len(nla); in drbd_nla_check_mandatory()
21 nla_for_each_attr(nla, head, len, rem) { in drbd_nla_check_mandatory()
22 if (nla->nla_type & DRBD_GENLA_F_MANDATORY) { in drbd_nla_check_mandatory()
23 nla->nla_type &= ~DRBD_GENLA_F_MANDATORY; in drbd_nla_check_mandatory()
24 if (nla_type(nla) > maxtype) in drbd_nla_check_mandatory()
31 int drbd_nla_parse_nested(struct nlattr *tb[], int maxtype, struct nlattr *nla, in drbd_nla_parse_nested() argument
36 err = drbd_nla_check_mandatory(maxtype, nla); in drbd_nla_parse_nested()
38 err = nla_parse_nested_deprecated(tb, maxtype, nla, policy, in drbd_nla_parse_nested()
[all …]
H A Ddrbd_nla.h5 extern int drbd_nla_parse_nested(struct nlattr *tb[], int maxtype, struct nlattr *nla,
7 extern struct nlattr *drbd_nla_find_nested(int maxtype, struct nlattr *nla, int attrtype);
/linux/net/netfilter/
H A Dnf_tables_api.c161 const struct nlattr * const *nla) in nft_trans_alloc()
168 ctx->nla = nla; in nft_trans_alloc()
628 if (ctx->nla[NFTA_CHAIN_ID]) {
630 ntohl(nla_get_be32(ctx->nla[NFTA_CHAIN_ID])); in nft_rule_expr_activate()
700 if (msg_type == NFT_MSG_NEWRULE && ctx->nla[NFTA_RULE_ID] != NULL) { in nft_delrule()
702 ntohl(nla_get_be32(ctx->nla[NFTA_RULE_ID])); in nft_delrule()
772 if (msg_type == NFT_MSG_NEWSET && ctx->nla[NFTA_SET_ID] && !desc) { in nft_mapelem_deactivate()
774 ntohl(nla_get_be32(ctx->nla[NFTA_SET_ID])); in nft_mapelem_deactivate()
991 const struct nlattr *nla, in nft_table_lookup()
138 nft_ctx_init(struct nft_ctx * ctx,struct net * net,const struct sk_buff * skb,const struct nlmsghdr * nlh,u8 family,struct nft_table * table,struct nft_chain * chain,const struct nlattr * const * nla) nft_ctx_init() argument
968 nft_table_lookup(const struct net * net,const struct nlattr * nla,u8 family,u8 genmask,u32 nlpid) nft_table_lookup() argument
995 nft_table_lookup_byhandle(const struct net * net,const struct nlattr * nla,int family,u8 genmask,u32 nlpid) nft_table_lookup_byhandle() argument
1035 __nf_tables_chain_type_lookup(const struct nlattr * nla,u8 family) __nf_tables_chain_type_lookup() argument
1105 nf_tables_chain_type_lookup(struct net * net,const struct nlattr * nla,u8 family,bool autoload) nf_tables_chain_type_lookup() argument
1295 nf_tables_gettable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_gettable() argument
1560 nf_tables_newtable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newtable() argument
1727 const struct nlattr * const *nla = ctx->nla; nft_flush() local
1758 nf_tables_deltable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_deltable() argument
1864 nft_chain_lookup(struct net * net,struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_chain_lookup() argument
2167 nf_tables_getchain(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getchain() argument
2470 nft_chain_parse_hook(struct net * net,struct nft_base_chain * basechain,const struct nlattr * const nla[],struct nft_chain_hook * hook,u8 family,u32 flags,struct netlink_ext_ack * extack) nft_chain_parse_hook() argument
2670 const struct nlattr * const *nla = ctx->nla; nf_tables_addchain() local
2816 const struct nlattr * const *nla = ctx->nla; nf_tables_updchain() local
3011 nft_chain_lookup_byid(const struct net * net,const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_chain_lookup_byid() argument
3028 nf_tables_newchain(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newchain() argument
3133 const struct nlattr * const *nla = ctx->nla; nft_delchain_hook() local
3181 nf_tables_delchain(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delchain() argument
3305 __nft_expr_type_get(u8 family,struct nlattr * nla) __nft_expr_type_get() argument
3322 nft_expr_type_request_module(struct net * net,u8 family,struct nlattr * nla) nft_expr_type_request_module() argument
3334 nft_expr_type_get(struct net * net,u8 family,struct nlattr * nla) nft_expr_type_get() argument
3416 nf_tables_expr_parse(const struct nft_ctx * ctx,const struct nlattr * nla,struct nft_expr_info * info) nf_tables_expr_parse() argument
3469 nft_expr_inner_parse(const struct nft_ctx * ctx,const struct nlattr * nla,struct nft_expr_info * info) nft_expr_inner_parse() argument
3549 nft_expr_init(const struct nft_ctx * ctx,const struct nlattr * nla) nft_expr_init() argument
3631 nft_rule_lookup(const struct net * net,const struct nft_chain * chain,const struct nlattr * nla) nft_rule_lookup() argument
3900 const struct nlattr * const *nla = cb->data; nf_tables_dump_rules_start() local
3940 nf_tables_getrule_single(u32 portid,const struct nfnl_info * info,const struct nlattr * const nla[],bool reset) nf_tables_getrule_single() argument
3986 nf_tables_getrule(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getrule() argument
4013 nf_tables_getrule_reset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getrule_reset() argument
4212 nf_tables_newrule(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newrule() argument
4451 nft_rule_lookup_byid(const struct net * net,const struct nft_chain * chain,const struct nlattr * nla) nft_rule_lookup_byid() argument
4467 nf_tables_delrule(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delrule() argument
4669 nft_set_lookup(const struct net * net,const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_set_lookup() argument
4686 nft_set_lookup_byhandle(const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_set_lookup_byhandle() argument
4701 nft_set_lookup_byid(const struct net * net,const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_set_lookup_byid() argument
4796 nf_msecs_to_jiffies64(const struct nlattr * nla,u64 * result) nf_msecs_to_jiffies64() argument
5097 nf_tables_getset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getset() argument
5187 nft_set_desc_concat(struct nft_set_desc * desc,const struct nlattr * nla) nft_set_desc_concat() argument
5216 nf_tables_set_desc_parse(struct nft_set_desc * desc,const struct nlattr * nla) nf_tables_set_desc_parse() argument
5235 nft_set_expr_alloc(struct nft_ctx * ctx,struct nft_set * set,const struct nlattr * const * nla,struct nft_expr ** exprs,int * num_exprs,u32 flags) nft_set_expr_alloc() argument
5325 nf_tables_newset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newset() argument
5665 nf_tables_delset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delset() argument
6450 struct nlattr *nla[NFTA_SET_ELEM_MAX + 1]; nft_get_set_elem() local
6507 nft_set_dump_ctx_init(struct nft_set_dump_ctx * dump_ctx,const struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[],bool reset) nft_set_dump_ctx_init() argument
6540 nf_tables_getsetelem(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getsetelem() argument
6583 nf_tables_getsetelem_reset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getsetelem_reset() argument
7172 nft_setelem_valid_key_end(const struct nft_set * set,struct nlattr ** nla,u32 flags) nft_setelem_valid_key_end() argument
7215 struct nlattr *nla[NFTA_SET_ELEM_MAX + 1]; nft_add_set_elem() local
7620 nf_tables_newsetelem(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newsetelem() argument
7781 struct nlattr *nla[NFTA_SET_ELEM_MAX + 1]; nft_del_setelem() local
7957 nf_tables_delsetelem(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delsetelem() argument
8047 nft_obj_lookup(const struct net * net,const struct nft_table * table,const struct nlattr * nla,u32 objtype,u8 genmask) nft_obj_lookup() argument
8080 nft_obj_lookup_byhandle(const struct nft_table * table,const struct nlattr * nla,u32 objtype,u8 genmask) nft_obj_lookup_byhandle() argument
8250 nf_tables_newobj(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newobj() argument
8503 const struct nlattr * const *nla = cb->data; nf_tables_dump_obj_start() local
8540 nf_tables_getobj_single(u32 portid,const struct nfnl_info * info,const struct nlattr * const nla[],bool reset) nf_tables_getobj_single() argument
8585 nf_tables_getobj(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getobj() argument
8611 nf_tables_getobj_reset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getobj_reset() argument
8666 nf_tables_delobj(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delobj() argument
8807 nft_flowtable_lookup(const struct net * net,const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_flowtable_lookup() argument
8840 nft_flowtable_lookup_byhandle(const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_flowtable_lookup_byhandle() argument
8865 nft_flowtable_parse_hook(const struct nft_ctx * ctx,const struct nlattr * const nla[],struct nft_flowtable_hook * flowtable_hook,struct nft_flowtable * flowtable,struct netlink_ext_ack * extack,bool add) nft_flowtable_parse_hook() argument
9090 const struct nlattr * const *nla = ctx->nla; nft_flowtable_update() local
9181 nf_tables_newflowtable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newflowtable() argument
9326 const struct nlattr * const *nla = ctx->nla; nft_delflowtable_hook() local
9373 nf_tables_delflowtable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delflowtable() argument
9547 const struct nlattr * const *nla = cb->data; nf_tables_dump_flowtable_start() local
9583 nf_tables_getflowtable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getflowtable() argument
9877 nf_tables_getgen(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getgen() argument
11745 nft_verdict_init(const struct nft_ctx * ctx,struct nft_data * data,struct nft_data_desc * desc,const struct nlattr * nla) nft_verdict_init() argument
11852 nft_value_init(const struct nft_ctx * ctx,struct nft_data * data,struct nft_data_desc * desc,const struct nlattr * nla) nft_value_init() argument
11899 nft_data_init(const struct nft_ctx * ctx,struct nft_data * data,struct nft_data_desc * desc,const struct nlattr * nla) nft_data_init() argument
[all...]
H A 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_ACCOUNT); in nft_log_init()
169 nla_strscpy(priv->prefix, nla, nla_len(nla) + 1); in nft_log_init()
H A Dnfnetlink_hook.c384 const struct nlattr * const *nla = cb->data; in nfnl_hook_dump_start() local
392 hooknum = ntohl(nla_get_be32(nla[NFNLA_HOOK_HOOKNUM])); in nfnl_hook_dump_start()
397 if (!nla[NFNLA_HOOK_DEV]) in nfnl_hook_dump_start()
400 nla_strscpy(name, nla[NFNLA_HOOK_DEV], sizeof(name)); in nfnl_hook_dump_start()
433 const struct nlattr * const nla[]) in nfnl_hook_get() argument
435 if (!nla[NFNLA_HOOK_HOOKNUM]) in nfnl_hook_get()
444 .data = (void *)nla, in nfnl_hook_get()
/linux/net/ipv4/
H A Dmetrics.c15 struct nlattr *nla; in ip_metrics_convert() local
18 nla_for_each_attr(nla, fc_mx, fc_mx_len, remaining) { in ip_metrics_convert()
19 int type = nla_type(nla); in ip_metrics_convert()
33 nla_strscpy(tmp, nla, sizeof(tmp)); in ip_metrics_convert()
40 if (nla_len(nla) != sizeof(u32)) { in ip_metrics_convert()
41 NL_SET_ERR_MSG_ATTR(extack, nla, in ip_metrics_convert()
45 val = nla_get_u32(nla); in ip_metrics_convert()
H A Dfib_semantics.c701 static int fib_gw_from_attr(__be32 *gw, struct nlattr *nla, in fib_gw_from_attr() argument
704 if (nla_len(nla) < sizeof(*gw)) { in fib_gw_from_attr()
709 *gw = nla_get_in_addr(nla); in fib_gw_from_attr()
746 struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); in fib_get_nhs() local
748 nla = nla_find(attrs, attrlen, RTA_GATEWAY); in fib_get_nhs()
750 if (nla && nlav) { in fib_get_nhs()
755 if (nla) { in fib_get_nhs()
756 ret = fib_gw_from_attr(&fib_cfg.fc_gw4, nla, in fib_get_nhs()
769 nla = nla_find(attrs, attrlen, RTA_FLOW); in fib_get_nhs()
770 if (nla) { in fib_get_nhs()
[all …]
/linux/include/linux/
H A Dgenl_magic_func.h102 #define DPRINT_FIELD(dir, nla_type, name, s, nla) \ argument
106 else if (nla) \
109 : nla_data(nla)); \
112 #define DPRINT_ARRAY(dir, nla_type, name, s, nla) \ argument
117 else if (nla) \
119 nla_data(nla), nla_len(nla)); \
123 #define DPRINT_FIELD(dir, nla_type, name, s, nla) do {} while (0) argument
124 #define DPRINT_ARRAY(dir, nla_type, name, s, nla) do {} while (0) argument
146 struct nlattr *nla; \
171 nla = ntb[attr_nr]; \
[all …]
/linux/net/sched/
H A 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 …]
H A Dsch_fifo.c233 struct nlattr *nla; in fifo_set_limit() local
243 nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL); in fifo_set_limit()
244 if (nla) { in fifo_set_limit()
245 nla->nla_type = RTM_NEWQDISC; in fifo_set_limit()
246 nla->nla_len = nla_attr_size(sizeof(struct tc_fifo_qopt)); in fifo_set_limit()
247 ((struct tc_fifo_qopt *)nla_data(nla))->limit = limit; in fifo_set_limit()
249 ret = q->ops->change(q, nla, NULL); in fifo_set_limit()
250 kfree(nla); in fifo_set_limit()
H A 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 …]
H A 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()
H A Dcls_bpf.c541 struct nlattr *nla; in cls_bpf_dump_bpf_info() local
546 nla = nla_reserve(skb, TCA_BPF_OPS, prog->bpf_num_ops * in cls_bpf_dump_bpf_info()
548 if (nla == NULL) in cls_bpf_dump_bpf_info()
551 memcpy(nla_data(nla), prog->bpf_ops, nla_len(nla)); in cls_bpf_dump_bpf_info()
559 struct nlattr *nla; in cls_bpf_dump_ebpf_info() local
568 nla = nla_reserve(skb, TCA_BPF_TAG, sizeof(prog->filter->tag)); in cls_bpf_dump_ebpf_info()
569 if (nla == NULL) in cls_bpf_dump_ebpf_info()
572 memcpy(nla_data(nla), prog->filter->tag, nla_len(nla)); in cls_bpf_dump_ebpf_info()
H A Dact_pedit.c42 static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla, in tcf_pedit_keys_ex_parse() argument
51 if (!nla) in tcf_pedit_keys_ex_parse()
60 nla_for_each_nested(ka, nla, rem) { in tcf_pedit_keys_ex_parse()
82 if (NL_REQ_ATTR_CHECK(extack, nla, tb, TCA_PEDIT_KEY_EX_HTYPE)) { in tcf_pedit_keys_ex_parse()
88 if (NL_REQ_ATTR_CHECK(extack, nla, tb, TCA_PEDIT_KEY_EX_CMD)) { in tcf_pedit_keys_ex_parse()
156 static int tcf_pedit_init(struct net *net, struct nlattr *nla, in tcf_pedit_init() argument
173 if (!nla) { in tcf_pedit_init()
178 err = nla_parse_nested_deprecated(tb, TCA_PEDIT_MAX, nla, in tcf_pedit_init()
/linux/net/openvswitch/
H A Dvport.c313 struct nlattr *nla; in ovs_vport_get_upcall_stats() local
331 nla = nla_nest_start_noflag(skb, OVS_VPORT_ATTR_UPCALL_STATS); in ovs_vport_get_upcall_stats()
332 if (!nla) in ovs_vport_get_upcall_stats()
337 nla_nest_cancel(skb, nla); in ovs_vport_get_upcall_stats()
343 nla_nest_cancel(skb, nla); in ovs_vport_get_upcall_stats()
346 nla_nest_end(skb, nla); in ovs_vport_get_upcall_stats()
369 struct nlattr *nla; in ovs_vport_get_options() local
375 nla = nla_nest_start_noflag(skb, OVS_VPORT_ATTR_OPTIONS); in ovs_vport_get_options()
376 if (!nla) in ovs_vport_get_options()
381 nla_nest_cancel(skb, nla); in ovs_vport_get_options()
[all …]
H A Dflow_netlink.c55 struct nlattr *nla; in actions_may_change_flow() local
58 nla_for_each_nested(nla, actions, rem) { in actions_may_change_flow()
59 u16 action = nla_type(nla); in actions_may_change_flow()
481 const struct nlattr *nla; in __parse_flow_nlattrs() local
486 nla_for_each_nested(nla, attr, rem) { in __parse_flow_nlattrs()
487 u16 type = nla_type(nla); in __parse_flow_nlattrs()
509 if (!check_attr_len(nla_len(nla), expected_len)) { in __parse_flow_nlattrs()
511 type, nla_len(nla), expected_len); in __parse_flow_nlattrs()
515 if (!nz || !is_all_zero(nla_data(nla), nla_len(nla))) { in __parse_flow_nlattrs()
870 struct nlattr *nla; vxlan_opt_to_nlattr() local
963 struct nlattr *nla; ip_tun_to_nlattr() local
1739 struct nlattr *nla; nlattr_set() local
1992 struct nlattr *nla; __ovs_nla_put_key() local
2245 struct nlattr *nla; ovs_nla_put_key() local
3718 struct nlattr *nla; masked_set_action_to_set_action_attr() local
[all...]
H A Dmeter.c235 struct nlattr *nla; in ovs_meter_cmd_reply_stats() local
250 nla = nla_nest_start_noflag(reply, OVS_METER_ATTR_BANDS); in ovs_meter_cmd_reply_stats()
251 if (!nla) in ovs_meter_cmd_reply_stats()
266 nla_nest_end(reply, nla); in ovs_meter_cmd_reply_stats()
277 struct nlattr *nla, *band_nla; in ovs_meter_cmd_features() local
303 nla = nla_nest_start_noflag(reply, OVS_METER_ATTR_BANDS); in ovs_meter_cmd_features()
304 if (!nla) in ovs_meter_cmd_features()
314 nla_nest_end(reply, nla); in ovs_meter_cmd_features()
328 struct nlattr *nla; in dp_meter_create() local
339 nla_for_each_nested(nla, a[OVS_METER_ATTR_BANDS], rem) in dp_meter_create()
[all …]
/linux/net/mpls/
H A Daf_mpls.c740 static int nla_get_via(const struct nlattr *nla, u8 *via_alen, u8 *via_table, in nla_get_via()
743 struct rtvia *via = nla_data(nla); in nla_get_via()
747 if (nla_len(nla) < offsetof(struct rtvia, rtvia_addr)) { in nla_get_via()
748 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_via()
752 alen = nla_len(nla) - in nla_get_via()
755 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_via()
867 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in mpls_count_nexthops()
872 nla = nla_find(attrs, attrlen, RTA_VIA); in mpls_count_nexthops()
873 if (nla && nla_len(nla) > in mpls_count_nexthops()
720 nla_get_via(const struct nlattr * nla,u8 * via_alen,u8 * via_table,u8 via_addr[],struct netlink_ext_ack * extack) nla_get_via() argument
847 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); mpls_count_nexthops() local
1104 struct nlattr *nla; mpls_fill_stats_af() local
1669 struct nlattr *nla; nla_put_via() local
1689 struct nlattr *nla; nla_put_labels() local
1708 nla_get_labels(const struct nlattr * nla,u8 max_labels,u8 * labels,u32 label[],struct netlink_ext_ack * extack) nla_get_labels() argument
1859 struct nlattr *nla = tb[index]; rtm_to_route_config() local
[all...]
/linux/net/psample/
H A Dpsample.c293 struct nlattr *nla; in psample_ip_tun_to_nlattr() local
296 nla = nla_nest_start_noflag(skb, PSAMPLE_ATTR_TUNNEL); in psample_ip_tun_to_nlattr()
297 if (!nla) in psample_ip_tun_to_nlattr()
302 nla_nest_cancel(skb, nla); in psample_ip_tun_to_nlattr()
306 nla_nest_end(skb, nla); in psample_ip_tun_to_nlattr()
480 struct nlattr *nla; in psample_sample_packet() local
482 nla = skb_put(nl_skb, nla_len); in psample_sample_packet()
483 nla->nla_type = PSAMPLE_ATTR_DATA; in psample_sample_packet()
484 nla->nla_len = nla_attr_size(data_len); in psample_sample_packet()
486 if (skb_copy_bits(skb, 0, nla_data(nla), data_len)) in psample_sample_packet()
/linux/net/ipv6/
H A 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()
319 struct nlattr *nla; in nla_put_rpl_srh() local
324 nla = nla_reserve(skb, attrtype, len); in nla_put_rpl_srh()
325 if (!nla) in nla_put_rpl_srh()
328 data = nla_data(nla); in nla_put_rpl_srh()
/linux/net/handshake/
H A Dtlshd.c66 struct nlattr *nla; in tls_handshake_remote_peerids() local
70 nla_for_each_attr(nla, head, len, rem) { in tls_handshake_remote_peerids()
71 if (nla_type(nla) == HANDSHAKE_A_DONE_REMOTE_AUTH) in tls_handshake_remote_peerids()
80 nla_for_each_attr(nla, head, len, rem) { in tls_handshake_remote_peerids()
81 if (nla_type(nla) == HANDSHAKE_A_DONE_REMOTE_AUTH) in tls_handshake_remote_peerids()
82 treq->th_peerid[i++] = nla_get_u32(nla); in tls_handshake_remote_peerids()

1234