Lines Matching refs:len

223         unaligned_write_be16(*buf + offsetof(DHCP6Option, len), optlen);  in option_append_hdr()
335 uint16_t len; in dhcp6_option_append_ia() local
348 len = sizeof(struct ia_header); in dhcp6_option_append_ia()
355 len = sizeof(header.id); /* IA_TA does not have lifetime. */ in dhcp6_option_append_ia()
365 if (*buflen < offsetof(DHCP6Option, data) + len) in dhcp6_option_append_ia()
375 *buf = mempcpy(*buf, &header, len); in dhcp6_option_append_ia()
376 *buflen -= len; in dhcp6_option_append_ia()
386 len += r; in dhcp6_option_append_ia()
389 return option_append_hdr(&ia_hdr, &ia_buflen, ia->type, len); in dhcp6_option_append_ia()
429 size_t len = strlen(*s); in dhcp6_option_append_user_class() local
432 if (len > 0xffff || len == 0) in dhcp6_option_append_user_class()
434 q = realloc(p, total + len + 2); in dhcp6_option_append_user_class()
440 unaligned_write_be16(&p[offset], len); in dhcp6_option_append_user_class()
441 memcpy(&p[offset + 2], *s, len); in dhcp6_option_append_user_class()
443 offset += 2 + len; in dhcp6_option_append_user_class()
444 total += 2 + len; in dhcp6_option_append_user_class()
470 size_t len = strlen(*s); in dhcp6_option_append_vendor_class() local
473 if (len > UINT16_MAX || len == 0) in dhcp6_option_append_vendor_class()
476 q = realloc(p, total + len + 2); in dhcp6_option_append_vendor_class()
482 unaligned_write_be16(&p[offset], len); in dhcp6_option_append_vendor_class()
483 memcpy(&p[offset + 2], *s, len); in dhcp6_option_append_vendor_class()
485 offset += 2 + len; in dhcp6_option_append_vendor_class()
486 total += 2 + len; in dhcp6_option_append_vendor_class()
500 size_t len; in dhcp6_option_parse() local
514 len = unaligned_read_be16(buf + *offset + offsetof(DHCP6Option, len)); in dhcp6_option_parse()
516 if (len > buflen - offsetof(DHCP6Option, data) - *offset) in dhcp6_option_parse()
520 *ret_option_data_len = len; in dhcp6_option_parse()
522 *offset += offsetof(DHCP6Option, data) + len; in dhcp6_option_parse()
588 …p6_option_parse_ia_address(sd_dhcp6_client *client, DHCP6IA *ia, const uint8_t *data, size_t len) { in dhcp6_option_parse_ia_address() argument
594 assert(data || len == 0); in dhcp6_option_parse_ia_address()
600 if (len < sizeof(struct iaaddr)) in dhcp6_option_parse_ia_address()
621 if (len > sizeof(struct iaaddr)) { in dhcp6_option_parse_ia_address()
622 …r = dhcp6_option_parse_ia_options(client, data + sizeof(struct iaaddr), len - sizeof(struct iaaddr… in dhcp6_option_parse_ia_address()
631 …6_option_parse_ia_pdprefix(sd_dhcp6_client *client, DHCP6IA *ia, const uint8_t *data, size_t len) { in dhcp6_option_parse_ia_pdprefix() argument
637 assert(data || len == 0); in dhcp6_option_parse_ia_pdprefix()
643 if (len < sizeof(struct iapdprefix)) in dhcp6_option_parse_ia_pdprefix()
664 if (len > sizeof(struct iapdprefix)) { in dhcp6_option_parse_ia_pdprefix()
665 …r = dhcp6_option_parse_ia_options(client, data + sizeof(struct iapdprefix), len - sizeof(struct ia… in dhcp6_option_parse_ia_pdprefix()
822 static int parse_domain(const uint8_t **data, size_t *len, char **ret) { in parse_domain() argument
830 assert(len); in parse_domain()
834 optlen = *len; in parse_domain()
885 *len = optlen; in parse_domain()