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()
265 return nghttp2_frame_priority_len(frame->hd.flags); in nghttp2_frame_headers_payload_nv_offset()
284 nghttp2_frame_hd hd; in frame_pack_headers_shared() local
288 hd = *frame_hd; in frame_pack_headers_shared()
289 hd.length = nghttp2_buf_len(buf); in frame_pack_headers_shared()
291 DEBUGF("send: HEADERS/PUSH_PROMISE, payloadlen=%zu\n", hd.length); in frame_pack_headers_shared()
297 hd.flags = (uint8_t)(hd.flags & ~NGHTTP2_FLAG_END_HEADERS); in frame_pack_headers_shared()
301 nghttp2_frame_pack_frame_hd(buf->pos, &hd); in frame_pack_headers_shared()
305 hd.type = NGHTTP2_CONTINUATION; in frame_pack_headers_shared()
307 hd.flags = NGHTTP2_FLAG_NONE; in frame_pack_headers_shared()
314 hd.length = nghttp2_buf_len(buf); in frame_pack_headers_shared()
316 DEBUGF("send: int CONTINUATION, payloadlen=%zu\n", hd.length); in frame_pack_headers_shared()
319 nghttp2_frame_pack_frame_hd(buf->pos, &hd); in frame_pack_headers_shared()
323 hd.length = nghttp2_buf_len(buf); in frame_pack_headers_shared()
325 hd.flags = NGHTTP2_FLAG_END_HEADERS; in frame_pack_headers_shared()
327 DEBUGF("send: last CONTINUATION, payloadlen=%zu\n", hd.length); in frame_pack_headers_shared()
330 nghttp2_frame_pack_frame_hd(buf->pos, &hd); in frame_pack_headers_shared()
364 if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) { in nghttp2_frame_pack_headers()
369 frame->hd.length = nghttp2_bufs_len(bufs); in nghttp2_frame_pack_headers()
371 return frame_pack_headers_shared(bufs, &frame->hd); in nghttp2_frame_pack_headers()
398 if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) { in nghttp2_frame_unpack_headers_payload()
421 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_priority()
447 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_rst_stream()
467 if (nghttp2_buf_avail(buf) < frame->hd.length) { in nghttp2_frame_pack_settings()
473 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_settings()
565 frame->hd.length = nghttp2_bufs_len(bufs); in nghttp2_frame_pack_push_promise()
567 return frame_pack_headers_shared(bufs, &frame->hd); in nghttp2_frame_pack_push_promise()
590 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_ping()
613 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_goaway()
689 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_window_update()
720 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_altsvc()
789 if (nghttp2_buf_avail(buf) < frame->hd.length) { in nghttp2_frame_pack_origin()
795 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd); in nghttp2_frame_pack_origin()
804 assert(nghttp2_buf_len(buf) == NGHTTP2_FRAME_HDLEN + frame->hd.length); in nghttp2_frame_pack_origin()
1110 int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd, in nghttp2_frame_add_pad() argument
1146 hd->length += padlen; in nghttp2_frame_add_pad()
1147 hd->flags |= NGHTTP2_FLAG_PADDED; in nghttp2_frame_add_pad()
1149 DEBUGF("send: final payloadlen=%zu, padlen=%zu\n", hd->length, padlen); in nghttp2_frame_add_pad()