Lines Matching defs:offset
30 static int option_append(uint8_t options[], size_t size, size_t *offset,
33 assert(offset);
43 if (size < *offset + 1)
46 options[*offset] = code;
47 *offset += 1;
51 if (size < *offset + optlen + 2)
54 options[*offset] = code;
55 options[*offset + 1] = optlen;
60 memcpy(&options[*offset + 2], optval, optlen);
63 *offset += optlen + 2;
71 int dhcp_option_append(DHCPMessage *message, size_t size, size_t *offset,
79 assert(offset);
84 if (*offset < size) {
86 r = option_append(message->options, size, offset, code, optlen, optval);
91 close the options array and move the offset to its end */
92 r = option_append(message->options, size, offset, SD_DHCP_OPTION_END, 0, NULL);
96 *offset = size;
102 file_offset = *offset - size;
108 *offset = size + file_offset;
112 close the file array and move the offset to its end */
113 r = option_append(message->options, size, offset, SD_DHCP_OPTION_END, 0, NULL);
117 *offset = size + sizeof(message->file);
124 sname_offset = *offset - size - (file ? sizeof(message->file) : 0);
130 *offset = size + (file ? sizeof(message->file) : 0) + sname_offset;
147 size_t offset = 0;
149 while (offset < buflen) {
150 code = options[offset ++];
160 if (buflen < offset + 1)
163 len = options[offset ++];
165 if (buflen < offset + len)
168 option = &options[offset];
220 offset += len;
223 if (offset < buflen)