---
name: "dnsjit.core.object"
section: "3"
platform: "linux"
package: "dnsjit"
version: "1.5.0-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/dnsjit.core.object"
---

# dnsjit.core.object(3)

Base object that is passed between receiver and receivee

## NAME

dnsjit.core.object - Base object that is passed between receiver and receivee

## SYNOPSIS

  require("dnsjit.core.object")\
   print(object:type())\
   packet = object:cast()

## DESCRIPTION

This is the base object that can be casted to other objects that to describe a DNS message, how it was captured or generated. Objects can be chained together, for example a DNS message is created ontop of a packet.

### Attributes

- obj\_type

  The enum of the object type.

- obj\_prev

  The previous object in the object chain.

### Functions

- **Object:type**()

  Return the textual type of the object.

- **Object:prev**()

  Return the previous object.

- **Object:cast**()

  Cast the object to the underlining object module and return it.

- **Object:cast\_to**(obj\_type)

  Cast the object to the specified object module and return it. Returns nil if the object chain doesn't contained the specified object type.

- **Object:uncast**()

  Cast the object to the generic object module and return it.

- **Object:copy**()

  Make a copy of the object and return it.

- **Object:free**()

  Free the object, should only be used on copies or otherwise allocated.

## SEE ALSO

[**dnsjit.core.object.pcap**(3)](/dnsjit.core.object.pcap/3.md), [**dnsjit.core.object.ether**(3)](/dnsjit.core.object.ether/3.md), [**dnsjit.core.object.null**(3)](/dnsjit.core.object.null/3.md), [**dnsjit.core.object.loop**(3)](/dnsjit.core.object.loop/3.md), [**dnsjit.core.object.linuxsll**(3)](/dnsjit.core.object.linuxsll/3.md), [**dnsjit.core.object.linuxsll2**(3)](/dnsjit.core.object.linuxsll2/3.md), [**dnsjit.core.object.ieee802**(3)](/dnsjit.core.object.ieee802/3.md), [**dnsjit.core.object.gre**(3)](/dnsjit.core.object.gre/3.md), [**dnsjit.core.object.ip**(3)](/dnsjit.core.object.ip/3.md), [**dnsjit.core.object.ip6**(3)](/dnsjit.core.object.ip6/3.md), [**dnsjit.core.object.icmp**(3)](/dnsjit.core.object.icmp/3.md), [**dnsjit.core.object.icmp6**(3)](/dnsjit.core.object.icmp6/3.md), [**dnsjit.core.object.udp**(3)](/dnsjit.core.object.udp/3.md), [**dnsjit.core.object.tcp**(3)](/dnsjit.core.object.tcp/3.md), [**dnsjit.core.object.payload**(3)](/dnsjit.core.object.payload/3.md), [**dnsjit.core.object.dns**(3)](/dnsjit.core.object.dns/3.md)

## AUTHORS and CONTRIBUTORS

Jerry Lundström (DNS-OARC), Tomáš Křížek (CZ.NIC), Petr Špaček (ISC)

Maintained by DNS-OARC

*https://www.dns-oarc.net/*

## BUGS

For issues and feature requests please use:

*https://github.com/DNS-OARC/dnsjit/issues*

For question and help please use:

*admin@dns-oarc.net*
