metasploit-framework

https://github.com/rapid7/metasploit-framework

Ruby

Metasploit Framework

Net::DNS::Header#initialize

Creates a new Net::DNS::Header object with the desired values,
which can be specified as an Hash argument. When called without
arguments, defaults are used. If a data string is passed, values 
are taken from parsing the string.

Examples:

  # Create a new Net::DNS::Header object
  header = Net::DNS::Header.new

  # Create a new Net::DNS::Header object passing values
  header = Net::DNS::Header.new(:opCode => 1, :rd => 0)

  # Create a new Net::DNS::Header object with binary data
  header = Net::DNS::Header.new(data)

Default values are:

  :id => auto generated
  :qr      => 0 # Query response flag
  :aa      => 0 # Authoritative answer flag
  :tc      => 0 # Truncated packet flag
  :ra      => 0 # Recursiond available flag
  :rCode   => 0 # Response code (status of the query)
  :opCode  => 0 # Operational code (purpose of the query)
  :cd      => 0 # Checking disable flag
  :ad      => 0 # Only relevant in DNSSEC context
  :rd      => 1 # Recursion desired flag
  :qdCount => 1 # Number of questions in the dns packet
  :anCount => 0 # Number of answer RRs in the dns packet
  :nsCount => 0 # Number of authoritative RRs in the dns packet
  :arCount => 0 # Number of additional RRs in the dns packet

See also each option for a detailed explanation of usage.

Source | Google | Stack overflow

Edit

git clone [email protected]:rapid7/metasploit-framework.git

cd metasploit-framework

open lib/net/dns/header.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Net--DNS--Header-initialize-for-pr


# Commit to git

git add lib/net/dns/header.rbgit commit -m "better docs for Net::DNS::Header#initialize"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Net--DNS--Header-initialize-for-pr

hub pull-request


# Celebrate!