@Tank
Great!
... in my opinion, I think it will be a long time, before IPV6 is like some major and only thing going on... However, it is said by some of the top ISP's who offer IPV6, including the major #1 and #2, ... they have data showing IPV4 assignments are due to run out very soon. Like in 2 or 3 years. It may be longer due to the recession, but no doubt, in coming years IPV6 will be more popular. I think IPV6 is pretty much being used internally, and like I said, projects are out there for IPV6 GURUs. Since enterprises want to be on the cutting edge, they are fine tuning, and hooking up the infrastructure now as we speak.
So in a nutshell, I think it is worth spending some time, and maybe $50 bucks to get a little environment set up. I just ordered mine, and trying to get some proof of concepts together, so I can pass my college class
But that is neither here nor there... the whole IPv6 game is pretty complex, and I am still learning new stuff.. from people are I bow down to and praise, like ISNULL and even my teacher who inspires me to keep pushing forward.
Have a great week! hope to hear some positive developments. I am going to be raising my hands as a TESTER here, so hopefully the struct below, ... @ can take it one step further and we can make a simple "hello world" IPV6 TCP/IP communications script.
That would be cool...
My Best Wishes -- Sarah.
@@@@@@@@@@@@@@@@
some backlog on this
////
I tried to convert the ConnectToAddress(IPAddress, Port) to allow IPv6 adr. My problem is, I have to create a ipv6 adrsocket-struct.
Code:
/**************************************************************
connect to a IPv6
***************************************************************
*/
ConnectToAddress(IPAddress, Port){
VarSetCapacity(wsaData, 32) ; The struct is only about 14 in size, so 32 is conservative.
;ipv6 requires wsock 2.2
WSOCK_20 := 0x0002 ;wsock 2.0
WSOCK_22 := 0x0202 ;wsock 2.2
result := DllCall("Ws2_32\WSAStartup", "UShort", 0x0202, "UInt", &wsaData) ; Request Winsock 2.0 (0x0202)
; Since WSAStartup() will likely be the first Winsock function called by this script,
; check ErrorLevel to see if the OS has Winsock 2.2 available:
if (ErrorLevel){
MsgBox WSAStartup() could not be called due to error %ErrorLevel%. Winsock 2.0 or higher is required.
return -1
}
if (result){ ; Non-zero, which means it failed (most Winsock functions return 0 upon success).
MsgBox % "WSAStartup() indicated Winsock error " . DllCall("Ws2_32\WSAGetLastError")
return -1
}
AF_INET := 2 ;for IPv4
AF_INET6 := 23 ;for IPv6
SOCK_STREAM := 1
IPPROTO_TCP := 6
socket := DllCall("Ws2_32\socket", "Int", AF_INET6, "Int", SOCK_STREAM, "Int", IPPROTO_TCP)
if socket = -1
{
MsgBox % "socket() indicated Winsock error " . DllCall("Ws2_32\WSAGetLastError")
return -1
}
;...until here it works, but now I need the sockaddr_in6 Data-struct.
/* struct def postet by Lexicos
typedef struct sockaddr_in6 {
ADDRESS_FAMILY sin6_family; // AF_INET6.
USHORT sin6_port; // Transport level port number.
ULONG sin6_flowinfo; // IPv6 flow information.
IN6_ADDR sin6_addr; // IPv6 address.
union {
ULONG sin6_scope_id; // Set of interfaces for a scope.
SCOPE_ID sin6_scope_struct;
};
} SOCKADDR_IN6_LH, *PSOCKADDR_IN6_LH, FAR *LPSOCKADDR_IN6_LH;
typedef struct in6_addr {
union {
UCHAR Byte[16];
USHORT Word[8];
} u;
} IN6_ADDR, *PIN6_ADDR, FAR *LPIN6_ADDR;
*/
/* THIS IS IPv4 sockadr Struct
; Prepare for connection:
SizeOfSocketAddress = 16
VarSetCapacity(SocketAddress, SizeOfSocketAddress)
InsertInteger(2, SocketAddress, 0, AF_INET) ; sin_family
InsertInteger(DllCall("Ws2_32\htons", "UShort", Port), SocketAddress, 2, 2) ; sin_port
InsertInteger(DllCall("Ws2_32\inet_addr", "Str", IPAddress), SocketAddress, 4, 4) ; sin_addr.s_addr
*/
; Attempt connection:
if DllCall("Ws2_32\connect", "UInt", socket, "UInt", &SocketAddress, "Int", SizeOfSocketAddress)
{
MsgBox % "connect() indicated Winsock error " . DllCall("Ws2_32\WSAGetLastError") . "?"
return -1
}
return socket ; Indicate success by returning a valid socket ID rather than -1.
}
I tried a bit, but I doesn't work. So, is there a struct-pro here, who can help me to create this ipv6-struct?
EDIT:
Maby this could be of interest:
http://msdn.microsoft.com/en-us/library/ms737937(VS.85).aspx
WSAConnectByName does include the following steps:
Quote:
Resolve a hostname to a set of IP addresses.
For each IP address:
Create a socket of the appropriate address family.
Attempts to connect to the remote IP address. If the connection was successful, it returns; otherwise the next remote IP address for the host is tried
CAN ANYONE ADVANCE THIS? 