Jump to content
Sign in to follow this  
DavidKarner

Sending UDP from bound receiving port

Recommended Posts

DavidKarner

I have searched the forums and there are several discussions on this and I from what I gather AutoIt does not seem to allow one to send UDP packets from the same port it is listening on. I.E. I want to listen on port 4011 for incoming UDP packets and respond to them from port 4011.

My question is does anyone know of a DLL call I can make from within AutoIt to allow me to specify the source port for the UDP packet?

Scenario:

I PXE boot Windows Vista WinPE. When BOOTMGR.EXE is TFTP'd down it calls back to the TFTP server on port 4011 looking for an DHCP ACK to confirm which TFTP server it should pull the BCD from. After 16 seconds (8 tries, 2 seconds a piece) it will time out and proceeding with pulling the BCD file from the TFTP server. Normally WDS or RIS has this Proxy DHCP service running on port 4011, but I am using TFTPD32.EXE.

I am trying to write a Proxy DHCP server for PXE booting Windows Vista WinPE using AutoIt to answer back so that it immediately starts loading the BCD instead of waiting for the 16 second time out.

I know that the AutoIt UDP functions will use a dynamic source port and that no one should care where the packets come from. However, BOOTMGR.EXE does seem to care. The only differences I have between a working ACK and the failing ACK from AutoIt is the source port.

Thanks

Share this post


Link to post
Share on other sites
martin

I have searched the forums and there are several discussions on this and I from what I gather AutoIt does not seem to allow one to send UDP packets from the same port it is listening on. I.E. I want to listen on port 4011 for incoming UDP packets and respond to them from port 4011.

My question is does anyone know of a DLL call I can make from within AutoIt to allow me to specify the source port for the UDP packet?

Scenario:

I PXE boot Windows Vista WinPE. When BOOTMGR.EXE is TFTP'd down it calls back to the TFTP server on port 4011 looking for an DHCP ACK to confirm which TFTP server it should pull the BCD from. After 16 seconds (8 tries, 2 seconds a piece) it will time out and proceeding with pulling the BCD file from the TFTP server. Normally WDS or RIS has this Proxy DHCP service running on port 4011, but I am using TFTPD32.EXE.

I am trying to write a Proxy DHCP server for PXE booting Windows Vista WinPE using AutoIt to answer back so that it immediately starts loading the BCD instead of waiting for the 16 second time out.

I know that the AutoIt UDP functions will use a dynamic source port and that no one should care where the packets come from. However, BOOTMGR.EXE does seem to care. The only differences I have between a working ACK and the failing ACK from AutoIt is the source port.

Thanks

The next release of AutoIt will enable you to see the IP and the port used by the sender when you recieve a UDP packet. With the current release (3.3.0.0) you can't tell the IP or the port number although you could see the IP with earlier versions. However, as far as I understand it, you still won't be able to specify the port used when you send a UDP packet. Maybe you have already read this.

I think you would need a dll to do what you want. In some other languages it would not be so difficult IMO.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
DavidKarner

The next release of AutoIt will enable you to see the IP and the port used by the sender when you recieve a UDP packet. With the current release (3.3.0.0) you can't tell the IP or the port number although you could see the IP with earlier versions. However, as far as I understand it, you still won't be able to specify the port used when you send a UDP packet. Maybe you have already read this.

I think you would need a dll to do what you want. In some other languages it would not be so difficult IMO.

I did see that thread. I am not sure what dll/call in windows I could leverage.

I do have a functional python script which works.

I just prefer using AutoIt as it is easy to read, compile, and everyone in my work environment is very familar with updating AutoIt scripts.

Share this post


Link to post
Share on other sites
martin

I did see that thread. I am not sure what dll/call in windows I could leverage.

I do have a functional python script which works.

I just prefer using AutoIt as it is easy to read, compile, and everyone in my work environment is very familar with updating AutoIt scripts.

Maye you will find something. I don't know of anything and my only solution would be to write a dll.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.