passt: Relicense to GPL 2.0, or any later version
In practical terms, passt doesn't benefit from the additional
protection offered by the AGPL over the GPL, because it's not
suitable to be executed over a computer network.
Further, restricting the distribution under the version 3 of the GPL
wouldn't provide any practical advantage either, as long as the passt
codebase is concerned, and might cause unnecessary compatibility
dilemmas.
Change licensing terms to the GNU General Public License Version 2,
or any later version, with written permission from all current and
past contributors, namely: myself, David Gibson, Laine Stump, Andrea
Bolognani, Paul Holzinger, Richard W.M. Jones, Chris Kuhn, Florian
Weimer, Giuseppe Scrivano, Stefan Hajnoczi, and Vasiliy Ulyanov.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-04-05 20:11:44 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
2021-10-19 12:43:28 +02:00
|
|
|
* Copyright (c) 2021 Red Hat GmbH
|
|
|
|
* Author: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
*/
|
|
|
|
|
2022-03-26 00:05:31 +01:00
|
|
|
#ifndef CHECKSUM_H
|
|
|
|
#define CHECKSUM_H
|
|
|
|
|
2022-10-19 02:43:46 +02:00
|
|
|
struct udphdr;
|
2022-10-19 02:43:45 +02:00
|
|
|
struct icmphdr;
|
2022-10-19 02:43:44 +02:00
|
|
|
struct icmp6hdr;
|
|
|
|
|
2022-03-26 07:23:21 +01:00
|
|
|
uint32_t sum_16b(const void *buf, size_t len);
|
2021-09-14 19:02:36 +02:00
|
|
|
uint16_t csum_fold(uint32_t sum);
|
2022-03-26 07:23:21 +01:00
|
|
|
uint16_t csum_unaligned(const void *buf, size_t len, uint32_t init);
|
2024-03-06 06:58:35 +01:00
|
|
|
uint16_t csum_ip4_header(uint16_t tot_len, uint8_t protocol,
|
|
|
|
struct in_addr saddr, struct in_addr daddr);
|
2022-11-04 04:10:35 +01:00
|
|
|
void csum_udp4(struct udphdr *udp4hr,
|
|
|
|
struct in_addr saddr, struct in_addr daddr,
|
2022-10-19 02:43:47 +02:00
|
|
|
const void *payload, size_t len);
|
2024-03-06 06:58:32 +01:00
|
|
|
void csum_icmp4(struct icmphdr *icmp4hr, const void *payload, size_t len);
|
2022-10-19 02:43:46 +02:00
|
|
|
void csum_udp6(struct udphdr *udp6hr,
|
|
|
|
const struct in6_addr *saddr, const struct in6_addr *daddr,
|
|
|
|
const void *payload, size_t len);
|
2022-10-19 02:43:44 +02:00
|
|
|
void csum_icmp6(struct icmp6hdr *icmp6hr,
|
|
|
|
const struct in6_addr *saddr, const struct in6_addr *daddr,
|
|
|
|
const void *payload, size_t len);
|
2024-03-06 06:58:32 +01:00
|
|
|
uint32_t csum_unfolded(const void *buf, size_t len, uint32_t init);
|
2021-09-14 19:02:36 +02:00
|
|
|
uint16_t csum(const void *buf, size_t len, uint32_t init);
|
2024-03-06 06:58:32 +01:00
|
|
|
uint16_t csum_iov(const struct iovec *iov, size_t n, uint32_t init);
|
2022-03-26 00:05:31 +01:00
|
|
|
|
|
|
|
#endif /* CHECKSUM_H */
|