'Author : 
'Dipl.-Ing. A. Traeger
'Traeger Industry Components
'WWW.TRAEGER.DE
'Söllnerstr. 9 
'D - 92637 Weiden
'Tel 0961/482300
'Fax 0961/48230 20
'
'  Rfc1006.bas
' V 1.27 25.3.14


const E_RFC1006_TIMEOUT		As Long = -1
const E_RFC1006_NORES_AVAIL	As Long = 	-2
const E_RFC1006_REF_NOTOPENED	As Long =  	-3
const E_RFC1006_GENERAL	As Long = 	-5
const E_RFC1006_NOPARTNER	As Long = 	-6
const E_RFC1006_SOCKERR	As Long = 	-7
const E_RFC1006_SERVER_YET_RUNNING As Long = 	-10	
const E_RFC1006_STARTING_SERVER As Long = 	-11	
const E_RFC1006_SERVER_NOT_RUNNING As Long = 	-12	
const E_RFC1006_NOCONNECTION	As Long = 	-13 
const E_RFC1006_BUFSIZE As Long =         -14 
const E_RFC1006_BADREF	 As Long = 	-99


Declare Function Rfc1006Open& Lib "rfc1006lib.dll" (ByVal IPAdr As String, _
                                                     SSAP as Byte, _
                                                     ByVal LenSSAP&, _
                                                     DSAP As Byte,  _
                                                     ByVal LenDSAP&, _
                                                     ByVal Port&, _
                                                     ByVal ConnectTimeout&)
                               
                               
Declare Function  Rfc1006Close& Lib "rfc1006lib.dll" (ByVal Ref&)

Declare Function Rfc1006Rx& Lib "rfc1006lib.dll"  (ByVal Ref&, _
                                                   Buf as Byte, _
                                                   DWORD MaxCnt, _
                                                   long RxTimeout)

Declare Function Rfc1006Tx& Lib "rfc1006lib.dll"  (ByVal Ref&, _
                                                   Buf as Byte, _
                                                   ByVal Cnt&, _
                                                   ByVal Timeout&)
                                                   
Declare Function Rfc1006GetSockErr& Lib "rfc1006lib.dll" (ByVal Ref&)

Declare Function Rfc1006Connect& Lib "rfc1006lib.dll"(ByVal Ref&)

Declare Function Rfc1006Disconnect& Lib "rfc1006lib.dll"(ByVal Ref&)

Declare Function Rfc1006GetStatus& Lib "rfc1006lib.dll"(ByVal Ref&)

Declare Function Rfc1006StartServer& Lib "rfc1006lib.dll"(int Port, _
                                                          ByVal BindIPAdr as String, _
                                                          int MaxCon)

Declare Function Rfc1006OpenServer& Lib "rfc1006lib.dll"(ByVal DstIPAdr as String, _
                                                         SSAP as Byte, _
                                                         ByVal LenSSAP&, _
                                                         DSAP as Byte, _
                                                         ByVal LenDSAP&)

Declare Function Rfc1006OpenExServer& Lib "rfc1006lib.dll"(ByVal DstIPAdr as String, _
                                                         SSAP as Byte, _
                                                         ByVal LenSSAP&, _
                                                         DSAP as Byte, _
                                                         ByVal LenDSAP&_
                                                         ByVal Port&)
                                                         
                                                         
Declare Sub Rfc1006StopServer& Lib "rfc1006lib.dll"  ()

Declare Sub Rfc1006CloseAll Lib "rfc1006lib.dll" ()


Declare Function Rfc1006SetKeepAlive& Lib "rfc1006lib.dll"(ByVal Ref&, _
                                       ByVal AliveInterval&, _
                                       ByVal AliveTime&)

Declare Function Rfc1006TxUnlocked& Lib "rfc1006lib.dll"(ByVal Ref&, _
                                     void *Buf, _
                                     ByVal Cnt&, _
                                     ByVal Timeout&)

Declare Function Rfc1006SetFastAck& Lib "rfc1006lib.dll" (ByVal Ref&, _
                                     ByVal Mode&)

Declare Function Rfc1006PacketInQ& Lib "rfc1006lib.dll" (ByVal Ref&)

Declare Function Rfc1006GetSockErrString& Lib "Rfc1006Lib.dll" (ByVal SockErr&, _
                                                     ByVal ErrStr As String, _
                                                     ByVal MaxLen&) as String

Declare Function Rfc1006GetLibraryVersion& Lib "Rfc1006Lib.dll" () as String

Declare Function Rfc1006GetLibraryVersionMajor& Lib "Rfc1006Lib.dll" () as Long

Declare Function Rfc1006GetLibraryVersionMinor& Lib "Rfc1006Lib.dll" () as Long

