ARP code

2009-09-29 Thread Nattapong Limprungpattanakit

Hello.

 

I have a problem can not run. 

I'm not understand.

Help me please.

 

How to use and detail ?

Thanks.

 

#!/usr/bin/python2.5
import py_net_libs

class dissect:

def __init__(self,pkt,offset):

   self.pkt, self.offset = py_net_libs.arp_dissect(pkt,offset)
   self.next = None

def format(self):

   mac_s, mac_d, ip_src, ip_dst = '','','',''
   for n in (self.pkt[5]): mac_s  = mac_s + '%02x:' % n
   for n in (self.pkt[7]): mac_d  = mac_d + '%02x:' % n
   for n in (self.pkt[6]): ip_src = ip_src + '%d.'   % n
   for n in (self.pkt[8]): ip_dst = ip_dst + '%d.'   % n

   return [ 'HW Type = 0x%02x'   % self.pkt[0],
'Protocol Type = 0x%x'   % self.pkt[1],
'HW Address Lenght = %d' % self.pkt[2],
'Procol Address Length = %d' % self.pkt[3],
'OP code = %x'   % self.pkt[4],
'Sender HW Addr = %s'% mac_s [:-1],
'Sender IP Addr = %s'% ip_src[:-1],
'Target HW Addr = %s'% mac_d [:-1],
'Target IP Addr = %s'% ip_dst[:-1] ]

  
_
แสดงเส้นทาง! เพิ่มแผนที่และทิศทางไปสู่งานปาร์ตี้ของคุณ
http://www.microsoft.com/windows/windowslive/products/events.aspx-- 
http://mail.python.org/mailman/listinfo/python-list


ARP Request/reply in Python

2009-09-23 Thread Nattapong Limprungpattanakit

Hello all.

 

I want check Mac Address Client on network which alive help me please.

 

Thanks. 

_
ด้วย Windows Live คุณสามารถจัดการ แก้ไข และแบ่งปันภาพถ่ายของคุณ
http://www.microsoft.com/thailand/windows/windowslive/products/photo-gallery-edit.aspx-- 
http://mail.python.org/mailman/listinfo/python-list