dnstap

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 4 Imported by: 3

README

Go version

go-dnstap-protobuf

Dnstap Protocol Buffers encoder and decoder implementation in Golang.

This library is based on the following

Installation

go get -u github.com/dmachard/go-dnstap-protobuf

Usage example

Example to use the Dnstap decoder

var dnstap_wiremessage = []byte{10, 8, 100, 110, 115, 116, 97, 112, 112, 98, 18, 14, 100, 110, 115, 116, 97, 112,
                                112, 98, 32, 48, 46, 48, 46, 48, 114, 90, 8, 5, 16, 1, 24, 1, 34, 4, 10, 0, 0, 210, 42, 4, 10, 0, 0,
                                210, 48, 230, 174, 3, 56, 53, 64, 142, 143, 198, 255, 5, 77, 28, 102, 44, 21, 82, 53, 218, 186, 1, 32,
                                0, 1, 0, 0, 0, 0, 0, 1, 3, 119, 119, 119, 6, 103, 111, 111, 103, 108, 101, 2, 102, 114, 0, 0, 1, 0, 1,
                                0, 0, 41, 16, 0, 0, 0, 0, 0, 0, 12, 0, 10, 0, 8, 230, 56, 227, 142, 1, 222, 120, 120, 1}

dt := &dnstap.Dnstap{}
err := proto.Unmarshal(dnstap_ref, dt)
if err != nil {
    t.Errorf("error to decode dnstap message %s", err)
}

identity := dt.GetIdentity()

Example to use the Dnstap encoder

dt := &dnstap.Dnstap{}

dt.Type = Dnstap_Type.Enum(1)
dt.Version = []byte("dnstappb 0.0.0")
dt.Identity = []byte("dnstappb")

dt.Message = &Message{}
dt.Message.Type = Message_Type.Enum(5)
dt.Message.SocketProtocol = SocketProtocol.Enum(1)
dt.Message.SocketFamily = SocketFamily.Enum(1)
dt.Message.QueryAddress = []byte("\n\x00\x00\xd2")
dt.Message.QueryPort = proto.Uint32(55142)
dt.Message.ResponseAddress = []byte("\n\x00\x00\xd2")
dt.Message.ResponsePort = proto.Uint32(53)
dt.Message.QueryTimeSec = proto.Uint64(1609664398)
dt.Message.QueryTimeNsec = proto.Uint32(355231260)
dt.Message.QueryMessage = []byte("ں\x01 \x00\x01\x00\x00\x00\x00\x00\x01\x03www\x06google\x02fr\x00\x00\x01\x00\x01\x00\x00)\x10\x00\x00\x00\x00\x00\x00\x0c\x00\n\x00\x08\xe68\xe3\x8e\x01\xdex")

wiremessage, err := proto.Marshal(dt)
if err != nil {
    t.Errorf("error to encode dnstap message %s", err)
}

Testing

$ go test -v
=== RUN   TestMarshal
--- PASS: TestMarshal (0.00s)
=== RUN   TestUnmarshal
--- PASS: TestUnmarshal (0.00s)
PASS
ok      github.com/dmachard/go-dnstap-protobuf  0.003s

Benchmark

$ go test -bench=.
goos: linux
goarch: amd64
pkg: github.com/dmachard/go-dnstap-protobuf
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkUnmarshal-4   	 2134670	       552.7 ns/op
BenchmarkMarshal-4     	 1889336	       601.4 ns/op
PASS
ok      github.com/dmachard/go-dnstap-protobuf  4.596s

Development

Download some tools

wget https://raw.githubusercontent.com/dnstap/dnstap.pb/master/dnstap.proto
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go get google.golang.org/protobuf@v1.34.2
go mod edit -go=1.23
go mod tidy

export PROTOC_VER=28.1
export GITHUB_URL=https://github.com/protocolbuffers
wget $GITHUB_URL/protobuf/releases/download/v$PROTOC_VER/protoc-$PROTOC_VER-linux-x86_64.zip
unzip protoc-$PROTOC_VER-linux-x86_64.zip

Edit and past the following line in the dnsmessage.proto

option go_package = "github.com/dmachard/go-dnstap-protobuf;dnstap";

Generate protobuf file

bin/protoc --proto_path=. --go_out=. --go_opt=paths=source_relative --plugin protoc-gen-go=$(go env GOPATH)/bin/protoc-gen-go dnstap.proto

Rename the dnstap.pb.go file to dnstap.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SocketFamily_name = map[int32]string{
		1: "INET",
		2: "INET6",
	}
	SocketFamily_value = map[string]int32{
		"INET":  1,
		"INET6": 2,
	}
)

Enum value maps for SocketFamily.

View Source
var (
	SocketProtocol_name = map[int32]string{
		1: "UDP",
		2: "TCP",
		3: "DOT",
		4: "DOH",
		5: "DNSCryptUDP",
		6: "DNSCryptTCP",
		7: "DOQ",
	}
	SocketProtocol_value = map[string]int32{
		"UDP":         1,
		"TCP":         2,
		"DOT":         3,
		"DOH":         4,
		"DNSCryptUDP": 5,
		"DNSCryptTCP": 6,
		"DOQ":         7,
	}
)

Enum value maps for SocketProtocol.

View Source
var (
	Dnstap_Type_name = map[int32]string{
		1: "MESSAGE",
	}
	Dnstap_Type_value = map[string]int32{
		"MESSAGE": 1,
	}
)

Enum value maps for Dnstap_Type.

View Source
var (
	Policy_Match_name = map[int32]string{
		1: "QNAME",
		2: "CLIENT_IP",
		3: "RESPONSE_IP",
		4: "NS_NAME",
		5: "NS_IP",
	}
	Policy_Match_value = map[string]int32{
		"QNAME":       1,
		"CLIENT_IP":   2,
		"RESPONSE_IP": 3,
		"NS_NAME":     4,
		"NS_IP":       5,
	}
)

Enum value maps for Policy_Match.

View Source
var (
	Policy_Action_name = map[int32]string{
		1: "NXDOMAIN",
		2: "NODATA",
		3: "PASS",
		4: "DROP",
		5: "TRUNCATE",
		6: "LOCAL_DATA",
	}
	Policy_Action_value = map[string]int32{
		"NXDOMAIN":   1,
		"NODATA":     2,
		"PASS":       3,
		"DROP":       4,
		"TRUNCATE":   5,
		"LOCAL_DATA": 6,
	}
)

Enum value maps for Policy_Action.

View Source
var (
	Message_Type_name = map[int32]string{
		1:  "AUTH_QUERY",
		2:  "AUTH_RESPONSE",
		3:  "RESOLVER_QUERY",
		4:  "RESOLVER_RESPONSE",
		5:  "CLIENT_QUERY",
		6:  "CLIENT_RESPONSE",
		7:  "FORWARDER_QUERY",
		8:  "FORWARDER_RESPONSE",
		9:  "STUB_QUERY",
		10: "STUB_RESPONSE",
		11: "TOOL_QUERY",
		12: "TOOL_RESPONSE",
		13: "UPDATE_QUERY",
		14: "UPDATE_RESPONSE",
	}
	Message_Type_value = map[string]int32{
		"AUTH_QUERY":         1,
		"AUTH_RESPONSE":      2,
		"RESOLVER_QUERY":     3,
		"RESOLVER_RESPONSE":  4,
		"CLIENT_QUERY":       5,
		"CLIENT_RESPONSE":    6,
		"FORWARDER_QUERY":    7,
		"FORWARDER_RESPONSE": 8,
		"STUB_QUERY":         9,
		"STUB_RESPONSE":      10,
		"TOOL_QUERY":         11,
		"TOOL_RESPONSE":      12,
		"UPDATE_QUERY":       13,
		"UPDATE_RESPONSE":    14,
	}
)

Enum value maps for Message_Type.

View Source
var File_dnstap_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Dnstap

type Dnstap struct {

	// DNS server identity.
	// If enabled, this is the identity string of the DNS server which generated
	// this message. Typically this would be the same string as returned by an
	// "NSID" (RFC 5001) query.
	Identity []byte `protobuf:"bytes,1,opt,name=identity" json:"identity,omitempty"`
	// DNS server version.
	// If enabled, this is the version string of the DNS server which generated
	// this message. Typically this would be the same string as returned by a
	// "version.bind" query.
	Version []byte `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
	// Extra data for this payload.
	// This field can be used for adding an arbitrary byte-string annotation to
	// the payload. No encoding or interpretation is applied or enforced.
	Extra []byte       `protobuf:"bytes,3,opt,name=extra" json:"extra,omitempty"`
	Type  *Dnstap_Type `protobuf:"varint,15,req,name=type,enum=dnstap.Dnstap_Type" json:"type,omitempty"`
	// One of the following will be filled in.
	Message *Message `protobuf:"bytes,14,opt,name=message" json:"message,omitempty"`
	// contains filtered or unexported fields
}

"Dnstap": this is the top-level dnstap type, which is a "union" type that contains other kinds of dnstap payloads, although currently only one type of dnstap payload is defined. See: https://developers.google.com/protocol-buffers/docs/techniques#union

func (*Dnstap) Descriptor deprecated

func (*Dnstap) Descriptor() ([]byte, []int)

Deprecated: Use Dnstap.ProtoReflect.Descriptor instead.

func (*Dnstap) GetExtra

func (x *Dnstap) GetExtra() []byte

func (*Dnstap) GetIdentity

func (x *Dnstap) GetIdentity() []byte

func (*Dnstap) GetMessage

func (x *Dnstap) GetMessage() *Message

func (*Dnstap) GetType

func (x *Dnstap) GetType() Dnstap_Type

func (*Dnstap) GetVersion

func (x *Dnstap) GetVersion() []byte

func (*Dnstap) ProtoMessage

func (*Dnstap) ProtoMessage()

func (*Dnstap) ProtoReflect

func (x *Dnstap) ProtoReflect() protoreflect.Message

func (*Dnstap) Reset

func (x *Dnstap) Reset()

func (*Dnstap) String

func (x *Dnstap) String() string

type Dnstap_Type

type Dnstap_Type int32

Identifies which field below is filled in.

const (
	Dnstap_MESSAGE Dnstap_Type = 1
)

func (Dnstap_Type) Descriptor

func (Dnstap_Type) Enum

func (x Dnstap_Type) Enum() *Dnstap_Type

func (Dnstap_Type) EnumDescriptor deprecated

func (Dnstap_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Dnstap_Type.Descriptor instead.

func (Dnstap_Type) Number

func (x Dnstap_Type) Number() protoreflect.EnumNumber

func (Dnstap_Type) String

func (x Dnstap_Type) String() string

func (Dnstap_Type) Type

func (*Dnstap_Type) UnmarshalJSON deprecated

func (x *Dnstap_Type) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type Message

type Message struct {

	// One of the Type values described above.
	Type *Message_Type `protobuf:"varint,1,req,name=type,enum=dnstap.Message_Type" json:"type,omitempty"`
	// One of the SocketFamily values described above.
	SocketFamily *SocketFamily `protobuf:"varint,2,opt,name=socket_family,json=socketFamily,enum=dnstap.SocketFamily" json:"socket_family,omitempty"`
	// One of the SocketProtocol values described above.
	SocketProtocol *SocketProtocol `protobuf:"varint,3,opt,name=socket_protocol,json=socketProtocol,enum=dnstap.SocketProtocol" json:"socket_protocol,omitempty"`
	// The network address of the message initiator.
	// For SocketFamily INET, this field is 4 octets (IPv4 address).
	// For SocketFamily INET6, this field is 16 octets (IPv6 address).
	QueryAddress []byte `protobuf:"bytes,4,opt,name=query_address,json=queryAddress" json:"query_address,omitempty"`
	// The network address of the message responder.
	// For SocketFamily INET, this field is 4 octets (IPv4 address).
	// For SocketFamily INET6, this field is 16 octets (IPv6 address).
	ResponseAddress []byte `protobuf:"bytes,5,opt,name=response_address,json=responseAddress" json:"response_address,omitempty"`
	// The transport port of the message initiator.
	// This is a 16-bit UDP or TCP port number, depending on SocketProtocol.
	QueryPort *uint32 `protobuf:"varint,6,opt,name=query_port,json=queryPort" json:"query_port,omitempty"`
	// The transport port of the message responder.
	// This is a 16-bit UDP or TCP port number, depending on SocketProtocol.
	ResponsePort *uint32 `protobuf:"varint,7,opt,name=response_port,json=responsePort" json:"response_port,omitempty"`
	// The time at which the DNS query message was sent or received, depending
	// on whether this is an AUTH_QUERY, RESOLVER_QUERY, or CLIENT_QUERY.
	// This is the number of seconds since the UNIX epoch.
	QueryTimeSec *uint64 `protobuf:"varint,8,opt,name=query_time_sec,json=queryTimeSec" json:"query_time_sec,omitempty"`
	// The time at which the DNS query message was sent or received.
	// This is the seconds fraction, expressed as a count of nanoseconds.
	QueryTimeNsec *uint32 `protobuf:"fixed32,9,opt,name=query_time_nsec,json=queryTimeNsec" json:"query_time_nsec,omitempty"`
	// The initiator's original wire-format DNS query message, verbatim.
	QueryMessage []byte `protobuf:"bytes,10,opt,name=query_message,json=queryMessage" json:"query_message,omitempty"`
	// The "zone" or "bailiwick" pertaining to the DNS query message.
	// This is a wire-format DNS domain name.
	QueryZone []byte `protobuf:"bytes,11,opt,name=query_zone,json=queryZone" json:"query_zone,omitempty"`
	// The time at which the DNS response message was sent or received,
	// depending on whether this is an AUTH_RESPONSE, RESOLVER_RESPONSE, or
	// CLIENT_RESPONSE.
	// This is the number of seconds since the UNIX epoch.
	ResponseTimeSec *uint64 `protobuf:"varint,12,opt,name=response_time_sec,json=responseTimeSec" json:"response_time_sec,omitempty"`
	// The time at which the DNS response message was sent or received.
	// This is the seconds fraction, expressed as a count of nanoseconds.
	ResponseTimeNsec *uint32 `protobuf:"fixed32,13,opt,name=response_time_nsec,json=responseTimeNsec" json:"response_time_nsec,omitempty"`
	// The responder's original wire-format DNS response message, verbatim.
	ResponseMessage []byte `protobuf:"bytes,14,opt,name=response_message,json=responseMessage" json:"response_message,omitempty"`
	// Operator policy applied to the processing of this message, if any.
	Policy *Policy `protobuf:"bytes,15,opt,name=policy" json:"policy,omitempty"`
	// contains filtered or unexported fields
}

Message: a wire-format (RFC 1035 section 4) DNS message and associated metadata. Applications generating "Message" payloads should follow certain requirements based on the MessageType, see below.

func (*Message) Descriptor deprecated

func (*Message) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetPolicy added in v0.2.0

func (x *Message) GetPolicy() *Policy

func (*Message) GetQueryAddress

func (x *Message) GetQueryAddress() []byte

func (*Message) GetQueryMessage

func (x *Message) GetQueryMessage() []byte

func (*Message) GetQueryPort

func (x *Message) GetQueryPort() uint32

func (*Message) GetQueryTimeNsec

func (x *Message) GetQueryTimeNsec() uint32

func (*Message) GetQueryTimeSec

func (x *Message) GetQueryTimeSec() uint64

func (*Message) GetQueryZone

func (x *Message) GetQueryZone() []byte

func (*Message) GetResponseAddress

func (x *Message) GetResponseAddress() []byte

func (*Message) GetResponseMessage

func (x *Message) GetResponseMessage() []byte

func (*Message) GetResponsePort

func (x *Message) GetResponsePort() uint32

func (*Message) GetResponseTimeNsec

func (x *Message) GetResponseTimeNsec() uint32

func (*Message) GetResponseTimeSec

func (x *Message) GetResponseTimeSec() uint64

func (*Message) GetSocketFamily

func (x *Message) GetSocketFamily() SocketFamily

func (*Message) GetSocketProtocol

func (x *Message) GetSocketProtocol() SocketProtocol

func (*Message) GetType

func (x *Message) GetType() Message_Type

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type Message_Type

type Message_Type int32
const (
	// AUTH_QUERY is a DNS query message received from a resolver by an
	// authoritative name server, from the perspective of the authoritative
	// name server.
	Message_AUTH_QUERY Message_Type = 1
	// AUTH_RESPONSE is a DNS response message sent from an authoritative
	// name server to a resolver, from the perspective of the authoritative
	// name server.
	Message_AUTH_RESPONSE Message_Type = 2
	// RESOLVER_QUERY is a DNS query message sent from a resolver to an
	// authoritative name server, from the perspective of the resolver.
	// Resolvers typically clear the RD (recursion desired) bit when
	// sending queries.
	Message_RESOLVER_QUERY Message_Type = 3
	// RESOLVER_RESPONSE is a DNS response message received from an
	// authoritative name server by a resolver, from the perspective of
	// the resolver.
	Message_RESOLVER_RESPONSE Message_Type = 4
	// CLIENT_QUERY is a DNS query message sent from a client to a DNS
	// server which is expected to perform further recursion, from the
	// perspective of the DNS server. The client may be a stub resolver or
	// forwarder or some other type of software which typically sets the RD
	// (recursion desired) bit when querying the DNS server. The DNS server
	// may be a simple forwarding proxy or it may be a full recursive
	// resolver.
	Message_CLIENT_QUERY Message_Type = 5
	// CLIENT_RESPONSE is a DNS response message sent from a DNS server to
	// a client, from the perspective of the DNS server. The DNS server
	// typically sets the RA (recursion available) bit when responding.
	Message_CLIENT_RESPONSE Message_Type = 6
	// FORWARDER_QUERY is a DNS query message sent from a downstream DNS
	// server to an upstream DNS server which is expected to perform
	// further recursion, from the perspective of the downstream DNS
	// server.
	Message_FORWARDER_QUERY Message_Type = 7
	// FORWARDER_RESPONSE is a DNS response message sent from an upstream
	// DNS server performing recursion to a downstream DNS server, from the
	// perspective of the downstream DNS server.
	Message_FORWARDER_RESPONSE Message_Type = 8
	// STUB_QUERY is a DNS query message sent from a stub resolver to a DNS
	// server, from the perspective of the stub resolver.
	Message_STUB_QUERY Message_Type = 9
	// STUB_RESPONSE is a DNS response message sent from a DNS server to a
	// stub resolver, from the perspective of the stub resolver.
	Message_STUB_RESPONSE Message_Type = 10
	// TOOL_QUERY is a DNS query message sent from a DNS software tool to a
	// DNS server, from the perspective of the tool.
	Message_TOOL_QUERY Message_Type = 11
	// TOOL_RESPONSE is a DNS response message received by a DNS software
	// tool from a DNS server, from the perspective of the tool.
	Message_TOOL_RESPONSE Message_Type = 12
	// UPDATE_QUERY is a Dynamic DNS Update request (RFC 2136) received
	// by an authoritative name server, from the perspective of the
	// authoritative name server.
	Message_UPDATE_QUERY Message_Type = 13
	// UPDATE_RESPONSE is a Dynamic DNS Update response (RFC 2136) sent
	// from an authoritative name server, from the perspective of the
	// authoritative name server.
	Message_UPDATE_RESPONSE Message_Type = 14
)

func (Message_Type) Descriptor

func (Message_Type) Enum

func (x Message_Type) Enum() *Message_Type

func (Message_Type) EnumDescriptor deprecated

func (Message_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Message_Type.Descriptor instead.

func (Message_Type) Number

func (Message_Type) String

func (x Message_Type) String() string

func (Message_Type) Type

func (*Message_Type) UnmarshalJSON deprecated

func (x *Message_Type) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type Policy added in v0.2.0

type Policy struct {

	// type: the type of policy applied, e.g. "RPZ" for a
	// policy from a Response Policy Zone.
	Type *string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
	// rule: the rule matched by the message.
	//
	// In a RPZ context, this is the owner name of the rule in
	// the Reponse Policy Zone in wire format.
	Rule []byte `protobuf:"bytes,2,opt,name=rule" json:"rule,omitempty"`
	// action: the policy action taken in response to the
	// rule match.
	Action *Policy_Action `protobuf:"varint,3,opt,name=action,enum=dnstap.Policy_Action" json:"action,omitempty"`
	// match: the feature of the message exchange which matched the rule.
	Match *Policy_Match `protobuf:"varint,4,opt,name=match,enum=dnstap.Policy_Match" json:"match,omitempty"`
	// The matched value. Format depends on the matched feature .
	Value []byte `protobuf:"bytes,5,opt,name=value" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Policy: information about any name server operator policy applied to the processing of a DNS message.

func (*Policy) Descriptor deprecated added in v0.2.0

func (*Policy) Descriptor() ([]byte, []int)

Deprecated: Use Policy.ProtoReflect.Descriptor instead.

func (*Policy) GetAction added in v0.2.0

func (x *Policy) GetAction() Policy_Action

func (*Policy) GetMatch added in v0.2.0

func (x *Policy) GetMatch() Policy_Match

func (*Policy) GetRule added in v0.2.0

func (x *Policy) GetRule() []byte

func (*Policy) GetType added in v0.2.0

func (x *Policy) GetType() string

func (*Policy) GetValue added in v0.2.0

func (x *Policy) GetValue() []byte

func (*Policy) ProtoMessage added in v0.2.0

func (*Policy) ProtoMessage()

func (*Policy) ProtoReflect added in v0.2.0

func (x *Policy) ProtoReflect() protoreflect.Message

func (*Policy) Reset added in v0.2.0

func (x *Policy) Reset()

func (*Policy) String added in v0.2.0

func (x *Policy) String() string

type Policy_Action added in v0.2.0

type Policy_Action int32

The Action taken to implement the Policy.

const (
	Policy_NXDOMAIN   Policy_Action = 1 // Respond with NXDOMAIN
	Policy_NODATA     Policy_Action = 2 // Respond with empty answer section
	Policy_PASS       Policy_Action = 3 // Do not alter the response (passthrough)
	Policy_DROP       Policy_Action = 4 // Do not respond.
	Policy_TRUNCATE   Policy_Action = 5 // Truncate UDP response, forcing TCP retry
	Policy_LOCAL_DATA Policy_Action = 6 // Respond with local data from policy
)

func (Policy_Action) Descriptor added in v0.2.0

func (Policy_Action) Enum added in v0.2.0

func (x Policy_Action) Enum() *Policy_Action

func (Policy_Action) EnumDescriptor deprecated added in v0.2.0

func (Policy_Action) EnumDescriptor() ([]byte, []int)

Deprecated: Use Policy_Action.Descriptor instead.

func (Policy_Action) Number added in v0.2.0

func (Policy_Action) String added in v0.2.0

func (x Policy_Action) String() string

func (Policy_Action) Type added in v0.2.0

func (*Policy_Action) UnmarshalJSON deprecated added in v0.2.0

func (x *Policy_Action) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type Policy_Match added in v0.2.0

type Policy_Match int32

Match: what aspect of the message or message exchange triggered the application of the Policy.

const (
	Policy_QNAME       Policy_Match = 1 // Name in question section of query
	Policy_CLIENT_IP   Policy_Match = 2 // Client IP address
	Policy_RESPONSE_IP Policy_Match = 3 // Address in A/AAAA RRSet
	Policy_NS_NAME     Policy_Match = 4 // Authoritative name server, by name
	Policy_NS_IP       Policy_Match = 5 // Authoritative name server, by IP address
)

func (Policy_Match) Descriptor added in v0.2.0

func (Policy_Match) Enum added in v0.2.0

func (x Policy_Match) Enum() *Policy_Match

func (Policy_Match) EnumDescriptor deprecated added in v0.2.0

func (Policy_Match) EnumDescriptor() ([]byte, []int)

Deprecated: Use Policy_Match.Descriptor instead.

func (Policy_Match) Number added in v0.2.0

func (Policy_Match) String added in v0.2.0

func (x Policy_Match) String() string

func (Policy_Match) Type added in v0.2.0

func (*Policy_Match) UnmarshalJSON deprecated added in v0.2.0

func (x *Policy_Match) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type SocketFamily

type SocketFamily int32

SocketFamily: the network protocol family of a socket. This specifies how to interpret "network address" fields.

const (
	SocketFamily_INET  SocketFamily = 1 // IPv4 (RFC 791)
	SocketFamily_INET6 SocketFamily = 2 // IPv6 (RFC 2460)
)

func (SocketFamily) Descriptor

func (SocketFamily) Enum

func (x SocketFamily) Enum() *SocketFamily

func (SocketFamily) EnumDescriptor deprecated

func (SocketFamily) EnumDescriptor() ([]byte, []int)

Deprecated: Use SocketFamily.Descriptor instead.

func (SocketFamily) Number

func (SocketFamily) String

func (x SocketFamily) String() string

func (SocketFamily) Type

func (*SocketFamily) UnmarshalJSON deprecated

func (x *SocketFamily) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type SocketProtocol

type SocketProtocol int32

SocketProtocol: the protocol used to transport a DNS message.

const (
	SocketProtocol_UDP         SocketProtocol = 1 // DNS over UDP transport (RFC 1035 section 4.2.1)
	SocketProtocol_TCP         SocketProtocol = 2 // DNS over TCP transport (RFC 1035 section 4.2.2)
	SocketProtocol_DOT         SocketProtocol = 3 // DNS over TLS (RFC 7858)
	SocketProtocol_DOH         SocketProtocol = 4 // DNS over HTTPS (RFC 8484)
	SocketProtocol_DNSCryptUDP SocketProtocol = 5 // DNSCrypt over UDP (https://dnscrypt.info/protocol)
	SocketProtocol_DNSCryptTCP SocketProtocol = 6 // DNSCrypt over TCP (https://dnscrypt.info/protocol)
	SocketProtocol_DOQ         SocketProtocol = 7 // DNS over QUIC (RFC 9250)
)

func (SocketProtocol) Descriptor

func (SocketProtocol) Enum

func (x SocketProtocol) Enum() *SocketProtocol

func (SocketProtocol) EnumDescriptor deprecated

func (SocketProtocol) EnumDescriptor() ([]byte, []int)

Deprecated: Use SocketProtocol.Descriptor instead.

func (SocketProtocol) Number

func (SocketProtocol) String

func (x SocketProtocol) String() string

func (SocketProtocol) Type

func (*SocketProtocol) UnmarshalJSON deprecated

func (x *SocketProtocol) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL