susu6514 Posted October 14, 2010 Posted October 14, 2010 (edited) Hi I'm doing some test and want to mimicry a DNS behavior but I find I can't use a specific port when sending UDP packet. The behavior is like this. PCA sends DNS query to PCB (UDP port 1234 to 53) PCB sends back DNS reply to PCA (UDP port 53 to 1234) Is there a way to do this? Thank you. Edited October 14, 2010 by susu6514
PsaltyDS Posted October 14, 2010 Posted October 14, 2010 UDPOpen(), UDPSend() Dog ate your help file? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
martin Posted October 14, 2010 Posted October 14, 2010 UDPOpen(), UDPSend()Dog ate your help file?Or maybe the dog is writing the program for you using an old version of AutoIt? 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.
PsaltyDS Posted October 14, 2010 Posted October 14, 2010 Oh, wow. Is that "UDP port 1234 to 53" really old AutoIt syntax? I wouldn't know, 'cause I'm so much YOUNGER than martin! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
martin Posted October 14, 2010 Posted October 14, 2010 I wouldn't know, 'cause I'm so much YOUNGER than martin! Yes, .. most people are . But I've still good a good memory.And the other thing is, I've still got a good memory. 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.
Richard Robertson Posted October 14, 2010 Posted October 14, 2010 What you are trying to do won't work using AutoIt's build in UDP commands. They only let you specify the destination port and not the source port on your outgoing data. You'll have to make some DllCalls to do this.
martin Posted October 14, 2010 Posted October 14, 2010 In my earlier post I think I was thinking of this. So maybe you could arrange things like this.Send a udp message from the PC to the PCA port 1234. (I don't know what PCA means!) Then the program on PCA could work out what port was used on the PC and use that port instead of 53. 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.
Richard Robertson Posted October 14, 2010 Posted October 14, 2010 (edited) Martin, that's PC (personal computer) 'A' and PC 'B'. At least that was my understanding. Also, setting the UDP source port is doable. Just not in pure AutoIt. Edited October 14, 2010 by Richard Robertson
susu6514 Posted October 15, 2010 Author Posted October 15, 2010 (edited) Thank you, Martin. Maybe I should use WinPcap instead. Edited October 15, 2010 by susu6514
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now