lemontree55 / packetgen

Ruby library to easily generate and capture network packets
MIT License
98 stars 13 forks source link

Possible mistake in PacketGen::Header::DNS docs #103

Closed n00b110 closed 5 years ago

n00b110 commented 5 years ago

@sdaubert @picatz I was skimming across the PacketGen::Header::DNS docs, and I came across a possible typo: In the docs, the dns.opcode was set to 0xe which in decimal is equivalent to the number 14. I researched into this and discovered that all opcodes 11-15 are unused. My source is right here , and the screenshot is below:

screen shot 2018-12-17 at 12 53 06 pm

sdaubert commented 5 years ago

These are examples to use DNS attribute.

You can set a number to opcode which is not defined as a mnemonic. But when you set it as a String, you have to use an existing mnemonic.

This is the same for rcode attribute (refused is not 0xa value).

Maybe the doc is not explicit enough...

n00b110 commented 5 years ago

@sdaubert So was the 0xe value set in the docs was just an example, and not an actual query number?

sdaubert commented 5 years ago

@n00b110 an example showing that #opcode may be set as an integer (or as a string as in line below).

But it seems this example is not understandable. I will update it.

n00b110 commented 5 years ago

@sdaubert Thanks!