Lines Matching refs:data

175 static int add_rtattr(sd_netlink_message *m, unsigned short type, const void *data, size_t data_len…  in add_rtattr()  argument
185 assert(!data || data_length > 0); in add_rtattr()
203 rtattr_append_attribute_internal(rta, type, data, data_length); in add_rtattr()
234 int sd_netlink_message_append_string(sd_netlink_message *m, unsigned short type, const char *data) { in sd_netlink_message_append_string() argument
240 assert_return(data, -EINVAL); in sd_netlink_message_append_string()
247 length = strnlen(data, size+1); in sd_netlink_message_append_string()
251 length = strlen(data); in sd_netlink_message_append_string()
253 r = add_rtattr(m, type, data, length + 1); in sd_netlink_message_append_string()
260 int sd_netlink_message_append_strv(sd_netlink_message *m, unsigned short type, char * const *data) { in sd_netlink_message_append_strv() argument
266 assert_return(data, -EINVAL); in sd_netlink_message_append_strv()
272 STRV_FOREACH(p, data) { in sd_netlink_message_append_strv()
306 int sd_netlink_message_append_u8(sd_netlink_message *m, unsigned short type, uint8_t data) { in sd_netlink_message_append_u8() argument
316 r = add_rtattr(m, type, &data, sizeof(uint8_t)); in sd_netlink_message_append_u8()
323 int sd_netlink_message_append_u16(sd_netlink_message *m, unsigned short type, uint16_t data) { in sd_netlink_message_append_u16() argument
333 r = add_rtattr(m, type, &data, sizeof(uint16_t)); in sd_netlink_message_append_u16()
340 int sd_netlink_message_append_u32(sd_netlink_message *m, unsigned short type, uint32_t data) { in sd_netlink_message_append_u32() argument
350 r = add_rtattr(m, type, &data, sizeof(uint32_t)); in sd_netlink_message_append_u32()
357 int sd_netlink_message_append_u64(sd_netlink_message *m, unsigned short type, uint64_t data) { in sd_netlink_message_append_u64() argument
367 r = add_rtattr(m, type, &data, sizeof(uint64_t)); in sd_netlink_message_append_u64()
374 int sd_netlink_message_append_s8(sd_netlink_message *m, unsigned short type, int8_t data) { in sd_netlink_message_append_s8() argument
384 r = add_rtattr(m, type, &data, sizeof(int8_t)); in sd_netlink_message_append_s8()
391 int sd_netlink_message_append_s16(sd_netlink_message *m, unsigned short type, int16_t data) { in sd_netlink_message_append_s16() argument
401 r = add_rtattr(m, type, &data, sizeof(int16_t)); in sd_netlink_message_append_s16()
408 int sd_netlink_message_append_s32(sd_netlink_message *m, unsigned short type, int32_t data) { in sd_netlink_message_append_s32() argument
418 r = add_rtattr(m, type, &data, sizeof(int32_t)); in sd_netlink_message_append_s32()
425 int sd_netlink_message_append_s64(sd_netlink_message *m, unsigned short type, int64_t data) { in sd_netlink_message_append_s64() argument
435 r = add_rtattr(m, type, &data, sizeof(int64_t)); in sd_netlink_message_append_s64()
442 int sd_netlink_message_append_data(sd_netlink_message *m, unsigned short type, const void *data, si… in sd_netlink_message_append_data() argument
448 r = add_rtattr(m, type, data, len); in sd_netlink_message_append_data()
455 …dr_union(sd_netlink_message *m, unsigned short type, int family, const union in_addr_union *data) { in netlink_message_append_in_addr_union() argument
460 assert_return(data, -EINVAL); in netlink_message_append_in_addr_union()
467 r = add_rtattr(m, type, data, FAMILY_ADDRESS_SIZE(family)); in netlink_message_append_in_addr_union()
474 …nk_message_append_in_addr(sd_netlink_message *m, unsigned short type, const struct in_addr *data) { in sd_netlink_message_append_in_addr() argument
475 … return netlink_message_append_in_addr_union(m, type, AF_INET, (const union in_addr_union *) data); in sd_netlink_message_append_in_addr()
478 …_message_append_in6_addr(sd_netlink_message *m, unsigned short type, const struct in6_addr *data) { in sd_netlink_message_append_in6_addr() argument
479 …return netlink_message_append_in_addr_union(m, type, AF_INET6, (const union in_addr_union *) data); in sd_netlink_message_append_in6_addr()
482 …pend_sockaddr_union(sd_netlink_message *m, unsigned short type, const union sockaddr_union *data) { in netlink_message_append_sockaddr_union() argument
487 assert_return(data, -EINVAL); in netlink_message_append_sockaddr_union()
488 assert_return(IN_SET(data->sa.sa_family, AF_INET, AF_INET6), -EINVAL); in netlink_message_append_sockaddr_union()
494 …r = add_rtattr(m, type, data, data->sa.sa_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(… in netlink_message_append_sockaddr_union()
501 …ge_append_sockaddr_in(sd_netlink_message *m, unsigned short type, const struct sockaddr_in *data) { in sd_netlink_message_append_sockaddr_in() argument
502 return netlink_message_append_sockaddr_union(m, type, (const union sockaddr_union *) data); in sd_netlink_message_append_sockaddr_in()
505 …_append_sockaddr_in6(sd_netlink_message *m, unsigned short type, const struct sockaddr_in6 *data) { in sd_netlink_message_append_sockaddr_in6() argument
506 return netlink_message_append_sockaddr_union(m, type, (const union sockaddr_union *) data); in sd_netlink_message_append_sockaddr_in6()
509 …sage_append_ether_addr(sd_netlink_message *m, unsigned short type, const struct ether_addr *data) { in sd_netlink_message_append_ether_addr() argument
514 assert_return(data, -EINVAL); in sd_netlink_message_append_ether_addr()
520 r = add_rtattr(m, type, data, ETH_ALEN); in sd_netlink_message_append_ether_addr()
527 …ssage_append_hw_addr(sd_netlink_message *m, unsigned short type, const struct hw_addr_data *data) { in netlink_message_append_hw_addr() argument
532 assert_return(data, -EINVAL); in netlink_message_append_hw_addr()
533 assert_return(data->length > 0, -EINVAL); in netlink_message_append_hw_addr()
539 r = add_rtattr(m, type, data->bytes, data->length); in netlink_message_append_hw_addr()
734 int sd_netlink_message_read(sd_netlink_message *m, unsigned short type, size_t size, void *data) { in sd_netlink_message_read() argument
747 if (data) in sd_netlink_message_read()
748 memcpy(data, attr_data, size); in sd_netlink_message_read()
764 void *data; in sd_netlink_message_read_data() local
766 data = memdup(attr_data, r); in sd_netlink_message_read_data()
767 if (!data) in sd_netlink_message_read_data()
770 *ret_data = data; in sd_netlink_message_read_data()
790 void *data; in sd_netlink_message_read_data_suffix0() local
792 data = memdup_suffix0(attr_data, r); in sd_netlink_message_read_data_suffix0()
793 if (!data) in sd_netlink_message_read_data_suffix0()
796 *ret_data = data; in sd_netlink_message_read_data_suffix0()
805 int sd_netlink_message_read_string_strdup(sd_netlink_message *m, unsigned short type, char **data) { in sd_netlink_message_read_string_strdup() argument
819 if (data) { in sd_netlink_message_read_string_strdup()
826 *data = str; in sd_netlink_message_read_string_strdup()
832 int sd_netlink_message_read_string(sd_netlink_message *m, unsigned short type, const char **data) { in sd_netlink_message_read_string() argument
849 if (data) in sd_netlink_message_read_string()
850 *data = (const char *) attr_data; in sd_netlink_message_read_string()
855 int sd_netlink_message_read_u8(sd_netlink_message *m, unsigned short type, uint8_t *data) { in sd_netlink_message_read_u8() argument
872 if (data) in sd_netlink_message_read_u8()
873 *data = *(uint8_t *) attr_data; in sd_netlink_message_read_u8()
878 int sd_netlink_message_read_u16(sd_netlink_message *m, unsigned short type, uint16_t *data) { in sd_netlink_message_read_u16() argument
896 if (data) { in sd_netlink_message_read_u16()
898 *data = be16toh(*(uint16_t *) attr_data); in sd_netlink_message_read_u16()
900 *data = *(uint16_t *) attr_data; in sd_netlink_message_read_u16()
906 int sd_netlink_message_read_u32(sd_netlink_message *m, unsigned short type, uint32_t *data) { in sd_netlink_message_read_u32() argument
924 if (data) { in sd_netlink_message_read_u32()
926 *data = be32toh(*(uint32_t *) attr_data); in sd_netlink_message_read_u32()
928 *data = *(uint32_t *) attr_data; in sd_netlink_message_read_u32()
934 …link_message_read_ether_addr(sd_netlink_message *m, unsigned short type, struct ether_addr *data) { in sd_netlink_message_read_ether_addr() argument
951 if (data) in sd_netlink_message_read_ether_addr()
952 memcpy(data, attr_data, sizeof(struct ether_addr)); in sd_netlink_message_read_ether_addr()
957 …tlink_message_read_hw_addr(sd_netlink_message *m, unsigned short type, struct hw_addr_data *data) { in netlink_message_read_hw_addr() argument
974 if (data) { in netlink_message_read_hw_addr()
975 memcpy(data->bytes, attr_data, r); in netlink_message_read_hw_addr()
976 data->length = r; in netlink_message_read_hw_addr()
1005 …_in_addr_union(sd_netlink_message *m, unsigned short type, int family, union in_addr_union *data) { in netlink_message_read_in_addr_union() argument
1023 if (data) in netlink_message_read_in_addr_union()
1024 memcpy(data, attr_data, FAMILY_ADDRESS_SIZE(family)); in netlink_message_read_in_addr_union()
1029 …sd_netlink_message_read_in_addr(sd_netlink_message *m, unsigned short type, struct in_addr *data) { in sd_netlink_message_read_in_addr() argument
1034 if (r >= 0 && data) in sd_netlink_message_read_in_addr()
1035 *data = u.in; in sd_netlink_message_read_in_addr()
1040 …_netlink_message_read_in6_addr(sd_netlink_message *m, unsigned short type, struct in6_addr *data) { in sd_netlink_message_read_in6_addr() argument
1045 if (r >= 0 && data) in sd_netlink_message_read_in6_addr()
1046 *data = u.in6; in sd_netlink_message_read_in6_addr()