Hi Anil,

 I'm also new to python and pox field, but will try to help you.

 Well, I think it would be better if you look at the packet class code and
check what it does, but it seems that it searches for a 'dns' string inside
the packet received and if find such a string it just "handle" the packet
(you will have to check what 'handle' does). Otherwise it just print "Not a
DNS packet".

  Maybe the code "packet.find('dns') is a way to check if it is a DNS
packet or not.

  As I told you, I think it would be better if you look at the 'packet'
class.

  Hope that was useful.

2014-09-18 6:03 GMT-03:00 Anil Kumar K K <aniluvc...@gmail.com>:

> Hi Folks,
>
> I have been struggling to write a program to dump all the questions and
> answers fields of DNS Query and response packets in POX controller. I am
> new to python. I have gone through the dns.py library, but did not find any
> API to get questions and answers.
>
> Could you please help me with the code ?
>
> Here is the code that I tried to find the DNS packet:
> dns = packet.find('dns')
>  84             if dns is None:
>  85                 print "Not a DNS packet"
>  86             else:
>  87                 print "DNS Packet"
>  88                 #self.handle_dns_packet(event)
>
>
> Thanks
> Anil
>



-- 
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br

Reply via email to