modules/up/src/rpsl/rpsl/schema_rpsl.cc
/* [<][>][^][v][top][bottom][index][help] */
FUNCTIONS
This source file includes following functions.
- addClass
- initializeBase
- initializeFromFile
- initializeFromString
- initialize
1 // $Id: schema_rpsl.cc,v 1.9 2001/01/18 12:44:16 engin Exp $
2 //
3 // Copyright (c) 1994 by the University of Southern California
4 // All rights reserved.
5 //
6 // Permission to use, copy, modify, and distribute this software and its
7 // documentation in source and binary forms for lawful non-commercial
8 // purposes and without fee is hereby granted, provided that the above
9 // copyright notice appear in all copies and that both the copyright
10 // notice and this permission notice appear in supporting documentation,
11 // and that any documentation, advertising materials, and other materials
12 // related to such distribution and use acknowledge that the software was
13 // developed by the University of Southern California, Information
14 // Sciences Institute. The name of the USC may not be used to endorse or
15 // promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THE UNIVERSITY OF SOUTHERN CALIFORNIA DOES NOT MAKE ANY
19 // REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY
20 // PURPOSE. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
21 // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
22 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,
23 // TITLE, AND NON-INFRINGEMENT.
24 //
25 // IN NO EVENT SHALL USC, OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY
26 // SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, WHETHER IN CONTRACT, TORT,
27 // OR OTHER FORM OF ACTION, ARISING OUT OF OR IN CONNECTION WITH, THE USE
28 // OR PERFORMANCE OF THIS SOFTWARE.
29 //
30 // Questions concerning this software should be directed to
31 // ratoolset@isi.edu.
32 //
33 // Author(s): Cengiz Alaettinoglu <cengiz@ISI.EDU>
34
35 #include "config.h"
36
37 #include <fstream.h>
38 #include <cstring>
39 #include "gnu/std.h"
40
41 #include "schema.hh"
42 #include "object.hh"
43 #include "rpsl.y.hh"
44 #include "rptype.hh"
45
46 #define NO 0
47 #define PRS 1
48 #define MAN 1
49 #define SNG 1
50 #define HDN 1
51 #define KEY 1
52 #define IDX 1
53 #define OBS 1
54
55
56 char Schema::dictionary_text[] = "";
57
58 #define CMN_ATTRS "
59 attr: notify syntax(email), optional, multiple
60 attr: remarks optional, multiple
61 attr: source syntax(special,source), mandatory, single, internal
62 attr: integrity syntax(rpsl_word), optional, single, internal
63 attr: changed syntax(special, changed), mandatory, multiple
64 attr: delete optional, single, deleted
65 attr: override optional, single"
66
67 static char base_text[] = "class: dictionary
68 attr: dictionary syntax(rpsl_word), mandatory, single, key
69 attr: rp-attribute syntax(special,rp-attribute), optional, multiple
70 attr: typedef syntax(special,typedef), optional, multiple
71 attr: protocol syntax(special,protocol), optional, multiple
72 attr: notify syntax(email), optional, multiple
73 attr: remarks optional, multiple
74 attr: source syntax(rpsl_word), mandatory, single, internal
75 attr: integrity syntax(rpsl_word), optional, single, internal
76 attr: changed optional, multiple
77 attr: deleted optional, single, deleted
78 attr: descr mandatory, single
79 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
80 attr: tech-c mandatory, multiple, lookup
81 attr: admin-c optional, multiple, lookup
82
83 dictionary: rpsl
84 descr: rpsl dictionary
85 admin-c: Cengiz Alaettinoglu
86 tech-c: Cengiz Alaettinoglu
87 mnt-by: MNT-CENGIZ
88 changed: cengiz@isi.edu 19980324
89 source: RPS-WG
90 typedef: ListOfIPv4Prefix list of Address_Prefix
91 typedef: Date integer[19000000,20000000]
92 typedef: as_number-as_set_name union as_number, as_set_name
93 typedef: ListOfas_number list of as_number
94 typedef: ListOfas_number-as_set_name list of as_number-as_set_name
95 typedef: ListOfas_set_name list of as_set_name
96 typedef: ListOfroute_set_name list of route_set_name
97 typedef: as_number-as_set_name-route_set_name-IPv4Prefix
98 union as_number, as_set_name, route_set_name, Address_Prefix
99 typedef: ListOfas_number-as_set_name-route_set_name-IPv4Prefix
100 list of as_number-as_set_name-route_set_name-IPv4Prefix
101 typedef: ListOfrpsl_word List of rpsl_word
102 rp-attribute: # preference, smaller values represent higher preferences
103 pref
104 operator=(integer[0, 65535])
105 rp-attribute: # BGP multi_exit_discriminator attribute
106 med
107 operator=(union integer[0, 65535], enum[igp_cost])
108 # to set med to the IGP metric: med = igp_cost;
109 #operator=(enum[igp_cost])
110 rp-attribute: # BGP destination preference attribute (dpa)
111 dpa
112 operator=(integer[0, 65535])
113 rp-attribute: # BGP aspath attribute
114 aspath
115 # prepends AS numbers from last to first order
116 prepend(as_number, ...)
117 typedef: # a community value in RPSL is either
118 # - a 4 byte integer
119 # - internet, no_export, no_advertise (see RFC-1997)
120 community_elm union
121 integer[1, 4294967295],
122 enum[internet, no_export, no_advertise]
123 typedef: # list of community values { 40, no_export, 3561:70}
124 community_list
125 list of community_elm
126 #typedef: # source list
127 # sources enum[RIPE, APNIC, MCI, INTERNIC, ARIN]
128 #typedef: country enum[NL, GB, UK, NL, DE, TR, PL, PT, IE, RU, AU, JP, TO, AT, IT]
129 rp-attribute: # BGP community attribute
130 community
131 # set to a list of communities
132 operator=(community_list)
133 # order independent equality comparison
134 operator==(community_list)
135 # append community values
136 operator.=(community_list)
137 append(community_elm, ...)
138 # delete community values
139 delete(community_elm, ...)
140 # a filter: true if one of community values is contained
141 contains(community_elm, ...)
142 # shortcut to contains: community(no_export, {3561,70})
143 operator()(community_elm, ...)
144 rp-attribute: # next hop router in a static route
145 next-hop
146 operator=(ipv4_address) # a router address
147 operator=(enum[self]) # router's own address
148 rp-attribute: # cost of a static route
149 cost
150 operator=(integer[0, 65535])
151 protocol: BGP4
152 # as number of the peer router
153 MANDATORY asno(as_number)
154 # enable flap damping
155 OPTIONAL flap_damp()
156 OPTIONAL flap_damp(integer[0,65535],# penalty per flap
157 integer[0,65535],# penalty value for supression
158 integer[0,65535],# penalty value for reuse
159 integer[0,65535],# halflife in secs when up
160 integer[0,65535],# halflife in secs when down
161 integer[0,65535])# maximum penalty
162 protocol: OSPF
163 protocol: RIP
164 protocol: IGRP
165 protocol: IS-IS
166 protocol: STATIC
167 protocol: RIPng
168 protocol: DVMRP
169 protocol: PIM-DM
170 protocol: PIM-SM
171 protocol: CBT
172 protocol: MOSPF
173 ";
174
175 static char classes_text[] = "class: mntner
176 attr: mntner syntax(rpsl_word), mandatory, single, key
177 attr: upd-to syntax(email), mandatory, multiple
178 attr: auth mandatory, multiple
179 attr: mnt-nfy syntax(email), optional, multiple " CMN_ATTRS "
180 attr: descr mandatory, multiple
181 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
182 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
183 attr: tech-c syntax(special,nichdl), optional, multiple, lookup
184 attr: referral-by syntax(rpsl_word), optional, single
185 attr: auth-override syntax(integer), optional, single
186
187 class: person
188 attr: person syntax(special,person), mandatory, single, lookup
189 attr: nic-hdl syntax(special,nichdl), mandatory, single, key
190 attr: address mandatory, multiple
191 attr: phone syntax(special,phone), mandatory, multiple
192 attr: fax-no syntax(special,phone), optional, multiple
193 attr: e-mail syntax(email), optional, multiple, lookup " CMN_ATTRS "
194 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
195
196 class: role
197 attr: role syntax(special,person), mandatory, single, lookup
198 attr: nic-hdl syntax(special,nichdl), mandatory, single, key
199 attr: address mandatory, multiple
200 attr: phone syntax(special,phone), mandatory, multiple
201 attr: fax-no syntax(special,phone), optional, multiple
202 attr: e-mail syntax(email), mandatory, multiple, lookup
203 attr: trouble optional, multiple " CMN_ATTRS "
204 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
205 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
206 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
207
208 class: route
209 attr: route syntax(address_prefix), mandatory, single, key, lookup
210 attr: origin syntax(as_number), mandatory, single, key, lookup
211 attr: member-of syntax(ListOfroute_set_name), optional, multiple, lookup
212 attr: inject syntax(special, inject), optional, multiple
213 attr: components syntax(special, components), optional, single
214 attr: aggr-bndry syntax(special, aggr-bndry), optional, single
215 attr: aggr-mtd syntax(special, aggr-mtd), optional, single
216 attr: export-comps syntax(special, filter), optional, single
217 attr: holes syntax(ListOfIPv4Prefix), optional, multiple " CMN_ATTRS "
218 attr: descr mandatory, single
219 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
220 attr: admin-c syntax(special,nichdl), optional, multiple, lookup
221 attr: tech-c syntax(special,nichdl), optional, multiple, lookup
222 attr: cross-nfy syntax(list of rpsl_word), optional, multiple
223 attr: cross-mnt syntax(list of rpsl_word), optional, multiple
224
225 class: route-set
226 attr: route-set syntax(route_set_name), mandatory, single, key
227 attr: members syntax(special, rs-members), optional, multiple, lookup
228 attr: mbrs-by-ref syntax(list of rpsl_Word), optional, multiple, lookup " CMN_ATTRS "
229 attr: descr mandatory, single
230 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
231 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
232 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
233
234 class: as-set
235 attr: as-set syntax(as_set_name), mandatory, single, key
236 attr: members syntax(list of union as_number, as_set_name), optional, multiple, lookup
237 attr: mbrs-by-ref syntax(list of rpsl_word), optional, multiple, lookup " CMN_ATTRS "
238 attr: descr mandatory, single
239 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
240 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
241 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
242
243 class: rtr-set
244 attr: rtr-set syntax(rtr_set_name), mandatory, single, key
245 attr: members syntax(list of union rtr_set_name, dns_name, ipv4_address), optional, multiple, lookup
246 attr: mbrs-by-ref syntax(list of rpsl_Word), optional, multiple, lookup " CMN_ATTRS "
247 attr: descr mandatory, single
248 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
249 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
250 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
251
252 class: peering-set
253 attr: peering-set syntax(peering_set_name), mandatory, single, key
254 attr: peering syntax(special, peering), mandatory, multiple " CMN_ATTRS "
255 attr: descr mandatory, single
256 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
257 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
258 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
259
260 class: filter-set
261 attr: filter-set syntax(filter_set_name), mandatory, single, key
262 attr: filter syntax(special, filter), mandatory, single " CMN_ATTRS "
263 attr: descr mandatory, single
264 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
265 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
266 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
267
268 class: aut-num
269 attr: aut-num syntax(as_number), mandatory, single, key
270 attr: as-name syntax(rpsl_word), optional, single, lookup
271 attr: member-of syntax(List Of AS_set_name), optional, multiple, lookup
272 attr: import syntax(special,import), optional, multiple
273 attr: export syntax(special,export), optional, multiple
274 attr: default syntax(special,default), optional, multiple " CMN_ATTRS "
275 attr: descr mandatory, multiple
276 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
277 attr: mnt-routes syntax(special, mnt-routes), optional, multiple, lookup
278 attr: mnt-lower syntax(list of rpsl_word), optional, multiple
279 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
280 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
281 attr: cross-nfy syntax(list of rpsl_word), optional, multiple
282 attr: cross-mnt syntax(list of rpsl_word), optional, multiple
283
284 class: inet-rtr
285 attr: inet-rtr syntax(dns_name), mandatory, single, key
286 attr: alias syntax(dns_name), optional, multiple, lookup
287 attr: local-as syntax(as_number), mandatory, single, lookup
288 attr: ifaddr syntax(special,ifaddr), mandatory, multiple
289 attr: peer syntax(special,peer), optional, multiple " CMN_ATTRS "
290 attr: member-of syntax(List Of rtr_set_name), optional, multiple, lookup
291 attr: descr optional, multiple
292 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
293 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
294 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
295
296 class: inetnum
297 attr: inetnum syntax(range of ipv4_address), mandatory, single, key
298 attr: netname syntax(rpsl_word), mandatory, single, lookup
299 attr: country syntax(special, country), mandatory, multiple
300 attr: rev-srv optional, multiple, lookup
301 attr: status syntax(special,status_inet), mandatory, single
302 attr: mnt-routes syntax(special, mnt-routes), optional, multiple
303 attr: mnt-lower syntax(ListOfrpsl_word), optional, multiple " CMN_ATTRS "
304 attr: descr mandatory, multiple
305 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
306 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
307 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
308
309 class: inet6num
310 attr: inet6num syntax(ipv6_prefix), mandatory, single, key
311 attr: netname syntax(rpsl_word), mandatory, single, lookup
312 attr: country syntax(special, country), mandatory, multiple
313 attr: rev-srv optional, multiple, lookup
314 attr: status optional, generated, single
315 attr: mnt-lower syntax(ListOfrpsl_word), optional, multiple " CMN_ATTRS "
316 attr: descr mandatory, multiple
317 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
318 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
319 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
320
321 class: domain
322 attr: domain syntax(union dns_name, rpsl_word), mandatory, single, key
323 attr: sub-dom optional, multiple, lookup
324 attr: dom-net optional, multiple
325 attr: zone-c syntax(special,nichdl), mandatory, multiple, lookup
326 attr: nserver optional, multiple, lookup
327 attr: refer syntax(special, refer), optional, single
328 attr: mnt-lower syntax(ListOfrpsl_word), optional, multiple " CMN_ATTRS "
329 attr: descr mandatory, multiple
330 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
331 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
332 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
333
334 class: limerick
335 attr: limerick mandatory, single, key
336 attr: text mandatory, multiple
337 attr: author syntax(special,nichdl), mandatory, multiple, lookup " CMN_ATTRS "
338 attr: descr optional, single
339 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
340 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
341
342 class: as-block
343 attr: as-block syntax(union as_number, range of as_number), mandatory, single, key
344 attr: mnt-lower syntax(ListOfrpsl_word), optional, multiple " CMN_ATTRS "
345 attr: descr mandatory, single
346 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
347 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
348 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
349
350 class: key-cert
351 attr: key-cert mandatory, single, key, syntax(keycrtname)
352 attr: method generated, optional, single, syntax(rpsl_word)
353 attr: owner generated, optional, multiple
354 attr: fingerpr generated, optional, single
355 attr: certif mandatory, multiple " CMN_ATTRS "
356 attr: mnt-by mandatory, multiple, lookup, syntax(list of rpsl_word)
357
358 class: peval
359 attr: peval syntax(special,filter), optional, single
360
361 class: repository
362 attr: repository mandatory, single, key, syntax(rpsl_word)
363 attr: query-address mandatory, multiple
364 attr: response-auth-type mandatory, multiple
365 attr: submit-address mandatory, multiple
366 attr: submit-auth-type mandatory, multiple
367 attr: repository-cert mandatory, multiple
368 attr: expire mandatory, single
369 attr: heartbeat-interval mandatory, single
370 attr: descr optional, multiple
371 attr: admin-c mandatory, multiple, lookup
372 attr: tech-c mandatory, multiple, lookup
373 attr: mnt-by mandatory, multiple, lookup " CMN_ATTRS "
374 ";
375
376 void Schema::addClass(AttrClass *clss) {
/* [<][>][^][v][top][bottom][index][help] */
377 classes[lastClass++] = clss;
378 }
379
380 void Schema::initializeBase() {
/* [<][>][^][v][top][bottom][index][help] */
381 static bool initializeBaseDone = false;
382 if (initializeBaseDone)
383 return;
384 initializeBaseDone = true;
385
386 AttrClass *classClass = new AttrClass(strdup("class"));
387 AttrClass *clss = NULL;
388
389 addClass(classClass);
390 classClass->addAttr(new AttrAttr(strdup("class"), ATTR_GENERIC,
391 RPType::newRPType("rpsl_word"),
392 AttrAttr::LOOKUP));
393 classClass->addAttr(new AttrAttr(strdup("attr"), ATTR_ATTR,
394 (RPType *) NULL,
395 AttrAttr::MULTIVALUED));
396
397 dictionary = initializeFromString(base_text, "dictionary");
398 }
399
400 List<Object> *Schema::initializeFromFile(char *filename) {
/* [<][>][^][v][top][bottom][index][help] */
401 Object *o;
402 const AttrAttr *attr;
403 char *class_name;
404 bool code = true;
405 List<Object> *result = new List<Object>;
406 AttrClass *clss = NULL;
407
408 initializeBase();
409
410 ifstream in(filename);
411 if (!in)
412 return result;
413
414 while (in) {
415 o = new Object;
416 code = o->read(in);
417 if (! code) {
418 delete o;
419 continue;
420 }
421
422 code = o->scan();
423 if (o->has_error)
424 delete o;
425 else {
426 if (! strcasecmp(o->type->name, "class")) {
427 AttrGenericIterator<ItemWORD> cname(o, "class");
428 AttrIterator<AttrAttr> attrItr(o, "attr");
429 char *name = cname.first()->word;
430
431 addClass(clss = new AttrClass(strdup(name)));
432 clss->object = o;
433 //cerr << "Reading "<< name << " class definition..." << endl;
434
435 for (attr = attrItr.first(); attr; attr = attrItr.next())
436 clss->addAttr((AttrAttr *) attr);
437
438 }
439
440 result->append(o);
441 }
442 }
443
444 return result;
445 }
446
447 Object *Schema::initializeFromString(char *class_text, char *lookFor) {
/* [<][>][^][v][top][bottom][index][help] */
448 Object *o;
449 const AttrAttr *attr;
450 char *class_name;
451 Object *result = (Object *) NULL;
452 AttrClass *clss = NULL;
453 int count = 0;
454
455 initializeBase();
456
457 do {
458 count++;
459 o = new Object;
460 if (count == 2 && ! dictionary)
461 dictionary = o;
462
463 o->scan(class_text, strlen(class_text));
464
465 if (o->has_error)
466 delete o;
467 else {
468 if (!strcasecmp(o->type->name, "class")) {
469 AttrGenericIterator<ItemWORD> cname(o, "class");
470 AttrIterator<AttrAttr> attrItr(o, "attr");
471 char *name = cname.first()->word;
472
473 addClass(clss = new AttrClass(strdup(name)));
474 clss->object = o;
475 // cerr << "Reading "<< name << " class definition..." << endl;
476
477 for (attr = attrItr.first(); attr; attr = attrItr.next())
478 clss->addAttr((AttrAttr *) attr);
479
480 //delete o;
481 }
482
483 if (lookFor && ! strcasecmp(o->type->name, lookFor))
484 result = o;
485 }
486
487 class_text = strstr(class_text, "\n\n");
488 if (class_text)
489 class_text += 2;
490 } while (class_text);
491
492 return result;
493 }
494
495 void Schema::initialize() {
/* [<][>][^][v][top][bottom][index][help] */
496 initializeBase();
497 initializeFromString(classes_text);
498 }
499
500 static RPSLKeyword rpsl_keywords[] = {
501 RPSLKeyword("true", KEYW_TRUE, 1),
502 RPSLKeyword("false", KEYW_FALSE, 1),
503 RPSLKeyword("action", KEYW_ACTION, 1),
504 RPSLKeyword("accept", KEYW_ACCEPT, 1),
505 RPSLKeyword("announce", KEYW_ANNOUNCE, 1),
506 RPSLKeyword("from", KEYW_FROM, 1),
507 RPSLKeyword("to", KEYW_TO, 1),
508 RPSLKeyword("at", KEYW_AT, 1),
509 RPSLKeyword("any", KEYW_ANY, 1),
510 RPSLKeyword("protocol", KEYW_PROTOCOL, 1),
511 RPSLKeyword("into", KEYW_INTO, 1),
512 RPSLKeyword("refine", KEYW_REFINE, 1),
513 RPSLKeyword("except", KEYW_EXCEPT, 1),
514 RPSLKeyword("static", KEYW_STATIC, 1),
515 RPSLKeyword("networks", KEYW_NETWORKS, 1),
516 RPSLKeyword("masklen", KEYW_MASKLEN, 1),
517 RPSLKeyword("peeras", KEYW_PEERAS, 1),
518
519 RPSLKeyword("atomic", KEYW_ATOMIC, 1),
520 RPSLKeyword("inbound", KEYW_INBOUND, 1),
521 RPSLKeyword("outbound", KEYW_OUTBOUND, 1),
522
523 RPSLKeyword("or", OP_OR , 1),
524 RPSLKeyword("and", OP_AND, 1),
525 RPSLKeyword("not", OP_NOT, 1),
526
527 RPSLKeyword("union", KEYW_UNION, 1),
528 RPSLKeyword("range", KEYW_RANGE, 1),
529 RPSLKeyword("list", KEYW_LIST, 1),
530 RPSLKeyword("of", KEYW_OF, 1),
531 RPSLKeyword("operator", KEYW_OPERATOR, 1),
532 RPSLKeyword("upon", KEYW_UPON, 1),
533 RPSLKeyword("have-components", KEYW_HAVE_COMPONENTS, 1),
534 RPSLKeyword("exclude", KEYW_EXCLUDE, 1),
535
536 RPSLKeyword("syntax", KEYW_SYNTAX, 1),
537 RPSLKeyword("special", KEYW_SPECIAL, 1),
538 RPSLKeyword("optional", KEYW_OPTIONAL, 1),
539 RPSLKeyword("mandatory", KEYW_MANDATORY, 1),
540 RPSLKeyword("internal", KEYW_INTERNAL, 1),
541 RPSLKeyword("single", KEYW_SINGLEVALUED, 1),
542 RPSLKeyword("multiple", KEYW_MULTIVALUED, 1),
543 RPSLKeyword("lookup", KEYW_LOOKUP, 1),
544 RPSLKeyword("key", KEYW_KEY, 1),
545 RPSLKeyword("deleted", KEYW_DELETED, 1),
546 RPSLKeyword("generated", KEYW_GENERATED, 1),
547 RPSLKeyword("none", KEYW_NONE, 1),
548 RPSLKeyword("mail-from", KEYW_MAILFROM, 1),
549 RPSLKeyword("crypt-pw", KEYW_CRYPTPW, 1),
550 RPSLKeyword("assigned", KEYW_ASSIGNED, 1),
551 RPSLKeyword("allocated", KEYW_ALLOCATED, 1),
552 RPSLKeyword("PA", KEYW_PA, 1),
553 RPSLKeyword("PI", KEYW_PI, 1),
554 RPSLKeyword("unspecified", KEYW_UNSPECIFIED, 1),
555 RPSLKeyword("ext", KEYW_EXT, 1),
556 RPSLKeyword("simple", KEYW_SIMPLE, 1),
557 RPSLKeyword("ripe", KEYW_RIPE, 1),
558 RPSLKeyword("internic", KEYW_INTERNIC, 1),
559 RPSLKeyword("clientaddress",KEYW_CLIENTADDRESS,1),
560 RPSLKeyword(NULL, 0, 0)
561 };
562
563 static RPSLKeyword rpsl_rules[] = {
564 RPSLKeyword("changed", ATTR_CHANGED, 1),
565 RPSLKeyword("import", ATTR_IMPORT, 1),
566 RPSLKeyword("export", ATTR_EXPORT, 1),
567 RPSLKeyword("default", ATTR_DEFAULT, 1),
568 RPSLKeyword("ifaddr", ATTR_IFADDR, 1),
569 RPSLKeyword("peer", ATTR_PEER, 1),
570 RPSLKeyword("rp-attribute", ATTR_RP_ATTR, 1),
571 RPSLKeyword("typedef", ATTR_TYPEDEF, 1),
572 RPSLKeyword("protocol", ATTR_PROTOCOL, 1),
573 RPSLKeyword("filter", ATTR_FILTER, 1),
574 RPSLKeyword("peering", ATTR_PEERING, 1),
575 RPSLKeyword("blobs", ATTR_BLOBS, 1),
576 RPSLKeyword("mnt-routes", ATTR_MNT_ROUTES, 1),
577 RPSLKeyword("components", ATTR_COMPONENTS, 1),
578 RPSLKeyword("inject", ATTR_INJECT, 1),
579 RPSLKeyword("aggr-mtd", ATTR_AGGR_MTD, 1),
580 RPSLKeyword("aggr-bndry", ATTR_AGGR_BNDRY, 1),
581 RPSLKeyword("rs-members", ATTR_RS_MEMBERS, 1),
582 RPSLKeyword("nichdl", ATTR_NICHDL, 1),
583 RPSLKeyword("auth", ATTR_AUTH, 1),
584 RPSLKeyword("status_inet", ATTR_STATUS_INET, 1),
585 RPSLKeyword("phone", ATTR_PHONE, 1),
586 RPSLKeyword("source", ATTR_SOURCE, 1),
587 RPSLKeyword("refer", ATTR_REFER, 1),
588 RPSLKeyword("country", ATTR_COUNTRY, 1),
589 RPSLKeyword("person", ATTR_PERSON, 1),
590 RPSLKeyword(NULL, 0, 1)
591 };
592
593 Schema schema(rpsl_keywords, rpsl_rules);