Skip to content
Snippets Groups Projects
Select Git revision
  • 2781bdaf89711390ae81dcba72c57b70db172810
  • master default
  • wip-add-ed25519
  • disable-sha1
  • lsh-2.0.4
  • experimental-20050201
  • lsh-1.4.2
  • lsh-1.2
  • lsh_2.1_release_20130626
  • converted-master-branch-to-git
  • nettle_2.4_release_20110903
  • nettle_2.3_release_20110902
  • nettle_2.2_release_20110711
  • nettle_2.1_release_20100725
  • camellia_32bit_20100720
  • nettle_2.0_release_20090608
  • converted-lsh-2.0.4-branch-to-git
  • lsh_2.0.4_release_20070905
  • lsh_2.9_exp_release_20070404
  • nettle_1.15_release_20061128
  • after_experimental_merge_20060516
  • branch_before_experimental_merge_20060516
  • converted-experimental-branch-to-git
  • head_before_experimental_merge_20060516
  • lsh_2.0.3_release_20060509
  • lsh_2.0.2_release_20060127
  • nettle_1.14_release_20051205
  • nettle_1.13_release_20051006
28 results

buffer.c

Blame
  • enum.scm 4.25 KiB
    (define-module (dns enum)
      :export (rr-types
               int->rr rr->int
               class-types
               int->class class->int
               rcode-types
               int->rcode rcode->int
               opcode-types
               int->opcode opcode->int))
    
    (define (flip-cons c)
      (cons (cdr c) (car c)))
    
    (define (make-mappings name table)
      (values
       (lambda (i)
         (cond ((assv i (map flip-cons table)) => cdr)
               ((integer? i) (inexact->exact i))
               (else (scm-error 'wrong-type-arg (format #f "int->~a" name)
                                "Unknown value ~s, expected known integer or one of ~a"
                                (list i (map car table)) (list (map car table))))))
    
       (lambda (value)
         (cond ((integer? value) (inexact->exact value))
               ((assv value table) => cdr)
               (else (scm-error 'wrong-type-arg (format #f "~a->int" name)
                                "Unknown value ~s"
                                (list value) #f)))  )))
    
    ;; All number are documented at
    ;; https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6
    
    (define rr-types
      '(; 0 reserved
        (A     . 1)
        (NS    . 2)
        (MD    . 3)
        (MF    . 4)
        (CNAME . 5)
        (SOA   . 6)
        (MB    . 7)
        (MG    . 8)
        (MR    . 9)
        (NULL  . 10)
        (WKS   . 11)
        (PTR   . 12)
        (HINFO . 13)
        (MINFO . 14)
        (MX    . 15)
        (TXT   . 16)
        (RP    . 17)
        (AFSDB . 18)
        (X25   . 19)
        (ISDN  . 20)
        (RT    . 21)
        (NSAP  . 22)
        (NSAP-PTR . 23)
        (SIG   . 24)
        (KEY   . 25)
        (PX    . 26)
        (GPOS  . 27)
        (AAAA  . 28)
        (LOC   . 29)
        (NXT   . 30)
        (EID   . 30)
        (NIMLOC . 32)
        (SRV   . 33)
        (ATMA  . 34)
        (NAPTR . 35)
        (KX    . 36)