home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
CHIPCD_2_2000.iso
/
software
/
testsoft
/
anasil
/
_SETUP.1
/
TCPIP.DEC
< prev
next >
Wrap
Text File
|
1998-07-13
|
7KB
|
259 lines
; ************************************************************************
;
; Plik z definicjami dekodera ramek dla protokolu TCP/IP
;
; ************************************************************************
[# IP_PROT_TYPE ]
Translate( 0x00,"Unknown" )
@ipprot.dec
[# IP_OPT_TYPE ]
Translate( 0x07,"Record Route (0x07)" )
Translate( 0x44,"Timestamp (0x44)" )
[# TCP_OPT_TYPE ]
Translate( 0,"End of option list" )
Translate( 1,"No operation" )
Translate( 2,"Max. segment size" )
Translate( 3,"Window scale factor" )
Translate( 4,"TCP SACK Permitted" )
Translate( 5,"TCP SACK" )
Translate( 6,"TCP Echo request" )
Translate( 7,"TCP Echo reply" )
Translate( 8,"Timestamp" )
Translate( 11,"Probe MTU" )
Translate( 12,"Reply MTU" )
[# UDP_PORT_TABLE]
@udpport.dec
[# TCP_PORT_TABLE]
@tcpport.dec
[# OSPF_TYPES ]
Translate( 0x01,"Hello (0x01)" )
Translate( 0x02,"Database description (0x02)" )
Translate( 0x03,"Link state request (0x03)" )
Translate( 0x04,"Link state update (0x04)" )
Translate( 0x05,"Link state acknowledgment (0x05)" )
;-----------------------------------------------------------
;
; Definicje fragmentow ramek
;
; Kazda linia ma nastepujacy format:
; Linia,Kolumna,Max.Szerokosc wartosci,Label,Format.Zmienna[,id tablicy translacji (tylko dla typow numerycznych)]
;
[$ IP_Header ]
Layer( "IP header","IP" )
Field( 0,0,3,"Version", "%d", Byte(0,4,7) ) = IP_HEADER_OFFSET
Field( 0,1,3,"Header length", "%d", Byte(0,0,3) ) = IP_HEAD_LEN
Field( 1,0,3,"TOS", "%02X", Byte(1) )
Field( 1,1,5,"Total length", "%d", RWord(2) )
Field( 2,0,5,"Ident.", "%u", RWord(4) )
Field( 2,1,3,"Flags", "%X", RWord(6,13,15) )
Field( 3,0,5,"Fragment offset", "%d", RWord(6,0,12) )
Field( 3,1,3,"TTL", "%d", Byte(8) )
Field( 4,0,1,"Protocol", "%s", Byte(9), IP_PROT_TYPE ) = IP_PROT_OFF
Field( 5,0,5,"Checksum", "%04X", RWord(10) )
[$ IP_Header2 ]
Field( 0,0,15,"Source IP Address", "%s", DString(0,4,".") )
Field( 1,0,15,"Dest. IP Address", "%s", DString(4,4,".") )
[$ IP_Option_Header ]
Field( 0,0,2,"Option", "%s", Byte(0), IP_OPT_TYPE )
Field( 1,0,3,"Length", "%d", Byte(1) )
Field( 1,1,3,"Ptr", "%d", Byte(2) )
Field( 2,0,1,"Data", "%s", HString(3,(Byte(1)-3)," ") )
[$ TCP_Header ]
Layer( "TCP header","TCP" )
Field( 0,0,1,"Source port","%s", RWord(0), TCP_PORT_TABLE ) = TCP_HEAD_OFFSET
Field( 1,0,1,"Dest. port","%s", RWord(2), TCP_PORT_TABLE ) = TCP_DEST_PORT
Field( 2,0,10,"Seq. number","%08X", RLong(4) )
Field( 2,1,10,"Ack. number","%08X", RLong(8) )
[$ TCP_Header2 ]
Field( 0,0,3,"Header len.", "%d", RWord(0,12,15) ) = TCP_HEAD_LEN
Field( 0,1,3,"Reserved", "%d", RWord(0,6,11) )
Field( 1,0,3,"Urgent", "%d", RWord(0,5,5) )
Field( 1,1,3,"ACK", "%d", RWord(0,4,4) )
Field( 2,0,3,"PSH", "%d", RWord(0,3,3) )
Field( 2,1,3,"RST", "%d", RWord(0,2,2) )
Field( 3,0,3,"SYN", "%d", RWord(0,1,1) )
Field( 3,1,3,"FIN", "%d", RWord(0,0,0) )
Field( 5,0,6,"Window size", "%d", RWord(2) )
Field( 6,0,6,"TCP Checksum", "%d", RWord(4) )
Field( 6,1,6,"Urgent pointer", "%d", RWord(6) )
[$ TCP_Option_Header ]
Field( 0,0,2,"Option", "%s", Byte(0), TCP_OPT_TYPE ) = TCP_OPTION
[$ TCP_OptionLen_Header ]
Field( 0,0,3,"Length", "%d", Byte(0) ) = TCP_OPTION_LEN
Field( 1,0,1,"Data", "%s", HString(1,(Byte(0)-2)," ") )
[$ UDP_Header ]
Layer( "UDP header","UDP" )
Field( 0,0,1,"Source port", "%s", RWord(0), UDP_PORT_TABLE ) = UDP_SOURCE_PORT
Field( 1,0,1,"Dest. port", "%s", RWord(2), UDP_PORT_TABLE ) = UDP_DEST_PORT
Field( 2,0,5,"Length", "%d", RWord(4) )
Field( 2,1,5,"Checksum", "%d", RWord(6) )
[$ OSPF_Header ]
Layer( "OSPF header","OSPF" )
Field( 0,0,4,"Version:", "%d", Byte(0) )
Field( 0,1,1,"Type:", "%s", Byte(1), OSPF_TYPES ) = OSPF_TYPE_OFF
Field( 1,0,4,"Length :", "%d", RWord(2) )
Field( 3,0,3,"Router ID :", "%s", DString(4,4,".") )
Field( 4,0,3,"Area ID :", "%s", DString(8,4,".") )
Field( 5,0,1,"Checksum :", "%04X", RWord(12) )
Field( 6,0,1,"Auth. type :", "%d", RWord(14) )
Field( 8,0,1,"Auth (hex) :", "%s", HString(16,8," ") )
Field( 9,0,1,"Auth (ascii):", "'%s'", String(16,8) )
[$ OSPF_HELLO_Header ]
Layer( "OSPF HELLO","OSPF-HELLO" )
Field( 0,0,3,"Network mask:", "%s", DString(0,4,".") )
Field( 2,0,3,"Interval :", "%d", RWord(4) )
Field( 3,0,3,"Options :", "%d", Byte(6) )
Field( 4,0,3,"Priotity :", "%d", Byte(7) )
Field( 5,0,1,"Dead Interval:", "%d", RLong(8) )
Field( 7,0,1,"Designated router:", "%s", DString(12,4,".") )
Field( 8,0,1,"Backup router :", "%s", DString(16,4,".") )
[$ IGMP_Header ]
Layer( "IGMP","IGMP" )
Field( 0,0,0,"Version : ", "%d", Byte(0,4,7) )
Field( 1,0,0,"Type : ", "%d", Byte(0,0,3) )
Field( 2,0,0,"Unused : ", "%d", Byte(1) )
Field( 3,0,0,"Checksum : ", "%d", RWord(2) )
Field( 4,0,0,"Group address : ", "%s", DString(4,4,".") )
;-----------------------------------------------------------
;
; Sekcje komend
;
[^ IP_Frame]
expand(IP_Header)
expand(IP_Header2)
On( Byte(IP_HEAD_LEN,0,3)>5 )
goto(IP_Option)
OnEnd
goto(IP_End)
[^ IP_Option ]
expand(IP_Option_Header)
On( (IP_HEADER_OFFSET*(-1)+1) < (Byte(IP_HEAD_LEN,0,3)*4) )
goto(IP_Option)
OnEnd
Skip( IP_HEADER_OFFSET+(Byte(IP_HEAD_LEN,0,3)*4) )
goto(IP_End)
[^ IP_End ]
TableJump( Byte(IP_PROT_OFF) )
1,ICMP_Frame
2,IGMP_Frame
6,TCP_Frame
17,UDP_Frame
89,OSPF_Frame
TableEnd
goto(Undecoded)
;-----------------------------------------------------------
;
; Protokol TCP
;
[^ TCP_Frame ]
expand(TCP_Header)
expand(TCP_Header2)
On( RWord(TCP_HEAD_LEN,12,15)>5 )
goto(TCP_Option)
OnEnd
goto(TCP_End)
[^ TCP_Option ]
expand(TCP_Option_Header)
On( ( Byte(TCP_OPTION)<>0 )&( Byte(TCP_OPTION)<>1 ) )
expand(TCP_OptionLen_Header)
OnEnd
On( (TCP_HEAD_OFFSET*(-1)+1) < (RWord(TCP_HEAD_LEN,12,15)*4) )
goto(TCP_Option)
OnEnd
Skip( TCP_HEAD_OFFSET+(RWord(TCP_HEAD_LEN,12,15)*4) )
goto(TCP_End)
[^ TCP_End ]
On( (RWord(TCP_HEAD_OFFSET)==53)|(RWord(TCP_DEST_PORT)==53) )
goto(DNS_Frame)
OnEnd
goto(Undecoded)
;-----------------------------------------------------------
;
; Protokol UDP
;
[^ UDP_Frame ]
expand(UDP_Header)
On( (RWord(UDP_SOURCE_PORT)==53)|(RWord(UDP_DEST_PORT)==53) )
goto(DNS_Frame)
OnEnd
goto(Undecoded)
;-----------------------------------------------------------
;
; Protokol OSPF
;
[^ OSPF_Frame ]
expand(OSPF_Header)
TableJump( Byte(OSPF_TYPE_OFF) )
1,OSPF_HELLO_Frame
TableEnd
goto(Undecoded)
[^ OSPF_HELLO_Frame ]
expand(OSPF_HELLO_Header)
goto(Undecoded)
;------------------------------------------------------------
;
; Protokol IGMP
;
[^ IGMP_Frame ]
expand(IGMP_Header)
goto(Undecoded)