Lines Matching refs:oa_p
437 dhcpoa_init_common(dhcpoa_t * oa_p, void * buffer, int size, int reserve)
439 bzero(oa_p, sizeof(*oa_p));
440 oa_p->oa_buffer = buffer;
441 oa_p->oa_size = size;
442 oa_p->oa_reserve = reserve;
446 dhcpoa_init_no_end(dhcpoa_t * oa_p, void * buffer, int size)
448 dhcpoa_init_common(oa_p, buffer, size, 0);
453 dhcpoa_size(dhcpoa_t * oa_p)
455 return (oa_p->oa_size);
459 dhcpoa_init(dhcpoa_t * oa_p, void * buffer, int size)
462 dhcpoa_init_common(oa_p, buffer, size, 1);
472 dhcpoa_add(dhcpoa_t * oa_p, dhcptag_t tag, int len, const void * option)
479 if (oa_p->oa_end_tag) {
486 if ((oa_p->oa_offset + 1) > oa_p->oa_size) {
489 oa_p->oa_offset + oa_p->oa_reserve, oa_p->oa_size));
492 ((uint8_t *)oa_p->oa_buffer)[oa_p->oa_offset + DHCP_TAG_OFFSET] = tag;
493 oa_p->oa_offset++;
494 oa_p->oa_end_tag = 1;
499 if ((oa_p->oa_offset + oa_p->oa_reserve + 1) > oa_p->oa_size) {
501 oa_p->oa_offset + oa_p->oa_reserve + 1, oa_p->oa_size));
504 ((uint8_t *)oa_p->oa_buffer)[oa_p->oa_offset + DHCP_TAG_OFFSET] = tag;
505 oa_p->oa_offset++;
510 if ((oa_p->oa_offset + len + 2 + oa_p->oa_reserve) > oa_p->oa_size) {
512 oa_p->oa_offset + len + 2 + oa_p->oa_reserve,
513 oa_p->oa_size));
516 ((uint8_t *)oa_p->oa_buffer)[oa_p->oa_offset + DHCP_TAG_OFFSET] = tag;
517 ((uint8_t *)oa_p->oa_buffer)[oa_p->oa_offset + DHCP_LEN_OFFSET] = (uint8_t)len;
519 memcpy(oa_p->oa_buffer + (DHCP_OPTION_OFFSET + oa_p->oa_offset),
522 oa_p->oa_offset += len + DHCP_OPTION_OFFSET;
525 oa_p->oa_option_count++;
536 dhcpoa_add_dhcpmsg(dhcpoa_t * oa_p, dhcp_msgtype_t msgtype)
538 return (dhcpoa_add(oa_p, dhcptag_dhcp_message_type_e,
543 dhcpoa_used(dhcpoa_t * oa_p)
545 return (oa_p->oa_offset);
549 dhcpoa_freespace(dhcpoa_t * oa_p)
553 freespace = oa_p->oa_size - oa_p->oa_offset - oa_p->oa_reserve;
561 dhcpoa_count(dhcpoa_t * oa_p)
563 return (oa_p->oa_option_count);
567 dhcpoa_buffer(dhcpoa_t * oa_p)
569 return (oa_p->oa_buffer);