Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asking #1

Open
sopheap77 opened this issue Apr 30, 2019 · 9 comments
Open

Asking #1

sopheap77 opened this issue Apr 30, 2019 · 9 comments

Comments

@sopheap77
Copy link

Hello.
I just want to you something regarding to this issue. For my case, I only want to read pcap file. By clicking open pcap file, all packets will be listed in TableWidget. Could you please explain me about this problem?

@PENGZhaoqing
Copy link
Owner

What do you want me to explain? TableWidget is a tool to display(or print) something, and you should first parse the packets with pcap and then convert to string, then you can display them with TableWidget

@sopheap77
Copy link
Author

sopheap77 commented May 1, 2019 via email

@sopheap77
Copy link
Author

sopheap77 commented May 1, 2019 via email

@PENGZhaoqing
Copy link
Owner

PENGZhaoqing commented May 1, 2019

ok, I will give you some hints.

self.filterButton.clicked.connect(self.start_thread) says that the start_thread function will be called after I clicked on filter button

text = str(self.filterText.text()) says that the I will get the input text from filter widget

self.thread = SniffThread(self, self.pkt_buffer) says that I initialize a thread (not started yet)

self.connect(self.thread, SIGNAL("output(PyQt_PyObject)"), self.push_entry) means that, under this thread, if I send something(e.g. l) with signal "output(PyQt_PyObject)" then the function push_entry will handle this l (in my example, push_entry will print this l).

self.thread.render(interface=interface, filter_text=text) says that I will start the thread now (the sniff will start).

Actually, pyqt is not that complicated if you just want to display something without thread, you can refer some tutorial:

https://pythonspot.com/pyqt4/

http://zetcode.com/gui/pyqt4/firstprograms/

But in my case, since a sniff operation is a thread, so I make it become so complicated.

@sopheap77
Copy link
Author

sopheap77 commented May 1, 2019 via email

@PENGZhaoqing
Copy link
Owner

yes, print_summary is callback function that handle the result from sniff function, it convert the packet result into lists

@sopheap77
Copy link
Author

sopheap77 commented May 1, 2019 via email

@sopheap77
Copy link
Author

sopheap77 commented May 7, 2019 via email

@sopheap77
Copy link
Author

sopheap77 commented May 8, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants