You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					20 lines
				
				448 B
			
		
		
			
		
	
	
					20 lines
				
				448 B
			| 
								 
											6 years ago
										 
									 | 
							
								#!/usr/bin/env python3
							 | 
						||
| 
								 | 
							
								import zmq
							 | 
						||
| 
								 | 
							
								import cereal.messaging as messaging
							 | 
						||
| 
								 | 
							
								from cereal.services import service_list
							 | 
						||
| 
								 | 
							
								import pcap
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								def main(gctx=None):
							 | 
						||
| 
								 | 
							
								  ethernetData = messaging.pub_sock('ethernetData')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  for ts, pkt in pcap.pcap('eth0'):
							 | 
						||
| 
								 | 
							
								    dat = messaging.new_message()
							 | 
						||
| 
								 | 
							
								    dat.init('ethernetData', 1)
							 | 
						||
| 
								 | 
							
								    dat.ethernetData[0].ts = ts
							 | 
						||
| 
								 | 
							
								    dat.ethernetData[0].pkt = str(pkt)
							 | 
						||
| 
								 | 
							
								    ethernetData.send(dat.to_bytes())
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if __name__ == "__main__":
							 | 
						||
| 
								 | 
							
								  main()
							 | 
						||
| 
								 | 
							
								
							 |