Greenbone Vulnerability Management Libraries 22.34.0
streamvalidator.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
6#ifndef _GVM_STREAMVALIDATOR_H
7#define _GVM_STREAMVALIDATOR_H
8
9#include <stdio.h>
10
11#define GVM_STREAM_VALIDATOR_NO_SIZE ((size_t) - 1)
12
17
38
43
45
48
50gvm_stream_validator_with_size_new (const char *, size_t,
52
54
56
59
61
62#endif /* not _GVM_STREAMVALIDATOR_H */
const char * gvm_stream_validator_return_str(gvm_stream_validator_return_t)
Gets a string representation of a gvm_stream_validator_return_t.
Definition streamvalidator.c:44
gvm_stream_validator_return_t gvm_stream_validator_end(gvm_stream_validator_t)
Signal the end of data input into a validator and produce the result of the validation.
Definition streamvalidator.c:260
void gvm_stream_validator_free(gvm_stream_validator_t)
Free a stream validator and all of its fields.
Definition streamvalidator.c:216
gvm_stream_validator_return_t gvm_stream_validator_write(gvm_stream_validator_t, const char *, size_t)
Write data to a validator, updating the hash state and current size.
Definition streamvalidator.c:236
gvm_stream_validator_return_t gvm_stream_validator_with_size_new(const char *, size_t, gvm_stream_validator_t *)
Allocate and initialize a new data stream validator.
Definition streamvalidator.c:117
void gvm_stream_validator_rewind(gvm_stream_validator_t)
Rewind the validation state of a stream validator while keeping the expected hash and data size.
Definition streamvalidator.c:204
gvm_stream_validator_return_t gvm_stream_validator_new(const char *, gvm_stream_validator_t *)
Allocate and initialize a checksum-only stream validator.
Definition streamvalidator.c:87
struct gvm_stream_validator * gvm_stream_validator_t
Pointer to an opaque stream validator data structure.
Definition streamvalidator.h:42
gvm_stream_validator_return_t
Definition streamvalidator.h:19
@ GVM_STREAM_VALIDATOR_INVALID_HASH_ALGORITHM
Definition streamvalidator.h:31
@ GVM_STREAM_VALIDATOR_HASH_MISMATCH
Definition streamvalidator.h:36
@ GVM_STREAM_VALIDATOR_DATA_TOO_SHORT
Definition streamvalidator.h:25
@ GVM_STREAM_VALIDATOR_DATA_TOO_LONG
Definition streamvalidator.h:27
@ GVM_STREAM_VALIDATOR_INTERNAL_ERROR
Definition streamvalidator.h:21
@ GVM_STREAM_VALIDATOR_OK
Definition streamvalidator.h:23
@ GVM_STREAM_VALIDATOR_INVALID_HASH_SYNTAX
Definition streamvalidator.h:29
@ GVM_STREAM_VALIDATOR_INVALID_HASH_VALUE
Definition streamvalidator.h:34
Data stream validator structure.
Definition streamvalidator.c:25