1    | /***************************************
2    |   $Revision: 
3    | 
4    |   CA module: Values defined at compile time.
5    | 
6    |   Status: NOT REVIEWED, NOT TESTED
7    | 
8    |   Author(s):       Ambrose Magee
9    | 
10   | ******************/ /******************
11   | Modification History:
12   | 
13   | ******************/
14   | 
15   | /************************************
16   | Copyright (c) 2000                              RIPE NCC
17   | 
18   | All Rights Reserved
19   | 
20   | Permission to use, copy, modify, and distribute this software and its
21   | documentation for any purpose and without fee is hereby granted,
22   | provided that the above copyright notice appear in all copies and that
23   | both that copyright notice and this permission notice appear in
24   | supporting documentation, and that the name of the author not be
25   | used in advertising or publicity pertaining to distribution of the
26   | software without specific, written prior permission.
27   | 
28   | THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
29   | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
30   | AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
31   | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
32   | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
33   | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
34   | ***************************************/
35   | 
36   | 
37   | #include "ca_defs.h"
38   | 
39   | /*
40   | int bport = 43;
41   | */
42   | 
43   | GSList *sourceList = NULL;
44   | 
45   | GSList *dbList = NULL;
46   | 
47   | GSList *nrtmList = NULL;
48   | 
49   | /*
50   |  * 20000609
51   |  * Experiment:
52   |  * The GSList variable, "mySrcList", is defined in the ca_defs.h
53   |  * file (with an 'extern' modifier).
54   |  * GSList *mySrcList = NULL;
55   |  */
56   | 
57   | /*
58   | int testmode = 0;
59   | */
60   | 
61   | /*
62   | values_t globals[]	=	{
63   | 			{"43", &bport},
64   | 			{"/ncc/db2/doc/HELP", "/ncc/db2/doc/HELP"},
65   | 			{"% Rights restricted by copyright. See http://www.ripe.net/db/dbcopyright.html", "% Rights restricted by copyright. See http://www.ripe.net/db/dbcopyright.html"},
66   | 			{"SourceList", NULL},
67   | 			{"0", &testmode},
68   | 			{"1Bt9RNSMWcA.Y", "1Bt9RNSMWcA.Y"},
69   | 			{"/ncc/db2/doc/WHOIS-HELP", "/ncc/db2/doc/WHOIS-HELP"},
70   | 			{"/ncc/db2/doc/AUTO-DBM-HELP", "/ncc/db2/doc/AUTO-DBM-HELP"},
71   | 			{"/ncc/db2/etc/attr-desc.config", "/ncc/db2/etc/attr-desc.config"},
72   | 			{"RIPE", "RIPE"},
73   | 			{"RIPE          /ncc/db2/data/ripe/ripe.db         SPLIT", "RIPE          /ncc/db2/data/ripe/ripe.db         SPLIT"},
74   | 			{"RIPE", "RIPE"},
75   | 			{"SourceList", NULL},
76   | 			{"dbase", "dbase"},
77   | 			{"/ncc/db2/log/qry/qrylog", "/ncc/db2/log/qry/qrylog"},
78   | 			{"/ncc/db2/log/qry/qry2log", "/ncc/db2/log/qry/qry2log"},
79   | 			{"/ncc/db2/log/err/errlog", "/ncc/db2/log/err/errlog"},
80   | 			{"/ncc/db2/log/audit/auditlog", "/ncc/db2/log/audit/auditlog"},
81   | 			{"/ncc/db2/log/upd", "/ncc/db2/log/upd"},
82   | 			{"/ncc/db2/log/ack", "/ncc/db2/log/ack"},
83   | 			{"/ncc/db2/locks", "/ncc/db2/locks"},
84   | 			{"whoisd.pid", "whoisd.pid"},
85   | 			{"STOPUPDATES", "STOPUPDATES"},
86   | 			{"CLEANDB.LOCK", "CLEANDB.LOCK"},
87   | 			{"/ncc/db2/serials/current", "/ncc/db2/serials/current"},
88   | 			{"/ncc/db2/serials/old", "/ncc/db2/serials/old"},
89   | 			{"/ncc/db2/serials/incoming", "/ncc/db2/serials/incoming"},
90   | 			{"180", "180"},
91   | 			{"RIPE-NCC-HM-MNT ", "RIPE-NCC-HM-MNT "},
92   | 			{"127.0.0.1", "127.0.0.1"},
93   | 			{"193.0.0.1[345678][0-9]", "193.0.0.1[345678][0-9]"},
94   | 			{"195.88.156.1", "195.88.156.1"},
95   | 			{"/ncc/db2/tmp", "/ncc/db2/tmp"},
96   | 			{"/usr/local/bin/pgpv", "/usr/local/bin/pgpv"},
97   | 			{"/usr/local/bin/pgpk", "/usr/local/bin/pgpk"},
98   | 			{"/ncc/db2/.pgp", "/ncc/db2/.pgp"},
99   | 			{"/var/qmail/bin/qmail-inject -fripe-dbm", "/var/qmail/bin/qmail-inject -fripe-dbm"},
100  | 			{"8096", "8096"},
101  | 			{"2097152", "2097152"},
102  | 			{"2", "2"},
103  | 			{"ripe-dbm@ripe.net", "ripe-dbm@ripe.net"},
104  | 			{"ripe-dbm@ripe.net", "ripe-dbm@ripe.net"},
105  | 			{"auto-dbm@ripe.net", "auto-dbm@ripe.net"},
106  | 			{"nostrict", "nostrict"},
107  | 			{"% No entries found for the selected source(s).", "% No entries found for the selected source(s)."},
108  | 			{"Subject: RIPE RR: Addition of overlapping routes", "Subject: RIPE RR: Addition of overlapping routes"},
109  | 			{"Subject: RIPE RR: Removal  of overlapping routes", "Subject: RIPE RR: Removal  of overlapping routes"},
110  | 			{"The addition of your route object ... ", "The addition of your route object ... "},
111  | 			{"The deletion of your route object ... ", "The deletion of your route object ... "},
112  | 			{"created new overlaps with the following routes ...", "created new overlaps with the following routes ..."},
113  | 			{"removed the overlaps with the following routes ...", "removed the overlaps with the following routes ..."},
114  | 			{"Subject: RIPE RR: Addition of overlapping routes", "Subject: RIPE RR: Addition of overlapping routes"},
115  | 			{"Subject: RIPE RR: Removal  of overlapping routes", "Subject: RIPE RR: Removal  of overlapping routes"},
116  | 			{"The addition of the route object ... ", "The addition of the route object ... "},
117  | 			{"The deletion of the route object ... ", "The deletion of the route object ... "},
118  | 			{"created new overlaps with your following routes ...", "created new overlaps with your following routes ..."},
119  | 			{"removed the overlaps with your following routes ...", "removed the overlaps with your following routes ..."},
120  | 			{"Your e-mail:", "Your e-mail:"},
121  | 			{"From: RIPE Database Management <$HUMAILBOX>", "From: RIPE Database Management <$HUMAILBOX>"},
122  | 			{"From: RIPE Database Management <$HUMAILBOX>", "From: RIPE Database Management <$HUMAILBOX>"},
123  | 			{"Subject: SUCCEEDED: $SUBJECT", "Subject: SUCCEEDED: $SUBJECT"},
124  | 			{"Help file requested so body of message ignored.", "Help file requested so body of message ignored."},
125  | 			{"Objects that just generated a WARNING have been updated as shown.", "Objects that just generated a WARNING have been updated as shown."},
126  | 			{"No errors were found in your database update.  Congratulations.", "No errors were found in your database update.  Congratulations."},
127  | 			{"RIPE Database Maintenance Department (Automatic Section)", "RIPE Database Maintenance Department (Automatic Section)"},
128  | 			{"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"},
129  | 			{"The update causing these changes had the following mail headers:", "The update causing these changes had the following mail headers:"},
130  | 			{"The update causing these changes came from the following host:", "The update causing these changes came from the following host:"},
131  | 			{"From: RIPE Database Notifications <$HUMAILBOX>", "From: RIPE Database Notifications <$HUMAILBOX>"},
132  | 			{"From: RIPE Database Maintainer Forwarding <$HUMAILBOX>", "From: RIPE Database Maintainer Forwarding <$HUMAILBOX>"},
133  | 			{"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"},
134  | 			{"The mail message causing these failures had the following mail headers:", "The mail message causing these failures had the following mail headers:"},
135  | 			{"The update causing these failures came from the following host:", "The update causing these failures came from the following host:"},
136  | 			{"From: RIPE Database Maintainer Creation <$HUMAILBOX>", "From: RIPE Database Maintainer Creation <$HUMAILBOX>"},
137  | 			{"A maintainer object is requested by:", "A maintainer object is requested by:"},
138  | 			{"* A C C E S S    D E N I E D *", "* A C C E S S    D E N I E D *"},
139  | 			{"The object shown below is NOT in the RIPE database.", "The object shown below is NOT in the RIPE database."},
140  | 			{"Referred query to host $REFERHOST at port $REFERPORT", "Referred query to host $REFERHOST at port $REFERPORT"},
141  | 			{"Referral loop detected when querying ", "Referral loop detected when querying "},
142  | 			{"Referred query to host $REFERHOST at port $REFERPORT", "Referred query to host $REFERHOST at port $REFERPORT"},
143  | 			{"Result TRUNCATED. Answer lenght exceeded limit.", "Result TRUNCATED. Answer lenght exceeded limit."},
144  | 			{"%%% End of referred query result", "%%% End of referred query result"},
145  | 			{"10", "10"},
146  | 			{"2000", "2000"},
147  | 			{"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 "},
148  | 			{"IE ie", "IE ie"}
149  | 	};
150  |  values_t locals[]	=	{
151  | 			{"43", &bport},
152  | 			{"/ncc/db2/doc/HELP", "/ncc/db2/doc/HELP"},
153  | 			{"% Rights restricted by copyright. See http://www.ripe.net/db/dbcopyright.html", "% Rights restricted by copyright. See http://www.ripe.net/db/dbcopyright.html"},
154  | 			{"SourceList", NULL},
155  | 			{"0", &testmode},
156  | 			{"1Bt9RNSMWcA.Y", "1Bt9RNSMWcA.Y"},
157  | 			{"/ncc/db2/doc/WHOIS-HELP", "/ncc/db2/doc/WHOIS-HELP"},
158  | 			{"/ncc/db2/doc/AUTO-DBM-HELP", "/ncc/db2/doc/AUTO-DBM-HELP"},
159  | 			{"/ncc/db2/etc/attr-desc.config", "/ncc/db2/etc/attr-desc.config"},
160  | 			{"RIPE", "RIPE"},
161  | 			{"RIPE          /ncc/db2/data/ripe/ripe.db         SPLIT", "RIPE          /ncc/db2/data/ripe/ripe.db         SPLIT"},
162  | 			{"RIPE", "RIPE"},
163  | 			{"SourceList", NULL},
164  | 			{"dbase", "dbase"},
165  | 			{"/ncc/db2/log/qry/qrylog", "/ncc/db2/log/qry/qrylog"},
166  | 			{"/ncc/db2/log/qry/qry2log", "/ncc/db2/log/qry/qry2log"},
167  | 			{"/ncc/db2/log/err/errlog", "/ncc/db2/log/err/errlog"},
168  | 			{"/ncc/db2/log/audit/auditlog", "/ncc/db2/log/audit/auditlog"},
169  | 			{"/ncc/db2/log/upd", "/ncc/db2/log/upd"},
170  | 			{"/ncc/db2/log/ack", "/ncc/db2/log/ack"},
171  | 			{"/ncc/db2/locks", "/ncc/db2/locks"},
172  | 			{"whoisd.pid", "whoisd.pid"},
173  | 			{"STOPUPDATES", "STOPUPDATES"},
174  | 			{"CLEANDB.LOCK", "CLEANDB.LOCK"},
175  | 			{"/ncc/db2/serials/current", "/ncc/db2/serials/current"},
176  | 			{"/ncc/db2/serials/old", "/ncc/db2/serials/old"},
177  | 			{"/ncc/db2/serials/incoming", "/ncc/db2/serials/incoming"},
178  | 			{"180", "180"},
179  | 			{"RIPE-NCC-HM-MNT ", "RIPE-NCC-HM-MNT "},
180  | 			{"127.0.0.1", "127.0.0.1"},
181  | 			{"193.0.0.1[345678][0-9]", "193.0.0.1[345678][0-9]"},
182  | 			{"195.88.156.1", "195.88.156.1"},
183  | 			{"/ncc/db2/tmp", "/ncc/db2/tmp"},
184  | 			{"/usr/local/bin/pgpv", "/usr/local/bin/pgpv"},
185  | 			{"/usr/local/bin/pgpk", "/usr/local/bin/pgpk"},
186  | 			{"/ncc/db2/.pgp", "/ncc/db2/.pgp"},
187  | 			{"/var/qmail/bin/qmail-inject -fripe-dbm", "/var/qmail/bin/qmail-inject -fripe-dbm"},
188  | 			{"8096", "8096"},
189  | 			{"2097152", "2097152"},
190  | 			{"2", "2"},
191  | 			{"ripe-dbm@ripe.net", "ripe-dbm@ripe.net"},
192  | 			{"ripe-dbm@ripe.net", "ripe-dbm@ripe.net"},
193  | 			{"auto-dbm@ripe.net", "auto-dbm@ripe.net"},
194  | 			{"nostrict", "nostrict"},
195  | 			{"% No entries found for the selected source(s).", "% No entries found for the selected source(s)."},
196  | 			{"Subject: RIPE RR: Addition of overlapping routes", "Subject: RIPE RR: Addition of overlapping routes"},
197  | 			{"Subject: RIPE RR: Removal  of overlapping routes", "Subject: RIPE RR: Removal  of overlapping routes"},
198  | 			{"The addition of your route object ... ", "The addition of your route object ... "},
199  | 			{"The deletion of your route object ... ", "The deletion of your route object ... "},
200  | 			{"created new overlaps with the following routes ...", "created new overlaps with the following routes ..."},
201  | 			{"removed the overlaps with the following routes ...", "removed the overlaps with the following routes ..."},
202  | 			{"Subject: RIPE RR: Addition of overlapping routes", "Subject: RIPE RR: Addition of overlapping routes"},
203  | 			{"Subject: RIPE RR: Removal  of overlapping routes", "Subject: RIPE RR: Removal  of overlapping routes"},
204  | 			{"The addition of the route object ... ", "The addition of the route object ... "},
205  | 			{"The deletion of the route object ... ", "The deletion of the route object ... "},
206  | 			{"created new overlaps with your following routes ...", "created new overlaps with your following routes ..."},
207  | 			{"removed the overlaps with your following routes ...", "removed the overlaps with your following routes ..."},
208  | 			{"Your e-mail:", "Your e-mail:"},
209  | 			{"From: RIPE Database Management <$HUMAILBOX>", "From: RIPE Database Management <$HUMAILBOX>"},
210  | 			{"From: RIPE Database Management <$HUMAILBOX>", "From: RIPE Database Management <$HUMAILBOX>"},
211  | 			{"Subject: SUCCEEDED: $SUBJECT", "Subject: SUCCEEDED: $SUBJECT"},
212  | 			{"Help file requested so body of message ignored.", "Help file requested so body of message ignored."},
213  | 			{"Objects that just generated a WARNING have been updated as shown.", "Objects that just generated a WARNING have been updated as shown."},
214  | 			{"No errors were found in your database update.  Congratulations.", "No errors were found in your database update.  Congratulations."},
215  | 			{"RIPE Database Maintenance Department (Automatic Section)", "RIPE Database Maintenance Department (Automatic Section)"},
216  | 			{"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"},
217  | 			{"The update causing these changes had the following mail headers:", "The update causing these changes had the following mail headers:"},
218  | 			{"The update causing these changes came from the following host:", "The update causing these changes came from the following host:"},
219  | 			{"From: RIPE Database Notifications <$HUMAILBOX>", "From: RIPE Database Notifications <$HUMAILBOX>"},
220  | 			{"From: RIPE Database Maintainer Forwarding <$HUMAILBOX>", "From: RIPE Database Maintainer Forwarding <$HUMAILBOX>"},
221  | 			{"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"},
222  | 			{"The mail message causing these failures had the following mail headers:", "The mail message causing these failures had the following mail headers:"},
223  | 			{"The update causing these failures came from the following host:", "The update causing these failures came from the following host:"},
224  | 			{"From: RIPE Database Maintainer Creation <$HUMAILBOX>", "From: RIPE Database Maintainer Creation <$HUMAILBOX>"},
225  | 			{"A maintainer object is requested by:", "A maintainer object is requested by:"},
226  | 			{"* A C C E S S    D E N I E D *", "* A C C E S S    D E N I E D *"},
227  | 			{"The object shown below is NOT in the RIPE database.", "The object shown below is NOT in the RIPE database."},
228  | 			{"Referred query to host $REFERHOST at port $REFERPORT", "Referred query to host $REFERHOST at port $REFERPORT"},
229  | 			{"Referral loop detected when querying ", "Referral loop detected when querying "},
230  | 			{"Referred query to host $REFERHOST at port $REFERPORT", "Referred query to host $REFERHOST at port $REFERPORT"},
231  | 			{"Result TRUNCATED. Answer lenght exceeded limit.", "Result TRUNCATED. Answer lenght exceeded limit."},
232  | 			{"%%% End of referred query result", "%%% End of referred query result"},
233  | 			{"10", "10"},
234  | 			{"2000", "2000"},
235  | 			{"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 "},
236  | 			{"IE ie", "IE ie"}
237  | 	};
238  | */
239  | 
240  | /*
241  | ca_database_t ripe		= 	{
242  | 				     "rowan.ripe.net", "4343", "Idiot", "scramble", "RIPE6"
243  | 		};
244  | 
245  | ca_database_t arin		= {
246  | 						
247  | 									"rowan", "2005", "dbint", "passwrd", "ARIN2"
248  | 		};
249  | */
250  | 
251  | /*
252  |  * ca_database_t radb		= {
253  |  *									"rowan", "default", "default", "default", "RADB1"
254  |  *		};
255  | 	*/
256  | 	
257  | /*
258  |  * ca_database_t radb = {
259  |  *								ca_defHost, ca_defPort, ca_defUser, ca_defPassword, "RADB1"	
260  |  *		};
261  | 	*/
262  | 
263  | /*
264  | ca_database_t radb = {
265  | 								CA_DEFHOST, CA_DEFPORT, CA_DEFUSER, CA_DEFPASSWORD, "RADB1"	
266  | 		};
267  | 
268  | ca_database_list_t ripeComponent = {
269  | 						"RIPE",	
270  | 						 {
271  | 						 "rowan.ripe.net",
272  | 						 "4343",
273  | 						 "Idiot",
274  | 						 "scramble",
275  | 						 "RIPE6"
276  | 						 }
277  | 		};
278  | 
279  | ca_database_list_t arinComponent = {
280  | 						"ARIN",
281  | 						{
282  | 						"rowan",
283  | 						"2005",
284  | 						"dbint",
285  | 						"passwd",
286  | 						"ARIN2"
287  | 						}
288  | 		};
289  | */
290  | 
291  | /*
292  |  * char ca_defHost[64] = "rowan";
293  |  * char ca_defPort[16] = "43";
294  |  * char ca_defUser[16] = "dbase";
295  |  * char ca_defPassword[9] = "encrypt1";
296  |  * char ca_defdbName[16] = "default-db";
297  |  */
298  | 
299  | /*
300  | ca_database_list_t radbComponent = {
301  | 						"RADB",
302  | 						{
303  | 						CA_DEFHOST,
304  | 						CA_DEFPORT,
305  | 						CA_DEFUSER,
306  | 						CA_DEFPASSWORD,
307  | 						"RADB1"
308  | 						}
309  | 		};
310  | */
311  | 
312  | /*
313  | 	* The test configuration file.
314  |  */
315  | const char *testFile = "test.config";
316  | const char *tempFile = "temp.config";
317  | const char *dictFile = "dictionary.txt";
318  | const char *confFile = "amrm.config";
319  | 
320  | /*
321  |  * const char *confFile = "./dbupdate.conf";
322  |  */ 
323  | const char *sourcesFile = "sources.config.amrm";
324  | 
325  | values_t confVars[VARS];
326  | dict_t dictionary[VARS];
327  | values_t globals[VARS];
328  | values_t locals[VARS];
329  | 
330  | ca_dbSource_t *theSrc;
331  |