]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/dnsdistdist/docs/reference/protobuf.rst
Merge pull request #8681 from rgacogne/auth-stats-rings-size
[thirdparty/pdns.git] / pdns / dnsdistdist / docs / reference / protobuf.rst
1 Protobuf Logging Reference
2 ==========================
3
4 .. function:: newRemoteLogger(address [, timeout=2[, maxQueuedEntries=100[, reconnectWaitTime=1]]])
5
6 Create a Remote Logger object, to use with :func:`RemoteLogAction` and :func:`RemoteLogResponseAction`.
7
8 :param string address: An IP:PORT combination where the logger is listening
9 :param int timeout: TCP connect timeout in seconds
10 :param int maxQueuedEntries: Queue this many messages before dropping new ones (e.g. when the remote listener closes the connection)
11 :param int reconnectWaitTime: Time in seconds between reconnection attempts
12
13 .. class:: DNSDistProtoBufMessage
14
15 This object represents a single protobuf message as emitted by :program:`dnsdist`.
16
17 .. method:: DNSDistProtoBufMessage:addResponseRR(name, type, class, ttl, blob)
18
19 .. versionadded:: 1.2.0
20
21 Add a response RR to the protobuf message.
22
23 :param string name: The RR name.
24 :param int type: The RR type.
25 :param int class: The RR class.
26 :param int ttl: The RR TTL.
27 :param string blob: The RR binary content.
28
29 .. method:: DNSDistProtoBufMessage:setBytes(bytes)
30
31 Set the size of the query
32
33 :param int bytes: Number of bytes in the query.
34
35 .. method:: DNSDistProtoBufMessage:setEDNSSubnet(netmask)
36
37 Set the EDNS Subnet to ``netmask``.
38
39 :param string netmask: The netmask to set to.
40
41 .. method:: DNSDistProtoBufMessage:setQueryTime(sec, usec)
42
43 In a response message, set the time at which the query has been received.
44
45 :param int sec: Unix timestamp when the query was received.
46 :param int usec: The microsecond the query was received.
47
48 .. method:: DNSDistProtoBufMessage:setQuestion(name, qtype, qclass)
49
50 Set the question in the protobuf message.
51
52 :param DNSName name: The qname of the question
53 :param int qtype: The qtype of the question
54 :param int qclass: The qclass of the question
55
56 .. method:: DNSDistProtoBufMessage:setProtobufResponseType(sec, usec)
57
58 .. versionadded:: 1.2.0
59
60 Change the protobuf response type from a query to a response, and optionally set the query time.
61
62 :param int sec: Optional query time in seconds.
63 :param int usec: Optional query time in additional micro-seconds.
64
65 .. method:: DNSDistProtoBufMessage:setRequestor(address [, port])
66
67 .. versionchanged:: 1.5.0
68 ``port`` optional parameter added.
69
70 Set the requestor's address.
71
72 :param ComboAddress address: The address to set to
73 :param int port: The requestor source port
74
75 .. method:: DNSDistProtoBufMessage:setRequestorFromString(address [, port])
76
77 .. versionchanged:: 1.5.0
78 ``port`` optional parameter added.
79
80 Set the requestor's address from a string.
81
82 :param string address: The address to set to
83 :param int port: The requestor source port
84
85 .. method:: DNSDistProtoBufMessage:setResponder(address [, port])
86
87 .. versionchanged:: 1.5.0
88 ``port`` optional parameter added.
89
90 Set the responder's address.
91
92 :param ComboAddress address: The address to set to
93 :param int port: The responder port
94
95 .. method:: DNSDistProtoBufMessage:setResponderFromString(address [, port])
96
97 .. versionchanged:: 1.5.0
98 ``port`` optional parameter added.
99
100 Set the responder's address.
101
102 :param string address: The address to set to
103 :param int port: The responder port
104
105 .. method:: DNSDistProtoBufMessage:setResponseCode(rcode)
106
107 Set the response code of the query.
108
109 :param int rcode: The response code of the answer
110
111 .. method:: DNSDistProtoBufMessage:setServerIdentity(id)
112
113 .. versionadded:: 1.3.3
114
115 Set the server identify field.
116
117 :param string id: The server ID
118
119 .. method:: DNSDistProtoBufMessage:setTag(value)
120
121 .. versionadded:: 1.2.0
122
123 Add a tag to the list of tags.
124
125 :param string value: The tag value
126
127 .. method:: DNSDistProtoBufMessage:setTagArray(valueList)
128
129 .. versionadded:: 1.2.0
130
131 Add a list of tags.
132
133 :param table tags: A list of tags as strings
134
135 .. method:: DNSDistProtoBufMessage:setTime(sec, usec)
136
137 Set the time at which the query or response has been received.
138
139 :param int sec: Unix timestamp when the query was received.
140 :param int usec: The microsecond the query was received.
141
142 .. method:: DNSDistProtoBufMessage:toDebugString() -> string
143
144 Return an string containing the content of the message