Lines Matching refs:hd
37 void nghttp2_frame_pack_frame_hd(uint8_t *buf, const nghttp2_frame_hd *hd) { in nghttp2_frame_pack_frame_hd() argument
38 nghttp2_put_uint32be(&buf[0], (uint32_t)(hd->length << 8)); in nghttp2_frame_pack_frame_hd()
39 buf[3] = hd->type; in nghttp2_frame_pack_frame_hd()
40 buf[4] = hd->flags; in nghttp2_frame_pack_frame_hd()
41 nghttp2_put_uint32be(&buf[5], (uint32_t)hd->stream_id); in nghttp2_frame_pack_frame_hd()
45 void nghttp2_frame_unpack_frame_hd(nghttp2_frame_hd *hd, const uint8_t *buf) { in nghttp2_frame_unpack_frame_hd() argument
46 hd->length = nghttp2_get_uint32(&buf[0]) >> 8; in nghttp2_frame_unpack_frame_hd()
47 hd->type = buf[3]; in nghttp2_frame_unpack_frame_hd()
48 hd->flags = buf[4]; in nghttp2_frame_unpack_frame_hd()
49 hd->stream_id = nghttp2_get_uint32(&buf[5]) & NGHTTP2_STREAM_ID_MASK; in nghttp2_frame_unpack_frame_hd()
50 hd->reserved = 0; in nghttp2_frame_unpack_frame_hd()
53 void nghttp2_frame_hd_init(nghttp2_frame_hd *hd, size_t length, uint8_t type, in nghttp2_frame_hd_init() argument
55 hd->length = length; in nghttp2_frame_hd_init()
56 hd->type = type; in nghttp2_frame_hd_init()
57 hd->flags = flags; in nghttp2_frame_hd_init()
58 hd->stream_id = stream_id; in nghttp2_frame_hd_init()
59 hd->reserved = 0; in nghttp2_frame_hd_init()
66 nghttp2_frame_hd_init(&frame->hd, 0, NGHTTP2_HEADERS, flags, stream_id); in nghttp2_frame_headers_init()
85 nghttp2_frame_hd_init(&frame->hd, NGHTTP2_PRIORITY_SPECLEN, NGHTTP2_PRIORITY, in nghttp2_frame_priority_init()
94 nghttp2_frame_hd_init(&frame->hd, 4, NGHTTP2_RST_STREAM, NGHTTP2_FLAG_NONE, in nghttp2_frame_rst_stream_init()
103 nghttp2_frame_hd_init(&frame->hd, niv * NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH, in nghttp2_frame_settings_init()
117 nghttp2_frame_hd_init(&frame->hd, 0, NGHTTP2_PUSH_PROMISE, flags, stream_id); in nghttp2_frame_push_promise_init()
132 nghttp2_frame_hd_init(&frame->hd, 8, NGHTTP2_PING, flags, 0); in nghttp2_frame_ping_init()
145 nghttp2_frame_hd_init(&frame->hd, 8 + opaque_data_len, NGHTTP2_GOAWAY, in nghttp2_frame_goaway_init()
161 nghttp2_frame_hd_init(&frame->hd, 4, NGHTTP2_WINDOW_UPDATE, flags, stream_id); in nghttp2_frame_window_update_init()
178 return padlen - ((frame->hd.flags & NGHTTP2_FLAG_PADDED) > 0); in nghttp2_frame_trail_padlen()
184 nghttp2_frame_hd_init(&frame->hd, 0, NGHTTP2_DATA, flags, stream_id); in nghttp2_frame_data_init()
193 nghttp2_frame_hd_init(&frame->hd, 0, type, flags, stream_id); in nghttp2_frame_extension_init()
204 nghttp2_frame_hd_init(&frame->hd, 2 + origin_len + field_value_len, in nghttp2_frame_altsvc_init()
236 nghttp2_frame_hd_init(&frame->hd, payloadlen, NGHTTP2_ORIGIN, in nghttp2_frame_origin_init()
261 nghttp2_frame_hd_init(&frame->hd, 4 + field_value_len, in nghttp2_frame_priority_update_init()
290 return nghttp2_frame_priority_len(frame->hd.flags); in nghttp2_frame_headers_payload_nv_offset()
309 nghttp2_frame_hd hd; in frame_pack_headers_shared() local
313 hd = *frame_hd; in frame_pack_headers_shared()
314 hd.length = nghttp2_buf_len(buf); in frame_pack_headers_shared()
316 DEBUGF("send: HEADERS/PUSH_PROMISE, payloadlen=%zu\n", hd.length); in frame_pack_headers_shared()
322 hd.flags = (uint8_t)(hd.flags & ~NGHTTP2_FLAG_END_HEADERS); in frame_pack_headers_shared()
326 nghttp2_frame_pack_frame_hd(buf->pos, &hd); in frame_pack_headers_shared()
330 hd.type = NGHTTP2_CONTINUATION; in frame_pack_headers_shared()
332 hd.flags = NGHTTP2_FLAG_NONE; in frame_pack_headers_shared()
339 hd.length = nghttp2_buf_len(buf); in frame_pack_headers_shared()
341 DEBUGF("send: int CONTINUATION, payloadlen=%zu\n", hd.length); in frame_pack_headers_shared()
344 nghttp2_frame_pack_frame_hd(buf->pos, &hd); in frame_pack_headers_shared()
348 hd.length = nghttp2_buf_len(buf); in frame_pack_headers_shared()
350 hd.flags = NGHTTP2_FLAG_END_HEADERS; in frame_pack_headers_shared()
352 DEBUGF("send: last CONTINUATION, payloadlen=%zu\n", hd.length); in frame_pack_headers_shared()
355 nghttp2_frame_pack_frame_hd(buf->pos, &hd); in frame_pack_headers_shared()
389 if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) { in nghttp2_frame_pack_headers()
394 frame->hd.length = nghttp2_bufs_len(bufs); in nghttp2_frame_pack_headers()
396 return frame_pack_headers_shared(bufs, &frame->hd); in nghttp2_frame_pack_headers()
423 if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) { in nghttp2_frame_unpack_headers_payload()
446 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_priority()
472 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_rst_stream()
492 if (nghttp2_buf_avail(buf) < frame->hd.length) { in nghttp2_frame_pack_settings()
498 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_settings()
590 frame->hd.length = nghttp2_bufs_len(bufs); in nghttp2_frame_pack_push_promise()
592 return frame_pack_headers_shared(bufs, &frame->hd); in nghttp2_frame_pack_push_promise()
615 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_ping()
638 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_goaway()
712 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_window_update()
743 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_altsvc()
812 if (nghttp2_buf_avail(buf) < frame->hd.length) { in nghttp2_frame_pack_origin()
818 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_origin()
827 assert(nghttp2_buf_len(buf) == NGHTTP2_FRAME_HDLEN + frame->hd.length); in nghttp2_frame_pack_origin()
921 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_priority_update()
1189 int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd, in nghttp2_frame_add_pad() argument
1225 hd->length += padlen; in nghttp2_frame_add_pad()
1226 hd->flags |= NGHTTP2_FLAG_PADDED; in nghttp2_frame_add_pad()
1228 DEBUGF("send: final payloadlen=%zu, padlen=%zu\n", hd->length, padlen); in nghttp2_frame_add_pad()