2021-10-19 10:43:28 +00:00
|
|
|
/* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
* 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-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);
|
2021-09-14 17:02:36 +00:00
|
|
|
void csum_tcp4(struct iphdr *iph);
|
|
|
|
uint16_t csum(const void *buf, size_t len, uint32_t init);
|
2022-03-25 23:05:31 +00:00
|
|
|
|
|
|
|
#endif /* CHECKSUM_H */
|