Click here to Skip to main content
15,888,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Does anyone know if "Null Routing" can be done in C++?
I am using Windows 7 and Visual Studio 2010.


Title changed to better reflect the questiion.
-Emilio-
Posted
Updated 21-Jul-11 21:44pm
v2
Comments
Maximilien 21-Jul-11 11:52am    
what is null routing ?
Member 7766180 21-Jul-11 12:40pm    
See below.

1 solution

Do you mean like writing to /dev/null in Linux? If so Windows has a file called nul in system32.
 
Share this answer
 
Comments
Member 7766180 21-Jul-11 12:40pm    
This is from the command prompt....
route ADD 124.151.99.22 MASK 255.255.255.255 192.168.1.253
I wnat to do it in C++....
This takes a source IP that is coming in and instead of receiving it on your local machine it sends it to a "Black Hole" basically nowhere.
Emilio Garavaglia 22-Jul-11 3:50am    
You are misinterpreting the meaning of "routing".
The line you wrote, literally means:
"send all packets directed to 124.151.99.22 and it alone (MASK 255.255.255.255 means just that) to 192.168.1.253

Is not related to the packets you receive, but to the answers you eventually reply to it. IP routing is destination directed (not source!).
The fact it is a black hole or not, then, depends on what 192.168.1.253 actually is into your network.
lewax00 21-Jul-11 13:04pm    
You could edit the hosts file ( system32\drivers\etc\hosts ) to the same effect I believe. And if that's from the Windows command line just do system("route ADD 124.151.99.22 MASK 255.255.255.255 192.168.1.253");
Member 7766180 21-Jul-11 18:35pm    
It's doing something. It says "Route Addition Failed. Object Already Exists." What can this possibly mean? Is it really send the IP address off to oblivion?
lewax00 21-Jul-11 18:37pm    
It means it's already been added I suspect, you probably only need to do it once unless you remove it again afterwards. If your command line example works then you should be fine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900