Changeset 141

Show
Ignore:
Timestamp:
01/31/03 13:42:28 (10 years ago)
Author:
ahu
Message:

working up to 2.9.5

Location:
trunk/pdns
Files:
18 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/ChangeLog

    r140 r141  
    1010        - SRV records (Ueli Heuer) 
    1111        - updated J root-server IP address in the recursor 
     12        - added USR1 forced log output 
     13        - changed meaning of 'cache hits -> packets which could be answered 
     14                without sending packets out 
     15        - added -lz (James H. Cloos Jr) to MySQL 
     16        - added name to webserver (Daniel Meyer) 
    1217         
    1318Changes since 2.9.3a: 
  • trunk/pdns/modules/mysqlbackend/OBJECTLIBS

    r13 r141  
    1 -lmysqlclient 
     1-lmysqlclient -lz 
  • trunk/pdns/pdns/backends/bind/bindlexer.c

    r57 r141  
    22 
    33/* Scanner skeleton version: 
    4  * $Header: /home/ahu/tmp/cvs2svn/pdns/pdns/backends/bind/bindlexer.c,v 1.3 2002/12/06 09:58:03 ahu Exp $ 
     4 * $Header: /home/ahu/tmp/cvs2svn/pdns/pdns/backends/bind/bindlexer.c,v 1.4 2003/01/31 12:42:28 ahu Exp $ 
    55 */ 
    66 
     
    457457 
    458458#ifdef WIN32 
    459 #include "bindparser.tab.cc.h" 
    460 #define isatty _isatty 
    461 int isatty( int fd ) 
     459#include "bindparser.tab.hh" 
     460 
     461extern "C" 
    462462{ 
    463   return _isatty( fd ); 
     463  int isatty( int ); 
     464  int yywrap() 
     465  { 
     466    return 1; 
     467  } 
    464468} 
     469 
     470 
    465471#else 
    466472#include "bindparser.h" 
     
    484490 
    485491#define YY_STACK_USED 1 
    486 #line 487 "lex.yy.c" 
     492#line 493 "lex.yy.c" 
    487493 
    488494/* Macros after this point can all be overridden by user definitions in 
     
    646652        register int yy_act; 
    647653 
    648 #line 36 "bindlexer.l" 
    649  
    650  
    651  
    652 #line 653 "lex.yy.c" 
     654#line 42 "bindlexer.l" 
     655 
     656 
     657 
     658#line 659 "lex.yy.c" 
    653659 
    654660        if ( yy_init ) 
     
    735741case 1: 
    736742YY_RULE_SETUP 
    737 #line 39 "bindlexer.l" 
     743#line 45 "bindlexer.l" 
    738744BEGIN(comment); 
    739745        YY_BREAK 
    740746case 2: 
    741747YY_RULE_SETUP 
    742 #line 40 "bindlexer.l" 
     748#line 46 "bindlexer.l" 
    743749/* eat anything that's not a '*' */ 
    744750        YY_BREAK 
    745751case 3: 
    746752YY_RULE_SETUP 
    747 #line 41 "bindlexer.l" 
     753#line 47 "bindlexer.l" 
    748754/* eat up '*'s not followed by '/'s */ 
    749755        YY_BREAK 
    750756case 4: 
    751757YY_RULE_SETUP 
    752 #line 42 "bindlexer.l" 
     758#line 48 "bindlexer.l" 
    753759++linenumber; 
    754760        YY_BREAK 
    755761case 5: 
    756762YY_RULE_SETUP 
    757 #line 43 "bindlexer.l" 
     763#line 49 "bindlexer.l" 
    758764BEGIN(INITIAL); 
    759765        YY_BREAK 
    760766case 6: 
    761767YY_RULE_SETUP 
    762 #line 45 "bindlexer.l" 
     768#line 51 "bindlexer.l" 
    763769BEGIN(incl); 
    764770        YY_BREAK 
    765771case 7: 
    766772YY_RULE_SETUP 
    767 #line 46 "bindlexer.l" 
     773#line 52 "bindlexer.l" 
    768774/* eat the whitespace */ 
    769775        YY_BREAK 
    770776case 8: 
    771777YY_RULE_SETUP 
    772 #line 47 "bindlexer.l" 
     778#line 53 "bindlexer.l" 
    773779{ /* got the include file name */ 
    774780        char filename[1024]; 
     
    807813case YY_STATE_EOF(incl): 
    808814case YY_STATE_EOF(quoted): 
    809 #line 80 "bindlexer.l" 
     815#line 86 "bindlexer.l" 
    810816{ 
    811817        if ( --include_stack_ptr < 0 ) 
     
    829835case 9: 
    830836YY_RULE_SETUP 
    831 #line 102 "bindlexer.l" 
     837#line 108 "bindlexer.l" 
    832838return ZONETOK;  
    833839        YY_BREAK 
    834840case 10: 
    835841YY_RULE_SETUP 
    836 #line 104 "bindlexer.l" 
     842#line 110 "bindlexer.l" 
    837843return FILETOK; 
    838844        YY_BREAK 
    839845case 11: 
    840846YY_RULE_SETUP 
    841 #line 105 "bindlexer.l" 
     847#line 111 "bindlexer.l" 
    842848return OPTIONSTOK; 
    843849        YY_BREAK 
    844850case 12: 
    845851YY_RULE_SETUP 
    846 #line 106 "bindlexer.l" 
     852#line 112 "bindlexer.l" 
    847853return ACLTOK; 
    848854        YY_BREAK 
    849855case 13: 
    850856YY_RULE_SETUP 
    851 #line 107 "bindlexer.l" 
     857#line 113 "bindlexer.l" 
    852858return LOGGINGTOK; 
    853859        YY_BREAK 
    854860case 14: 
    855861YY_RULE_SETUP 
    856 #line 108 "bindlexer.l" 
     862#line 114 "bindlexer.l" 
    857863return DIRECTORYTOK; 
    858864        YY_BREAK 
    859865case 15: 
    860866YY_RULE_SETUP 
    861 #line 109 "bindlexer.l" 
     867#line 115 "bindlexer.l" 
    862868return MASTERTOK; 
    863869        YY_BREAK 
    864870case 16: 
    865871YY_RULE_SETUP 
    866 #line 110 "bindlexer.l" 
     872#line 116 "bindlexer.l" 
    867873return TYPETOK; 
    868874        YY_BREAK 
    869875case 17: 
    870876YY_RULE_SETUP 
    871 #line 111 "bindlexer.l" 
     877#line 117 "bindlexer.l" 
    872878yy_push_state(quoted); 
    873879        YY_BREAK 
    874880case 18: 
    875881YY_RULE_SETUP 
    876 #line 112 "bindlexer.l" 
     882#line 118 "bindlexer.l" 
    877883yylval=strdup(yytext); return QUOTEDWORD; 
    878884        YY_BREAK 
    879885case 19: 
    880886YY_RULE_SETUP 
    881 #line 113 "bindlexer.l" 
     887#line 119 "bindlexer.l" 
    882888yy_pop_state(); 
    883889        YY_BREAK 
    884890case 20: 
    885891YY_RULE_SETUP 
    886 #line 114 "bindlexer.l" 
    887 yylval=strdup(yytext);return WORD; 
     892#line 120 "bindlexer.l" 
     893yylval=strdup(yytext);return AWORD; 
    888894        YY_BREAK 
    889895case 21: 
    890896YY_RULE_SETUP 
    891 #line 115 "bindlexer.l" 
     897#line 121 "bindlexer.l" 
    892898return OBRACE; 
    893899        YY_BREAK 
    894900case 22: 
    895901YY_RULE_SETUP 
    896 #line 116 "bindlexer.l" 
     902#line 122 "bindlexer.l" 
    897903return EBRACE; 
    898904        YY_BREAK 
    899905case 23: 
    900906YY_RULE_SETUP 
    901 #line 117 "bindlexer.l" 
     907#line 123 "bindlexer.l" 
    902908return SEMICOLON; 
    903909        YY_BREAK 
    904910case 24: 
    905911YY_RULE_SETUP 
    906 #line 118 "bindlexer.l" 
     912#line 124 "bindlexer.l" 
    907913linenumber++; 
    908914        YY_BREAK 
    909915case 25: 
    910916YY_RULE_SETUP 
    911 #line 119 "bindlexer.l" 
     917#line 125 "bindlexer.l" 
    912918; 
    913919        YY_BREAK 
     
    917923YY_DO_BEFORE_ACTION; /* set up yytext again */ 
    918924YY_RULE_SETUP 
    919 #line 120 "bindlexer.l" 
     925#line 126 "bindlexer.l" 
    920926; 
    921927        YY_BREAK 
     
    925931YY_DO_BEFORE_ACTION; /* set up yytext again */ 
    926932YY_RULE_SETUP 
    927 #line 121 "bindlexer.l" 
     933#line 127 "bindlexer.l" 
    928934; 
    929935        YY_BREAK 
    930936case 28: 
    931937YY_RULE_SETUP 
    932 #line 122 "bindlexer.l" 
     938#line 128 "bindlexer.l" 
    933939{  
    934940                        fprintf(stderr,"Parsing '%s': unable to parse line %d at character '%s'\n",current_filename, linenumber, yytext); 
     
    937943case 29: 
    938944YY_RULE_SETUP 
    939 #line 125 "bindlexer.l" 
     945#line 131 "bindlexer.l" 
    940946YY_FATAL_ERROR( "flex scanner jammed" ); 
    941947        YY_BREAK 
    942 #line 943 "lex.yy.c" 
     948#line 949 "lex.yy.c" 
    943949 
    944950        case YY_END_OF_BUFFER: 
     
    18281834        } 
    18291835#endif 
    1830 #line 125 "bindlexer.l" 
    1831  
     1836#line 131 "bindlexer.l" 
     1837 
  • trunk/pdns/pdns/backends/bind/bindlexer.l

    r57 r141  
    88 
    99#ifdef WIN32 
    10 #include "bindparser.tab.cc.h" 
    11 #define isatty _isatty 
    12 int isatty( int fd ) 
     10#include "bindparser.tab.hh" 
     11 
     12extern "C" 
    1313{ 
    14   return _isatty( fd ); 
     14  int isatty( int ); 
     15  int yywrap() 
     16  { 
     17    return 1; 
     18  } 
    1519} 
     20 
     21 
    1622#else 
    1723#include "bindparser.h" 
     
    112118<quoted>[^\"]*          yylval=strdup(yytext); return QUOTEDWORD; 
    113119<quoted>\"              yy_pop_state(); 
    114 [^\" \t\n{};]*               yylval=strdup(yytext);return WORD; 
     120[^\" \t\n{};]*               yylval=strdup(yytext);return AWORD; 
    115121\{                      return OBRACE; 
    116122\}                      return EBRACE; 
  • trunk/pdns/pdns/backends/bind/bindparser.cc

    r86 r141  
    44#define YYBISON 1  /* Identify Bison output.  */ 
    55 
    6 # define        WORD    257 
     6# define        AWORD   257 
    77# define        QUOTEDWORD      258 
    88# define        OBRACE  259 
     
    2222 
    2323 
    24 #define DIRTY_HACK WORD 
    25 #undef WORD 
    26  
    2724#include <stdio.h> 
    2825#include <string.h> 
     
    3936#include "bindparser.hh" 
    4037 
    41 #define WORD DIRTY_HACK  
    42  
    4338#define YYSTYPE char * 
    4439 
     40 
     41#ifndef WIN32 
    4542extern "C"  
    4643{ 
     44#endif // WIN32 
    4745        int yyparse(void); 
    4846        int yylex(void); 
     47        void yyrestart(FILE *); 
    4948        int yywrap() 
    5049        { 
    5150                return 1; 
    5251        } 
    53         void yyrestart(FILE *); 
    54  
     52#ifndef WIN32 
    5553} 
     54#endif // WIN32 
     55 
    5656 
    5757extern int yydebug; 
     
    216216static const char *const yytname[] = 
    217217{ 
    218   "$", "error", "$undefined.", "WORD", "QUOTEDWORD", "OBRACE", "EBRACE",  
     218  "$", "error", "$undefined.", "AWORD", "QUOTEDWORD", "OBRACE", "EBRACE",  
    219219  "SEMICOLON", "ZONETOK", "FILETOK", "OPTIONSTOK", "DIRECTORYTOK",  
    220220  "ACLTOK", "LOGGINGTOK", "CLASSTOK", "TYPETOK", "MASTERTOK",  
  • trunk/pdns/pdns/backends/bind/bindparser.h

    r2 r141  
    66#  define YYSTYPE_IS_TRIVIAL 1 
    77# endif 
    8 # define        WORD    257 
     8# define        AWORD   257 
    99# define        QUOTEDWORD      258 
    1010# define        OBRACE  259 
  • trunk/pdns/pdns/backends/bind/bindparser.yy

    r86 r141  
    11%{ 
    2  
    3 #define DIRTY_HACK WORD 
    4 #undef WORD 
    52 
    63#include <stdio.h> 
     
    1815#include "bindparser.hh" 
    1916 
    20 #define WORD DIRTY_HACK  
    21  
    2217#define YYSTYPE char * 
    2318 
     19 
     20#ifndef WIN32 
    2421extern "C"  
    2522{ 
     23#endif // WIN32 
    2624        int yyparse(void); 
    2725        int yylex(void); 
     26        void yyrestart(FILE *); 
    2827        int yywrap() 
    2928        { 
    3029                return 1; 
    3130        } 
    32         void yyrestart(FILE *); 
    33  
    34 } 
     31#ifndef WIN32 
     32} 
     33#endif // WIN32 
     34 
    3535 
    3636extern int yydebug; 
     
    101101%} 
    102102 
    103 %token WORD QUOTEDWORD OBRACE EBRACE SEMICOLON ZONETOK FILETOK OPTIONSTOK 
     103%token AWORD QUOTEDWORD OBRACE EBRACE SEMICOLON ZONETOK FILETOK OPTIONSTOK 
    104104%token DIRECTORYTOK ACLTOK LOGGINGTOK CLASSTOK TYPETOK MASTERTOK 
    105105 
     
    131131        } 
    132132        |        
    133         ZONETOK quotedname WORD zone_block 
     133        ZONETOK quotedname AWORD zone_block 
    134134        { 
    135135                s_di.name=$2; 
     
    159159 
    160160acl: 
    161         WORD 
     161        AWORD 
    162162        ; 
    163163 
     
    182182        ; 
    183183 
    184 term: WORD | block | quotedname 
     184term: AWORD | block | quotedname 
    185185        ; 
    186186block:  
     
    208208        ; 
    209209 
    210 master: WORD 
     210master: AWORD 
    211211        { 
    212212                s_di.master=$1; 
     
    223223 
    224224zone_type_command: 
    225 TYPETOK WORD 
     225TYPETOK AWORD 
    226226        { 
    227227                s_di.type=$2; 
     
    237237        ; 
    238238 
    239 filename: WORD 
    240         ; 
     239filename: AWORD 
     240        ; 
  • trunk/pdns/pdns/dnsproxy.cc

    r138 r141  
    169169      (*d_resanswers)++; 
    170170      (*d_udpanswers)++; 
    171       DNSPacket::dnsheader *d=reinterpret_cast<DNSPacket::dnsheader *>(buffer); 
     171      DNSPacket::dnsheader d; 
     172      memcpy(&d,buffer,sizeof(d)); 
    172173      { 
    173174        Lock l(&d_lock); 
    174         map_t::iterator i=d_conntrack.find(d->id^d_xor); 
     175        map_t::iterator i=d_conntrack.find(d.id^d_xor); 
    175176        if(i==d_conntrack.end()) { 
    176           L<<Logger::Error<<"Discarding untracked packet from recursor backend with id "<<(d->id^d_xor)<< 
     177          L<<Logger::Error<<"Discarding untracked packet from recursor backend with id "<<(d.id^d_xor)<< 
    177178            ". Contrack table size="<<d_conntrack.size()<<endl; 
    178179          continue; 
    179180        } 
    180181        else if(i->second.created==0) { 
    181           L<<Logger::Error<<"Received packet from recursor backend with id "<<(d->id^d_xor)<<" which is a duplicate"<<endl; 
     182          L<<Logger::Error<<"Received packet from recursor backend with id "<<(d.id^d_xor)<<" which is a duplicate"<<endl; 
    182183          continue; 
    183184        } 
    184         d->id=i->second.id; 
     185        d.id=i->second.id; 
     186        memcpy(buffer,&d,sizeof(d));  // commit spoofed id 
     187 
    185188        sendto(i->second.outsock,buffer,len,0,(struct sockaddr*)&i->second.remote,i->second.addrlen); 
    186189 
  • trunk/pdns/pdns/docs/pdns.sgml

    r140 r141  
    1212    </author> 
    1313     
    14     <PubDate>v2.1 $Date: 2003/01/23 15:34:53 $</PubDate> 
     14    <PubDate>v2.1 $Date: 2003/01/31 12:42:28 $</PubDate> 
    1515     
    1616    <Abstract> 
     
    57405740      </para> 
    57415741      <para> 
    5742         This is the driver that corresponds to the set of XML-RPC tools available from PowerDNS. For database schemas, see there. 
     5742        This is the driver that corresponds to the set of XML-RPC tools available from PowerDNS.  
     5743      </para> 
     5744      <para> 
     5745        The schema: 
     5746        <screen> 
     5747CREATE TABLE MailForwards ( 
     5748  Id int(10) unsigned NOT NULL auto_increment, 
     5749  ZoneId int(10) unsigned NOT NULL default '0', 
     5750  Name varchar(255) NOT NULL default '', 
     5751  Destination varchar(255) NOT NULL default '', 
     5752  Flags int(11) NOT NULL default '0', 
     5753  ChangeDate timestamp(14) NOT NULL, 
     5754  CreateDate timestamp(14) NOT NULL, 
     5755  Active tinyint(4) NOT NULL default '0', 
     5756  PRIMARY KEY  (Id), 
     5757  KEY NameIndex (Name), 
     5758  KEY ZoneIdIndex (ZoneId) 
     5759); 
     5760 
     5761-- 
     5762-- Table structure for table 'Mailboxes' 
     5763-- 
     5764 
     5765CREATE TABLE Mailboxes ( 
     5766  Id int(10) unsigned NOT NULL auto_increment, 
     5767  ZoneId int(10) unsigned NOT NULL default '0', 
     5768  Name varchar(255) NOT NULL default '', 
     5769  Password varchar(255) NOT NULL default '', 
     5770  Quota int(10) unsigned NOT NULL default '0', 
     5771  Flags int(11) NOT NULL default '0', 
     5772  ChangeDate timestamp(14) NOT NULL, 
     5773  CreateDate timestamp(14) NOT NULL, 
     5774  Active tinyint(4) NOT NULL default '0', 
     5775  PRIMARY KEY  (Id), 
     5776  UNIQUE KEY Name (Name), 
     5777  KEY ZoneIdIndex (ZoneId), 
     5778  KEY NameIndex (Name) 
     5779); 
     5780 
     5781-- 
     5782-- Table structure for table 'Records' 
     5783-- 
     5784 
     5785CREATE TABLE Records ( 
     5786  Id int(10) unsigned NOT NULL auto_increment, 
     5787  ZoneId int(10) unsigned NOT NULL default '0', 
     5788  Name varchar(255) NOT NULL default '', 
     5789  Type varchar(8) NOT NULL default '', 
     5790  Content varchar(255) NOT NULL default '', 
     5791  TimeToLive int(11) NOT NULL default '60', 
     5792  Priority int(11) NOT NULL default '0', 
     5793  Flags int(11) NOT NULL default '0', 
     5794  ChangeDate timestamp(14) NOT NULL, 
     5795  CreateDate timestamp(14) NOT NULL, 
     5796  Active tinyint(4) NOT NULL default '0', 
     5797  PRIMARY KEY  (Id), 
     5798  KEY NameIndex (Name) 
     5799); 
     5800 
     5801-- 
     5802-- Table structure for table 'WebForwards' 
     5803-- 
     5804 
     5805CREATE TABLE WebForwards ( 
     5806  Id int(10) unsigned NOT NULL auto_increment, 
     5807  ZoneId int(10) unsigned NOT NULL default '0', 
     5808  Name varchar(255) NOT NULL default '', 
     5809  Destination varchar(255) NOT NULL default '', 
     5810  Type varchar(7) NOT NULL default 'NORMAL', 
     5811  Title varchar(255) NOT NULL default '', 
     5812  Description varchar(255) NOT NULL default '', 
     5813  Keywords varchar(255) NOT NULL default '', 
     5814  FavIcon varchar(255) NOT NULL default '', 
     5815  Flags int(11) NOT NULL default '0', 
     5816  ChangeDate timestamp(14) NOT NULL, 
     5817  CreateDate timestamp(14) NOT NULL, 
     5818  Active tinyint(4) NOT NULL default '0', 
     5819  PRIMARY KEY  (Id), 
     5820  KEY NameIndex (Name), 
     5821  KEY ZoneIdIndex (ZoneId) 
     5822); 
     5823 
     5824-- 
     5825-- Table structure for table 'Zones' 
     5826-- 
     5827 
     5828CREATE TABLE Zones ( 
     5829  Id int(10) unsigned NOT NULL auto_increment, 
     5830  Name varchar(255) NOT NULL default '', 
     5831  Hostmaster varchar(255) NOT NULL default '', 
     5832  Serial int(10) unsigned NOT NULL default '0', 
     5833  AutoSerial tinyint(4) NOT NULL default '0', 
     5834  Flags int(11) NOT NULL default '0', 
     5835  ChangeDate timestamp(14) NOT NULL, 
     5836  CreateDate timestamp(14) NOT NULL, 
     5837  Active tinyint(4) NOT NULL default '0', 
     5838  TimeToLive int(11) NOT NULL default '0', 
     5839  OwnerId varchar(255) NOT NULL default '', 
     5840  PRIMARY KEY  (Id), 
     5841  UNIQUE KEY Name (Name), 
     5842  KEY NameIndex (Name) 
     5843); 
     5844 
     5845        </screen> 
    57435846      </para> 
    57445847      <para> 
     
    58935996      <sect2><title>PostgresSQL specifics</title> 
    58945997      <para> 
    5895         The default setup conforms to the following schema: 
     5998        The default setup conforms to the following schema, which you should add to a PostgreSQL database. 
    58965999        <programlisting> 
    58976000create table domains ( 
     
    59436046      <para> 
    59446047        Zone2sql with the --gpgsql flag also assumes this layout is in place. 
    5945       </para> 
     6048        </para> 
     6049        <para> 
     6050          With PostgreSQL, you may have to run 'createdb powerdns' first and then connect to that database with 'psql powerdns', and  
     6051          feed it the schema above. 
     6052        </para> 
    59466053      </sect2> 
    59476054      <sect2><title>Basic functionality</title> 
  • trunk/pdns/pdns/lwres.hh

    r138 r141  
    4444 
    4545int asendto(const char *data, int len, int flags, struct sockaddr *toaddr, int addrlen, int id); 
    46 int arecvfrom(char *data, int len, int flags, struct sockaddr *toaddr, socklen_t *addrlen, int *d_len, int id); 
     46int arecvfrom(char *data, int len, int flags, struct sockaddr *toaddr, Utility::socklen_t *addrlen, int *d_len, int id); 
    4747 
    4848class LWResException : public AhuException 
  • trunk/pdns/pdns/mtasker.hh

    r135 r141  
    1919#ifndef MTASKER_HH 
    2020#define MTASKER_HH 
     21 
     22#ifdef WIN32 
     23# include "win32_mtasker.hh" 
     24#else 
     25 
    2126#include <signal.h> 
    2227#include <ucontext.h> 
     
    8085}; 
    8186#include "mtasker.cc" 
    82 #endif 
     87 
     88#endif // WIN32 
     89#endif // MTASKER_HH 
     90 
  • trunk/pdns/pdns/pdns_recursor.cc

    r140 r141  
    1717    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    1818*/ 
    19   
     19 
     20#include "utility.hh"  
    2021#include <iostream> 
    2122#include <errno.h> 
    2223#include <map> 
    2324#include <set> 
     25#ifndef WIN32 
    2426#include <netdb.h> 
     27#endif // WIN32 
    2528#include <stdio.h> 
    2629#include <signal.h> 
     
    3437#include "syncres.hh" 
    3538 
     39#ifndef WIN32 
    3640extern "C" { 
    3741  int sem_init(sem_t*, int, unsigned int){return 0;} 
     
    4145  int sem_getvalue(sem_t*, int*){return 0;} 
    4246} 
     47#endif // WIN32 
    4348 
    4449StatBag S; 
     
    8186} 
    8287 
    83 int arecvfrom(char *data, int len, int flags, struct sockaddr *toaddr, socklen_t *addrlen, int *d_len, int id) 
     88int arecvfrom(char *data, int len, int flags, struct sockaddr *toaddr, Utility::socklen_t *addrlen, int *d_len, int id) 
    8489{ 
    8590  PacketID pident; 
     
    121126void init(void) 
    122127{ 
    123   PacketID a, b; 
    124   a.remote=b.remote; 
    125   a.id=b.id; 
    126  
    127128  // prime root cache 
    128129  static char*ips[]={"198.41.0.4", "128.9.0.107", "192.33.4.12", "128.8.10.90", "192.203.230.10", "192.5.5.241", "192.112.36.4", "128.63.2.53",  
     
    213214  int tries=10; 
    214215  while(--tries) { 
    215     u_int16_t port=10000+random()%10000; 
     216    u_int16_t port=10000+Utility::random()%10000; 
    216217    sin.sin_port = htons(port);  
    217218     
     
    254255  L<<Logger::Error<<"Incoming query source port: "<<arg().asNum("local-port")<<endl; 
    255256} 
     257 
     258#ifndef WIN32 
    256259void daemonize(void) 
    257260{ 
     
    267270 
    268271} 
     272#endif 
     273 
    269274int counter, qcounter; 
    270275bool statsWanted; 
     
    309314int main(int argc, char **argv)  
    310315{ 
     316#ifdef WIN32 
     317    WSADATA wsaData; 
     318    WSAStartup( MAKEWORD( 2, 0 ), &wsaData ); 
     319#endif // WIN32 
     320 
    311321  try { 
    312     srandom(time(0)); 
     322    Utility::srandom(time(0)); 
    313323    arg().set("soa-minimum-ttl","Don't change")="0"; 
    314324    arg().set("soa-serial-offset","Don't change")="0"; 
     
    332342    arg().parse(argc,argv); 
    333343 
    334  
    335344    if(arg().mustDo("help")) { 
    336345      cerr<<"syntax:"<<endl<<endl; 
     
    353362    init();     
    354363    L<<Logger::Warning<<"Done priming cache with root hints"<<endl; 
    355  
     364#ifndef WIN32 
    356365    if(arg().mustDo("daemon")) { 
    357366      L.toConsole(Logger::Critical); 
     
    359368    } 
    360369    signal(SIGUSR1,usr1Handler); 
     370#endif 
    361371 
    362372    for(;;) { 
     
    368378        doStats(); 
    369379 
    370       socklen_t addrlen=sizeof(fromaddr); 
     380      Utility::socklen_t addrlen=sizeof(fromaddr); 
    371381      int d_len; 
    372382      DNSPacket P; 
     
    387397          continue; 
    388398 
    389        
    390399      if(FD_ISSET(d_clientsock,&readfds)) { // do we have a question response? 
    391400        d_len=recvfrom(d_clientsock, data, sizeof(data), 0, (sockaddr *)&fromaddr, &addrlen);     
     
    440449    L<<Logger::Error<<"any other exception in main: "<<endl; 
    441450  } 
    442 } 
     451   
     452#ifdef WIN32 
     453  WSACleanup(); 
     454#endif // WIN32 
     455 
     456  return 0; 
     457} 
  • trunk/pdns/pdns/powerdns.dsw

    r57 r141  
    44############################################################################### 
    55 
    6 Project: "installer"=.\installer.dsp - Package Owner=<4> 
     6Project: "installer"=".\installer.dsp" - Package Owner=<4> 
    77 
    88Package=<5> 
     
    1616    End Project Dependency 
    1717    Begin Project Dependency 
    18     Project_Dep_Name pdnsmsg 
     18    Project_Dep_Name zone2sql 
    1919    End Project Dependency 
    2020    Begin Project Dependency 
    21     Project_Dep_Name zone2sql 
     21    Project_Dep_Name pdns_recursor 
     22    End Project Dependency 
     23    Begin Project Dependency 
     24    Project_Dep_Name pdns_control 
    2225    End Project Dependency 
    2326}}} 
     
    2528############################################################################### 
    2629 
    27 Project: "odbcbackend"=.\odbcbackend.dsp - Package Owner=<4> 
     30Project: "odbcbackend"=".\odbcbackend.dsp" - Package Owner=<4> 
    2831 
    2932Package=<5> 
     
    3740############################################################################### 
    3841 
    39 Project: "pdns"=.\pdns.dsp - Package Owner=<4> 
     42Project: "pdns"=".\pdns.dsp" - Package Owner=<4> 
    4043 
    4144Package=<5> 
     
    5558############################################################################### 
    5659 
    57 Project: "pdnscontrol"=.\pdnscontrol.dsp - Package Owner=<4> 
     60Project: "pdns_control"=".\pdns_control.dsp" - Package Owner=<4> 
    5861 
    5962Package=<5> 
     
    6770############################################################################### 
    6871 
    69 Project: "pdnsmsg"=.\pdnsmsg.dsp - Package Owner=<4> 
     72Project: "pdns_recursor"=".\pdns_recursor.dsp" - Package Owner=<4> 
     73 
     74Package=<5> 
     75{{{ 
     76}}} 
     77 
     78Package=<4> 
     79{{{ 
     80    Begin Project Dependency 
     81    Project_Dep_Name pdnsmsg 
     82    End Project Dependency 
     83}}} 
     84 
     85############################################################################### 
     86 
     87Project: "pdnsmsg"=".\pdnsmsg.dsp" - Package Owner=<4> 
    7088 
    7189Package=<5> 
     
    7997############################################################################### 
    8098 
    81 Project: "zone2sql"=.\zone2sql.dsp - Package Owner=<4> 
     99Project: "zone2sql"=".\zone2sql.dsp" - Package Owner=<4> 
    82100 
    83101Package=<5> 
     
    87105Package=<4> 
    88106{{{ 
     107    Begin Project Dependency 
     108    Project_Dep_Name pdnsmsg 
     109    End Project Dependency 
    89110}}} 
    90111 
  • trunk/pdns/pdns/syncres.cc

    r138 r141  
    1717    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    1818*/ 
     19 
     20#include "utility.hh" 
    1921#include "syncres.hh" 
    2022#include <iostream> 
     
    381383        return RCode::NXDomain; 
    382384      } 
    383       if(nsset.empty() && !d_lwr.d_rcode) { 
    384         LOG<<prefix<<qname<<": status=noerror, other types may exist, but we are done "<<(negindic ? "(have negative SOA)" : "")<<endl; 
    385         return 0; 
    386       } 
    387385      if(!newtarget.empty()) { 
    388386        LOG<<prefix<<qname<<": status=got a CNAME referral, starting over with "<<newtarget<<endl; 
    389387        set<GetBestNSAnswer>beenthere2; 
    390388        return doResolve(newtarget, qtype, ret,0,beenthere2); 
     389      } 
     390      if(nsset.empty() && !d_lwr.d_rcode) { 
     391        LOG<<prefix<<qname<<": status=noerror, other types may exist, but we are done "<<(negindic ? "(have negative SOA)" : "")<<endl; 
     392        return 0; 
    391393      } 
    392394      else if(realreferral) { 
  • trunk/pdns/pdns/utility.hh

    r104 r141  
    5050# pragma warning ( disable: 4101 ) 
    5151 
     52# define _WIN32_WINNT 0x0400 
    5253# define WINDOWS_LEAN_AND_MEAN 
    5354# include <windows.h> 
     
    6162# define EINPROGRESS  WSAEWOULDBLOCK 
    6263 
    63 # define AF_INET6 -1 
    64  
    65 # define VERSION "2.9.2-WIN32" 
     64# define VERSION "2.9.5-WIN32" 
    6665 
    6766# define snprintf _snprintf 
  • trunk/pdns/pdns/win32_logger.cc

    r57 r141  
    6565      return; 
    6666    } 
     67  } 
     68 
     69  if ( !PDNSService::instance()) 
     70  { 
     71    clog << msg << endl; 
     72    return; 
    6773  } 
    6874 
  • trunk/pdns/pdns/win32_receiver.cc

    r57 r141  
    1818*/ 
    1919 
    20 // $Id: win32_receiver.cc,v 1.2 2002/12/06 09:58:03 ahu Exp $ 
     20// $Id: win32_receiver.cc,v 1.3 2003/01/31 12:42:28 ahu Exp $ 
    2121#include "utility.hh" 
    2222#include <cstdio> 
     
    492492    dl->registerFunc("REDISCOVER",&DLRediscoverHandler); 
    493493    dl->registerFunc("VERSION",&DLVersionHandler); 
     494    dl->registerFunc("PURGE",&DLPurgeHandler); 
     495    dl->registerFunc("CCOUNTS",&DLCCHandler); 
     496    dl->registerFunc("SET",&DLSettingsHandler); 
     497    dl->registerFunc("RETRIEVE",&DLNotifyRetrieveHandler); 
    494498 
    495499       
  • trunk/pdns/pdns/ws.cc

    r138 r141  
    160160 
    161161 
     162  ret<<"<h2>"; 
     163  if(!arg()["config-name"].empty()) 
     164    ret<<"["<<arg()["config-name"]<<"]"; 
    162165  if(rvarmap["ring"].empty()) 
    163     ret<<"<h2>PDNS "VERSION" Main Page</h2>"<<endl; 
     166    ret<<"PDNS "VERSION" Main Page</h2>"<<endl; 
    164167  else 
    165     ret<<"<h2>Details page</h2><a href=/>Back to main page</a><p>"<<endl; 
     168    ret<<"Details page</h2><a href=/>Back to main page</a><p>"<<endl; 
    166169 
    167170  time_t passed=time(0)-s_starttime;