2020-01-05 18:48:10 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <netinet/ip6.h>
|
|
|
|
#include <netinet/ip.h>
|
|
|
|
#include <netinet/tcp.h>
|
|
|
|
|
|
|
|
uint16_t csum_partial(const void *buff, size_t len);
|
|
|
|
uint16_t csum_tcpudp_magic(uint32_t saddr, uint32_t daddr, size_t len, uint8_t proto, uint16_t sum);
|
|
|
|
uint16_t csum_ipv6_magic(const void *saddr, const void *daddr, size_t len, uint8_t proto, uint16_t sum);
|
|
|
|
uint16_t ip4_compute_csum(const void *buff, size_t len);
|
|
|
|
void ip4_fix_checksum(struct iphdr *ip);
|
|
|
|
|
2020-02-03 12:46:08 +03:00
|
|
|
void tcp4_fix_checksum(struct tcphdr *tcp,int len, in_addr_t src_addr, in_addr_t dest_addr);
|
2020-01-05 18:48:10 +03:00
|
|
|
void tcp6_fix_checksum(struct tcphdr *tcp,int len, const struct in6_addr *src_addr, const struct in6_addr *dest_addr);
|
2020-02-03 12:46:08 +03:00
|
|
|
void tcp_fix_checksum(struct tcphdr *tcp,int len,const struct iphdr *iphdr,const struct ip6_hdr *ip6hdr);
|