forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Magic Packet. WOL

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Wed Dec 10, 2008 1:47 pm    Post subject: Magic Packet. WOL Reply with quote

Does anyone know how to format a magic packet and send it with the Internet Suite?

Thanks
Back to top
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sun Dec 14, 2008 2:25 pm    Post subject: Reply with quote

I could never figure out how to do this with VDS and any of the extentions so, I've always used "WolCmd" for this.

http://www.depicus.com/wake-on-lan
Back to top
View user's profile Send private message Send e-mail
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Mon Dec 15, 2008 2:22 pm    Post subject: Reply with quote

It seams simple enuff. But converting the mac and ip into the right format in the packet seams to be my problem.

Thanks for the site, the command line utility would work for me and may be where I go with it. The protocal package and vds should be able to handle this. As least I think it should?

quote from http://www.jibble.org/wake-on-lan/
Quote:

A Wake-on-LAN packet is an ordinary UDP packet which contains the MAC address of the target computer. For reasons unknown to me, the UDP packet must be 16 times larger than the byte representation of the MAC address, plus an extra 6 bytes for a header. A MAC address is usually specified as a string of hexadecimal digits, for example 00:0D:61:08:22:4A, so can be represented using just 6 bytes. This makes the total packet size 6 + 16*6 = 102 bytes.

The first 6 bytes of the packet are filled with 0xff. I'm not sure why!
The next 6 bytes are the MAC address of the target computer
Each subsequent set of 6 bytes is also filled with the MAC address of the target computer, until the packet is full.
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Dec 15, 2008 2:58 pm    Post subject: Reply with quote

I once made a program for sending Wake On LAN packets in VDS using an extension, I can't remember which one. It's on another computer I don't have access to right now but I'll try to remember to post the source on here when I can.
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Dec 15, 2008 4:21 pm    Post subject: Reply with quote

I have not tested this but I beleive it to work. If not let me know and I will do some testing.

Code:

#---------------------------------------------------------------------------------------#
#                                                                                       #
# Description: WOL example using vdsipp.dll                                             #
#                                                                                       #
# Copyright: Copyright © 2008 DragonSphere Software All Rights Reserved.                #
#                                                                                       #
#---------------------------------------------------------------------------------------#
Title VDS WOL
#define command,internet
#define function,internet
option decimalsep,.
external vdsipp.dll,DEMO

# Build WOL packet
# The Mac ADDR below is made up so you will need to change it
# %%Macaddr = 00:0D:61:08:22:4A
%%Macaddr = ^NULL^@chr($0D)@chr($61)@chr($08)@chr($22)@chr($4A)
# The packet starts with either 6 @chr(255) or @chr($FF)
# or
# 12 @chr(255)'s depending on who you believe... AMD, LinkSys uses the 12 @chr(255)'s
%p = @chr(255)@chr(255)@chr(255)@chr(255)@chr(255)@chr(255)@chr(255)@chr(255)@chr(255)@chr(255)@chr(255)@chr(255)

%c = 0
%%cnt = 16
Repeat
  %p = %p%%Macaddr
   %c = @succ(%c)
Until @Equal(%c,%%cnt)
# WOL packet has been built
#
# Setup the connection
INTERNET REPLACENULL,ON
INTERNET UDP,CREATE,1
INTERNET UDP,THREADS,1,OFF
# Use the broadcast IP address for the target subnet on port 9
INTERNET UDP,SERVER,1,192.168.0.255,9
# Send the WOL packet
INTERNET UDP,SEND,1,%p
# Get the response.
%A = @Internet(UDP,MESSAGE,1)
Info WOL replied: %A
# disconnect and now your remote PC should be booting.
INTERNET UDP,DESTROY,1
Exit

_________________
Home of

Give VDS a new purpose!


Last edited by vdsalchemist on Tue Dec 16, 2008 1:42 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Mon Dec 15, 2008 6:51 pm    Post subject: Reply with quote

Cool.

I'll give a try when I get a chance. Thanks!!

btw what is @chr($0D) or anything with the $ in it. I havent used that before?
Back to top
View user's profile Send private message
JerryDee
Contributor
Contributor


Joined: 19 Oct 2005
Posts: 53
Location: Czech Republic

PostPosted: Mon Dec 15, 2008 11:21 pm    Post subject: Reply with quote

Hi briguy,

a character $ is used as a label for hexadecimal number
where
01,02,03,...,08, 09 are as decimal numbers 1 - 9
0A = 10
0B - 11
.
.
0F = 15
10 = 16
11 = 17
.
.
1F = 31
20 = 32
.
.
and so one Smile

well, e.g. @chr($0D) is the same as @chr(13)

_________________
Jerry
(VDS 4,5,6 Pro | V-Setup 3)
Back to top
View user's profile Send private message Send e-mail
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Tue Dec 16, 2008 1:32 am    Post subject: Reply with quote

I had to make an update to the code above. It seems that the documentation that I wrote that from was short 6 bytes for the packet. Also I might note that there are two different drafts for WOL so if the extra 6 byte do not work put it then drop the frist 6 @chr(255)'s at the begining of the %p variable and try again.
_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Tue Dec 16, 2008 2:57 pm    Post subject: Reply with quote

dragonsphere,

Thank you so much for the code.

Unfortunately its not working with or without the dropped @chr(255) or the @chr($FF) with 6 or 12. I did download and tried a command line WOL exe that was provided in Aslan responce.

The WOLCMD.exe that I tried did start a machine that I have on the network useing same port mac ip etc.

I would prefer doing WOL in VDS vs command line. Any Ideas?

Also a question:
Where 00: in the macaddr this is represented by the ^NULL^ correct?


Code:

# %%Macaddr = 00:0D:61:08:22:4A
#%%Macaddr = ^NULL^@chr($04)@chr($E4)@chr($F1)@chr($18)@chr($81)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group