Branch: Tag:

2008-07-24

2008-07-24 16:04:20 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added support for SPF-records.

Rev: lib/modules/Protocols.pmod/DNS.pmod:1.100

1: - // $Id: DNS.pmod,v 1.99 2008/07/23 15:11:21 grubba Exp $ + // $Id: DNS.pmod,v 1.100 2008/07/24 16:04:20 grubba Exp $   // Not yet finished -- Fredrik Hubinette      //! Domain Name System
101:       //! Type - IPv6 address record (RFC 2874, incomplete support)    T_A6=38, +  +  //! Type - SPF - Sender Policy Framework (RFC 4408) +  T_SPF=99,   };      //! Low level DNS protocol
201:    lambda(string t) {    return sprintf("%1c%s", sizeof(t), t);    })*""; +  case T_SPF: +  return Array.map(stringp(entry->spf)? ({entry->spf}):(entry->spf||({})), +  lambda(string t) { +  return sprintf("%1c%s", sizeof(t), t); +  })*"";    case T_LOC:    // FIXME: Not implemented yet.    default:
454:    //! @mapping    //! @member string "txt"    //! @endmapping +  //! @value T_SPF +  //! @mapping +  //! @member string "spf" +  //! @endmapping    //! @endint    //! @endarray    array decode_entries(string s,int num, array(int) next)
554:    case T_TXT:    m->txt = decode_string(s, next);    break; +  case T_SPF: +  m->spf = decode_string(s, next); +  break;    }       next[0]=tmp+m->len;