3 # Should I use brackets in this language?
4 # Well, considering that all whitespace is ignored, it might be an idea
6 # Well, it would make VVV a little simpler
7 # Just define a funciton with the name 'Sys.IO.Open'
8 # Not a namespace Sys, with a child Sys
10 $fp = Sys.IO.Open( "/Devices/ipstack" );
11 $ifname = Sys.IO.IOCtl( $fp, 4, "/Devices/ne2k/0" );
15 # b - Signed 8-bit integer, B - unsigned
21 # Fields can be prefixed by a size for arrays (taking only one argument)
22 # * indicates a variable size array
24 # Sys.Mem.MakeStruct( "L*B", $len, $len, $str );
25 # Hmm.. that would mean I will need arrays... fuck it, do them later
28 function SetIPv4($ifaceName, $addr)
30 $fp = Sys.IO.Open( "/Devices/ipstack/$ifaceName" );
31 $data = Lang.MakeStruct( "l", 4 );
32 Sys.IO.IOCtl( $fp, 4, $data );
33 $data = Lang.Struct( "BBBB", $addr[0], $addr[1], $addr[2], $addr[3] );
34 Sys.IO.IOCtl( $fp, 6, $data );
38 SetIPv4( $ifname, Lang.Array(10, 0, 2, 55) );
42 return 42; // Script return value