Home | History | Annotate | Download | only in dhcpcd

Lines Matching full:len

257 get_option(const struct dhcp_message *dhcp, uint8_t opt, int *len, int *type)
317 if (len)
318 *len = bl;
383 decode_rfc3397(char *out, ssize_t len, int pl, const uint8_t *p)
414 if ((ssize_t)l + 1 > len) {
421 len -= l;
422 len--;
442 decode_rfc3442(char *out, ssize_t len, int pl, const uint8_t *p)
471 if ((((4 * 4) * 2) + 4) > len) {
477 len--;
483 b = snprintf(o, len, "%s/%d", inet_ntoa(addr), cidr);
486 b = snprintf(o, len, "0.0.0.0/0");
488 len -= b;
493 b = snprintf(o, len, " %s", inet_ntoa(addr));
495 len -= b;
606 int len;
610 p = get_option(dhcp, option, &len, &type);
615 type = decode_rfc3397(NULL, 0, len, p);
621 decode_rfc3397(s, type, len, p);
626 return decode_rfc3361(len, p);
628 s = xmalloc(sizeof(char) * (len + 1));
629 memcpy(s, p, len);
630 s[len] = '\0';
673 int len;
676 p = get_option(dhcp, DHO_CSR, &len, NULL);
679 p = get_option(dhcp, DHO_MSCSR, &len, NULL);
681 routes = decode_rfc3442_rt(len, p);
687 p = get_option(dhcp, DHO_STATICROUTE, &len, NULL);
689 e = p + len;
706 p = get_option(dhcp, DHO_ROUTER, &len, NULL);
708 e = p + len;
769 size_t len;
841 len = strlen(DAD);
842 *p++ = len;
843 memcpy(p, DAD, len);
844 p += len;
898 len = hp - options->hostname;
900 len = strlen(options->hostname);
901 *p++ = len;
902 memcpy(p, options->hostname, len);
903 p += len;
1028 print_string(char *s, ssize_t len, int dl, const uint8_t *data)
1048 if (len < 5) {
1052 r = snprintf(s, len, "\\%03o", c);
1053 len -= r;
1067 if (len < 3) {
1072 len--;
1079 len--;
1092 print_option(char *s, ssize_t len, int type, int dl, const uint8_t *data)
1110 l = print_string(s, len, l - 1, (uint8_t *)tmp);
1116 return decode_rfc3442(s, len, dl, data);
1122 return print_string(s, len, dl, data);
1151 len--;
1154 l = snprintf(s, len, "%d", *data);
1159 l = snprintf(s, len, "%d", u16);
1164 l = snprintf(s, len, "%d", s16);
1169 l = snprintf(s, len, "%d", u32);
1174 l = snprintf(s, len, "%d", s32);
1178 l = snprintf(s, len, "%s", inet_ntoa(addr));
1182 len -= l;
1193 size_t len = strlen(prefix) + strlen(var) + strlen(value) + 4;
1195 **e = xmalloc(len);
1196 snprintf(**e, len, "%s_%s=%s", prefix, var, value);
1212 ssize_t len, e = 0;
1277 len = print_option(NULL, 0, opt->type, pl, p);
1278 if (len < 0)
1280 e = strlen(prefix) + strlen(opt->var) + len + 4;
1283 if (len != 0)
1284 print_option(v, len, opt->type, pl, p);