'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class message

odtone::dns::message

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/net/dns/message.hpp>


class message {
public:
  // construct/copy/destruct
  message();
  message(const frame &);
  message& operator=(const frame &);
  ~message();

  // public member functions
  void tid(uint16);
  void qr(bool);
  void opcode(uint8);
  void aa(bool);
  void tc(bool);
  void rd(bool);
  void ra(bool);
  void z(bool);
  void rcode(uint8);
  void query(std::vector< question >);
  void answer(std::vector< resource_record >);
  void auth(std::vector< resource_record >);
  void add(std::vector< resource_record >);
  uint16 tid() const;
  bool qr() const;
  uint8 opcode() const;
  bool aa() const;
  bool tc() const;
  bool rd() const;
  bool ra() const;
  bool z() const;
  uint8 rcode() const;
  uint16 nquery() const;
  uint16 nanswer() const;
  uint16 nauth() const;
  uint16 nadd() const;
  std::vector< question > query();
  std::vector< resource_record > answer();
  std::vector< resource_record > auth();
  std::vector< resource_record > add();
  void get_frame(frame_vla &) const;
};

Description

DNS Message

The odtone::dns::message is high level representation of an DNS message. It provides access to all fields of the DNS message header and to all resource records presented on the DNS Message.

The odtone::dns::message can be set from an odtone::dns::frame that was received or it can create an odtone::dns::frame ready to be sent.

message public construct/copy/destruct

  1. message();

    Construct a default DNS Message.

    The defaults for each field are: tid = 0; qr = false; opcode = 0; aa = false; tc = false; rd = false; ra = false; z = false; rcode = false; nquery = false; nanswer = false; nauth = false; nadd = false;

  2. message(const frame & fm);

    Construct a DNS Message parsing all fields from a frame.

    Parameters:

    fm

    odtone::dns::frame from which to parse information.

  3. message& operator=(const frame & fm);

    Extract the DNS Message fields from a given odtone::dns::frame.

    Parameters:

    fm

    odtone::dns::frame from which to extract information.

    Returns:

    odtone::dns::message with the fields updated.

  4. ~message();

    Destruct a DNS Message.

message public member functions

  1. void tid(uint16 tid);

    Set the DNS Message Transaction Identifier.

    Parameters:

    tid

    The value of the DNS Message Transaction Identifier field.

  2. void qr(bool qr);

    Set the DNS Message Query/Response Flag.

    Parameters:

    qr

    The value of the DNS Message Query/Response Flag field.

  3. void opcode(uint8 opcode);

    Set the DNS Message Operation Code.

    Parameters:

    opcode

    The value of the DNS Message Operation Code field.

  4. void aa(bool aa);

    Set the DNS Message Authoritative Answer Flag.

    Parameters:

    aa

    The value of the DNS Message Authoritative Answer Flag field.

  5. void tc(bool tc);

    Set the DNS Message Truncation Flag.

    Parameters:

    tc

    The value of the DNS Message Truncation Flag field.

  6. void rd(bool rd);

    Set the DNS Message Recursion Desired.

    Parameters:

    rd

    The value of the DNS Message Recursion Desired field.

  7. void ra(bool ra);

    Set the DNS Message Recursion Available.

    Parameters:

    ra

    The value of the DNS Message Recursion Available field.

  8. void z(bool z);

    Set the DNS Message Zero.

    Parameters:

    z

    The value of the DNS Message Zero field.

  9. void rcode(uint8 rcode);

    Set the DNS Message Response Code.

    Parameters:

    rcode

    The value of the DNS Message Response Code field.

  10. void query(std::vector< question > query);

    Set the DNS Message Question list.

    Parameters:

    query

    The value of the DNS Message Question list.

  11. void answer(std::vector< resource_record > answer);

    Set the DNS Message Answer Record list.

    Parameters:

    answer

    The value of the DNS Message Answer Record list.

  12. void auth(std::vector< resource_record > auth);

    Set the DNS Message Authority Record list.

    Parameters:

    auth

    The value of the DNS Message Authority Record list.

  13. void add(std::vector< resource_record > add);

    Set the DNS Message Additional Record list.

    Parameters:

    add

    The value of the DNS Message Additional Record Count list.

  14. uint16 tid() const;

    Get the DNS Message Transaction Identifier.

    Returns:

    The value of the DNS Message Transaction Identifier field.

  15. bool qr() const;

    Get the DNS Message Query/Response Flag.

    Returns:

    The value of the DNS Message Query/Response Flag field.

  16. uint8 opcode() const;

    Get the DNS Message Operation Code.

    Returns:

    The value of the DNS Message Operation Code field.

  17. bool aa() const;

    Get the DNS Message Authoritative Answer Flag.

    Returns:

    The value of the DNS Message Authoritative Answer Flag field.

  18. bool tc() const;

    Get the DNS Message Truncation Flag.

    Returns:

    The value of the DNS Message Truncation Flag field.

  19. bool rd() const;

    Get the DNS Message Recursion Desired.

    Returns:

    The value of the DNS Message Recursion Desired field.

  20. bool ra() const;

    Get the DNS Message Recursion Available.

    Returns:

    The value of the DNS Message Recursion Available field.

  21. bool z() const;

    Get the DNS Message Zero.

    Returns:

    The value of the DNS Message Zero field.

  22. uint8 rcode() const;

    Get the DNS Message Response Code.

    Returns:

    The value of the DNS Message Response Code field.

  23. uint16 nquery() const;

    Get the DNS Message Question Count.

    Returns:

    The value of the DNS Message Question Count field.

  24. uint16 nanswer() const;

    Get the DNS Message Answer Record Count.

    Returns:

    The value of the DNS Message Answer Record Count field.

  25. uint16 nauth() const;

    Get the DNS Message Authority Record Count.

    Returns:

    The value of the DNS Message Authority Record Count field.

  26. uint16 nadd() const;

    Get the DNS Message Additional Record Count.

    Returns:

    The value of the DNS Message Additional Record Count field.

  27. std::vector< question > query();

    Get the DNS Message Question list.

    Returns:

    The DNS Message Question list.

  28. std::vector< resource_record > answer();

    Get the DNS Message Answer Record list.

    Returns:

    The DNS Message Answer Record list.

  29. std::vector< resource_record > auth();

    Get the DNS Message Authority Record list.

    Returns:

    The DNS Message Authority Record list.

  30. std::vector< resource_record > add();

    Get the DNS Message Additional Record list.

    Returns:

    The DNS Message Additional Record Count list.

  31. void get_frame(frame_vla & fm) const;

    Get the DNS Message Frame.

    Parameters:

    fm

    A dynamic frame buffer to store the information.


PrevUpHomeNext