Read incoming packets

Reply

Join Date: Jan 2008
Posts: 54
Reputation: Thew is an unknown quantity at this point 
Solved Threads: 0
Thew's Avatar
Thew Thew is offline Offline
Junior Poster in Training

Read incoming packets

 
0
  #1
Oct 14th, 2008
Hello,
I need help in my project, where I want to catch, read and forward some packets given to another application. Example: some packets is incoming for application MyApp on port 888. The another application is running on background and listening for communication with MyApp. If the server sends packet I need to catch it before it comes to MyApp and if data inside will include some special code, like "....server_echo" I need to destroy it. But if there isn't any special code, I need to forward it to MyApp.
It looks like a firewall application.
Thank you
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 6,605
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 854
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Read incoming packets

 
0
  #2
Oct 14th, 2008
Set your app to listen to 127.0.0.1:888
Your filter then connects to 127.0.0.1:888 and itself listens on port 888 of the machine itself.
Your filter now sees all the traffic on that port, and can forward/modify/drop as necessary.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
--
If your code lacks code tags, you will be IGNORED
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum


Views: 467 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC