home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / CHIPCD_2_2000.iso / software / testsoft / anasil / _SETUP.1 / IPXSPX.DEC < prev    next >
Text File  |  1997-10-06  |  5KB  |  215 lines

  1. ; ************************************************************************
  2. ;
  3. ; Plik z definicjami dekodera ramek dla protokolu IPX/SPX
  4. ;
  5. ; ************************************************************************
  6.  
  7. ;-----------------------------------------------------------
  8. ;
  9. ;  Tablice translacji - linie maja format
  10. ;   <liczba hex|liczba dec>,"tekst"
  11.  
  12.  
  13. [# IPX_TYPE ]
  14.    Translate( 0x00,"Unknown" )
  15.    Translate( 0x01,"RIP" )
  16.    Translate( 0x04,"Packet Exchange" )
  17.    Translate( 0x05,"SPX" )
  18.    Translate( 0x11,"NCP" )
  19.    Translate( 0x14,"NetBIOS" )
  20.  
  21. [# IPX_PORT ]
  22.    @ipxport.dec
  23.  
  24. [# SAP_TYPE ]
  25.    Translate( 0x01,"Request (0x01)" )
  26.    Translate( 0x02,"Response (0x02)" )
  27.    Translate( 0x03,"Get nearest server request (0x03)" )
  28.    Translate( 0x04,"Get nearest server response (0x04)" )
  29.  
  30. [# SAP_SERVER ]
  31.    @saps.dec
  32.  
  33. [# NCP_TYPE ]
  34.    Translate( 0x1111,"Allocate (0x1111)" )
  35.    Translate( 0x2222,"Request (0x2222)" )
  36.    Translate( 0x3333,"Reply (0x3333)" )
  37.    Translate( 0x5555,"Deallocate (0x5555)" )
  38.    Translate( 0x7777,"Burst (0x7777)" )
  39.    Translate( 0x9999,"ACK (0x9999)" )
  40.  
  41. ;-----------------------------------------------------------
  42. ;
  43. ;  Definicje fragmentow ramek
  44. ;
  45. ;  Kazda linia ma nastepujacy format:
  46. ;    Linia,Kolumna,Max.Szerokosc wartosci,Label,Format.Zmienna[,id tablicy translacji (tylko dla typow numerycznych)]
  47. ;
  48.  
  49.  
  50. [$ IPX_Header ]
  51.   Layer( "IPX packet header","IPX" )
  52.   Field( 0,0,5,"Checksum", "%04X", RWord(0) )
  53.   Field( 1,0,5,"Packet length", "%d", RWord(2) )
  54.   Field( 2,0,3,"Transport control", "%02X", Byte(4) )
  55.   Field( 3,0,7,"Packet type", "%s", Byte(5), IPX_TYPE )
  56.  
  57. [$ IPX_Header1 ]
  58.   Field( 0,0,12,"Dest. network  ", "%s", HString(0,4,"-") )
  59.   Field( 1,0,19,"Dest. node     ", "%s", HString(4,6,"-") ) 
  60.   Field( 2,0,6, "Dest. socket   ", "%s", RWord(10), IPX_PORT ) = IPX_DEST_SOCK
  61.   Field( 3,0,12,"Source network ", "%s", HString(12,4,"-") )
  62.   Field( 4,0,19,"Source node    ", "%s", HString(16,6,"-") )
  63.   Field( 5,0,6, "Source socket  ", "%s", RWord(22), IPX_PORT ) = IPX_SRC_SOCK
  64.  
  65. [$ RIP_Header ]
  66.   Layer( "RIP packet","RIP" )
  67.   Field( 0,0,5,"Operation", "%04X", RWord(0) )
  68.  
  69. [$ RIP_Rest ]
  70.   Field( 0,0,12,"Network number", "%s", HString(0,4,"-") )
  71.   Field( 1,0,3, "Number of hops", "%d", RWord(4) )
  72.   Field( 2,0,3, "Number of ticks","%d", RWord(6) )
  73.  
  74. [$ SAP_Header ]
  75.   Layer( "SAP packet","SAP" )
  76.   Field( 0,0,5,"Operation", "%s", RWord(0), SAP_TYPE )
  77.  
  78. [$ SAP_Req ]
  79.   Field( 0,0,5,"Service type", "%s", RWord(0), SAP_SERVER )
  80.  
  81. [$ SAP_Resp ]
  82.   Field( 0,0,5,  "Service type",   "%s", RWord(0), SAP_SERVER )
  83.   Field( 1,0,10, "Server name",    "%s", String(2,48) )
  84.   Field( 2,0,12, "Network ",       "%s", HString(50,4,"-") )
  85.   Field( 3,0,19, "Node    ",       "%s", HString(54,6,"-") )
  86.   Field( 4,0,6,  "Socket  ",       "%s", HString(60,2,"-") )
  87.   Field( 5,0,3,  "Hops to server", "%d", RWord(62) )
  88.  
  89. [$ NCP_Header ]
  90.   Layer( "NCP packet header","NCP" )
  91.   Field( 0,0,5,  "Packet type",   "%s", RWord(0), NCP_TYPE )
  92.   Field( 1,0,3,  "Sequence",   "%d", Byte(2) )
  93.   Field( 2,0,3,  "Conn. Id low",   "%d", Byte(3) )
  94.   Field( 3,0,3,  "Client task number",  "%d", Byte(4) )
  95.   Field( 4,0,3,  "Conn. Id high",   "%d", Byte(5) )
  96.   Field( 5,0,3,  "Function",   "%d", Byte(6) )
  97.   Field( 6,0,5,  "Sub-function len.",   "%d", RWord(7) )
  98.   Field( 7,0,3,  "Sub-function",   "%d", Byte(9) )
  99.  
  100. [$ SPX_Header ]  
  101.   Layer( "SPX packet header","SPX" )
  102.   Field( 0,0,3,  "Connection control",   "%02X", Byte(0) )
  103.   Field( 1,0,3,  "Data stream type",     "%02X", Byte(1) )
  104.   Field( 2,0,5,  "Source Connection Id", "%04X", RWord(2) )
  105.   Field( 3,0,5,  "Dest.  Connection Id", "%04X", RWord(4) )
  106.   Field( 4,0,5,  "Sequence number",      "%d",   RWord(6) )
  107.   Field( 5,0,5,  "Ack. number",          "%d",   RWord(8) )
  108.   Field( 6,0,5,  "Allocation number",    "%d",   RWord(10) )
  109.  
  110. ;-----------------------------------------------------------
  111. ;
  112. ;  Sekcje komend
  113. ;
  114.  
  115. [^ IPX_Frame]
  116. expand(IPX_Header)
  117. expand(IPX_Header1)
  118.  
  119. TableJump( RWord(IPX_SRC_SOCK) )
  120.    0x0451,NCP_Frame
  121.    0x0452,SAP_Frame
  122.    0x0453,RIP_Frame
  123. TableEnd
  124.  
  125. TableJump( RWord(IPX_DEST_SOCK) )
  126.    0x0451,NCP_Frame
  127.    0x0452,SAP_Frame
  128.    0x0453,RIP_Frame
  129. TableEnd
  130.  
  131. TableJump( Byte(-25) )
  132.    0x00,Unk_Frame
  133.    0x01,RIP_Frame
  134.    0x05,SPX_Frame
  135.    0x11,NCP_Frame
  136. TableEnd
  137.  
  138. goto(Undecoded)
  139.  
  140. ;
  141. ;  Jezeli typ nie jest ustawiony
  142. ;
  143.  
  144. [^ Unk_Frame ]
  145.  
  146. TableJump( RWord(IPX_DEST_SOCK) )
  147.    0x0452,SAP_Frame
  148. TableEnd
  149.  
  150. goto(Undecoded)
  151.  
  152. ;
  153. ;  Protokol RIP
  154. ;
  155.  
  156. [^ RIP_Frame]
  157. expand(RIP_Header)
  158. goto(RIP_RestSec)
  159.  
  160. [^ RIP_RestSec]
  161. expand(RIP_Rest)
  162. goto(RIP_RestSec)
  163.  
  164. ;
  165. ;  Protokol SAP
  166. ;
  167.  
  168. [^ SAP_Frame]
  169. expand(SAP_Header)
  170.  
  171. On( RWord(-2)==1 )
  172.   goto(SAP_Request)
  173. OnEnd
  174.  
  175. On( RWord(-2)==3 )
  176.   goto(SAP_Request)
  177. OnEnd
  178.  
  179. On( RWord(-2)==2 )
  180.   goto(SAP_Response)
  181. OnEnd
  182.  
  183. On( RWord(-2)==4 )
  184.   goto(SAP_Response)
  185. OnEnd
  186.  
  187. goto(Undecoded)
  188.  
  189. [^ SAP_Request]
  190. expand(SAP_Req)
  191. goto(SAP_Request)
  192.  
  193. [^ SAP_Response]
  194. expand(SAP_Resp)
  195. goto(SAP_Response)
  196.  
  197. ;
  198. ;  Protokol SPX
  199. ;
  200.  
  201. [^ SPX_Frame]
  202. expand(SPX_Header)
  203. goto(Undecoded)
  204.  
  205.  
  206. ;
  207. ;  Protokol NCP
  208. ;
  209.  
  210. [^ NCP_Frame]
  211. expand(NCP_Header)
  212. goto(Undecoded)
  213.  
  214.  
  215.