// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#ifndef CHECKSUMCALCULATOR_H
-#define CHECKSUMCALCULATOR_H
+#ifndef CHECKSUM_HPP
+#define CHECKSUM_HPP
#include <stdint.h>
//-----------------------------------------------------------------------------
-// ChecksumCalculator
+// Checksum
//-----------------------------------------------------------------------------
/**
* @brief Class that provides checksum calculation.
*/
template<typename Iterator>
-class ChecksumCalculator
+class Checksum
{
public:
- ChecksumCalculator(
+ Checksum(
const Iterator &body_begin,
const Iterator &body_end
);
// TODO common checksum
- // The <typename Message> must have a method which returns an aray of works
+ // The <typename Message> must have a method which returns an array of words
// this way the checksum calculator can be used with any ICMP, TCP, UDP...
// uint16_t compute( const Message &message ) const
// {
};
template<typename Iterator>
- ChecksumCalculator<Iterator>::ChecksumCalculator(
+ Checksum<Iterator>::Checksum(
const Iterator &body_begin,
const Iterator &body_end
) :
}
template<typename Iterator>
- uint16_t ChecksumCalculator<Iterator>::compute(
+ uint16_t Checksum<Iterator>::compute(
uint8_t type,
uint8_t code,
uint16_t identifier,
return checksum;
}
-#endif /* CHECKSUMCALCULATOR_H */
+#endif // CHECKSUM_HPP
#ifndef ICMPCHECKSUMCALCULATOR_H
#define ICMPCHECKSUMCALCULATOR_H
-#include "icmp/checksumcalculator.h"
+#include "host/checksum.hpp"
#include "icmp/icmpdata.h"
//-----------------------------------------------------------------------------
// IcmpChecksumCalculator
//-----------------------------------------------------------------------------
-typedef ChecksumCalculator<IcmpData::const_iterator> IcmpChecksumCalculator;
+typedef Checksum<IcmpData::const_iterator> IcmpChecksumCalculator;
#endif /* ICMPCHECKSUMCALCULATOR_H */