Lines Matching refs:offset
68 inet6_opt_append(void *extbuf, socklen_t extlen, int offset, uint8_t type,
91 remainder = (offset + 2 + len) % align;
98 endlen = offset + padbytes + 2 + len;
107 p = (uint8_t *)extbuf + offset;
140 inet6_opt_finish(void *extbuf, socklen_t extlen, int offset)
155 padbytes = 8 - (offset % 8);
159 if ((offset + padbytes > extlen) || !extbuf) {
163 return (offset + padbytes);
167 p = (uint8_t *)extbuf + offset;
186 return (offset + padbytes);
194 inet6_opt_set_val(void *databuf, int offset, void *val, socklen_t vallen)
196 (void) memcpy((uint8_t *)databuf + offset, val, vallen);
197 return (offset + vallen);
201 * Section 10.5 RFC 3542. Starting walking the option header offset into the
203 * and pass it back in as offset to iterate. -1 is returned on error.
209 inet6_opt_next(void *extbuf, socklen_t extlen, int offset, uint8_t *typep,
223 if (offset == 0) {
224 offset = 2;
228 p = (uint8_t *)extbuf + offset;
262 * Section 10.6 RFC 3542. Starting walking the option header offset into the
264 * and pass it back in as offset to iterate. -1 is returned on error.
270 inet6_opt_find(void *extbuf, socklen_t extlen, int offset, uint8_t type,
276 offset = inet6_opt_next(extbuf, extlen, offset, &newtype, lenp,
279 if (offset == -1)
283 /* value to feed back into inet6_opt_find() as offset */
284 return (offset);
293 inet6_opt_get_val(void *databuf, int offset, void *val, socklen_t vallen)
295 (void) memcpy(val, (uint8_t *)databuf + offset, vallen);
296 return (offset + vallen);