1    | #include "ca_defs.h"
2    | 
3    | /*
4    | int bport = 43;
5    | */
6    | 
7    | GSList *sourceList = NULL;
8    | 
9    | /*
10   |  * 20000609
11   |  * Experiment:
12   |  * The GSList variable, "mySrcList", is defined in the ca_defs.h
13   |  * file (with an 'extern' modifier).
14   |  * GSList *mySrcList = NULL;
15   |  */
16   | 
17   | /*
18   | int testmode = 0;
19   | */
20   | 
21   | /*
22   | values_t globals[]	=	{
23   | 			{"43", &bport},
24   | 			{"/ncc/db2/doc/HELP", "/ncc/db2/doc/HELP"},
25   | 			{"% Rights restricted by copyright. See http://www.ripe.net/db/dbcopyright.html", "% Rights restricted by copyright. See http://www.ripe.net/db/dbcopyright.html"},
26   | 			{"SourceList", NULL},
27   | 			{"0", &testmode},
28   | 			{"1Bt9RNSMWcA.Y", "1Bt9RNSMWcA.Y"},
29   | 			{"/ncc/db2/doc/WHOIS-HELP", "/ncc/db2/doc/WHOIS-HELP"},
30   | 			{"/ncc/db2/doc/AUTO-DBM-HELP", "/ncc/db2/doc/AUTO-DBM-HELP"},
31   | 			{"/ncc/db2/etc/attr-desc.config", "/ncc/db2/etc/attr-desc.config"},
32   | 			{"RIPE", "RIPE"},
33   | 			{"RIPE          /ncc/db2/data/ripe/ripe.db         SPLIT", "RIPE          /ncc/db2/data/ripe/ripe.db         SPLIT"},
34   | 			{"RIPE", "RIPE"},
35   | 			{"SourceList", NULL},
36   | 			{"dbase", "dbase"},
37   | 			{"/ncc/db2/log/qry/qrylog", "/ncc/db2/log/qry/qrylog"},
38   | 			{"/ncc/db2/log/qry/qry2log", "/ncc/db2/log/qry/qry2log"},
39   | 			{"/ncc/db2/log/err/errlog", "/ncc/db2/log/err/errlog"},
40   | 			{"/ncc/db2/log/audit/auditlog", "/ncc/db2/log/audit/auditlog"},
41   | 			{"/ncc/db2/log/upd", "/ncc/db2/log/upd"},
42   | 			{"/ncc/db2/log/ack", "/ncc/db2/log/ack"},
43   | 			{"/ncc/db2/locks", "/ncc/db2/locks"},
44   | 			{"whoisd.pid", "whoisd.pid"},
45   | 			{"STOPUPDATES", "STOPUPDATES"},
46   | 			{"CLEANDB.LOCK", "CLEANDB.LOCK"},
47   | 			{"/ncc/db2/serials/current", "/ncc/db2/serials/current"},
48   | 			{"/ncc/db2/serials/old", "/ncc/db2/serials/old"},
49   | 			{"/ncc/db2/serials/incoming", "/ncc/db2/serials/incoming"},
50   | 			{"180", "180"},
51   | 			{"RIPE-NCC-HM-MNT ", "RIPE-NCC-HM-MNT "},
52   | 			{"127.0.0.1", "127.0.0.1"},
53   | 			{"193.0.0.1[345678][0-9]", "193.0.0.1[345678][0-9]"},
54   | 			{"195.88.156.1", "195.88.156.1"},
55   | 			{"/ncc/db2/tmp", "/ncc/db2/tmp"},
56   | 			{"/usr/local/bin/pgpv", "/usr/local/bin/pgpv"},
57   | 			{"/usr/local/bin/pgpk", "/usr/local/bin/pgpk"},
58   | 			{"/ncc/db2/.pgp", "/ncc/db2/.pgp"},
59   | 			{"/var/qmail/bin/qmail-inject -fripe-dbm", "/var/qmail/bin/qmail-inject -fripe-dbm"},
60   | 			{"8096", "8096"},
61   | 			{"2097152", "2097152"},
62   | 			{"2", "2"},
63   | 			{"ripe-dbm@ripe.net", "ripe-dbm@ripe.net"},
64   | 			{"ripe-dbm@ripe.net", "ripe-dbm@ripe.net"},
65   | 			{"auto-dbm@ripe.net", "auto-dbm@ripe.net"},
66   | 			{"nostrict", "nostrict"},
67   | 			{"% No entries found for the selected source(s).", "% No entries found for the selected source(s)."},
68   | 			{"Subject: RIPE RR: Addition of overlapping routes", "Subject: RIPE RR: Addition of overlapping routes"},
69   | 			{"Subject: RIPE RR: Removal  of overlapping routes", "Subject: RIPE RR: Removal  of overlapping routes"},
70   | 			{"The addition of your route object ... ", "The addition of your route object ... "},
71   | 			{"The deletion of your route object ... ", "The deletion of your route object ... "},
72   | 			{"created new overlaps with the following routes ...", "created new overlaps with the following routes ..."},
73   | 			{"removed the overlaps with the following routes ...", "removed the overlaps with the following routes ..."},
74   | 			{"Subject: RIPE RR: Addition of overlapping routes", "Subject: RIPE RR: Addition of overlapping routes"},
75   | 			{"Subject: RIPE RR: Removal  of overlapping routes", "Subject: RIPE RR: Removal  of overlapping routes"},
76   | 			{"The addition of the route object ... ", "The addition of the route object ... "},
77   | 			{"The deletion of the route object ... ", "The deletion of the route object ... "},
78   | 			{"created new overlaps with your following routes ...", "created new overlaps with your following routes ..."},
79   | 			{"removed the overlaps with your following routes ...", "removed the overlaps with your following routes ..."},
80   | 			{"Your e-mail:", "Your e-mail:"},
81   | 			{"From: RIPE Database Management <$HUMAILBOX>", "From: RIPE Database Management <$HUMAILBOX>"},
82   | 			{"From: RIPE Database Management <$HUMAILBOX>", "From: RIPE Database Management <$HUMAILBOX>"},
83   | 			{"Subject: SUCCEEDED: $SUBJECT", "Subject: SUCCEEDED: $SUBJECT"},
84   | 			{"Help file requested so body of message ignored.", "Help file requested so body of message ignored."},
85   | 			{"Objects that just generated a WARNING have been updated as shown.", "Objects that just generated a WARNING have been updated as shown."},
86   | 			{"No errors were found in your database update.  Congratulations.", "No errors were found in your database update.  Congratulations."},
87   | 			{"RIPE Database Maintenance Department (Automatic Section)", "RIPE Database Maintenance Department (Automatic Section)"},
88   | 			{"This is to notify you that some object(s) in the RIPE database", "This is to notify you that some object(s) in the RIPE database"},
89   | 			{"The update causing these changes had the following mail headers:", "The update causing these changes had the following mail headers:"},
90   | 			{"The update causing these changes came from the following host:", "The update causing these changes came from the following host:"},
91   | 			{"From: RIPE Database Notifications <$HUMAILBOX>", "From: RIPE Database Notifications <$HUMAILBOX>"},
92   | 			{"From: RIPE Database Maintainer Forwarding <$HUMAILBOX>", "From: RIPE Database Maintainer Forwarding <$HUMAILBOX>"},
93   | 			{"This is to notify you that some objects in which you are mentioned as", "This is to notify you that some objects in which you are mentioned as"},
94   | 			{"The mail message causing these failures had the following mail headers:", "The mail message causing these failures had the following mail headers:"},
95   | 			{"The update causing these failures came from the following host:", "The update causing these failures came from the following host:"},
96   | 			{"From: RIPE Database Maintainer Creation <$HUMAILBOX>", "From: RIPE Database Maintainer Creation <$HUMAILBOX>"},
97   | 			{"A maintainer object is requested by:", "A maintainer object is requested by:"},
98   | 			{"* A C C E S S    D E N I E D *", "* A C C E S S    D E N I E D *"},
99   | 			{"The object shown below is NOT in the RIPE database.", "The object shown below is NOT in the RIPE database."},
100  | 			{"Referred query to host $REFERHOST at port $REFERPORT", "Referred query to host $REFERHOST at port $REFERPORT"},
101  | 			{"Referral loop detected when querying ", "Referral loop detected when querying "},
102  | 			{"Referred query to host $REFERHOST at port $REFERPORT", "Referred query to host $REFERHOST at port $REFERPORT"},
103  | 			{"Result TRUNCATED. Answer lenght exceeded limit.", "Result TRUNCATED. Answer lenght exceeded limit."},
104  | 			{"%%% End of referred query result", "%%% End of referred query result"},
105  | 			{"10", "10"},
106  | 			{"2000", "2000"},
107  | 			{"Copyright (c)1992/1993/1994/1995/1996/1997/1998/1999 by RIPE NCC ", "Copyright (c)1992/1993/1994/1995/1996/1997/1998/1999 by RIPE NCC "},
108  | 			{"IE ie", "IE ie"}
109  | 	};
110  |  values_t locals[]	=	{
111  | 			{"43", &bport},
112  | 			{"/ncc/db2/doc/HELP", "/ncc/db2/doc/HELP"},
113  | 			{"% Rights restricted by copyright. See http://www.ripe.net/db/dbcopyright.html", "% Rights restricted by copyright. See http://www.ripe.net/db/dbcopyright.html"},
114  | 			{"SourceList", NULL},
115  | 			{"0", &testmode},
116  | 			{"1Bt9RNSMWcA.Y", "1Bt9RNSMWcA.Y"},
117  | 			{"/ncc/db2/doc/WHOIS-HELP", "/ncc/db2/doc/WHOIS-HELP"},
118  | 			{"/ncc/db2/doc/AUTO-DBM-HELP", "/ncc/db2/doc/AUTO-DBM-HELP"},
119  | 			{"/ncc/db2/etc/attr-desc.config", "/ncc/db2/etc/attr-desc.config"},
120  | 			{"RIPE", "RIPE"},
121  | 			{"RIPE          /ncc/db2/data/ripe/ripe.db         SPLIT", "RIPE          /ncc/db2/data/ripe/ripe.db         SPLIT"},
122  | 			{"RIPE", "RIPE"},
123  | 			{"SourceList", NULL},
124  | 			{"dbase", "dbase"},
125  | 			{"/ncc/db2/log/qry/qrylog", "/ncc/db2/log/qry/qrylog"},
126  | 			{"/ncc/db2/log/qry/qry2log", "/ncc/db2/log/qry/qry2log"},
127  | 			{"/ncc/db2/log/err/errlog", "/ncc/db2/log/err/errlog"},
128  | 			{"/ncc/db2/log/audit/auditlog", "/ncc/db2/log/audit/auditlog"},
129  | 			{"/ncc/db2/log/upd", "/ncc/db2/log/upd"},
130  | 			{"/ncc/db2/log/ack", "/ncc/db2/log/ack"},
131  | 			{"/ncc/db2/locks", "/ncc/db2/locks"},
132  | 			{"whoisd.pid", "whoisd.pid"},
133  | 			{"STOPUPDATES", "STOPUPDATES"},
134  | 			{"CLEANDB.LOCK", "CLEANDB.LOCK"},
135  | 			{"/ncc/db2/serials/current", "/ncc/db2/serials/current"},
136  | 			{"/ncc/db2/serials/old", "/ncc/db2/serials/old"},
137  | 			{"/ncc/db2/serials/incoming", "/ncc/db2/serials/incoming"},
138  | 			{"180", "180"},
139  | 			{"RIPE-NCC-HM-MNT ", "RIPE-NCC-HM-MNT "},
140  | 			{"127.0.0.1", "127.0.0.1"},
141  | 			{"193.0.0.1[345678][0-9]", "193.0.0.1[345678][0-9]"},
142  | 			{"195.88.156.1", "195.88.156.1"},
143  | 			{"/ncc/db2/tmp", "/ncc/db2/tmp"},
144  | 			{"/usr/local/bin/pgpv", "/usr/local/bin/pgpv"},
145  | 			{"/usr/local/bin/pgpk", "/usr/local/bin/pgpk"},
146  | 			{"/ncc/db2/.pgp", "/ncc/db2/.pgp"},
147  | 			{"/var/qmail/bin/qmail-inject -fripe-dbm", "/var/qmail/bin/qmail-inject -fripe-dbm"},
148  | 			{"8096", "8096"},
149  | 			{"2097152", "2097152"},
150  | 			{"2", "2"},
151  | 			{"ripe-dbm@ripe.net", "ripe-dbm@ripe.net"},
152  | 			{"ripe-dbm@ripe.net", "ripe-dbm@ripe.net"},
153  | 			{"auto-dbm@ripe.net", "auto-dbm@ripe.net"},
154  | 			{"nostrict", "nostrict"},
155  | 			{"% No entries found for the selected source(s).", "% No entries found for the selected source(s)."},
156  | 			{"Subject: RIPE RR: Addition of overlapping routes", "Subject: RIPE RR: Addition of overlapping routes"},
157  | 			{"Subject: RIPE RR: Removal  of overlapping routes", "Subject: RIPE RR: Removal  of overlapping routes"},
158  | 			{"The addition of your route object ... ", "The addition of your route object ... "},
159  | 			{"The deletion of your route object ... ", "The deletion of your route object ... "},
160  | 			{"created new overlaps with the following routes ...", "created new overlaps with the following routes ..."},
161  | 			{"removed the overlaps with the following routes ...", "removed the overlaps with the following routes ..."},
162  | 			{"Subject: RIPE RR: Addition of overlapping routes", "Subject: RIPE RR: Addition of overlapping routes"},
163  | 			{"Subject: RIPE RR: Removal  of overlapping routes", "Subject: RIPE RR: Removal  of overlapping routes"},
164  | 			{"The addition of the route object ... ", "The addition of the route object ... "},
165  | 			{"The deletion of the route object ... ", "The deletion of the route object ... "},
166  | 			{"created new overlaps with your following routes ...", "created new overlaps with your following routes ..."},
167  | 			{"removed the overlaps with your following routes ...", "removed the overlaps with your following routes ..."},
168  | 			{"Your e-mail:", "Your e-mail:"},
169  | 			{"From: RIPE Database Management <$HUMAILBOX>", "From: RIPE Database Management <$HUMAILBOX>"},
170  | 			{"From: RIPE Database Management <$HUMAILBOX>", "From: RIPE Database Management <$HUMAILBOX>"},
171  | 			{"Subject: SUCCEEDED: $SUBJECT", "Subject: SUCCEEDED: $SUBJECT"},
172  | 			{"Help file requested so body of message ignored.", "Help file requested so body of message ignored."},
173  | 			{"Objects that just generated a WARNING have been updated as shown.", "Objects that just generated a WARNING have been updated as shown."},
174  | 			{"No errors were found in your database update.  Congratulations.", "No errors were found in your database update.  Congratulations."},
175  | 			{"RIPE Database Maintenance Department (Automatic Section)", "RIPE Database Maintenance Department (Automatic Section)"},
176  | 			{"This is to notify you that some object(s) in the RIPE database", "This is to notify you that some object(s) in the RIPE database"},
177  | 			{"The update causing these changes had the following mail headers:", "The update causing these changes had the following mail headers:"},
178  | 			{"The update causing these changes came from the following host:", "The update causing these changes came from the following host:"},
179  | 			{"From: RIPE Database Notifications <$HUMAILBOX>", "From: RIPE Database Notifications <$HUMAILBOX>"},
180  | 			{"From: RIPE Database Maintainer Forwarding <$HUMAILBOX>", "From: RIPE Database Maintainer Forwarding <$HUMAILBOX>"},
181  | 			{"This is to notify you that some objects in which you are mentioned as", "This is to notify you that some objects in which you are mentioned as"},
182  | 			{"The mail message causing these failures had the following mail headers:", "The mail message causing these failures had the following mail headers:"},
183  | 			{"The update causing these failures came from the following host:", "The update causing these failures came from the following host:"},
184  | 			{"From: RIPE Database Maintainer Creation <$HUMAILBOX>", "From: RIPE Database Maintainer Creation <$HUMAILBOX>"},
185  | 			{"A maintainer object is requested by:", "A maintainer object is requested by:"},
186  | 			{"* A C C E S S    D E N I E D *", "* A C C E S S    D E N I E D *"},
187  | 			{"The object shown below is NOT in the RIPE database.", "The object shown below is NOT in the RIPE database."},
188  | 			{"Referred query to host $REFERHOST at port $REFERPORT", "Referred query to host $REFERHOST at port $REFERPORT"},
189  | 			{"Referral loop detected when querying ", "Referral loop detected when querying "},
190  | 			{"Referred query to host $REFERHOST at port $REFERPORT", "Referred query to host $REFERHOST at port $REFERPORT"},
191  | 			{"Result TRUNCATED. Answer lenght exceeded limit.", "Result TRUNCATED. Answer lenght exceeded limit."},
192  | 			{"%%% End of referred query result", "%%% End of referred query result"},
193  | 			{"10", "10"},
194  | 			{"2000", "2000"},
195  | 			{"Copyright (c)1992/1993/1994/1995/1996/1997/1998/1999 by RIPE NCC ", "Copyright (c)1992/1993/1994/1995/1996/1997/1998/1999 by RIPE NCC "},
196  | 			{"IE ie", "IE ie"}
197  | 	};
198  | */
199  | 
200  | /*
201  | ca_database_t ripe		= 	{
202  | 				     "rowan.ripe.net", "4343", "Idiot", "scramble", "RIPE6"
203  | 		};
204  | 
205  | ca_database_t arin		= {
206  | 						
207  | 									"rowan", "2005", "dbint", "passwrd", "ARIN2"
208  | 		};
209  | */
210  | 
211  | /*
212  |  * ca_database_t radb		= {
213  |  *									"rowan", "default", "default", "default", "RADB1"
214  |  *		};
215  | 	*/
216  | 	
217  | /*
218  |  * ca_database_t radb = {
219  |  *								ca_defHost, ca_defPort, ca_defUser, ca_defPassword, "RADB1"	
220  |  *		};
221  | 	*/
222  | 
223  | /*
224  | ca_database_t radb = {
225  | 								CA_DEFHOST, CA_DEFPORT, CA_DEFUSER, CA_DEFPASSWORD, "RADB1"	
226  | 		};
227  | 
228  | ca_database_list_t ripeComponent = {
229  | 						"RIPE",	
230  | 						 {
231  | 						 "rowan.ripe.net",
232  | 						 "4343",
233  | 						 "Idiot",
234  | 						 "scramble",
235  | 						 "RIPE6"
236  | 						 }
237  | 		};
238  | 
239  | ca_database_list_t arinComponent = {
240  | 						"ARIN",
241  | 						{
242  | 						"rowan",
243  | 						"2005",
244  | 						"dbint",
245  | 						"passwd",
246  | 						"ARIN2"
247  | 						}
248  | 		};
249  | */
250  | 
251  | /*
252  |  * char ca_defHost[64] = "rowan";
253  |  * char ca_defPort[16] = "43";
254  |  * char ca_defUser[16] = "dbase";
255  |  * char ca_defPassword[9] = "encrypt1";
256  |  * char ca_defdbName[16] = "default-db";
257  |  */
258  | 
259  | /*
260  | ca_database_list_t radbComponent = {
261  | 						"RADB",
262  | 						{
263  | 						CA_DEFHOST,
264  | 						CA_DEFPORT,
265  | 						CA_DEFUSER,
266  | 						CA_DEFPASSWORD,
267  | 						"RADB1"
268  | 						}
269  | 		};
270  | */
271  | 
272  | /*
273  | 	* The test configuration file.
274  |  */
275  | const char *testFile = "test.config";
276  | const char *tempFile = "temp.config";
277  | const char *dictFile = "dictionary.txt";
278  | const char *confFile = "amrm.config";
279  | 
280  | values_t confVars[85];
281  | dict_t dictionary[85];
282  | values_t globals[85];
283  | values_t locals[85];
284  |