'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class checksum

odtone::net::ip::checksum

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/net/ip/checksum.hpp>


class checksum {
public:
  // construct/copy/destruct
  checksum();

  // public member functions
  void update(const void *, size_t);
  void update(const uint16 *, size_t);
  uint16 final() const;
  void clear();
};

Description

This class represents the checksum field in IP packets.

checksum public construct/copy/destruct

  1. checksum();

    Construct an undefined checksum, i.e., it is set to zero value.

checksum public member functions

  1. void update(const void * data, size_t len);

    Update the checksum value based on the byte buffer.

    Parameters:

    data

    Byte buffer.

    len

    Byte buffer length.

  2. void update(const uint16 * data, size_t len);

    Update the checksum value based on the byte buffer.

    Parameters:

    data

    Byte buffer.

    len

    Byte buffer length.

  3. uint16 final() const;

    Get the value of the checksum.

    Returns:

    The value of the checksum.

  4. void clear();

    Clear the value of the checksum.


PrevUpHomeNext