Lines Matching defs:len

136 	int adjust_len, len, i;
139 len = (uchar_t)mac_get_addr_len();
140 if (len <= sizeof (p->chaddr)) {
141 p->hlen = len;
142 bcopy(mac_get_addr_buf(), p->chaddr, len);
166 len = strlen("SUNW.");
169 len = 0;
172 len += strlen(mfg);
174 if ((len + 2) < DHCP_MAX_OPT_SIZE) {
178 for (i = 0; i < len; i++, tp++) {
187 len -= adjust_len;
188 dhcp_classid[1] = (uint8_t)len;
209 bkmem_free((char *)tmp->pkt, tmp->len);
236 bkmem_free((char *)pl->pkt, pl->len);
250 bootp_collect(int len)
256 if (len < sizeof (PKT)) {
257 dprintf("%s: BOOTP reply too small: %d\n", s_n, len);
266 NULL) || ((pl->pkt = (PKT *)bkmem_zalloc(len)) == NULL)) {
272 bcopy(dhcp_rcv_bufp, pl->pkt, len);
273 pl->len = len;
320 int done = B_FALSE, flags, len;
381 if ((len = recvfrom(sd, (char *)dhcp_rcv_bufp,
391 if (bootp_collect(len))
417 int len = p->len;
420 if (len > DHCP_MAX_OPT_SIZE)
421 len = DHCP_MAX_OPT_SIZE;
422 bcopy(p->value, scratch, len);
423 scratch[len] = '\0';
499 wk->opts[CD_DHCP_TYPE]->len == 1) {
510 if (wk->opts[CD_LEASE_TIME]->len != 4) {
521 if (wk->opts[CD_SERVER_ID]->len != 4) {
606 pl->opts[CD_SERVER_ID]->len == sizeof (struct in_addr)) {
608 &t_server, pl->opts[CD_SERVER_ID]->len);
741 bkmem_free((char *)pl->pkt, pl->len);
776 *opt++ = pl->opts[CD_SERVER_ID]->len;
778 pl->opts[CD_SERVER_ID]->len);
779 opt += pl->opts[CD_SERVER_ID]->len;
815 bkmem_free((char *)pl->pkt, pl->len);
865 (doptp->len % 4) != 0)) {
876 bkmem_free((char *)state_pl->pkt, state_pl->len);
930 if (doptp->len != sizeof (int16_t))
939 if (doptp->len != 4)
956 if (doptp->len > 1)
972 if ((doptp->len % 4) != 0) {
980 items = doptp->len / sizeof (struct in_addr);
1022 i = doptp->len;
1050 buflen = (pl->len * 2) + 1; /* extra space for null (1) */
1054 if (octet_to_hexascii((uint8_t *)pl->pkt, pl->len, bootp_response,
1056 bkmem_free(bootp_response, (pl->len * 2) + 1);
1061 prom_create_encoded_prop("bootp-response", pl->pkt, pl->len,
1089 int len;
1097 if ((len = prom_getproplen(chosen, prop)) <= 0)
1104 ((pl->pkt = (PKT *)bkmem_zalloc(len)) == NULL)) {
1113 pl->len = len;
1117 bkmem_free((char *)pl->pkt, pl->len);
1241 size_t len = *vallenp;
1244 optsize, value, &len)) {
1246 if (len <= *vallenp) {
1247 *vallenp = len;