Blame include/uapi/linux/if_alg.h

Packit Service 3880ab
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
Packit Service 3880ab
/*
Packit Service 3880ab
 * if_alg: User-space algorithm interface
Packit Service 3880ab
 *
Packit Service 3880ab
 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
Packit Service 3880ab
 *
Packit Service 3880ab
 * This program is free software; you can redistribute it and/or modify it
Packit Service 3880ab
 * under the terms of the GNU General Public License as published by the Free
Packit Service 3880ab
 * Software Foundation; either version 2 of the License, or (at your option)
Packit Service 3880ab
 * any later version.
Packit Service 3880ab
 *
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
#ifndef _LINUX_IF_ALG_H
Packit Service 3880ab
#define _LINUX_IF_ALG_H
Packit Service 3880ab
Packit Service 3880ab
#include <linux/types.h>
Packit Service 3880ab
Packit Service 3880ab
struct sockaddr_alg {
Packit Service 3880ab
	__u16	salg_family;
Packit Service 3880ab
	__u8	salg_type[14];
Packit Service 3880ab
	__u32	salg_feat;
Packit Service 3880ab
	__u32	salg_mask;
Packit Service 3880ab
	__u8	salg_name[64];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Bot 867fae
/*
Packit Bot 867fae
 * Linux v4.12 and later removed the 64-byte limit on salg_name[]; it's now an
Packit Bot 867fae
 * arbitrary-length field.  We had to keep the original struct above for source
Packit Bot 867fae
 * compatibility with existing userspace programs, though.  Use the new struct
Packit Bot 867fae
 * below if support for very long algorithm names is needed.  To do this,
Packit Bot 867fae
 * allocate 'sizeof(struct sockaddr_alg_new) + strlen(algname) + 1' bytes, and
Packit Bot 867fae
 * copy algname (including the null terminator) into salg_name.
Packit Bot 867fae
 */
Packit Bot 867fae
struct sockaddr_alg_new {
Packit Bot 867fae
	__u16	salg_family;
Packit Bot 867fae
	__u8	salg_type[14];
Packit Bot 867fae
	__u32	salg_feat;
Packit Bot 867fae
	__u32	salg_mask;
Packit Bot 867fae
	__u8	salg_name[];
Packit Bot 867fae
};
Packit Bot 867fae
Packit Service 3880ab
struct af_alg_iv {
Packit Service 3880ab
	__u32	ivlen;
Packit Service 3880ab
	__u8	iv[0];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* Socket options */
Packit Service 3880ab
#define ALG_SET_KEY			1
Packit Service 3880ab
#define ALG_SET_IV			2
Packit Service 3880ab
#define ALG_SET_OP			3
Packit Service 3880ab
#define ALG_SET_AEAD_ASSOCLEN		4
Packit Service 3880ab
#define ALG_SET_AEAD_AUTHSIZE		5
Packit Bot 867fae
#define ALG_SET_DRBG_ENTROPY		6
Packit Service 3880ab
Packit Service 3880ab
/* Operations */
Packit Service 3880ab
#define ALG_OP_DECRYPT			0
Packit Service 3880ab
#define ALG_OP_ENCRYPT			1
Packit Service 3880ab
Packit Service 3880ab
#endif	/* _LINUX_IF_ALG_H */