Lines Matching refs:optlen
214 static int option_append_hdr(uint8_t **buf, size_t *buflen, uint16_t optcode, size_t optlen) { in option_append_hdr() argument
219 if (optlen > 0xffff || *buflen < optlen + offsetof(DHCP6Option, data)) in option_append_hdr()
223 unaligned_write_be16(*buf + offsetof(DHCP6Option, len), optlen); in option_append_hdr()
232 size_t optlen, const void *optval) { in dhcp6_option_append() argument
235 assert_return(optval || optlen == 0, -EINVAL); in dhcp6_option_append()
237 r = option_append_hdr(buf, buflen, code, optlen); in dhcp6_option_append()
241 *buf = mempcpy_safe(*buf, optval, optlen); in dhcp6_option_append()
242 *buflen -= optlen; in dhcp6_option_append()
802 size_t optlen, in dhcp6_option_parse_addresses() argument
810 if (optlen == 0 || optlen % sizeof(struct in6_addr) != 0) in dhcp6_option_parse_addresses()
813 if (!GREEDY_REALLOC(*addrs, *count + optlen / sizeof(struct in6_addr))) in dhcp6_option_parse_addresses()
816 memcpy(*addrs + *count, optval, optlen); in dhcp6_option_parse_addresses()
817 *count += optlen / sizeof(struct in6_addr); in dhcp6_option_parse_addresses()
825 size_t optlen, n = 0; in parse_domain() local
834 optlen = *len; in parse_domain()
836 if (optlen <= 1) in parse_domain()
843 if (optlen == 0) in parse_domain()
848 optlen--; in parse_domain()
855 if (c > optlen) in parse_domain()
861 optlen -= c; in parse_domain()
885 *len = optlen; in parse_domain()
890 int dhcp6_option_parse_domainname(const uint8_t *optval, size_t optlen, char **ret) { in dhcp6_option_parse_domainname() argument
897 r = parse_domain(&optval, &optlen, &domain); in dhcp6_option_parse_domainname()
902 if (optlen != 0) in dhcp6_option_parse_domainname()
909 int dhcp6_option_parse_domainname_list(const uint8_t *optval, size_t optlen, char ***ret) { in dhcp6_option_parse_domainname_list() argument
916 if (optlen <= 1) in dhcp6_option_parse_domainname_list()
918 if (optval[optlen - 1] != '\0') in dhcp6_option_parse_domainname_list()
921 while (optlen > 0) { in dhcp6_option_parse_domainname_list()
924 r = parse_domain(&optval, &optlen, &name); in dhcp6_option_parse_domainname_list()