Home
last modified time | relevance | path

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

12345

/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/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->nla_type & NLA_TYPE_MASK; in nla_type()
45 static int validate_nla(struct nlattr *nla, int maxtype, in validate_nla() 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/include/net/
H A Dnetlink.h537 ssize_t nla_strscpy(char *dst, const struct nlattr *nla, size_t dstsize);
538 char *nla_strdup(const struct nlattr *nla, gfp_t flags);
540 int nla_memcmp(const struct nlattr *nla, const void *data, size_t size);
541 int nla_strcmp(const struct nlattr *nla, const char *str);
1236 static inline int nla_type(const struct nlattr *nla) in nla_type() argument
1238 return nla->nla_type & NLA_TYPE_MASK; in nla_type()
1245 static inline void *nla_data(const struct nlattr *nla) in nla_data() argument
1247 return (char *) nla + NLA_HDRLEN; in nla_data()
1254 static inline u16 nla_len(const struct nlattr *nla) in nla_len() argument
1256 return nla->nla_len - NLA_HDRLEN; in nla_len()
[all …]
/linux/net/netfilter/
H A Dnf_tables_api.c137 const struct nlattr * const *nla) in nft_ctx_init() argument
144 ctx->nla = nla; in nft_ctx_init()
479 if (ctx->nla[NFTA_CHAIN_ID]) { in nft_trans_chain_add()
481 ntohl(nla_get_be32(ctx->nla[NFTA_CHAIN_ID])); in nft_trans_chain_add()
551 if (msg_type == NFT_MSG_NEWRULE && ctx->nla[NFTA_RULE_ID] != NULL) { in nft_trans_rule_add()
553 ntohl(nla_get_be32(ctx->nla[NFTA_RULE_ID])); in nft_trans_rule_add()
623 if (msg_type == NFT_MSG_NEWSET && ctx->nla[NFTA_SET_ID] && !desc) { in __nft_trans_set_add()
625 ntohl(nla_get_be32(ctx->nla[NFTA_SET_ID])); in __nft_trans_set_add()
842 const struct nlattr *nla, in nft_table_lookup() argument
869 nft_table_lookup_byhandle(const struct net * net,const struct nlattr * nla,int family,u8 genmask,u32 nlpid) nft_table_lookup_byhandle() argument
909 __nf_tables_chain_type_lookup(const struct nlattr * nla,u8 family) __nf_tables_chain_type_lookup() argument
979 nf_tables_chain_type_lookup(struct net * net,const struct nlattr * nla,u8 family,bool autoload) nf_tables_chain_type_lookup() argument
1165 nf_tables_gettable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_gettable() argument
1430 nf_tables_newtable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newtable() argument
1597 const struct nlattr * const *nla = ctx->nla; nft_flush() local
1628 nf_tables_deltable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_deltable() argument
1734 nft_chain_lookup(struct net * net,struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_chain_lookup() argument
2021 nf_tables_getchain(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getchain() argument
2304 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
2502 const struct nlattr * const *nla = ctx->nla; nf_tables_addchain() local
2648 const struct nlattr * const *nla = ctx->nla; nf_tables_updchain() local
2824 nft_chain_lookup_byid(const struct net * net,const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_chain_lookup_byid() argument
2841 nf_tables_newchain(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newchain() argument
2946 const struct nlattr * const *nla = ctx->nla; nft_delchain_hook() local
2994 nf_tables_delchain(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delchain() argument
3118 __nft_expr_type_get(u8 family,struct nlattr * nla) __nft_expr_type_get() argument
3135 nft_expr_type_request_module(struct net * net,u8 family,struct nlattr * nla) nft_expr_type_request_module() argument
3147 nft_expr_type_get(struct net * net,u8 family,struct nlattr * nla) nft_expr_type_get() argument
3229 nf_tables_expr_parse(const struct nft_ctx * ctx,const struct nlattr * nla,struct nft_expr_info * info) nf_tables_expr_parse() argument
3282 nft_expr_inner_parse(const struct nft_ctx * ctx,const struct nlattr * nla,struct nft_expr_info * info) nft_expr_inner_parse() argument
3350 nft_expr_init(const struct nft_ctx * ctx,const struct nlattr * nla) nft_expr_init() argument
3429 nft_rule_lookup(const struct nft_chain * chain,const struct nlattr * nla) nft_rule_lookup() argument
3698 const struct nlattr * const *nla = cb->data; nf_tables_dump_rules_start() local
3738 nf_tables_getrule_single(u32 portid,const struct nfnl_info * info,const struct nlattr * const nla[],bool reset) nf_tables_getrule_single() argument
3784 nf_tables_getrule(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getrule() argument
3811 nf_tables_getrule_reset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getrule_reset() argument
4006 nf_tables_newrule(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newrule() argument
4245 nft_rule_lookup_byid(const struct net * net,const struct nft_chain * chain,const struct nlattr * nla) nft_rule_lookup_byid() argument
4261 nf_tables_delrule(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delrule() argument
4460 nft_set_lookup(const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_set_lookup() argument
4476 nft_set_lookup_byhandle(const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_set_lookup_byhandle() argument
4491 nft_set_lookup_byid(const struct net * net,const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_set_lookup_byid() argument
4586 nf_msecs_to_jiffies64(const struct nlattr * nla,u64 * result) nf_msecs_to_jiffies64() argument
4852 nf_tables_getset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getset() argument
4942 nft_set_desc_concat(struct nft_set_desc * desc,const struct nlattr * nla) nft_set_desc_concat() argument
4971 nf_tables_set_desc_parse(struct nft_set_desc * desc,const struct nlattr * nla) nf_tables_set_desc_parse() argument
4990 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
5071 nf_tables_newset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newset() argument
5405 nf_tables_delset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delset() argument
6187 struct nlattr *nla[NFTA_SET_ELEM_MAX + 1]; nft_get_set_elem() local
6244 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
6277 nf_tables_getsetelem(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getsetelem() argument
6320 nf_tables_getsetelem_reset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getsetelem_reset() argument
6820 nft_setelem_valid_key_end(const struct nft_set * set,struct nlattr ** nla,u32 flags) nft_setelem_valid_key_end() argument
6842 struct nlattr *nla[NFTA_SET_ELEM_MAX + 1]; nft_add_set_elem() local
7238 nf_tables_newsetelem(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newsetelem() argument
7350 struct nlattr *nla[NFTA_SET_ELEM_MAX + 1]; nft_del_setelem() local
7526 nf_tables_delsetelem(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delsetelem() argument
7616 nft_obj_lookup(const struct net * net,const struct nft_table * table,const struct nlattr * nla,u32 objtype,u8 genmask) nft_obj_lookup() argument
7649 nft_obj_lookup_byhandle(const struct nft_table * table,const struct nlattr * nla,u32 objtype,u8 genmask) nft_obj_lookup_byhandle() argument
7821 nf_tables_newobj(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newobj() argument
8072 const struct nlattr * const *nla = cb->data; nf_tables_dump_obj_start() local
8109 nf_tables_getobj_single(u32 portid,const struct nfnl_info * info,const struct nlattr * const nla[],bool reset) nf_tables_getobj_single() argument
8154 nf_tables_getobj(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getobj() argument
8180 nf_tables_getobj_reset(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getobj_reset() argument
8235 nf_tables_delobj(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delobj() argument
8376 nft_flowtable_lookup(const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_flowtable_lookup() argument
8408 nft_flowtable_lookup_byhandle(const struct nft_table * table,const struct nlattr * nla,u8 genmask) nft_flowtable_lookup_byhandle() argument
8433 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
8638 const struct nlattr * const *nla = ctx->nla; nft_flowtable_update() local
8710 nf_tables_newflowtable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_newflowtable() argument
8855 const struct nlattr * const *nla = ctx->nla; nft_delflowtable_hook() local
8902 nf_tables_delflowtable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_delflowtable() argument
9073 const struct nlattr * const *nla = cb->data; nf_tables_dump_flowtable_start() local
9109 nf_tables_getflowtable(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getflowtable() argument
9320 nf_tables_getgen(struct sk_buff * skb,const struct nfnl_info * info,const struct nlattr * const nla[]) nf_tables_getgen() argument
11199 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
11306 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
11353 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 Dnfnetlink_hook.c346 const struct nlattr * const *nla = cb->data; in nfnl_hook_dump_start() local
354 hooknum = ntohl(nla_get_be32(nla[NFNLA_HOOK_HOOKNUM])); in nfnl_hook_dump_start()
359 if (!nla[NFNLA_HOOK_DEV]) in nfnl_hook_dump_start()
362 nla_strscpy(name, nla[NFNLA_HOOK_DEV], sizeof(name)); in nfnl_hook_dump_start()
395 const struct nlattr * const nla[]) in nfnl_hook_get() argument
397 if (!nla[NFNLA_HOOK_HOOKNUM]) in nfnl_hook_get()
406 .data = (void *)nla, in nfnl_hook_get()
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()
/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.c676 static int fib_gw_from_attr(__be32 *gw, struct nlattr *nla, in fib_gw_from_attr() argument
679 if (nla_len(nla) < sizeof(*gw)) { in fib_gw_from_attr()
684 *gw = nla_get_in_addr(nla); in fib_gw_from_attr()
721 struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); in fib_get_nhs() local
723 nla = nla_find(attrs, attrlen, RTA_GATEWAY); in fib_get_nhs()
725 if (nla && nlav) { in fib_get_nhs()
730 if (nla) { in fib_get_nhs()
731 ret = fib_gw_from_attr(&fib_cfg.fc_gw4, nla, in fib_get_nhs()
744 nla = nla_find(attrs, attrlen, RTA_FLOW); in fib_get_nhs()
745 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_tunnel_key.c88 tunnel_key_copy_geneve_opt(const struct nlattr *nla, void *dst, int dst_len, in tunnel_key_copy_geneve_opt() argument
97 nla, geneve_opt_policy, extack); in tunnel_key_copy_geneve_opt()
140 tunnel_key_copy_vxlan_opt(const struct nlattr *nla, void *dst, int dst_len, in tunnel_key_copy_vxlan_opt() argument
146 err = nla_parse_nested(tb, TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX, nla, in tunnel_key_copy_vxlan_opt()
167 tunnel_key_copy_erspan_opt(const struct nlattr *nla, void *dst, int dst_len, in tunnel_key_copy_erspan_opt() argument
174 err = nla_parse_nested(tb, TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX, nla, in tunnel_key_copy_erspan_opt()
206 nla = tb[TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_INDEX]; in tunnel_key_copy_erspan_opt()
207 md->u.index = nla_get_be32(nla); in tunnel_key_copy_erspan_opt()
209 nla = tb[TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_DIR]; in tunnel_key_copy_erspan_opt()
210 md->u.md2.dir = nla_get_u8(nla); in tunnel_key_copy_erspan_opt()
[all …]
H A Dact_bpf.c102 struct nlattr *nla; in tcf_bpf_dump_bpf_info() local
107 nla = nla_reserve(skb, TCA_ACT_BPF_OPS, prog->bpf_num_ops * in tcf_bpf_dump_bpf_info()
109 if (nla == NULL) in tcf_bpf_dump_bpf_info()
112 memcpy(nla_data(nla), prog->bpf_ops, nla_len(nla)); in tcf_bpf_dump_bpf_info()
120 struct nlattr *nla; in tcf_bpf_dump_ebpf_info() local
129 nla = nla_reserve(skb, TCA_ACT_BPF_TAG, sizeof(prog->filter->tag)); in tcf_bpf_dump_ebpf_info()
130 if (nla == NULL) in tcf_bpf_dump_ebpf_info()
133 memcpy(nla_data(nla), prog->filter->tag, nla_len(nla)); in tcf_bpf_dump_ebpf_info()
279 static int tcf_bpf_init(struct net *net, struct nlattr *nla, in tcf_bpf_init() argument
295 if (!nla) in tcf_bpf_init()
[all …]
H A Dsch_fifo.c230 struct nlattr *nla; in fifo_set_limit() local
240 nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL); in fifo_set_limit()
241 if (nla) { in fifo_set_limit()
242 nla->nla_type = RTM_NEWQDISC; in fifo_set_limit()
243 nla->nla_len = nla_attr_size(sizeof(struct tc_fifo_qopt)); in fifo_set_limit()
244 ((struct tc_fifo_qopt *)nla_data(nla))->limit = limit; in fifo_set_limit()
246 ret = q->ops->change(q, nla, NULL); in fifo_set_limit()
247 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()
/linux/net/xfrm/
H A Dxfrm_compat.c297 const struct nlattr *nla, *attrs; in xfrm_xlate64() local
308 nla_for_each_attr(nla, attrs, len, remaining) { in xfrm_xlate64()
313 err = xfrm_nla_cpy(dst, nla, nla_len(nla)); in xfrm_xlate64()
316 err = xfrm_xlate64_attr(dst, nla); in xfrm_xlate64()
408 struct nlattr *nla; in xfrm_attr_cpy32() local
420 nla = dst + *pos; in xfrm_attr_cpy32()
422 memcpy(nla, src, nla_attr_size(copy_len)); in xfrm_attr_cpy32()
423 nla->nla_len = nla_attr_size(payload); in xfrm_attr_cpy32()
425 nlmsg->nlmsg_len += nla->nla_len; in xfrm_attr_cpy32()
433 static int xfrm_xlate32_attr(void *dst, const struct nlattr *nla, in xfrm_xlate32_attr() argument
[all …]
/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()
517 a[type] = nla; in __parse_flow_nlattrs()
[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/drivers/net/vxlan/
H A Dvxlan_private.h89 const struct nlattr *nla) in vxlan_nla_get_addr() argument
91 if (nla_len(nla) >= sizeof(struct in6_addr)) { in vxlan_nla_get_addr()
92 ip->sin6.sin6_addr = nla_get_in6_addr(nla); in vxlan_nla_get_addr()
95 } else if (nla_len(nla) >= sizeof(__be32)) { in vxlan_nla_get_addr()
96 ip->sin.sin_addr.s_addr = nla_get_in_addr(nla); in vxlan_nla_get_addr()
130 const struct nlattr *nla) in vxlan_nla_get_addr() argument
132 if (nla_len(nla) >= sizeof(struct in6_addr)) { in vxlan_nla_get_addr()
134 } else if (nla_len(nla) >= sizeof(__be32)) { in vxlan_nla_get_addr()
135 ip->sin.sin_addr.s_addr = nla_get_in_addr(nla); in vxlan_nla_get_addr()
/linux/net/mpls/
H A Daf_mpls.c720 static int nla_get_via(const struct nlattr *nla, u8 *via_alen, u8 *via_table, in nla_get_via() argument
723 struct rtvia *via = nla_data(nla); in nla_get_via()
727 if (nla_len(nla) < offsetof(struct rtvia, rtvia_addr)) { in nla_get_via()
728 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_via()
732 alen = nla_len(nla) - in nla_get_via()
735 NL_SET_ERR_MSG_ATTR(extack, nla, in nla_get_via()
847 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in mpls_count_nexthops() local
852 nla = nla_find(attrs, attrlen, RTA_VIA); in mpls_count_nexthops()
853 if (nla && nla_len(nla) >= in mpls_count_nexthops()
855 int via_alen = nla_len(nla) - in mpls_count_nexthops()
[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()
478 struct nlattr *nla; in psample_sample_packet() local
480 nla = skb_put(nl_skb, nla_len); in psample_sample_packet()
481 nla->nla_type = PSAMPLE_ATTR_DATA; in psample_sample_packet()
482 nla->nla_len = nla_attr_size(data_len); in psample_sample_packet()
484 if (skb_copy_bits(skb, 0, nla_data(nla), data_len)) in psample_sample_packet()
/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()

12345