home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
CHIPCD_2_2000.iso
/
software
/
testsoft
/
anasil
/
_SETUP.1
/
IPXSPX.DEC
< prev
next >
Wrap
Text File
|
1997-10-06
|
5KB
|
215 lines
; ************************************************************************
;
; Plik z definicjami dekodera ramek dla protokolu IPX/SPX
;
; ************************************************************************
;-----------------------------------------------------------
;
; Tablice translacji - linie maja format
; <liczba hex|liczba dec>,"tekst"
[# IPX_TYPE ]
Translate( 0x00,"Unknown" )
Translate( 0x01,"RIP" )
Translate( 0x04,"Packet Exchange" )
Translate( 0x05,"SPX" )
Translate( 0x11,"NCP" )
Translate( 0x14,"NetBIOS" )
[# IPX_PORT ]
@ipxport.dec
[# SAP_TYPE ]
Translate( 0x01,"Request (0x01)" )
Translate( 0x02,"Response (0x02)" )
Translate( 0x03,"Get nearest server request (0x03)" )
Translate( 0x04,"Get nearest server response (0x04)" )
[# SAP_SERVER ]
@saps.dec
[# NCP_TYPE ]
Translate( 0x1111,"Allocate (0x1111)" )
Translate( 0x2222,"Request (0x2222)" )
Translate( 0x3333,"Reply (0x3333)" )
Translate( 0x5555,"Deallocate (0x5555)" )
Translate( 0x7777,"Burst (0x7777)" )
Translate( 0x9999,"ACK (0x9999)" )
;-----------------------------------------------------------
;
; Definicje fragmentow ramek
;
; Kazda linia ma nastepujacy format:
; Linia,Kolumna,Max.Szerokosc wartosci,Label,Format.Zmienna[,id tablicy translacji (tylko dla typow numerycznych)]
;
[$ IPX_Header ]
Layer( "IPX packet header","IPX" )
Field( 0,0,5,"Checksum", "%04X", RWord(0) )
Field( 1,0,5,"Packet length", "%d", RWord(2) )
Field( 2,0,3,"Transport control", "%02X", Byte(4) )
Field( 3,0,7,"Packet type", "%s", Byte(5), IPX_TYPE )
[$ IPX_Header1 ]
Field( 0,0,12,"Dest. network ", "%s", HString(0,4,"-") )
Field( 1,0,19,"Dest. node ", "%s", HString(4,6,"-") )
Field( 2,0,6, "Dest. socket ", "%s", RWord(10), IPX_PORT ) = IPX_DEST_SOCK
Field( 3,0,12,"Source network ", "%s", HString(12,4,"-") )
Field( 4,0,19,"Source node ", "%s", HString(16,6,"-") )
Field( 5,0,6, "Source socket ", "%s", RWord(22), IPX_PORT ) = IPX_SRC_SOCK
[$ RIP_Header ]
Layer( "RIP packet","RIP" )
Field( 0,0,5,"Operation", "%04X", RWord(0) )
[$ RIP_Rest ]
Field( 0,0,12,"Network number", "%s", HString(0,4,"-") )
Field( 1,0,3, "Number of hops", "%d", RWord(4) )
Field( 2,0,3, "Number of ticks","%d", RWord(6) )
[$ SAP_Header ]
Layer( "SAP packet","SAP" )
Field( 0,0,5,"Operation", "%s", RWord(0), SAP_TYPE )
[$ SAP_Req ]
Field( 0,0,5,"Service type", "%s", RWord(0), SAP_SERVER )
[$ SAP_Resp ]
Field( 0,0,5, "Service type", "%s", RWord(0), SAP_SERVER )
Field( 1,0,10, "Server name", "%s", String(2,48) )
Field( 2,0,12, "Network ", "%s", HString(50,4,"-") )
Field( 3,0,19, "Node ", "%s", HString(54,6,"-") )
Field( 4,0,6, "Socket ", "%s", HString(60,2,"-") )
Field( 5,0,3, "Hops to server", "%d", RWord(62) )
[$ NCP_Header ]
Layer( "NCP packet header","NCP" )
Field( 0,0,5, "Packet type", "%s", RWord(0), NCP_TYPE )
Field( 1,0,3, "Sequence", "%d", Byte(2) )
Field( 2,0,3, "Conn. Id low", "%d", Byte(3) )
Field( 3,0,3, "Client task number", "%d", Byte(4) )
Field( 4,0,3, "Conn. Id high", "%d", Byte(5) )
Field( 5,0,3, "Function", "%d", Byte(6) )
Field( 6,0,5, "Sub-function len.", "%d", RWord(7) )
Field( 7,0,3, "Sub-function", "%d", Byte(9) )
[$ SPX_Header ]
Layer( "SPX packet header","SPX" )
Field( 0,0,3, "Connection control", "%02X", Byte(0) )
Field( 1,0,3, "Data stream type", "%02X", Byte(1) )
Field( 2,0,5, "Source Connection Id", "%04X", RWord(2) )
Field( 3,0,5, "Dest. Connection Id", "%04X", RWord(4) )
Field( 4,0,5, "Sequence number", "%d", RWord(6) )
Field( 5,0,5, "Ack. number", "%d", RWord(8) )
Field( 6,0,5, "Allocation number", "%d", RWord(10) )
;-----------------------------------------------------------
;
; Sekcje komend
;
[^ IPX_Frame]
expand(IPX_Header)
expand(IPX_Header1)
TableJump( RWord(IPX_SRC_SOCK) )
0x0451,NCP_Frame
0x0452,SAP_Frame
0x0453,RIP_Frame
TableEnd
TableJump( RWord(IPX_DEST_SOCK) )
0x0451,NCP_Frame
0x0452,SAP_Frame
0x0453,RIP_Frame
TableEnd
TableJump( Byte(-25) )
0x00,Unk_Frame
0x01,RIP_Frame
0x05,SPX_Frame
0x11,NCP_Frame
TableEnd
goto(Undecoded)
;
; Jezeli typ nie jest ustawiony
;
[^ Unk_Frame ]
TableJump( RWord(IPX_DEST_SOCK) )
0x0452,SAP_Frame
TableEnd
goto(Undecoded)
;
; Protokol RIP
;
[^ RIP_Frame]
expand(RIP_Header)
goto(RIP_RestSec)
[^ RIP_RestSec]
expand(RIP_Rest)
goto(RIP_RestSec)
;
; Protokol SAP
;
[^ SAP_Frame]
expand(SAP_Header)
On( RWord(-2)==1 )
goto(SAP_Request)
OnEnd
On( RWord(-2)==3 )
goto(SAP_Request)
OnEnd
On( RWord(-2)==2 )
goto(SAP_Response)
OnEnd
On( RWord(-2)==4 )
goto(SAP_Response)
OnEnd
goto(Undecoded)
[^ SAP_Request]
expand(SAP_Req)
goto(SAP_Request)
[^ SAP_Response]
expand(SAP_Resp)
goto(SAP_Response)
;
; Protokol SPX
;
[^ SPX_Frame]
expand(SPX_Header)
goto(Undecoded)
;
; Protokol NCP
;
[^ NCP_Frame]
expand(NCP_Header)
goto(Undecoded)