How to modify route table programmatically on NT 4.0 
Author Message
 How to modify route table programmatically on NT 4.0

From a MSVC++ 5.0 application I need to be able to add and delete
entries into the local route table.  I have been able to do this by
sending a string to a system(pstr) call, but there are some problems
with this:
1. Flashes a black cmd.exe window on the screen while executing
2. Requires the logged on user to have administrative priviledges
3. Can't get the status of the command to know if it succeeded or not

Is there another in-line way of doing this? The only other solution I
can think of is to write an NT Service and have it run at system level.

Thanks for your help!



Sat, 30 Jun 2001 03:00:00 GMT  
 How to modify route table programmatically on NT 4.0
Yes, we do need to support non-SP4 PCs.  Can we use the SNMP extension
agent to modify the route tables?  Remember, our logon user does NOT
have administrative priviledges.

Thanks again!

Quote:

> Nancy,

>  > I need to be able to add and delete
>  > entries into the local route table.

> Easiest way: require NT4SP4 or NT5 and use the new "TCP/IP Helper
> Functions", documented in the MSDN under that title. (Start by looking
> for "GetIpForwardTable".)

> No SP4? Do it the hard way, through the SNMP extension agent -- if I am
> not mistaken, this is what the IP helper functions do, too, for large
> parts of their offerings.

> --

> Cheers,

> Felix.

> If you post a reply, kindly refrain from emailing it, too.

> No anti-spam address here. Just one comment: IN YOUR FACE!



Sat, 30 Jun 2001 03:00:00 GMT  
 How to modify route table programmatically on NT 4.0
Nancy,

 > I need to be able to add and delete
 > entries into the local route table.

Easiest way: require NT4SP4 or NT5 and use the new "TCP/IP Helper
Functions", documented in the MSDN under that title. (Start by looking
for "GetIpForwardTable".)

No SP4? Do it the hard way, through the SNMP extension agent -- if I am
not mistaken, this is what the IP helper functions do, too, for large
parts of their offerings.

--

Cheers,

Felix.

If you post a reply, kindly refrain from emailing it, too.

No anti-spam address here. Just one comment: IN YOUR FACE!



Sun, 01 Jul 2001 03:00:00 GMT  
 How to modify route table programmatically on NT 4.0
Nancy,

 > Can we use the SNMP extension
 > agent to modify the route tables?

I'd have to check the MIBs but I think the route table is read-write.

--

Cheers,

Felix.

If you post a reply, kindly refrain from emailing it, too.

No anti-spam address here. Just one comment: IN YOUR FACE!



Tue, 03 Jul 2001 03:00:00 GMT  
 How to modify route table programmatically on NT 4.0
The solution (finally!):
- To avoid a black screen flashing, use the CreateProcess call to
execute the Route add command.
- To enable Route add commands from a program run by NT users without
admin priviledges, write a NT Service that accepts requests to do the
command.
Quote:

> From a MSVC++ 5.0 application I need to be able to add and delete
> entries into the local route table.  I have been able to do this by
> sending a string to a system(pstr) call, but there are some problems
> with this:
> 1. Flashes a black cmd.exe window on the screen while executing
> 2. Requires the logged on user to have administrative priviledges
> 3. Can't get the status of the command to know if it succeeded or not

> Is there another in-line way of doing this? The only other solution I
> can think of is to write an NT Service and have it run at system level.

> Thanks for your help!



Fri, 13 Jul 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How to modify route table programmatically on NT 4.0

2. Programmatically sizing Command Prompt window in NT 4.0

3. Programmatically sizing Command Prompt window in NT 4.0

4. Implement "route print" programmatically

5. NT 4.0 and VC 4.0 Debug symbols

6. Visual C++ 4.0 ignore breakpoints under NT 4.0

7. VC++ 4.0: Breakpoints don't break on NT 4.0

8. can't get debug to work in nt 4.0 with visual c++ 4.0

9. U1077 MSVC 4.0 Release Build with NT 4.0 Check Build 1381

10. VC++ 4.0 and NT 4.0 WIN32 SDK

11. VC 4.0 and NT 4.0

12. Does VC 4.0 run under NT 4.0?

 

 
Powered by phpBB® Forum Software