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 18:11:44 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
2021-10-19 10:43:28 +00:00
|
|
|
* Copyright (c) 2021 Red Hat GmbH
|
|
|
|
* Author: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
*/
|
|
|
|
|
2022-03-25 23:05:31 +00:00
|
|
|
#ifndef CHECKSUM_H
|
|
|
|
#define CHECKSUM_H
|
|
|
|
|
2022-10-19 00:43:46 +00:00
|
|
|
struct udphdr;
|
2022-10-19 00:43:45 +00:00
|
|
|
struct icmphdr;
|
2022-10-19 00:43:44 +00:00
|
|
|
struct icmp6hdr;
|
|
|
|
|
2022-03-26 06:23:21 +00:00
|
|
|
uint32_t sum_16b(const void *buf, size_t len);
|
2021-09-14 17:02:36 +00:00
|
|
|
uint16_t csum_fold(uint32_t sum);
|
2022-03-26 06:23:21 +00:00
|
|
|
uint16_t csum_unaligned(const void *buf, size_t len, uint32_t init);
|
2024-05-01 06:53:49 +00:00
|
|
|
uint16_t csum_ip4_header(uint16_t l3len, uint8_t protocol,
|
2024-03-06 05:58:35 +00:00
|
|
|
struct in_addr saddr, struct in_addr daddr);
|
2024-05-01 06:53:49 +00:00
|
|
|
uint32_t proto_ipv4_header_psum(uint16_t l4len, uint8_t protocol,
|
2024-03-06 05:58:36 +00:00
|
|
|
struct in_addr saddr, struct in_addr daddr);
|
2022-11-04 03:10:35 +00:00
|
|
|
void csum_udp4(struct udphdr *udp4hr,
|
|
|
|
struct in_addr saddr, struct in_addr daddr,
|
2024-10-03 14:51:08 +00:00
|
|
|
const struct iovec *iov, int iov_cnt, size_t offset);
|
2024-05-01 06:53:49 +00:00
|
|
|
void csum_icmp4(struct icmphdr *icmp4hr, const void *payload, size_t dlen);
|
2024-03-06 05:58:36 +00:00
|
|
|
uint32_t proto_ipv6_header_psum(uint16_t payload_len, uint8_t protocol,
|
|
|
|
const struct in6_addr *saddr,
|
|
|
|
const struct in6_addr *daddr);
|
2022-10-19 00:43:46 +00:00
|
|
|
void csum_udp6(struct udphdr *udp6hr,
|
|
|
|
const struct in6_addr *saddr, const struct in6_addr *daddr,
|
2024-10-03 14:51:08 +00:00
|
|
|
const struct iovec *iov, int iov_cnt, size_t offset);
|
2022-10-19 00:43:44 +00:00
|
|
|
void csum_icmp6(struct icmp6hdr *icmp6hr,
|
|
|
|
const struct in6_addr *saddr, const struct in6_addr *daddr,
|
2024-05-01 06:53:49 +00:00
|
|
|
const void *payload, size_t dlen);
|
2024-03-06 05:58:32 +00:00
|
|
|
uint32_t csum_unfolded(const void *buf, size_t len, uint32_t init);
|
2021-09-14 17:02:36 +00:00
|
|
|
uint16_t csum(const void *buf, size_t len, uint32_t init);
|
2024-10-03 14:51:06 +00:00
|
|
|
uint16_t csum_iov(const struct iovec *iov, size_t n, size_t offset,
|
|
|
|
uint32_t init);
|
2022-03-25 23:05:31 +00:00
|
|
|
|
|
|
|
#endif /* CHECKSUM_H */
|