26#include "libssh/libssh.h"
28#define SSH_BUFFER_PACK_END ((uint32_t) 0x4f65feb3)
36int ssh_buffer_add_u8(
ssh_buffer buffer, uint8_t data);
37int ssh_buffer_add_u16(
ssh_buffer buffer, uint16_t data);
38int ssh_buffer_add_u32(
ssh_buffer buffer, uint32_t data);
39int ssh_buffer_add_u64(
ssh_buffer buffer, uint64_t data);
53#define ssh_buffer_pack(buffer, format, ...) \
54 _ssh_buffer_pack((buffer), (format), __VA_NARG__(__VA_ARGS__), __VA_ARGS__, SSH_BUFFER_PACK_END)
57 const char *format,
size_t argc,
63#define ssh_buffer_unpack(buffer, format, ...) \
64 _ssh_buffer_unpack((buffer), (format), __VA_NARG__(__VA_ARGS__), __VA_ARGS__, SSH_BUFFER_PACK_END)
66int ssh_buffer_prepend_data(
ssh_buffer buffer,
const void *data, uint32_t len);
70uint32_t ssh_buffer_get_u8(
ssh_buffer buffer, uint8_t *data);
71uint32_t ssh_buffer_get_u32(
ssh_buffer buffer, uint32_t *data);
72uint32_t ssh_buffer_get_u64(
ssh_buffer buffer, uint64_t *data);
78uint32_t ssh_buffer_pass_bytes_end(
ssh_buffer buffer, uint32_t len);
79uint32_t ssh_buffer_pass_bytes(
ssh_buffer buffer, uint32_t len);
int ssh_buffer_validate_length(struct ssh_buffer_struct *buffer, size_t len)
Validates that the given length can be obtained from the buffer.
Definition buffer.c:749
int ssh_buffer_allocate_size(struct ssh_buffer_struct *buffer, uint32_t len)
Ensure the buffer has at least a certain preallocated size.
Definition buffer.c:341
void ssh_buffer_set_secure(ssh_buffer buffer)
Sets the buffer as secure.
Definition buffer.c:177