home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / CHIPCD_2_2000.iso / software / testsoft / anasil / _SETUP.1 / DNS.DEC < prev    next >
Text File  |  1998-05-14  |  3KB  |  98 lines

  1. ; ************************************************************************
  2. ;
  3. ;  Plik z definicjami dekodera ramek dla protokolu DNS
  4. ;
  5. ; ************************************************************************
  6.  
  7. [# DNS_QR ]
  8.    Translate( 0,"Query" )
  9.    Translate( 1,"Response" )
  10.  
  11. [# DNS_OPCODE ]
  12.    Translate( 0,"Standard query" )
  13.    Translate( 1,"Inverse query" )
  14.    Translate( 2,"Server status request" )
  15.  
  16. [# DNS_RETCODE ]
  17.    Translate( 0,"No error" )
  18.    Translate( 1,"Name error" )
  19.  
  20. [# DNS_TYPES ]
  21.    Translate( 1,  "A (IP address)" )
  22.    Translate( 2,  "NS (Name server)" )
  23.    Translate( 5,  "CNAME (Canonical name)" )
  24.    Translate( 12, "PTR (Pointer record)" )
  25.    Translate( 13, "HINFO (Host info)" )
  26.    Translate( 15, "MX (Mail exchange record)" )
  27.    Translate( 252,"AXFR (Request for zone transfer)" )
  28.    Translate( 255,"ANY (Request for all records)" )
  29.  
  30. [# DNS_CLASSES ]
  31.    Translate( 1, "Internet address" )
  32.  
  33. ;-----------------------------------------------------------
  34. ;
  35. ;  Definicje fragmentow ramek
  36. ;
  37. ;  Kazda linia ma nastepujacy format:
  38. ;    Linia,Kolumna,Max.Szerokosc wartosci,Label,Format.Zmienna[,id tablicy translacji (tylko dla typow numerycznych)]
  39. ;
  40.  
  41.  
  42. [$ DNS_Header ]
  43.   Layer( "DNS header","DNS" )
  44.   Field( 0,0,4,"Identification", "%04X", RWord(0) ) = DNS_OFFSET
  45.   Field( 1,0,9,"Query flag", "%s", RWord(2,15,15), DNS_QR ) = DNS_FLAG_OFF
  46.   Field( 1,1,1,"Opcode", "%s", RWord(DNS_FLAG_OFF,11,14), DNS_OPCODE )
  47.   Field( 3,0,1,"AA flag", "%d", RWord(DNS_FLAG_OFF,10,10) )
  48.   Field( 3,1,1,"TC flag", "%d", RWord(DNS_FLAG_OFF,9,9) )
  49.   Field( 4,0,1,"RD flag", "%d", RWord(DNS_FLAG_OFF,8,8) )
  50.   Field( 4,1,1,"RA flag", "%d", RWord(DNS_FLAG_OFF,7,7) )
  51.   Field( 5,0,1,"Return code", "%s", RWord(DNS_FLAG_OFF,0,3), DNS_RETCODE )
  52.  
  53. [$ DNS_Header1 ]
  54.   Field( 0,0,4,"Num.of questions", "%d", RWord(0) ) = DNS_QUESTION_NUM
  55.   Field( 1,0,4,"Num.of answers", "%d", RWord(2) ) = DNS_ANSWERS_NUM 
  56.   Field( 2,0,4,"Num.of authorities", "%d", RWord(4) ) = DNS_AUTH_NUM
  57.   Field( 3,0,4,"Num.of additional RR", "%d", RWord(6) ) = DNS_ADD_NUM
  58.  
  59. [$ DNS_Question ]
  60.   Field( 0,0,1,"Name", "%s", DNSNAME(0,DNS_OFFSET) )
  61.   Field( 1,0,1,"Query type", "%s", RWord(%FIELD_OFFSET), DNS_TYPES )
  62.   Field( 2,0,1,"Query class", "%s", RWord(%FIELD_OFFSET), DNS_CLASSES )
  63.  
  64. [$ DNS_Res_Record ]
  65.   Field( 0,0,1,"Domain name", "%s", DNSNAME(0,DNS_OFFSET) )
  66.   Field( 1,0,1,"Type", "%s", RWord(%FIELD_OFFSET), DNS_TYPES )
  67.   Field( 2,0,1,"Class", "%s", RWord(%FIELD_OFFSET), DNS_CLASSES )
  68.   Field( 3,0,1,"Time to live", "%d", RLong(%FIELD_OFFSET) )
  69.   Field( 4,0,1,"Data length", "%d", RWord(%FIELD_OFFSET) ) = DNS_DATALEN
  70.   Field( 5,0,1,"Data", "%s", HString(%FIELD_OFFSET,RWord(DNS_DATALEN),"-") )
  71.  
  72. ;-----------------------------------------------------------
  73. ;
  74. ;  Sekcje komend
  75. ;
  76.  
  77. [^ DNS_Frame]
  78. expand(DNS_Header)
  79. expand(DNS_Header1)
  80.  
  81. Loop( RWord(DNS_QUESTION_NUM) )
  82.   expand(DNS_Question)
  83. LoopEnd
  84.  
  85. Loop( RWord(DNS_ANSWERS_NUM) )
  86.   expand(DNS_Res_Record)
  87. LoopEnd
  88.  
  89. Loop( RWord(DNS_AUTH_NUM) )
  90.   expand(DNS_Res_Record)
  91. LoopEnd
  92.  
  93. Loop( RWord(DNS_ADD_NUM) )
  94.   expand(DNS_Res_Record)
  95. LoopEnd
  96.  
  97. goto(Undecoded)
  98.