Changeset 141
- Timestamp:
- 01/31/03 13:42:28 (10 years ago)
- Location:
- trunk/pdns
- Files:
-
- 18 modified
-
ChangeLog (modified) (1 diff)
-
modules/mysqlbackend/OBJECTLIBS (modified) (1 diff)
-
pdns/backends/bind/bindlexer.c (modified) (11 diffs)
-
pdns/backends/bind/bindlexer.l (modified) (2 diffs)
-
pdns/backends/bind/bindparser.cc (modified) (4 diffs)
-
pdns/backends/bind/bindparser.h (modified) (1 diff)
-
pdns/backends/bind/bindparser.yy (modified) (9 diffs)
-
pdns/dnsproxy.cc (modified) (1 diff)
-
pdns/docs/pdns.sgml (modified) (4 diffs)
-
pdns/lwres.hh (modified) (1 diff)
-
pdns/mtasker.hh (modified) (2 diffs)
-
pdns/pdns_recursor.cc (modified) (15 diffs)
-
pdns/powerdns.dsw (modified) (8 diffs)
-
pdns/syncres.cc (modified) (2 diffs)
-
pdns/utility.hh (modified) (2 diffs)
-
pdns/win32_logger.cc (modified) (1 diff)
-
pdns/win32_receiver.cc (modified) (2 diffs)
-
pdns/ws.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/ChangeLog
r140 r141 10 10 - SRV records (Ueli Heuer) 11 11 - 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) 12 17 13 18 Changes 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 2 2 3 3 /* Scanner skeleton version: 4 * $Header: /home/ahu/tmp/cvs2svn/pdns/pdns/backends/bind/bindlexer.c,v 1. 3 2002/12/06 09:58:03ahu Exp $4 * $Header: /home/ahu/tmp/cvs2svn/pdns/pdns/backends/bind/bindlexer.c,v 1.4 2003/01/31 12:42:28 ahu Exp $ 5 5 */ 6 6 … … 457 457 458 458 #ifdef WIN32 459 #include "bindparser.tab. cc.h"460 #define isatty _isatty 461 int isatty( int fd ) 459 #include "bindparser.tab.hh" 460 461 extern "C" 462 462 { 463 return _isatty( fd ); 463 int isatty( int ); 464 int yywrap() 465 { 466 return 1; 467 } 464 468 } 469 470 465 471 #else 466 472 #include "bindparser.h" … … 484 490 485 491 #define YY_STACK_USED 1 486 #line 4 87"lex.yy.c"492 #line 493 "lex.yy.c" 487 493 488 494 /* Macros after this point can all be overridden by user definitions in … … 646 652 register int yy_act; 647 653 648 #line 36"bindlexer.l"649 650 651 652 #line 65 3"lex.yy.c"654 #line 42 "bindlexer.l" 655 656 657 658 #line 659 "lex.yy.c" 653 659 654 660 if ( yy_init ) … … 735 741 case 1: 736 742 YY_RULE_SETUP 737 #line 39"bindlexer.l"743 #line 45 "bindlexer.l" 738 744 BEGIN(comment); 739 745 YY_BREAK 740 746 case 2: 741 747 YY_RULE_SETUP 742 #line 4 0"bindlexer.l"748 #line 46 "bindlexer.l" 743 749 /* eat anything that's not a '*' */ 744 750 YY_BREAK 745 751 case 3: 746 752 YY_RULE_SETUP 747 #line 4 1"bindlexer.l"753 #line 47 "bindlexer.l" 748 754 /* eat up '*'s not followed by '/'s */ 749 755 YY_BREAK 750 756 case 4: 751 757 YY_RULE_SETUP 752 #line 4 2"bindlexer.l"758 #line 48 "bindlexer.l" 753 759 ++linenumber; 754 760 YY_BREAK 755 761 case 5: 756 762 YY_RULE_SETUP 757 #line 4 3"bindlexer.l"763 #line 49 "bindlexer.l" 758 764 BEGIN(INITIAL); 759 765 YY_BREAK 760 766 case 6: 761 767 YY_RULE_SETUP 762 #line 45"bindlexer.l"768 #line 51 "bindlexer.l" 763 769 BEGIN(incl); 764 770 YY_BREAK 765 771 case 7: 766 772 YY_RULE_SETUP 767 #line 46"bindlexer.l"773 #line 52 "bindlexer.l" 768 774 /* eat the whitespace */ 769 775 YY_BREAK 770 776 case 8: 771 777 YY_RULE_SETUP 772 #line 47"bindlexer.l"778 #line 53 "bindlexer.l" 773 779 { /* got the include file name */ 774 780 char filename[1024]; … … 807 813 case YY_STATE_EOF(incl): 808 814 case YY_STATE_EOF(quoted): 809 #line 8 0"bindlexer.l"815 #line 86 "bindlexer.l" 810 816 { 811 817 if ( --include_stack_ptr < 0 ) … … 829 835 case 9: 830 836 YY_RULE_SETUP 831 #line 10 2"bindlexer.l"837 #line 108 "bindlexer.l" 832 838 return ZONETOK; 833 839 YY_BREAK 834 840 case 10: 835 841 YY_RULE_SETUP 836 #line 1 04"bindlexer.l"842 #line 110 "bindlexer.l" 837 843 return FILETOK; 838 844 YY_BREAK 839 845 case 11: 840 846 YY_RULE_SETUP 841 #line 1 05"bindlexer.l"847 #line 111 "bindlexer.l" 842 848 return OPTIONSTOK; 843 849 YY_BREAK 844 850 case 12: 845 851 YY_RULE_SETUP 846 #line 1 06"bindlexer.l"852 #line 112 "bindlexer.l" 847 853 return ACLTOK; 848 854 YY_BREAK 849 855 case 13: 850 856 YY_RULE_SETUP 851 #line 1 07"bindlexer.l"857 #line 113 "bindlexer.l" 852 858 return LOGGINGTOK; 853 859 YY_BREAK 854 860 case 14: 855 861 YY_RULE_SETUP 856 #line 1 08"bindlexer.l"862 #line 114 "bindlexer.l" 857 863 return DIRECTORYTOK; 858 864 YY_BREAK 859 865 case 15: 860 866 YY_RULE_SETUP 861 #line 1 09"bindlexer.l"867 #line 115 "bindlexer.l" 862 868 return MASTERTOK; 863 869 YY_BREAK 864 870 case 16: 865 871 YY_RULE_SETUP 866 #line 11 0"bindlexer.l"872 #line 116 "bindlexer.l" 867 873 return TYPETOK; 868 874 YY_BREAK 869 875 case 17: 870 876 YY_RULE_SETUP 871 #line 11 1"bindlexer.l"877 #line 117 "bindlexer.l" 872 878 yy_push_state(quoted); 873 879 YY_BREAK 874 880 case 18: 875 881 YY_RULE_SETUP 876 #line 11 2"bindlexer.l"882 #line 118 "bindlexer.l" 877 883 yylval=strdup(yytext); return QUOTEDWORD; 878 884 YY_BREAK 879 885 case 19: 880 886 YY_RULE_SETUP 881 #line 11 3"bindlexer.l"887 #line 119 "bindlexer.l" 882 888 yy_pop_state(); 883 889 YY_BREAK 884 890 case 20: 885 891 YY_RULE_SETUP 886 #line 1 14"bindlexer.l"887 yylval=strdup(yytext);return WORD;892 #line 120 "bindlexer.l" 893 yylval=strdup(yytext);return AWORD; 888 894 YY_BREAK 889 895 case 21: 890 896 YY_RULE_SETUP 891 #line 1 15"bindlexer.l"897 #line 121 "bindlexer.l" 892 898 return OBRACE; 893 899 YY_BREAK 894 900 case 22: 895 901 YY_RULE_SETUP 896 #line 1 16"bindlexer.l"902 #line 122 "bindlexer.l" 897 903 return EBRACE; 898 904 YY_BREAK 899 905 case 23: 900 906 YY_RULE_SETUP 901 #line 1 17"bindlexer.l"907 #line 123 "bindlexer.l" 902 908 return SEMICOLON; 903 909 YY_BREAK 904 910 case 24: 905 911 YY_RULE_SETUP 906 #line 1 18"bindlexer.l"912 #line 124 "bindlexer.l" 907 913 linenumber++; 908 914 YY_BREAK 909 915 case 25: 910 916 YY_RULE_SETUP 911 #line 1 19"bindlexer.l"917 #line 125 "bindlexer.l" 912 918 ; 913 919 YY_BREAK … … 917 923 YY_DO_BEFORE_ACTION; /* set up yytext again */ 918 924 YY_RULE_SETUP 919 #line 12 0"bindlexer.l"925 #line 126 "bindlexer.l" 920 926 ; 921 927 YY_BREAK … … 925 931 YY_DO_BEFORE_ACTION; /* set up yytext again */ 926 932 YY_RULE_SETUP 927 #line 12 1"bindlexer.l"933 #line 127 "bindlexer.l" 928 934 ; 929 935 YY_BREAK 930 936 case 28: 931 937 YY_RULE_SETUP 932 #line 12 2"bindlexer.l"938 #line 128 "bindlexer.l" 933 939 { 934 940 fprintf(stderr,"Parsing '%s': unable to parse line %d at character '%s'\n",current_filename, linenumber, yytext); … … 937 943 case 29: 938 944 YY_RULE_SETUP 939 #line 1 25"bindlexer.l"945 #line 131 "bindlexer.l" 940 946 YY_FATAL_ERROR( "flex scanner jammed" ); 941 947 YY_BREAK 942 #line 94 3"lex.yy.c"948 #line 949 "lex.yy.c" 943 949 944 950 case YY_END_OF_BUFFER: … … 1828 1834 } 1829 1835 #endif 1830 #line 1 25"bindlexer.l"1831 1836 #line 131 "bindlexer.l" 1837 -
trunk/pdns/pdns/backends/bind/bindlexer.l
r57 r141 8 8 9 9 #ifdef WIN32 10 #include "bindparser.tab. cc.h"11 #define isatty _isatty 12 int isatty( int fd ) 10 #include "bindparser.tab.hh" 11 12 extern "C" 13 13 { 14 return _isatty( fd ); 14 int isatty( int ); 15 int yywrap() 16 { 17 return 1; 18 } 15 19 } 20 21 16 22 #else 17 23 #include "bindparser.h" … … 112 118 <quoted>[^\"]* yylval=strdup(yytext); return QUOTEDWORD; 113 119 <quoted>\" yy_pop_state(); 114 [^\" \t\n{};]* yylval=strdup(yytext);return WORD;120 [^\" \t\n{};]* yylval=strdup(yytext);return AWORD; 115 121 \{ return OBRACE; 116 122 \} return EBRACE; -
trunk/pdns/pdns/backends/bind/bindparser.cc
r86 r141 4 4 #define YYBISON 1 /* Identify Bison output. */ 5 5 6 # define WORD 2576 # define AWORD 257 7 7 # define QUOTEDWORD 258 8 8 # define OBRACE 259 … … 22 22 23 23 24 #define DIRTY_HACK WORD25 #undef WORD26 27 24 #include <stdio.h> 28 25 #include <string.h> … … 39 36 #include "bindparser.hh" 40 37 41 #define WORD DIRTY_HACK42 43 38 #define YYSTYPE char * 44 39 40 41 #ifndef WIN32 45 42 extern "C" 46 43 { 44 #endif // WIN32 47 45 int yyparse(void); 48 46 int yylex(void); 47 void yyrestart(FILE *); 49 48 int yywrap() 50 49 { 51 50 return 1; 52 51 } 53 void yyrestart(FILE *); 54 52 #ifndef WIN32 55 53 } 54 #endif // WIN32 55 56 56 57 57 extern int yydebug; … … 216 216 static const char *const yytname[] = 217 217 { 218 "$", "error", "$undefined.", " WORD", "QUOTEDWORD", "OBRACE", "EBRACE",218 "$", "error", "$undefined.", "AWORD", "QUOTEDWORD", "OBRACE", "EBRACE", 219 219 "SEMICOLON", "ZONETOK", "FILETOK", "OPTIONSTOK", "DIRECTORYTOK", 220 220 "ACLTOK", "LOGGINGTOK", "CLASSTOK", "TYPETOK", "MASTERTOK", -
trunk/pdns/pdns/backends/bind/bindparser.h
r2 r141 6 6 # define YYSTYPE_IS_TRIVIAL 1 7 7 # endif 8 # define WORD 2578 # define AWORD 257 9 9 # define QUOTEDWORD 258 10 10 # define OBRACE 259 -
trunk/pdns/pdns/backends/bind/bindparser.yy
r86 r141 1 1 %{ 2 3 #define DIRTY_HACK WORD4 #undef WORD5 2 6 3 #include <stdio.h> … … 18 15 #include "bindparser.hh" 19 16 20 #define WORD DIRTY_HACK21 22 17 #define YYSTYPE char * 23 18 19 20 #ifndef WIN32 24 21 extern "C" 25 22 { 23 #endif // WIN32 26 24 int yyparse(void); 27 25 int yylex(void); 26 void yyrestart(FILE *); 28 27 int yywrap() 29 28 { 30 29 return 1; 31 30 } 32 void yyrestart(FILE *); 33 34 } 31 #ifndef WIN32 32 } 33 #endif // WIN32 34 35 35 36 36 extern int yydebug; … … 101 101 %} 102 102 103 %token WORD QUOTEDWORD OBRACE EBRACE SEMICOLON ZONETOK FILETOK OPTIONSTOK103 %token AWORD QUOTEDWORD OBRACE EBRACE SEMICOLON ZONETOK FILETOK OPTIONSTOK 104 104 %token DIRECTORYTOK ACLTOK LOGGINGTOK CLASSTOK TYPETOK MASTERTOK 105 105 … … 131 131 } 132 132 | 133 ZONETOK quotedname WORD zone_block133 ZONETOK quotedname AWORD zone_block 134 134 { 135 135 s_di.name=$2; … … 159 159 160 160 acl: 161 WORD161 AWORD 162 162 ; 163 163 … … 182 182 ; 183 183 184 term: WORD | block | quotedname184 term: AWORD | block | quotedname 185 185 ; 186 186 block: … … 208 208 ; 209 209 210 master: WORD210 master: AWORD 211 211 { 212 212 s_di.master=$1; … … 223 223 224 224 zone_type_command: 225 TYPETOK WORD225 TYPETOK AWORD 226 226 { 227 227 s_di.type=$2; … … 237 237 ; 238 238 239 filename: WORD240 ; 239 filename: AWORD 240 ; -
trunk/pdns/pdns/dnsproxy.cc
r138 r141 169 169 (*d_resanswers)++; 170 170 (*d_udpanswers)++; 171 DNSPacket::dnsheader *d=reinterpret_cast<DNSPacket::dnsheader *>(buffer); 171 DNSPacket::dnsheader d; 172 memcpy(&d,buffer,sizeof(d)); 172 173 { 173 174 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); 175 176 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)<< 177 178 ". Contrack table size="<<d_conntrack.size()<<endl; 178 179 continue; 179 180 } 180 181 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; 182 183 continue; 183 184 } 184 d->id=i->second.id; 185 d.id=i->second.id; 186 memcpy(buffer,&d,sizeof(d)); // commit spoofed id 187 185 188 sendto(i->second.outsock,buffer,len,0,(struct sockaddr*)&i->second.remote,i->second.addrlen); 186 189 -
trunk/pdns/pdns/docs/pdns.sgml
r140 r141 12 12 </author> 13 13 14 <PubDate>v2.1 $Date: 2003/01/ 23 15:34:53$</PubDate>14 <PubDate>v2.1 $Date: 2003/01/31 12:42:28 $</PubDate> 15 15 16 16 <Abstract> … … 5740 5740 </para> 5741 5741 <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> 5747 CREATE 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 5765 CREATE 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 5785 CREATE 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 5805 CREATE 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 5828 CREATE 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> 5743 5846 </para> 5744 5847 <para> … … 5893 5996 <sect2><title>PostgresSQL specifics</title> 5894 5997 <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. 5896 5999 <programlisting> 5897 6000 create table domains ( … … 5943 6046 <para> 5944 6047 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> 5946 6053 </sect2> 5947 6054 <sect2><title>Basic functionality</title> -
trunk/pdns/pdns/lwres.hh
r138 r141 44 44 45 45 int 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);46 int arecvfrom(char *data, int len, int flags, struct sockaddr *toaddr, Utility::socklen_t *addrlen, int *d_len, int id); 47 47 48 48 class LWResException : public AhuException -
trunk/pdns/pdns/mtasker.hh
r135 r141 19 19 #ifndef MTASKER_HH 20 20 #define MTASKER_HH 21 22 #ifdef WIN32 23 # include "win32_mtasker.hh" 24 #else 25 21 26 #include <signal.h> 22 27 #include <ucontext.h> … … 80 85 }; 81 86 #include "mtasker.cc" 82 #endif 87 88 #endif // WIN32 89 #endif // MTASKER_HH 90 -
trunk/pdns/pdns/pdns_recursor.cc
r140 r141 17 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 19 20 #include "utility.hh" 20 21 #include <iostream> 21 22 #include <errno.h> 22 23 #include <map> 23 24 #include <set> 25 #ifndef WIN32 24 26 #include <netdb.h> 27 #endif // WIN32 25 28 #include <stdio.h> 26 29 #include <signal.h> … … 34 37 #include "syncres.hh" 35 38 39 #ifndef WIN32 36 40 extern "C" { 37 41 int sem_init(sem_t*, int, unsigned int){return 0;} … … 41 45 int sem_getvalue(sem_t*, int*){return 0;} 42 46 } 47 #endif // WIN32 43 48 44 49 StatBag S; … … 81 86 } 82 87 83 int arecvfrom(char *data, int len, int flags, struct sockaddr *toaddr, socklen_t *addrlen, int *d_len, int id)88 int arecvfrom(char *data, int len, int flags, struct sockaddr *toaddr, Utility::socklen_t *addrlen, int *d_len, int id) 84 89 { 85 90 PacketID pident; … … 121 126 void init(void) 122 127 { 123 PacketID a, b;124 a.remote=b.remote;125 a.id=b.id;126 127 128 // prime root cache 128 129 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", … … 213 214 int tries=10; 214 215 while(--tries) { 215 u_int16_t port=10000+ random()%10000;216 u_int16_t port=10000+Utility::random()%10000; 216 217 sin.sin_port = htons(port); 217 218 … … 254 255 L<<Logger::Error<<"Incoming query source port: "<<arg().asNum("local-port")<<endl; 255 256 } 257 258 #ifndef WIN32 256 259 void daemonize(void) 257 260 { … … 267 270 268 271 } 272 #endif 273 269 274 int counter, qcounter; 270 275 bool statsWanted; … … 309 314 int main(int argc, char **argv) 310 315 { 316 #ifdef WIN32 317 WSADATA wsaData; 318 WSAStartup( MAKEWORD( 2, 0 ), &wsaData ); 319 #endif // WIN32 320 311 321 try { 312 srandom(time(0));322 Utility::srandom(time(0)); 313 323 arg().set("soa-minimum-ttl","Don't change")="0"; 314 324 arg().set("soa-serial-offset","Don't change")="0"; … … 332 342 arg().parse(argc,argv); 333 343 334 335 344 if(arg().mustDo("help")) { 336 345 cerr<<"syntax:"<<endl<<endl; … … 353 362 init(); 354 363 L<<Logger::Warning<<"Done priming cache with root hints"<<endl; 355 364 #ifndef WIN32 356 365 if(arg().mustDo("daemon")) { 357 366 L.toConsole(Logger::Critical); … … 359 368 } 360 369 signal(SIGUSR1,usr1Handler); 370 #endif 361 371 362 372 for(;;) { … … 368 378 doStats(); 369 379 370 socklen_t addrlen=sizeof(fromaddr);380 Utility::socklen_t addrlen=sizeof(fromaddr); 371 381 int d_len; 372 382 DNSPacket P; … … 387 397 continue; 388 398 389 390 399 if(FD_ISSET(d_clientsock,&readfds)) { // do we have a question response? 391 400 d_len=recvfrom(d_clientsock, data, sizeof(data), 0, (sockaddr *)&fromaddr, &addrlen); … … 440 449 L<<Logger::Error<<"any other exception in main: "<<endl; 441 450 } 442 } 451 452 #ifdef WIN32 453 WSACleanup(); 454 #endif // WIN32 455 456 return 0; 457 } -
trunk/pdns/pdns/powerdns.dsw
r57 r141 4 4 ############################################################################### 5 5 6 Project: "installer"= .\installer.dsp- Package Owner=<4>6 Project: "installer"=".\installer.dsp" - Package Owner=<4> 7 7 8 8 Package=<5> … … 16 16 End Project Dependency 17 17 Begin Project Dependency 18 Project_Dep_Name pdnsmsg18 Project_Dep_Name zone2sql 19 19 End Project Dependency 20 20 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 22 25 End Project Dependency 23 26 }}} … … 25 28 ############################################################################### 26 29 27 Project: "odbcbackend"= .\odbcbackend.dsp- Package Owner=<4>30 Project: "odbcbackend"=".\odbcbackend.dsp" - Package Owner=<4> 28 31 29 32 Package=<5> … … 37 40 ############################################################################### 38 41 39 Project: "pdns"= .\pdns.dsp- Package Owner=<4>42 Project: "pdns"=".\pdns.dsp" - Package Owner=<4> 40 43 41 44 Package=<5> … … 55 58 ############################################################################### 56 59 57 Project: "pdns control"=.\pdnscontrol.dsp- Package Owner=<4>60 Project: "pdns_control"=".\pdns_control.dsp" - Package Owner=<4> 58 61 59 62 Package=<5> … … 67 70 ############################################################################### 68 71 69 Project: "pdnsmsg"=.\pdnsmsg.dsp - Package Owner=<4> 72 Project: "pdns_recursor"=".\pdns_recursor.dsp" - Package Owner=<4> 73 74 Package=<5> 75 {{{ 76 }}} 77 78 Package=<4> 79 {{{ 80 Begin Project Dependency 81 Project_Dep_Name pdnsmsg 82 End Project Dependency 83 }}} 84 85 ############################################################################### 86 87 Project: "pdnsmsg"=".\pdnsmsg.dsp" - Package Owner=<4> 70 88 71 89 Package=<5> … … 79 97 ############################################################################### 80 98 81 Project: "zone2sql"= .\zone2sql.dsp- Package Owner=<4>99 Project: "zone2sql"=".\zone2sql.dsp" - Package Owner=<4> 82 100 83 101 Package=<5> … … 87 105 Package=<4> 88 106 {{{ 107 Begin Project Dependency 108 Project_Dep_Name pdnsmsg 109 End Project Dependency 89 110 }}} 90 111 -
trunk/pdns/pdns/syncres.cc
r138 r141 17 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 20 #include "utility.hh" 19 21 #include "syncres.hh" 20 22 #include <iostream> … … 381 383 return RCode::NXDomain; 382 384 } 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 }387 385 if(!newtarget.empty()) { 388 386 LOG<<prefix<<qname<<": status=got a CNAME referral, starting over with "<<newtarget<<endl; 389 387 set<GetBestNSAnswer>beenthere2; 390 388 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; 391 393 } 392 394 else if(realreferral) { -
trunk/pdns/pdns/utility.hh
r104 r141 50 50 # pragma warning ( disable: 4101 ) 51 51 52 # define _WIN32_WINNT 0x0400 52 53 # define WINDOWS_LEAN_AND_MEAN 53 54 # include <windows.h> … … 61 62 # define EINPROGRESS WSAEWOULDBLOCK 62 63 63 # define AF_INET6 -1 64 65 # define VERSION "2.9.2-WIN32" 64 # define VERSION "2.9.5-WIN32" 66 65 67 66 # define snprintf _snprintf -
trunk/pdns/pdns/win32_logger.cc
r57 r141 65 65 return; 66 66 } 67 } 68 69 if ( !PDNSService::instance()) 70 { 71 clog << msg << endl; 72 return; 67 73 } 68 74 -
trunk/pdns/pdns/win32_receiver.cc
r57 r141 18 18 */ 19 19 20 // $Id: win32_receiver.cc,v 1. 2 2002/12/06 09:58:03ahu Exp $20 // $Id: win32_receiver.cc,v 1.3 2003/01/31 12:42:28 ahu Exp $ 21 21 #include "utility.hh" 22 22 #include <cstdio> … … 492 492 dl->registerFunc("REDISCOVER",&DLRediscoverHandler); 493 493 dl->registerFunc("VERSION",&DLVersionHandler); 494 dl->registerFunc("PURGE",&DLPurgeHandler); 495 dl->registerFunc("CCOUNTS",&DLCCHandler); 496 dl->registerFunc("SET",&DLSettingsHandler); 497 dl->registerFunc("RETRIEVE",&DLNotifyRetrieveHandler); 494 498 495 499 -
trunk/pdns/pdns/ws.cc
r138 r141 160 160 161 161 162 ret<<"<h2>"; 163 if(!arg()["config-name"].empty()) 164 ret<<"["<<arg()["config-name"]<<"]"; 162 165 if(rvarmap["ring"].empty()) 163 ret<<" <h2>PDNS "VERSION" Main Page</h2>"<<endl;166 ret<<"PDNS "VERSION" Main Page</h2>"<<endl; 164 167 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; 166 169 167 170 time_t passed=time(0)-s_starttime;