예제 #1
0
 def handle_frame(self, pktItem, header, frame):
     """
     assume that no error occur in the header section
     """
     local_tv_sec = header.ts.tv_sec
     ltime = time.localtime(local_tv_sec);
     pktItem.time = time.strftime("%H:%M:%S", ltime) # time
     
     pktItem.len = header.len    # length
     
     pktItem.protocol = 'Ethernet'   # protocol
     pktItem.src_mac = NetFormat.ntoa_mac(frame.src)  # src_mac
     pktItem.dst_mac = NetFormat.ntoa_mac(frame.dst)  # dst_mac
     
     self.statistics.total += 1