Lines Matching refs:hd
37 void nghttp2_frame_pack_frame_hd(uint8_t *buf, const nghttp2_frame_hd *hd) {
38 nghttp2_put_uint32be(&buf[0], (uint32_t)(hd->length << 8));
39 buf[3] = hd->type;
40 buf[4] = hd->flags;
41 nghttp2_put_uint32be(&buf[5], (uint32_t)hd->stream_id);
42 /* ignore hd->reserved for now */
45 void nghttp2_frame_unpack_frame_hd(nghttp2_frame_hd *hd, const uint8_t *buf) {
46 hd->length = nghttp2_get_uint32(&buf[0]) >> 8;
47 hd->type = buf[3];
48 hd->flags = buf[4];
49 hd->stream_id = nghttp2_get_uint32(&buf[5]) & NGHTTP2_STREAM_ID_MASK;
50 hd->reserved = 0;
53 void nghttp2_frame_hd_init(nghttp2_frame_hd *hd, size_t length, uint8_t type,
55 hd->length = length;
56 hd->type = type;
57 hd->flags = flags;
58 hd->stream_id = stream_id;
59 hd->reserved = 0;
66 nghttp2_frame_hd_init(&frame->hd, 0, NGHTTP2_HEADERS, flags, stream_id);
85 nghttp2_frame_hd_init(&frame->hd, NGHTTP2_PRIORITY_SPECLEN, NGHTTP2_PRIORITY,
94 nghttp2_frame_hd_init(&frame->hd, 4, NGHTTP2_RST_STREAM, NGHTTP2_FLAG_NONE,
103 nghttp2_frame_hd_init(&frame->hd, niv * NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH,
117 nghttp2_frame_hd_init(&frame->hd, 0, NGHTTP2_PUSH_PROMISE, flags, stream_id);
132 nghttp2_frame_hd_init(&frame->hd, 8, NGHTTP2_PING, flags, 0);
145 nghttp2_frame_hd_init(&frame->hd, 8 + opaque_data_len, NGHTTP2_GOAWAY,
161 nghttp2_frame_hd_init(&frame->hd, 4, NGHTTP2_WINDOW_UPDATE, flags, stream_id);
171 /* We have iframe->padlen == 0, but iframe->frame.hd.flags may have
178 return padlen - ((frame->hd.flags & NGHTTP2_FLAG_PADDED) > 0);
184 nghttp2_frame_hd_init(&frame->hd, 0, NGHTTP2_DATA, flags, stream_id);
193 nghttp2_frame_hd_init(&frame->hd, 0, type, flags, stream_id);
204 nghttp2_frame_hd_init(&frame->hd, 2 + origin_len + field_value_len,
236 nghttp2_frame_hd_init(&frame->hd, payloadlen, NGHTTP2_ORIGIN,
261 nghttp2_frame_hd_init(&frame->hd, 4 + field_value_len,
290 return nghttp2_frame_priority_len(frame->hd.flags);
309 nghttp2_frame_hd hd;
313 hd = *frame_hd;
314 hd.length = nghttp2_buf_len(buf);
316 DEBUGF("send: HEADERS/PUSH_PROMISE, payloadlen=%zu\n", hd.length);
322 hd.flags = (uint8_t)(hd.flags & ~NGHTTP2_FLAG_END_HEADERS);
326 nghttp2_frame_pack_frame_hd(buf->pos, &hd);
330 hd.type = NGHTTP2_CONTINUATION;
332 hd.flags = NGHTTP2_FLAG_NONE;
339 hd.length = nghttp2_buf_len(buf);
341 DEBUGF("send: int CONTINUATION, payloadlen=%zu\n", hd.length);
344 nghttp2_frame_pack_frame_hd(buf->pos, &hd);
348 hd.length = nghttp2_buf_len(buf);
350 hd.flags = NGHTTP2_FLAG_END_HEADERS;
352 DEBUGF("send: last CONTINUATION, payloadlen=%zu\n", hd.length);
355 nghttp2_frame_pack_frame_hd(buf->pos, &hd);
389 if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) {
394 frame->hd.length = nghttp2_bufs_len(bufs);
396 return frame_pack_headers_shared(bufs, &frame->hd);
423 if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) {
444 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
468 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
486 if (nghttp2_buf_avail(buf) < frame->hd.length) {
492 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
584 frame->hd.length = nghttp2_bufs_len(bufs);
586 return frame_pack_headers_shared(bufs, &frame->hd);
608 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
629 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
703 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
732 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
799 if (nghttp2_buf_avail(buf) < frame->hd.length) {
805 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
814 assert(nghttp2_buf_len(buf) == NGHTTP2_FRAME_HDLEN + frame->hd.length);
908 nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
1174 void nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
1210 hd->length += padlen;
1211 hd->flags |= NGHTTP2_FLAG_PADDED;
1213 DEBUGF("send: final payloadlen=%zu, padlen=%zu\n", hd->length, padlen);