Tftp Multiple Instances
#1
Posted 31 January 2009 - 04:40 AM
#2
Posted 31 January 2009 - 04:56 AM
// Detect an already running Tftpd32 myMutEx = CreateMutex (NULL, TRUE, TFTPD32_MUTEX); if ( strstr (lpszCmdLine, "-kill") != NULL || (myMutEx!=NULL && GetLastError()==ERROR_ALREADY_EXISTS) ) { ReturnToPreviousInstance (myMutEx, lpszCmdLine); return 0; }
I'm however not sure the ramifications of removing this.
Update: A quick look through the .sln file revels
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
#3
Posted 31 January 2009 - 05:52 AM
For those of you in the future that want to compile this, you need to check those because they're all set to d:\tftpd32\....
And I did try commenting out the code and got:
Error 10048 Only one usage of each socket address (protocol/network address/port) is normally permitted. Tftpd32 can not bind the DHCP port an application is already listening on this port.
Any ideas on a work around?
#4
Posted 31 January 2009 - 01:39 PM
To actually change the code, perhaps it wouldn't be bad idea to contact the author for his opinion about this matter.
#5
Posted 01 February 2009 - 10:42 PM
I'd like to make a distributable ghosting application which can use multiple/single NIC(s) and alias multiple IPs out for each NIC (so that multiple ghosting sessions can occur concurrently with the same session name).
I'll be using the following applications:
- Symantec Ghost Server
- Tftpd32's DHCP and TFTP services
I need (would like) the unique DHCP server(s) so that I can know the range of IPs given the boxes so that I can perform post ghost operations on them remotely. I also do not have the option of installing software on the machines (ie Ghost Explorer which would be awesome).
If anyone has any other ideas outside of mine, I would also love to hear them.
Contacting the author may also not be a bad idea, but from reading other posts on this forum it seems like he does not have much to do with this project any more. Is this true?
#6
Posted 03 February 2009 - 10:05 AM
TFTPd32 do not support, for the moment, DHCP relay-agent :
- DHCP multiple range configuration with DHCP Agent Relay
http://www.tech-faq....lay-agent.shtml
See this post for feature request http://www.boot-land...?...&hl=feature
#7
Posted 08 April 2009 - 11:33 PM
You have to specify interface IP address for each TFTPD32 instance you run. There's an option in a settings window. If it is not ticked TFTPD32 will listen and respond to all interfaces.
Can you please clarify what is "the same session name"? I do a lot of imaging with DOS ghost over the LAN (through regular Windows file share). Haven't used ghost server though.
Regards,
Andrius
#8
Posted 15 April 2009 - 01:42 AM
thanks
Justin
#9
Posted 15 April 2009 - 01:37 PM
You can actually cheat instances detection code. As long as you run tftpd32.exe in a different user context (must be user without administrative rights) it will not be able to find another running instance.
There are at least two ways of launching tftpd32.exe under a different credentials - Task Sheduler or RunAs.
I've just tried RunAs way and it seems to work very well. Here's what you have to do:
1. create two new windows user accounts ie. tftpduser1 and tftpduser2. Make sure they are not in Administrators group.
2. Make 2 copies of tftpd32 folder tftpd32_1 and tftpd32_2 and make sure file system permissions are set to Full Access to Everyone on both folders (for sake of simplicity).
3. Run each copy of tftpd32 and configure for different subnets. Make sure to tick boxes to bind to correct IP address.
4. Close tftpd32 if you haven't done that yet.
5. Now's the fun part. Run tftpd32.exe from the first folder by right clicking exe file and chosing RunAs and type in logon details for the first user. This should start your first tftpd32 instance.
6. In the same maner start the second copy of tftpd32 just make sure to use second user login details.
If you've done everything correctly you should be able to see pretty much the same picture as my screen shot.
Running even more than two instances shouldn't be a problem as long as they all run under different credentials and can not see each other. If you want unattended way of starting tftpd32 you can try using task scheduler or use runas command in a bat file.
This trick works not just for tftpd32 but for any other program prohibiting multiple instances.
Hope this helps and good luck.
regards,
Andrius
#10
Posted 15 April 2009 - 06:02 PM
#11
Posted 15 April 2009 - 09:57 PM
Very cool solution!!This trick works not just for tftpd32 but for any other program prohibiting multiple instances.
#12
Posted 17 April 2009 - 07:58 PM
This detection is necessary since Tftpd32 uses unique resources (mainly udp ports) and to keep the "all in one" spirit.
If you need this feature (and if you know what's you're doing), you can edit the exe file (i use notepad++) and search for
- <Tftpd32> by Ph. Jounin MutEx
- Tftpd32.ini
Change both Tftpd32 occurrences with, for instance, Tftpd33 save the file as tftpd33.exe. Now create an empty Tftpd33.ini file and you are at home (but don't complain if Tftpd32/Tftpd33 can't bind ports ;-)
I proceeded this way to test Tftpd32 and separate the TFTP client and the TFTP server (Remember that Tftpd32 is 11 years old and virtualization was not that common).
#13
Posted 08 June 2009 - 07:04 PM
If this is to use TFTPd32 for it DHCP feature, the best way is to have a windows server 2003/2008 and use it's own DHCP server. And only use TFTPd32 for TFTP protocol.
TFTPd32 do not support, for the moment, DHCP relay-agent :
- DHCP multiple range configuration with DHCP Agent Relay
http://www.tech-faq....lay-agent.shtml
See this post for feature request http://www.boot-land...?...&hl=feature
However now that I see the developer responded. I did edit the .exe and as you stated and was seeing binding errors (i'm not complaining ) Is it possible to bind to random ports within in a range so that these errors are not seen? Or are these ports required to be a certain number for a DHCP server?
Finally got it built, why would you hard code in the directory path to your include and lib files?
For those of you in the future that want to compile this, you need to check those because they're all set to d:\tftpd32\....
And I did try commenting out the code and got:Error 10048 Only one usage of each socket address (protocol/network address/port) is normally permitted. Tftpd32 can not bind the DHCP port an application is already listening on this port.
Any ideas on a work around?
The above quote states that I was able to get multiple instances but was receiving those errors when starting them up.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users