Greenbone Vulnerability Management Libraries 22.26.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
15
36
41
43
45gvm_stream_validator_new (const char *, size_t, gvm_stream_validator_t *);
46
48
50
53
55
56#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:41
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:200
void gvm_stream_validator_free(gvm_stream_validator_t)
Free a stream validator and all of its fields.
Definition streamvalidator.c:159
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:179
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:147
gvm_stream_validator_return_t gvm_stream_validator_new(const char *, size_t, gvm_stream_validator_t *)
Allocate and initialize a new data stream validator.
Definition streamvalidator.c:82
struct gvm_stream_validator * gvm_stream_validator_t
Pointer to an opaque stream validator data structure.
Definition streamvalidator.h:40
gvm_stream_validator_return_t
Definition streamvalidator.h:17
@ GVM_STREAM_VALIDATOR_INVALID_HASH_ALGORITHM
Definition streamvalidator.h:29
@ GVM_STREAM_VALIDATOR_HASH_MISMATCH
Definition streamvalidator.h:34
@ GVM_STREAM_VALIDATOR_DATA_TOO_SHORT
Definition streamvalidator.h:23
@ GVM_STREAM_VALIDATOR_DATA_TOO_LONG
Definition streamvalidator.h:25
@ GVM_STREAM_VALIDATOR_INTERNAL_ERROR
Definition streamvalidator.h:19
@ GVM_STREAM_VALIDATOR_OK
Definition streamvalidator.h:21
@ GVM_STREAM_VALIDATOR_INVALID_HASH_SYNTAX
Definition streamvalidator.h:27
@ GVM_STREAM_VALIDATOR_INVALID_HASH_VALUE
Definition streamvalidator.h:32
Data stream validator structure.
Definition streamvalidator.c:23