/* * WrapSix * Copyright (C) 2008-2012 Michal Zima * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ #ifndef CHECKSUM_H #define CHECKSUM_H #include "ipv4.h" #include "ipv6.h" unsigned short checksum(const void *data, int length); unsigned short checksum_ipv4(struct s_ipv4_addr ip_src, struct s_ipv4_addr ip_dest, unsigned short length, unsigned char proto, unsigned char *payload); unsigned short checksum_ipv6(struct s_ipv6_addr ip_src, struct s_ipv6_addr ip_dest, unsigned short length, unsigned char proto, unsigned char *payload); #endif /* CHECKSUM_H */