Home
last modified time | relevance | path

Searched refs:rta (Results 1 – 25 of 48) sorted by relevance

12

/external/iproute2/include/
Dlibnetlink.h124 int rta_addattr8(struct rtattr *rta, int maxlen, int type, __u8 data);
125 int rta_addattr16(struct rtattr *rta, int maxlen, int type, __u16 data);
126 int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data);
127 int rta_addattr64(struct rtattr *rta, int maxlen, int type, __u64 data);
128 int rta_addattr_l(struct rtattr *rta, int maxlen, int type,
131 int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len);
132 int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta,
135 struct rtattr *rta, int len);
136 struct rtattr *parse_rtattr_one(int type, struct rtattr *rta, int len);
137 int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rta, int len);
[all …]
Dutils.h122 #define format_host_rta(af, rta) \ argument
123 format_host(af, RTA_PAYLOAD(rta), RTA_DATA(rta))
127 #define rt_addr_n2a_rta(af, rta) \ argument
128 rt_addr_n2a(af, RTA_PAYLOAD(rta), RTA_DATA(rta))
/external/ltp/testcases/kernel/crypto/
Dcrypto_user01.c48 static void validate_attr(const struct rtattr *rta) in validate_attr() argument
50 switch (rta->rta_type) { in validate_attr()
52 const struct crypto_report_larval *p = RTA_DATA(rta); in validate_attr()
58 const struct crypto_report_hash *p = RTA_DATA(rta); in validate_attr()
64 const struct crypto_report_blkcipher *p = RTA_DATA(rta); in validate_attr()
71 const struct crypto_report_aead *p = RTA_DATA(rta); in validate_attr()
78 const struct crypto_report_comp *p = RTA_DATA(rta); in validate_attr()
84 const struct crypto_report_rng *p = RTA_DATA(rta); in validate_attr()
90 const struct crypto_report_cipher *p = RTA_DATA(rta); in validate_attr()
96 const struct crypto_report_akcipher *p = RTA_DATA(rta); in validate_attr()
[all …]
/external/iproute2/lib/
Dlibnetlink.c864 struct rtattr *rta; in addattr_l() local
872 rta = NLMSG_TAIL(n); in addattr_l()
873 rta->rta_type = type; in addattr_l()
874 rta->rta_len = len; in addattr_l()
876 memcpy(RTA_DATA(rta), data, alen); in addattr_l()
929 int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data) in rta_addattr32() argument
934 if (RTA_ALIGN(rta->rta_len) + len > maxlen) { in rta_addattr32()
940 subrta = (struct rtattr *)(((char *)rta) + RTA_ALIGN(rta->rta_len)); in rta_addattr32()
944 rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len; in rta_addattr32()
948 int rta_addattr_l(struct rtattr *rta, int maxlen, int type, in rta_addattr_l() argument
[all …]
/external/iproute2/ip/
Diproute_lwtunnel.c467 static int parse_encap_seg6(struct rtattr *rta, size_t len, int *argcp, in parse_encap_seg6() argument
518 rta_addattr_l(rta, len, SEG6_IPTUNNEL_SRH, tuninfo, in parse_encap_seg6()
530 static int parse_encap_seg6local(struct rtattr *rta, size_t len, int *argcp, in parse_encap_seg6local() argument
551 rta_addattr32(rta, len, SEG6_LOCAL_ACTION, action); in parse_encap_seg6local()
557 rta_addattr32(rta, len, SEG6_LOCAL_TABLE, table); in parse_encap_seg6local()
563 rta_addattr_l(rta, len, SEG6_LOCAL_NH4, &addr.data, in parse_encap_seg6local()
570 rta_addattr_l(rta, len, SEG6_LOCAL_NH6, &addr.data, in parse_encap_seg6local()
579 rta_addattr32(rta, len, SEG6_LOCAL_IIF, iif); in parse_encap_seg6local()
587 rta_addattr32(rta, len, SEG6_LOCAL_OIF, oif); in parse_encap_seg6local()
628 rta_addattr_l(rta, len, SEG6_LOCAL_SRH, srh, srhlen); in parse_encap_seg6local()
[all …]
Diplink_macvlan.c186 struct rtattr *rta; in macvlan_print_opt() local
230 rta = RTA_DATA(tb[IFLA_MACVLAN_MACADDR_DATA]); in macvlan_print_opt()
234 for (; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) { in macvlan_print_opt()
235 if (rta->rta_type != IFLA_MACVLAN_MACADDR || in macvlan_print_opt()
236 RTA_PAYLOAD(rta) < 6) in macvlan_print_opt()
238 addr = RTA_DATA(rta); in macvlan_print_opt()
Dipxfrm.c684 struct rtattr *rta = tb[XFRMA_MARK]; in xfrm_xfrma_print() local
685 struct xfrm_mark *m = RTA_DATA(rta); in xfrm_xfrma_print()
700 struct rtattr *rta = tb[XFRMA_ALG_AUTH]; in xfrm_xfrma_print() local
702 xfrm_algo_print(RTA_DATA(rta), in xfrm_xfrma_print()
703 XFRMA_ALG_AUTH, RTA_PAYLOAD(rta), fp, prefix); in xfrm_xfrma_print()
707 struct rtattr *rta = tb[XFRMA_ALG_AUTH_TRUNC]; in xfrm_xfrma_print() local
709 xfrm_auth_trunc_print(RTA_DATA(rta), in xfrm_xfrma_print()
710 RTA_PAYLOAD(rta), fp, prefix); in xfrm_xfrma_print()
714 struct rtattr *rta = tb[XFRMA_ALG_AEAD]; in xfrm_xfrma_print() local
716 xfrm_aead_print(RTA_DATA(rta), in xfrm_xfrma_print()
[all …]
Diproute.c741 struct rtattr *rta, struct rtnexthop *rtnh, in parse_one_nh() argument
762 rta_addattr_l(rta, 4096, RTA_GATEWAY, &addr.data, addr.bytelen); in parse_one_nh()
765 rta_addattr_l(rta, 4096, RTA_VIA, &addr.family, addr.bytelen+2); in parse_one_nh()
789 rta_addattr32(rta, 4096, RTA_FLOW, realm); in parse_one_nh()
792 int len = rta->rta_len; in parse_one_nh()
794 lwt_parse_encap(rta, 4096, &argc, &argv); in parse_one_nh()
795 rtnh->rtnh_len += rta->rta_len - len; in parse_one_nh()
803 rta_addattr_l(rta, 4096, RTA_NEWDST, &addr.data, in parse_one_nh()
818 struct rtattr *rta = (void *)buf; in parse_nexthops() local
821 rta->rta_type = RTA_MULTIPATH; in parse_nexthops()
[all …]
Dxfrm_policy.c460 struct rtattr *rta; in xfrm_policy_print() local
496 rta = XFRMPID_RTA(xpid); in xfrm_policy_print()
498 rta = XFRMPEXP_RTA(xpexp); in xfrm_policy_print()
500 rta = XFRMP_RTA(xpinfo); in xfrm_policy_print()
502 parse_rtattr(tb, XFRMA_MAX, rta, len); in xfrm_policy_print()
928 struct rtattr *rta; in print_spdinfo() local
938 rta = XFRMSAPD_RTA(f); in print_spdinfo()
939 parse_rtattr(tb, XFRMA_SPD_MAX, rta, len); in print_spdinfo()
/external/wpa_supplicant_8/src/drivers/
Dpriv_netlink.h64 #define RTA_OK(rta,len) \ argument
65 ((len) > 0 && (rta)->rta_len >= sizeof(struct rtattr) && \
66 (rta)->rta_len <= (len))
67 #define RTA_NEXT(rta,attrlen) \ argument
68 ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
69 (struct rtattr *) (((char *)(rta)) + RTA_ALIGN((rta)->rta_len)))
72 #define RTA_DATA(rta) ((void *) (((char *) (rta)) + RTA_LENGTH(0))) argument
73 #define RTA_PAYLOAD(rta) ((int) ((rta)->rta_len) - RTA_LENGTH(0)) argument
Dnetlink.c177 struct rtattr *rta; in netlink_send_oper_ifla() local
196 rta = aliasing_hide_typecast( in netlink_send_oper_ifla()
199 rta->rta_type = IFLA_LINKMODE; in netlink_send_oper_ifla()
200 rta->rta_len = RTA_LENGTH(sizeof(char)); in netlink_send_oper_ifla()
201 *((char *) RTA_DATA(rta)) = linkmode; in netlink_send_oper_ifla()
205 rta = aliasing_hide_typecast( in netlink_send_oper_ifla()
208 rta->rta_type = IFLA_OPERSTATE; in netlink_send_oper_ifla()
209 rta->rta_len = RTA_LENGTH(sizeof(char)); in netlink_send_oper_ifla()
210 *((char *) RTA_DATA(rta)) = operstate; in netlink_send_oper_ifla()
/external/dnsmasq/src/
Dnetlink.c174 struct rtattr* rta = IFA_RTA(ifa); in iface_enumerate() local
184 while (RTA_OK(rta, len1)) { in iface_enumerate()
185 if (rta->rta_type == IFA_LOCAL) in iface_enumerate()
186 addr = *((struct in_addr*) (rta + 1)); in iface_enumerate()
187 else if (rta->rta_type == IFA_BROADCAST) in iface_enumerate()
188 broadcast = *((struct in_addr*) (rta + 1)); in iface_enumerate()
190 rta = RTA_NEXT(rta, len1); in iface_enumerate()
200 while (RTA_OK(rta, len1)) { in iface_enumerate()
201 if (rta->rta_type == IFA_ADDRESS) addrp = ((struct in6_addr*) (rta + 1)); in iface_enumerate()
203 rta = RTA_NEXT(rta, len1); in iface_enumerate()
/external/linux-kselftest/tools/testing/selftests/net/
Dudpgso.c371 struct rtattr *rta; in set_route_mtu() local
402 rta = (void *)(data + off); in set_route_mtu()
403 rta->rta_type = RTA_DST; in set_route_mtu()
404 rta->rta_len = RTA_LENGTH(alen); in set_route_mtu()
406 memcpy(RTA_DATA(rta), &addr4, alen); in set_route_mtu()
408 memcpy(RTA_DATA(rta), &addr6, alen); in set_route_mtu()
409 off += NLMSG_ALIGN(rta->rta_len); in set_route_mtu()
411 rta = (void *)(data + off); in set_route_mtu()
412 rta->rta_type = RTA_OIF; in set_route_mtu()
413 rta->rta_len = RTA_LENGTH(sizeof(int)); in set_route_mtu()
[all …]
/external/libnl/include/linux-private/linux/
Drtnetlink.h146 #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \ argument
147 (rta)->rta_len >= sizeof(struct rtattr) && \
148 (rta)->rta_len <= (len))
149 #define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \ argument
150 (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
153 #define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0))) argument
154 #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0)) argument
/external/iproute2/tc/
Dem_meta.c436 static inline int print_value(FILE *fd, int type, struct rtattr *rta) in print_value() argument
438 if (rta == NULL) { in print_value()
445 if (RTA_PAYLOAD(rta) < sizeof(__u32)) { in print_value()
450 fprintf(fd, "%d", rta_getattr_u32(rta)); in print_value()
454 print_binary(fd, RTA_DATA(rta), RTA_PAYLOAD(rta)); in print_value()
461 static int print_object(FILE *fd, struct tcf_meta_val *obj, struct rtattr *rta) in print_object() argument
468 return print_value(fd, type, rta); in print_object()
482 if (rta) { in print_object()
483 if (RTA_PAYLOAD(rta) < sizeof(__u32)) in print_object()
486 if (rta_getattr_u32(rta)) in print_object()
[all …]
Dtc_stab.c107 void print_size_table(FILE *fp, const char *prefix, struct rtattr *rta) in print_size_table() argument
113 parse_rtattr_nested(tb, TCA_STAB_MAX, rta); in print_size_table()
Dm_ematch.c442 struct rtattr *rta) in print_ematch_list() argument
452 if (parse_rtattr_nested(tb, hdr->nmatches, rta) < 0) in print_ematch_list()
466 int print_ematch(FILE *fd, const struct rtattr *rta) in print_ematch() argument
471 if (parse_rtattr_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) in print_ematch()
/external/ltp/testcases/kernel/containers/share/
Dns_ifmove.c80 struct rtattr *rta; in main() local
110 rta = (struct rtattr *)(((char *) &req) + in main()
112 rta->rta_type = IFLA_NET_NS_PID; in main()
113 rta->rta_len = RTA_LENGTH(sizeof(int)); in main()
116 memcpy(RTA_DATA(rta), &pid, sizeof(pid)); in main()
/external/iproute2/include/uapi/linux/
Drtnetlink.h176 #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \ argument
177 (rta)->rta_len >= sizeof(struct rtattr) && \
178 (rta)->rta_len <= (len))
179 #define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \ argument
180 (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
183 #define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0))) argument
184 #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0)) argument
/external/libnfnetlink/src/
Drtnl.c94 int rtnl_parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len) in rtnl_parse_rtattr() argument
98 while (RTA_OK(rta, len)) { in rtnl_parse_rtattr()
99 if (rta->rta_type <= max) in rtnl_parse_rtattr()
100 tb[rta->rta_type] = rta; in rtnl_parse_rtattr()
101 rta = RTA_NEXT(rta,len); in rtnl_parse_rtattr()
/external/webrtc/webrtc/base/
Difaddrs-android.cc174 rtattr* rta = IFA_RTA(address_msg); in getifaddrs() local
176 while (RTA_OK(rta, payload_len)) { in getifaddrs()
177 if (rta->rta_type == IFA_ADDRESS) { in getifaddrs()
187 if (populate_ifaddrs(newest, address_msg, RTA_DATA(rta), in getifaddrs()
188 RTA_PAYLOAD(rta)) != 0) { in getifaddrs()
196 rta = RTA_NEXT(rta, payload_len); in getifaddrs()
/external/kernel-headers/original/uapi/linux/
Drtnetlink.h183 #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \ argument
184 (rta)->rta_len >= sizeof(struct rtattr) && \
185 (rta)->rta_len <= (len))
186 #define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \ argument
187 (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
190 #define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0))) argument
191 #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0)) argument
/external/toybox/toys/pending/
Dip.c431 struct rtattr *rta; in add_string_to_rtattr() local
434 rta = (struct rtattr*)(((char*)n) + NLMSG_ALIGN(n->nlmsg_len)); in add_string_to_rtattr()
435 rta->rta_type = type; in add_string_to_rtattr()
436 rta->rta_len = len; in add_string_to_rtattr()
437 memcpy(RTA_DATA(rta), data, alen); in add_string_to_rtattr()
950 struct rtattr *rta, *rta_tb[IFA_MAX+1] = {0,}; in print_addrinfo() local
962 for (rta = IFA_RTA(ifa); RTA_OK(rta, len); rta=RTA_NEXT(rta, len)) in print_addrinfo()
963 if (rta->rta_type <= IFA_MAX) rta_tb[rta->rta_type] = rta; in print_addrinfo()
1351 struct rtattr *rta, *rta_tb[IFA_MAX+1] = {0,}; in ipaddr_print() local
1365 for (rta = IFA_RTA(addressInfo); RTA_OK(rta, rt_len); rta=RTA_NEXT(rta, rt_len)) { in ipaddr_print()
[all …]
/external/iputils/ninfod/
Dni_ifaddrs.c387 struct rtattr *rta; in ni_ifaddrs() local
433 for (rta = (struct rtattr *) (((char *) NLMSG_DATA(nlh)) + in ni_ifaddrs()
435 RTA_OK(rta, rtasize); in ni_ifaddrs()
436 rta = RTA_NEXT(rta, rtasize)) { in ni_ifaddrs()
437 void *rtadata = RTA_DATA(rta); in ni_ifaddrs()
438 size_t rtapayload = RTA_PAYLOAD(rta); in ni_ifaddrs()
444 switch (rta->rta_type) { in ni_ifaddrs()
/external/ipsec-tools/src/racoon/
Dgrabmyaddr.c117 static int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len) in parse_rtattr() argument
119 while (RTA_OK(rta, len)) { in parse_rtattr()
120 if (rta->rta_type <= max) in parse_rtattr()
121 tb[rta->rta_type] = rta; in parse_rtattr()
122 rta = RTA_NEXT(rta,len); in parse_rtattr()

12