fb:porticula NoPaste
test_client_ipv6.bas
Uploader: | ThePuppetMaster |
Datum/Zeit: | 27.02.2011 12:27:37 |
'##############################################################################################################
'TEST-CLIENT für TSNE_V3 (IPV6 version)
'##############################################################################################################
'##############################################################################################################
#include once "TSNE_V3_IPV6.bi"
'##############################################################################################################
Sub TSNE_Disconnected(ByVal V_TSNEID as UInteger)
Print "[DIS]";
End Sub
'##############################################################################################################
Sub TSNE_Connected(ByVal V_TSNEID as UInteger)
Print "[COK]";
TSNE_Disconnect(V_TSNEID)
End Sub
'##############################################################################################################
Sub TSNE_NewData (ByVal V_TSNEID as UInteger, ByRef V_Data as String)
End Sub
'##############################################################################################################
Print "[INIT] /proc/net/if_inet6"
Dim XFN as Integer = FreeFile
If Open pipe("cat /proc/net/if_inet6" for Input as #XFN) = 0 Then
Dim T as String
Do Until EOF(XFN)
Line Input #XFN, T
If T <> "" Then Print T
Loop
Close #XFN
Else: Print "Can't open if_inet6"
End If
Dim G_Client as UInteger
Dim BV as Integer
Print
Print "[INIT] IP_V6 Test... (Connecting to SSH)"
Print "localhost... [CON]";
BV = TSNE_Create_Client(G_Client, "::", 22, @TSNE_Disconnected, @TSNE_Connected, @TSNE_NewData, 10)
If BV = TSNE_Const_NoError Then
Print "[WIT]";: TSNE_WaitClose(G_Client): Print "[WOK]"
Else: Print "[FAIL] " & TSNE_GetGURUCode(BV)
End If
Print "localhost on lo... [CON]";
BV = TSNE_Create_Client(G_Client, "::%lo", 22, @TSNE_Disconnected, @TSNE_Connected, @TSNE_NewData, 10)
If BV = TSNE_Const_NoError Then
Print "[WIT]";: TSNE_WaitClose(G_Client): Print "[WOK]"
Else: Print "[FAIL] " & TSNE_GetGURUCode(BV)
End If
Print
Print "[INIT] IP_V6 Test... (Connecting to HTTP)"
Print "ipv6.google.com (NoDNS)... [CON]";
BV = TSNE_Create_Client(G_Client, "2001:4860:b002::68", 80, @TSNE_Disconnected, @TSNE_Connected, @TSNE_NewData, 10)
If BV = TSNE_Const_NoError Then
Print "[WIT]";: TSNE_WaitClose(G_Client): Print "[WOK]"
Else: Print "[FAIL] " & TSNE_GetGURUCode(BV)
End If
Print "ipv6.google.com on eth0 (NoDNS)... [CON]";
BV = TSNE_Create_Client(G_Client, "2001:4860:b002::68%eth0", 80, @TSNE_Disconnected, @TSNE_Connected, @TSNE_NewData, 10)
If BV = TSNE_Const_NoError Then
Print "[WIT]";: TSNE_WaitClose(G_Client): Print "[WOK]"
Else: Print "[FAIL] " & TSNE_GetGURUCode(BV)
End If
Print "ipv6.google.com on lo (NoDNS)... [CON]";
BV = TSNE_Create_Client(G_Client, "2001:4860:b002::68%lo", 80, @TSNE_Disconnected, @TSNE_Connected, @TSNE_NewData, 10)
If BV = TSNE_Const_NoError Then
Print "[WIT]";: TSNE_WaitClose(G_Client): Print "[WOK]"
Else: Print "[FAIL] " & TSNE_GetGURUCode(BV)
End If
Print "ipv6.google.com (DNS)... [CON]";
BV = TSNE_Create_Client(G_Client, "ipv6.google.com", 80, @TSNE_Disconnected, @TSNE_Connected, @TSNE_NewData, 10)
If BV = TSNE_Const_NoError Then
Print "[WIT]";: TSNE_WaitClose(G_Client): Print "[WOK]"
Else: Print "[FAIL] " & TSNE_GetGURUCode(BV)
End If
Print "ipv6.google.com on eth0 (DNS)... [CON]";
BV = TSNE_Create_Client(G_Client, "ipv6.google.com%eth0", 80, @TSNE_Disconnected, @TSNE_Connected, @TSNE_NewData, 10)
If BV = TSNE_Const_NoError Then
Print "[WIT]";: TSNE_WaitClose(G_Client): Print "[WOK]"
Else: Print "[FAIL] " & TSNE_GetGURUCode(BV)
End If
Print "ipv6.google.com on lo (DNS)... [CON]";
BV = TSNE_Create_Client(G_Client, "ipv6.google.com%lo", 80, @TSNE_Disconnected, @TSNE_Connected, @TSNE_NewData, 10)
If BV = TSNE_Const_NoError Then
Print "[WIT]";: TSNE_WaitClose(G_Client): Print "[WOK]"
Else: Print "[FAIL] " & TSNE_GetGURUCode(BV)
End If
Print
Print "[END]"
End