MCPcopy Create free account
hub / github.com/rthalley/dnspython / write_header

Method write_header

dns/renderer.py:317–336  ·  view source on GitHub ↗

Write the DNS message header. Writing the DNS message header is done after all sections have been rendered, but before the optional TSIG signature is added.

(self)

Source from the content-addressed store, hash-verified

315 self.output.write(struct.pack("!H", self.counts[ADDITIONAL]))
316
317 def write_header(self):
318 """Write the DNS message header.
319
320 Writing the DNS message header is done after all sections
321 have been rendered, but before the optional TSIG signature
322 is added.
323 """
324
325 with self._temporarily_seek_to(0):
326 self.output.write(
327 struct.pack(
328 "!HHHHHH",
329 self.id,
330 self.flags,
331 self.counts[0],
332 self.counts[1],
333 self.counts[2],
334 self.counts[3],
335 )
336 )
337
338 def get_wire(self):
339 """Return the wire format message."""

Callers 4

to_wireMethod · 0.95
test_basicMethod · 0.95
test_tsigMethod · 0.95
test_multi_tsigMethod · 0.95

Calls 2

_temporarily_seek_toMethod · 0.95
writeMethod · 0.45

Tested by 3

test_basicMethod · 0.76
test_tsigMethod · 0.76
test_multi_tsigMethod · 0.76