diff --git a/src/internet-stack/ipv4-checksum.cc b/src/internet-stack/ipv4-checksum.cc deleted file mode 100644 index 5e93b4a7d..000000000 --- a/src/internet-stack/ipv4-checksum.cc +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2005,2006,2007 INRIA - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Mathieu Lacage - */ -#include "ipv4-checksum.h" - -namespace ns3 { - -uint16_t -Ipv4ChecksumCalculate (uint16_t checksum, uint8_t *buffer, uint16_t size) -{ - /* see RFC 1071 to understand this code. */ - uint32_t sum = checksum; - uint16_t *data = (uint16_t *) buffer; - for (uint16_t i = 0; i < (size/2); i++) { - sum += data[i]; - } - if ((size % 2) != 0) { - uint8_t tmpBuf[2]; - tmpBuf[0] = buffer[size-1]; - tmpBuf[1] = 0; - data = (uint16_t *)tmpBuf; - sum += *data; - } - while (sum >> 16) { - sum = (sum & 0xffff) + (sum >> 16); - } - return sum; -} - -uint16_t -Ipv4ChecksumComplete (uint16_t checksum) -{ - return ~checksum; -} - -}; //namespace ns3 diff --git a/src/internet-stack/ipv4-checksum.h b/src/internet-stack/ipv4-checksum.h deleted file mode 100644 index 98bbed5c2..000000000 --- a/src/internet-stack/ipv4-checksum.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2005,2006,2007 INRIA - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Mathieu Lacage - */ -#ifndef IPV4_CHECKSUM_H -#define IPV4_CHECKSUM_H - -#include - -namespace ns3 { - -uint16_t Ipv4ChecksumCalculate (uint16_t checksum, uint8_t *buffer, uint16_t size); - -uint16_t Ipv4ChecksumComplete (uint16_t checksum); - -}; //namespace ns3 - -#endif /* IPV4_CHECKSUM_H */ diff --git a/src/internet-stack/wscript b/src/internet-stack/wscript index 6e97c09d4..9d4ea3118 100644 --- a/src/internet-stack/wscript +++ b/src/internet-stack/wscript @@ -78,7 +78,6 @@ def build(bld): 'ipv4-l4-protocol.cc', 'udp-header.cc', 'tcp-header.cc', - 'ipv4-checksum.cc', 'ipv4-interface.cc', 'ipv4-l3-protocol.cc', 'ipv4-end-point.cc',