Lines Matching defs:optlen
45 size_t optlen) {
52 if (optlen > 0xffff || *buflen < optlen + sizeof(DHCP6Option))
56 option->len = htobe16(optlen);
65 size_t optlen, const void *optval) {
68 assert_return(optval || optlen == 0, -EINVAL);
70 r = option_append_hdr(buf, buflen, code, optlen);
75 memcpy(*buf, optval, optlen);
77 *buf += optlen;
78 *buflen -= optlen;
141 static int option_parse_hdr(uint8_t **buf, size_t *buflen, uint16_t *optcode, size_t *optlen) {
147 assert_return(optlen, -EINVAL);
158 *optlen = len;
167 size_t *optlen, uint8_t **optvalue) {
170 assert_return(buf && buflen && optcode && optlen && optvalue, -EINVAL);
172 r = option_parse_hdr(buf, buflen, optcode, optlen);
176 if (*optlen > *buflen)
180 *buflen -= *optlen;
181 *buf += *optlen;
190 size_t optlen;
247 while ((r = option_parse_hdr(buf, buflen, &opt, &optlen)) >= 0) {
278 if (optlen < sizeof(status))
296 *buflen -= optlen;
297 *buf += optlen;
323 int dhcp6_option_parse_ip6addrs(uint8_t *optval, uint16_t optlen,
327 if (optlen == 0 || optlen % sizeof(struct in6_addr) != 0)
331 count * sizeof(struct in6_addr) + optlen))
334 memcpy(*addrs + count, optval, optlen);
336 count += optlen / sizeof(struct in6_addr);
341 int dhcp6_option_parse_domainname(const uint8_t *optval, uint16_t optlen, char ***str_arr) {
346 assert_return(optlen > 1, -ENODATA);
347 assert_return(optval[optlen - 1] == '\0', -EINVAL);
349 while (pos < optlen) {
368 if (pos > optlen)