Blame lib/iov.h

Packit Service 991b93
/*
Packit Service 991b93
 * Copyright (C) 2019 Red Hat, Inc.
Packit Service 991b93
 *
Packit Service 991b93
 * Author: Daiki Ueno
Packit Service 991b93
 *
Packit Service 991b93
 * This file is part of GnuTLS.
Packit Service 991b93
 *
Packit Service 991b93
 * The GnuTLS is free software; you can redistribute it and/or
Packit Service 991b93
 * modify it under the terms of the GNU Lesser General Public License
Packit Service 991b93
 * as published by the Free Software Foundation; either version 2.1 of
Packit Service 991b93
 * the License, or (at your option) any later version.
Packit Service 991b93
 *
Packit Service 991b93
 * This library is distributed in the hope that it will be useful, but
Packit Service 991b93
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 991b93
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 991b93
 * Lesser General Public License for more details.
Packit Service 991b93
 *
Packit Service 991b93
 * You should have received a copy of the GNU Lesser General Public License
Packit Service 991b93
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
Packit Service 991b93
 *
Packit Service 991b93
 */
Packit Service 991b93
Packit Service 991b93
#ifndef GNUTLS_LIB_IOV_H
Packit Service 991b93
#define GNUTLS_LIB_IOV_H
Packit Service 991b93
Packit Service 991b93
#include "gnutls_int.h"
Packit Service 991b93
Packit Service 991b93
struct iov_iter_st {
Packit Service 991b93
	const giovec_t *iov;
Packit Service 991b93
	size_t iov_count;	/* the number of iov */
Packit Service 991b93
	size_t iov_index;	/* index of the current buffer */
Packit Service 991b93
	size_t iov_offset;	/* byte offset in the current buffer */
Packit Service 991b93
Packit Service 991b93
	uint8_t block[MAX_CIPHER_BLOCK_SIZE]; /* incomplete block for reading */
Packit Service 991b93
	size_t block_size;	/* actual block size of the cipher */
Packit Service 991b93
	size_t block_offset;	/* offset in block */
Packit Service 991b93
};
Packit Service 991b93
Packit Service 991b93
int _gnutls_iov_iter_init(struct iov_iter_st *iter,
Packit Service 991b93
			  const giovec_t *iov, size_t iov_count,
Packit Service 991b93
			  size_t block_size);
Packit Service 991b93
Packit Service 991b93
ssize_t _gnutls_iov_iter_next(struct iov_iter_st *iter, uint8_t **data);
Packit Service 991b93
Packit Service 991b93
int _gnutls_iov_iter_sync(struct iov_iter_st *iter, const uint8_t *data,
Packit Service 991b93
			  size_t data_size);
Packit Service 991b93
Packit Service 991b93
#endif /* GNUTLS_LIB_IOV_H */