Lines Matching defs:data
45 * Returns a pointer to the first byte after the packet data.
66 * copy of the data so |buf| must be present for the whole time that the PACKET
105 * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
119 * original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
134 * |*data|
137 unsigned int *data)
142 *data = ((unsigned int)(*pkt->curr)) << 8;
143 *data |= *(pkt->curr + 1);
149 /* Get 2 bytes in network order from |pkt| and store the value in |*data| */
150 __owur static ossl_inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data)
152 if (!PACKET_peek_net_2(pkt, data))
161 __owur static ossl_inline int PACKET_get_net_2_len(PACKET *pkt, size_t *data)
167 *data = (size_t)i;
174 * |*data|
177 unsigned long *data)
182 *data = ((unsigned long)(*pkt->curr)) << 16;
183 *data |= ((unsigned long)(*(pkt->curr + 1))) << 8;
184 *data |= *(pkt->curr + 2);
190 /* Get 3 bytes in network order from |pkt| and store the value in |*data| */
191 __owur static ossl_inline int PACKET_get_net_3(PACKET *pkt, unsigned long *data)
193 if (!PACKET_peek_net_3(pkt, data))
202 __owur static ossl_inline int PACKET_get_net_3_len(PACKET *pkt, size_t *data)
208 *data = (size_t)i;
215 * |*data|
218 unsigned long *data)
223 *data = ((unsigned long)(*pkt->curr)) << 24;
224 *data |= ((unsigned long)(*(pkt->curr + 1))) << 16;
225 *data |= ((unsigned long)(*(pkt->curr + 2))) << 8;
226 *data |= *(pkt->curr + 3);
233 * |*data|
236 uint64_t *data)
241 *data = ((uint64_t)(*pkt->curr)) << 56;
242 *data |= ((uint64_t)(*(pkt->curr + 1))) << 48;
243 *data |= ((uint64_t)(*(pkt->curr + 2))) << 40;
244 *data |= ((uint64_t)(*(pkt->curr + 3))) << 32;
245 *data |= ((uint64_t)(*(pkt->curr + 4))) << 24;
246 *data |= ((uint64_t)(*(pkt->curr + 5))) << 16;
247 *data |= ((uint64_t)(*(pkt->curr + 6))) << 8;
248 *data |= *(pkt->curr + 7);
254 /* Get 4 bytes in network order from |pkt| and store the value in |*data| */
255 __owur static ossl_inline int PACKET_get_net_4(PACKET *pkt, unsigned long *data)
257 if (!PACKET_peek_net_4(pkt, data))
266 __owur static ossl_inline int PACKET_get_net_4_len(PACKET *pkt, size_t *data)
272 *data = (size_t)i;
277 /* Get 8 bytes in network order from |pkt| and store the value in |*data| */
278 __owur static ossl_inline int PACKET_get_net_8(PACKET *pkt, uint64_t *data)
280 if (!PACKET_peek_net_8(pkt, data))
288 /* Peek ahead at 1 byte from |pkt| and store the value in |*data| */
290 unsigned int *data)
295 *data = *pkt->curr;
300 /* Get 1 byte from |pkt| and store the value in |*data| */
301 __owur static ossl_inline int PACKET_get_1(PACKET *pkt, unsigned int *data)
303 if (!PACKET_peek_1(pkt, data))
312 __owur static ossl_inline int PACKET_get_1_len(PACKET *pkt, size_t *data)
318 *data = (size_t)i;
325 * in |*data|
328 unsigned long *data)
333 *data = *pkt->curr;
334 *data |= ((unsigned long)(*(pkt->curr + 1))) << 8;
335 *data |= ((unsigned long)(*(pkt->curr + 2))) << 16;
336 *data |= ((unsigned long)(*(pkt->curr + 3))) << 24;
344 * |*data|
346 __owur static ossl_inline int PACKET_get_4(PACKET *pkt, unsigned long *data)
348 if (!PACKET_peek_4(pkt, data))
358 * |*data|. This just points at the underlying buffer that |pkt| is using. The
359 * caller should not free this data directly (it will be freed when the
363 const unsigned char **data,
369 *data = pkt->curr;
375 * Read |len| bytes from the |pkt| and store a pointer to them in |*data|. This
377 * not free this data directly (it will be freed when the underlying buffer gets
381 const unsigned char **data,
384 if (!PACKET_peek_bytes(pkt, data, len))
392 /* Peek ahead at |len| bytes from |pkt| and copy them to |data| */
394 unsigned char *data,
400 memcpy(data, pkt->curr, len);
406 * Read |len| bytes from |pkt| and copy them to |data|.
407 * The caller is responsible for ensuring that |data| can hold |len| bytes.
410 unsigned char *data, size_t len)
412 if (!PACKET_peek_copy_bytes(pkt, data, len))
421 * Copy packet data to |dest|, and set |len| to the number of copied bytes.
423 * Returns 1 if the packet data fits in |dest_len| bytes, 0 otherwise.
442 * result in |*data|, and the length in |len|.
443 * If |*data| is not NULL, the old data is OPENSSL_free'd.
444 * If the packet is empty, or malloc fails, |*data| will be set to NULL.
450 unsigned char **data, size_t *len)
454 OPENSSL_free(*data);
455 *data = NULL;
463 *data = OPENSSL_memdup(pkt->curr, length);
464 if (*data == NULL)
473 * buffer. Store a pointer to the result in |*data|.
474 * If |*data| is not NULL, the old data is OPENSSL_free'd.
475 * If the data in |pkt| does not contain a NUL-byte, the entire data is
481 __owur static ossl_inline int PACKET_strndup(const PACKET *pkt, char **data)
483 OPENSSL_free(*data);
486 *data = OPENSSL_strndup((const char *)pkt->curr, PACKET_remaining(pkt));
487 return (*data != NULL);
511 * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
518 const unsigned char *data;
521 !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
526 subpkt->curr = data;
540 const unsigned char *data;
543 !PACKET_get_bytes(&tmp, &data, (size_t)length) ||
549 subpkt->curr = data;
559 * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
566 const unsigned char *data;
570 !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
575 subpkt->curr = data;
589 const unsigned char *data;
593 !PACKET_get_bytes(&tmp, &data, (size_t)length) ||
599 subpkt->curr = data;
609 * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|.
616 const unsigned char *data;
619 !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
624 subpkt->curr = data;
655 /* The buffer where we store the output data */
685 /* Error on WPACKET_close() if no data written to the WPACKET */
689 * Abandon all changes on WPACKET_close() if no data written to the WPACKET,
698 * data is preallocated at the start of the buffer to store the length of the
710 * Same as WPACKET_init_len except there is no underlying buffer. No data is
711 * ever actually written. We just keep track of how much data would have been
760 * data is added to the WPACKET). This function fails if a sub-packet is of 0
766 * Initialise a new sub-packet. Additionally |lenbytes| of data is preallocated
827 * how big arbitrary data is going to be up front, but we do know what the
889 /* Copy |len| bytes of data from |*src| into the WPACKET. */
892 /* Set |len| bytes of data to |ch| into the WPACKET. */
896 * Copy |len| bytes of data from |*src| into the WPACKET and prefix with its
897 * length (consuming |lenbytes| of data for the length). Don't call this