Lines Matching refs:lenbytes

30                                  unsigned char **allocbytes, size_t lenbytes)  in WPACKET_sub_allocate_bytes__()  argument
32 if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) in WPACKET_sub_allocate_bytes__()
81 unsigned char **allocbytes, size_t lenbytes) in WPACKET_sub_reserve_bytes__() argument
83 if (pkt->endfirst && lenbytes > 0) in WPACKET_sub_reserve_bytes__()
86 if (!WPACKET_reserve_bytes(pkt, lenbytes + len, allocbytes)) in WPACKET_sub_reserve_bytes__()
90 *allocbytes += lenbytes; in WPACKET_sub_reserve_bytes__()
95 static size_t maxmaxsize(size_t lenbytes) in maxmaxsize() argument
97 if (lenbytes >= sizeof(size_t) || lenbytes == 0) in maxmaxsize()
100 return ((size_t)1 << (lenbytes * 8)) - 1 + lenbytes; in maxmaxsize()
103 static int wpacket_intern_init_len(WPACKET *pkt, size_t lenbytes) in wpacket_intern_init_len() argument
113 if (lenbytes == 0) in wpacket_intern_init_len()
116 pkt->subs->pwritten = lenbytes; in wpacket_intern_init_len()
117 pkt->subs->lenbytes = lenbytes; in wpacket_intern_init_len()
119 if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) { in wpacket_intern_init_len()
130 size_t lenbytes) in WPACKET_init_static_len() argument
132 size_t max = maxmaxsize(lenbytes); in WPACKET_init_static_len()
143 return wpacket_intern_init_len(pkt, lenbytes); in WPACKET_init_static_len()
160 int WPACKET_init_len(WPACKET *pkt, BUF_MEM *buf, size_t lenbytes) in WPACKET_init_len() argument
168 pkt->maxsize = maxmaxsize(lenbytes); in WPACKET_init_len()
171 return wpacket_intern_init_len(pkt, lenbytes); in WPACKET_init_len()
179 int WPACKET_init_null(WPACKET *pkt, size_t lenbytes) in WPACKET_init_null() argument
183 pkt->maxsize = maxmaxsize(lenbytes); in WPACKET_init_null()
265 if ((pkt->curr - sub->lenbytes) == sub->packet_len) { in wpacket_intern_close()
266 pkt->written -= sub->lenbytes; in wpacket_intern_close()
267 pkt->curr -= sub->lenbytes; in wpacket_intern_close()
272 sub->lenbytes = 0; in wpacket_intern_close()
276 if (sub->lenbytes > 0) { in wpacket_intern_close()
282 if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes)) in wpacket_intern_close()
285 if (!put_quic_value(&buf[sub->packet_len], packlen, sub->lenbytes)) in wpacket_intern_close()
289 if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes)) in wpacket_intern_close()
366 int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) in WPACKET_start_sub_packet_len__() argument
376 if (lenbytes > 0 && pkt->endfirst) in WPACKET_start_sub_packet_len__()
384 sub->pwritten = pkt->written + lenbytes; in WPACKET_start_sub_packet_len__()
385 sub->lenbytes = lenbytes; in WPACKET_start_sub_packet_len__()
387 if (lenbytes == 0) { in WPACKET_start_sub_packet_len__()
394 if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) in WPACKET_start_sub_packet_len__()
421 size_t lenbytes; in WPACKET_set_max_size() local
431 lenbytes = sub->lenbytes; in WPACKET_set_max_size()
432 if (lenbytes == 0) in WPACKET_set_max_size()
433 lenbytes = sizeof(pkt->maxsize); in WPACKET_set_max_size()
435 if (maxmaxsize(lenbytes) < maxsize || maxsize < pkt->written) in WPACKET_set_max_size()
476 size_t lenbytes) in WPACKET_sub_memcpy__() argument
478 if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) in WPACKET_sub_memcpy__()