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.10 2001/02/27 10:08:52 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 rp-attribute: # BGP community attribute
127 community
128 # set to a list of communities
129 operator=(community_list)
130 # order independent equality comparison
131 operator==(community_list)
132 # append community values
133 operator.=(community_list)
134 append(community_elm, ...)
135 # delete community values
136 delete(community_elm, ...)
137 # a filter: true if one of community values is contained
138 contains(community_elm, ...)
139 # shortcut to contains: community(no_export, {3561,70})
140 operator()(community_elm, ...)
141 rp-attribute: # next hop router in a static route
142 next-hop
143 operator=(ipv4_address) # a router address
144 operator=(enum[self]) # router's own address
145 rp-attribute: # cost of a static route
146 cost
147 operator=(integer[0, 65535])
148 protocol: BGP4
149 # as number of the peer router
150 MANDATORY asno(as_number)
151 # enable flap damping
152 OPTIONAL flap_damp()
153 OPTIONAL flap_damp(integer[0,65535],# penalty per flap
154 integer[0,65535],# penalty value for supression
155 integer[0,65535],# penalty value for reuse
156 integer[0,65535],# halflife in secs when up
157 integer[0,65535],# halflife in secs when down
158 integer[0,65535])# maximum penalty
159 protocol: OSPF
160 protocol: RIP
161 protocol: IGRP
162 protocol: IS-IS
163 protocol: STATIC
164 protocol: RIPng
165 protocol: DVMRP
166 protocol: PIM-DM
167 protocol: PIM-SM
168 protocol: CBT
169 protocol: MOSPF
170 ";
171
172 static char classes_text[] = "class: mntner
173 attr: mntner syntax(rpsl_word), mandatory, single, key
174 attr: upd-to syntax(email), mandatory, multiple
175 attr: auth mandatory, multiple
176 attr: mnt-nfy syntax(email), optional, multiple " CMN_ATTRS "
177 attr: descr mandatory, multiple
178 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
179 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
180 attr: tech-c syntax(special,nichdl), optional, multiple, lookup
181 attr: referral-by syntax(rpsl_word), optional, single
182 attr: auth-override syntax(integer), optional, single
183
184 class: person
185 attr: person syntax(special,person), mandatory, single, lookup
186 attr: nic-hdl syntax(special,nichdl), mandatory, single, key
187 attr: address mandatory, multiple
188 attr: phone syntax(special,phone), mandatory, multiple
189 attr: fax-no syntax(special,phone), optional, multiple
190 attr: e-mail syntax(email), optional, multiple, lookup " CMN_ATTRS "
191 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
192
193 class: role
194 attr: role syntax(special,person), mandatory, single, lookup
195 attr: nic-hdl syntax(special,nichdl), mandatory, single, key
196 attr: address mandatory, multiple
197 attr: phone syntax(special,phone), mandatory, multiple
198 attr: fax-no syntax(special,phone), optional, multiple
199 attr: e-mail syntax(email), mandatory, multiple, lookup
200 attr: trouble optional, multiple " CMN_ATTRS "
201 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
202 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
203 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
204
205 class: route
206 attr: route syntax(address_prefix), mandatory, single, key, lookup
207 attr: origin syntax(as_number), mandatory, single, key, lookup
208 attr: member-of syntax(ListOfroute_set_name), optional, multiple, lookup
209 attr: inject syntax(special, inject), optional, multiple
210 attr: components syntax(special, components), optional, single
211 attr: aggr-bndry syntax(special, aggr-bndry), optional, single
212 attr: aggr-mtd syntax(special, aggr-mtd), optional, single
213 attr: export-comps syntax(special, filter), optional, single
214 attr: holes syntax(ListOfIPv4Prefix), optional, multiple " CMN_ATTRS "
215 attr: descr mandatory, single
216 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
217 attr: admin-c syntax(special,nichdl), optional, multiple, lookup
218 attr: tech-c syntax(special,nichdl), optional, multiple, lookup
219 attr: cross-nfy syntax(list of rpsl_word), optional, multiple
220 attr: cross-mnt syntax(list of rpsl_word), optional, multiple
221
222 class: route-set
223 attr: route-set syntax(route_set_name), mandatory, single, key
224 attr: members syntax(special, rs-members), optional, multiple, lookup
225 attr: mbrs-by-ref syntax(list of rpsl_Word), optional, multiple, lookup " CMN_ATTRS "
226 attr: descr mandatory, single
227 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
228 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
229 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
230
231 class: as-set
232 attr: as-set syntax(as_set_name), mandatory, single, key
233 attr: members syntax(list of union as_number, as_set_name), optional, multiple, lookup
234 attr: mbrs-by-ref syntax(list of rpsl_word), optional, multiple, lookup " CMN_ATTRS "
235 attr: descr mandatory, single
236 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
237 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
238 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
239
240 class: rtr-set
241 attr: rtr-set syntax(rtr_set_name), mandatory, single, key
242 attr: members syntax(list of union rtr_set_name, dns_name, ipv4_address), optional, multiple, lookup
243 attr: mbrs-by-ref syntax(list of rpsl_Word), optional, multiple, lookup " CMN_ATTRS "
244 attr: descr mandatory, single
245 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
246 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
247 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
248
249 class: peering-set
250 attr: peering-set syntax(peering_set_name), mandatory, single, key
251 attr: peering syntax(special, peering), mandatory, multiple " CMN_ATTRS "
252 attr: descr mandatory, single
253 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
254 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
255 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
256
257 class: filter-set
258 attr: filter-set syntax(filter_set_name), mandatory, single, key
259 attr: filter syntax(special, filter), mandatory, single " CMN_ATTRS "
260 attr: descr mandatory, single
261 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
262 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
263 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
264
265 class: aut-num
266 attr: aut-num syntax(as_number), mandatory, single, key
267 attr: as-name syntax(rpsl_word), optional, single, lookup
268 attr: member-of syntax(List Of AS_set_name), optional, multiple, lookup
269 attr: import syntax(special,import), optional, multiple
270 attr: export syntax(special,export), optional, multiple
271 attr: default syntax(special,default), optional, multiple " CMN_ATTRS "
272 attr: descr mandatory, multiple
273 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
274 attr: mnt-routes syntax(special, mnt-routes), optional, multiple, lookup
275 attr: mnt-lower syntax(list of rpsl_word), optional, multiple
276 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
277 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
278 attr: cross-nfy syntax(list of rpsl_word), optional, multiple
279 attr: cross-mnt syntax(list of rpsl_word), optional, multiple
280
281 class: inet-rtr
282 attr: inet-rtr syntax(dns_name), mandatory, single, key
283 attr: alias syntax(dns_name), optional, multiple, lookup
284 attr: local-as syntax(as_number), mandatory, single, lookup
285 attr: ifaddr syntax(special,ifaddr), mandatory, multiple
286 attr: peer syntax(special,peer), optional, multiple " CMN_ATTRS "
287 attr: member-of syntax(List Of rtr_set_name), optional, multiple, lookup
288 attr: descr optional, multiple
289 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
290 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
291 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
292
293 class: inetnum
294 attr: inetnum syntax(range of ipv4_address), mandatory, single, key
295 attr: netname syntax(rpsl_word), mandatory, single, lookup
296 attr: country syntax(special, country), mandatory, multiple
297 attr: rev-srv optional, multiple, lookup
298 attr: status syntax(special,status_inet), mandatory, single
299 attr: mnt-routes syntax(special, mnt-routes), optional, multiple
300 attr: mnt-lower syntax(ListOfrpsl_word), optional, multiple " CMN_ATTRS "
301 attr: descr mandatory, multiple
302 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
303 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
304 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
305
306 class: inet6num
307 attr: inet6num syntax(ipv6_prefix), mandatory, single, key
308 attr: netname syntax(rpsl_word), mandatory, single, lookup
309 attr: country syntax(special, country), mandatory, multiple
310 attr: rev-srv optional, multiple, lookup
311 attr: status optional, generated, single
312 attr: mnt-lower syntax(ListOfrpsl_word), optional, multiple " CMN_ATTRS "
313 attr: descr mandatory, multiple
314 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
315 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
316 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
317
318 class: domain
319 attr: domain syntax(union dns_name, rpsl_word), mandatory, single, key
320 attr: sub-dom optional, multiple, lookup
321 attr: dom-net optional, multiple
322 attr: zone-c syntax(special,nichdl), mandatory, multiple, lookup
323 attr: nserver optional, multiple, lookup
324 attr: refer syntax(special, refer), optional, single
325 attr: mnt-lower syntax(ListOfrpsl_word), optional, multiple " CMN_ATTRS "
326 attr: descr mandatory, multiple
327 attr: mnt-by syntax(list of rpsl_word), optional, multiple, lookup
328 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
329 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
330
331 class: limerick
332 attr: limerick mandatory, single, key
333 attr: text mandatory, multiple
334 attr: author syntax(special,nichdl), mandatory, multiple, lookup " CMN_ATTRS "
335 attr: descr optional, single
336 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
337 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
338
339 class: as-block
340 attr: as-block syntax(union as_number, range of as_number), mandatory, single, key
341 attr: mnt-lower syntax(ListOfrpsl_word), optional, multiple " CMN_ATTRS "
342 attr: descr mandatory, single
343 attr: mnt-by syntax(list of rpsl_word), mandatory, multiple, lookup
344 attr: admin-c syntax(special,nichdl), mandatory, multiple, lookup
345 attr: tech-c syntax(special,nichdl), mandatory, multiple, lookup
346
347 class: key-cert
348 attr: key-cert mandatory, single, key, syntax(keycrtname)
349 attr: method generated, optional, single, syntax(rpsl_word)
350 attr: owner generated, optional, multiple
351 attr: fingerpr generated, optional, single
352 attr: certif mandatory, multiple " CMN_ATTRS "
353 attr: mnt-by mandatory, multiple, lookup, syntax(list of rpsl_word)
354
355 class: peval
356 attr: peval syntax(special,filter), optional, single
357
358 class: repository
359 attr: repository mandatory, single, key, syntax(rpsl_word)
360 attr: query-address mandatory, multiple
361 attr: response-auth-type mandatory, multiple
362 attr: submit-address mandatory, multiple
363 attr: submit-auth-type mandatory, multiple
364 attr: repository-cert mandatory, multiple
365 attr: expire mandatory, single
366 attr: heartbeat-interval mandatory, single
367 attr: descr optional, multiple
368 attr: admin-c mandatory, multiple, lookup
369 attr: tech-c mandatory, multiple, lookup
370 attr: mnt-by mandatory, multiple, lookup " CMN_ATTRS "
371 ";
372
373 void Schema::addClass(AttrClass *clss) {
/* [<][>][^][v][top][bottom][index][help] */
374 classes[lastClass++] = clss;
375 }
376
377 void Schema::initializeBase() {
/* [<][>][^][v][top][bottom][index][help] */
378 static bool initializeBaseDone = false;
379 if (initializeBaseDone)
380 return;
381 initializeBaseDone = true;
382
383 AttrClass *classClass = new AttrClass(strdup("class"));
384 AttrClass *clss = NULL;
385
386 addClass(classClass);
387 classClass->addAttr(new AttrAttr(strdup("class"), ATTR_GENERIC,
388 RPType::newRPType("rpsl_word"),
389 AttrAttr::LOOKUP));
390 classClass->addAttr(new AttrAttr(strdup("attr"), ATTR_ATTR,
391 (RPType *) NULL,
392 AttrAttr::MULTIVALUED));
393
394 dictionary = initializeFromString(base_text, "dictionary");
395 }
396
397 List<Object> *Schema::initializeFromFile(char *filename) {
/* [<][>][^][v][top][bottom][index][help] */
398 Object *o;
399 const AttrAttr *attr;
400 char *class_name;
401 bool code = true;
402 List<Object> *result = new List<Object>;
403 AttrClass *clss = NULL;
404
405 initializeBase();
406
407 ifstream in(filename);
408 if (!in)
409 return result;
410
411 while (in) {
412 o = new Object;
413 code = o->read(in);
414 if (! code) {
415 delete o;
416 continue;
417 }
418
419 code = o->scan();
420 if (o->has_error)
421 delete o;
422 else {
423 if (! strcasecmp(o->type->name, "class")) {
424 AttrGenericIterator<ItemWORD> cname(o, "class");
425 AttrIterator<AttrAttr> attrItr(o, "attr");
426 char *name = cname.first()->word;
427
428 addClass(clss = new AttrClass(strdup(name)));
429 clss->object = o;
430 //cerr << "Reading "<< name << " class definition..." << endl;
431
432 for (attr = attrItr.first(); attr; attr = attrItr.next())
433 clss->addAttr((AttrAttr *) attr);
434
435 }
436
437 result->append(o);
438 }
439 }
440
441 return result;
442 }
443
444 Object *Schema::initializeFromString(char *class_text, char *lookFor) {
/* [<][>][^][v][top][bottom][index][help] */
445 Object *o;
446 const AttrAttr *attr;
447 char *class_name;
448 Object *result = (Object *) NULL;
449 AttrClass *clss = NULL;
450 int count = 0;
451
452 initializeBase();
453
454 do {
455 count++;
456 o = new Object;
457 if (count == 2 && ! dictionary)
458 dictionary = o;
459
460 o->scan(class_text, strlen(class_text));
461
462 if (o->has_error)
463 delete o;
464 else {
465 if (!strcasecmp(o->type->name, "class")) {
466 AttrGenericIterator<ItemWORD> cname(o, "class");
467 AttrIterator<AttrAttr> attrItr(o, "attr");
468 char *name = cname.first()->word;
469
470 addClass(clss = new AttrClass(strdup(name)));
471 clss->object = o;
472 // cerr << "Reading "<< name << " class definition..." << endl;
473
474 for (attr = attrItr.first(); attr; attr = attrItr.next())
475 clss->addAttr((AttrAttr *) attr);
476
477 //delete o;
478 }
479
480 if (lookFor && ! strcasecmp(o->type->name, lookFor))
481 result = o;
482 }
483
484 class_text = strstr(class_text, "\n\n");
485 if (class_text)
486 class_text += 2;
487 } while (class_text);
488
489 return result;
490 }
491
492 void Schema::initialize() {
/* [<][>][^][v][top][bottom][index][help] */
493 initializeBase();
494 initializeFromString(classes_text);
495 }
496
497 static RPSLKeyword rpsl_keywords[] = {
498 RPSLKeyword("true", KEYW_TRUE, 1),
499 RPSLKeyword("false", KEYW_FALSE, 1),
500 RPSLKeyword("action", KEYW_ACTION, 1),
501 RPSLKeyword("accept", KEYW_ACCEPT, 1),
502 RPSLKeyword("announce", KEYW_ANNOUNCE, 1),
503 RPSLKeyword("from", KEYW_FROM, 1),
504 RPSLKeyword("to", KEYW_TO, 1),
505 RPSLKeyword("at", KEYW_AT, 1),
506 RPSLKeyword("any", KEYW_ANY, 1),
507 RPSLKeyword("protocol", KEYW_PROTOCOL, 1),
508 RPSLKeyword("into", KEYW_INTO, 1),
509 RPSLKeyword("refine", KEYW_REFINE, 1),
510 RPSLKeyword("except", KEYW_EXCEPT, 1),
511 RPSLKeyword("static", KEYW_STATIC, 1),
512 RPSLKeyword("networks", KEYW_NETWORKS, 1),
513 RPSLKeyword("masklen", KEYW_MASKLEN, 1),
514 RPSLKeyword("peeras", KEYW_PEERAS, 1),
515
516 RPSLKeyword("atomic", KEYW_ATOMIC, 1),
517 RPSLKeyword("inbound", KEYW_INBOUND, 1),
518 RPSLKeyword("outbound", KEYW_OUTBOUND, 1),
519
520 RPSLKeyword("or", OP_OR , 1),
521 RPSLKeyword("and", OP_AND, 1),
522 RPSLKeyword("not", OP_NOT, 1),
523
524 RPSLKeyword("union", KEYW_UNION, 1),
525 RPSLKeyword("range", KEYW_RANGE, 1),
526 RPSLKeyword("list", KEYW_LIST, 1),
527 RPSLKeyword("of", KEYW_OF, 1),
528 RPSLKeyword("operator", KEYW_OPERATOR, 1),
529 RPSLKeyword("upon", KEYW_UPON, 1),
530 RPSLKeyword("have-components", KEYW_HAVE_COMPONENTS, 1),
531 RPSLKeyword("exclude", KEYW_EXCLUDE, 1),
532
533 RPSLKeyword("syntax", KEYW_SYNTAX, 1),
534 RPSLKeyword("special", KEYW_SPECIAL, 1),
535 RPSLKeyword("optional", KEYW_OPTIONAL, 1),
536 RPSLKeyword("mandatory", KEYW_MANDATORY, 1),
537 RPSLKeyword("internal", KEYW_INTERNAL, 1),
538 RPSLKeyword("single", KEYW_SINGLEVALUED, 1),
539 RPSLKeyword("multiple", KEYW_MULTIVALUED, 1),
540 RPSLKeyword("lookup", KEYW_LOOKUP, 1),
541 RPSLKeyword("key", KEYW_KEY, 1),
542 RPSLKeyword("deleted", KEYW_DELETED, 1),
543 RPSLKeyword("generated", KEYW_GENERATED, 1),
544 RPSLKeyword("none", KEYW_NONE, 1),
545 RPSLKeyword("mail-from", KEYW_MAILFROM, 1),
546 RPSLKeyword("crypt-pw", KEYW_CRYPTPW, 1),
547 RPSLKeyword("assigned", KEYW_ASSIGNED, 1),
548 RPSLKeyword("allocated", KEYW_ALLOCATED, 1),
549 RPSLKeyword("PA", KEYW_PA, 1),
550 RPSLKeyword("PI", KEYW_PI, 1),
551 RPSLKeyword("unspecified", KEYW_UNSPECIFIED, 1),
552 RPSLKeyword("ext", KEYW_EXT, 1),
553 RPSLKeyword("simple", KEYW_SIMPLE, 1),
554 RPSLKeyword("ripe", KEYW_RIPE, 1),
555 RPSLKeyword("internic", KEYW_INTERNIC, 1),
556 RPSLKeyword("clientaddress",KEYW_CLIENTADDRESS,1),
557 RPSLKeyword(NULL, 0, 0)
558 };
559
560 static RPSLKeyword rpsl_rules[] = {
561 RPSLKeyword("changed", ATTR_CHANGED, 1),
562 RPSLKeyword("import", ATTR_IMPORT, 1),
563 RPSLKeyword("export", ATTR_EXPORT, 1),
564 RPSLKeyword("default", ATTR_DEFAULT, 1),
565 RPSLKeyword("ifaddr", ATTR_IFADDR, 1),
566 RPSLKeyword("peer", ATTR_PEER, 1),
567 RPSLKeyword("rp-attribute", ATTR_RP_ATTR, 1),
568 RPSLKeyword("typedef", ATTR_TYPEDEF, 1),
569 RPSLKeyword("protocol", ATTR_PROTOCOL, 1),
570 RPSLKeyword("filter", ATTR_FILTER, 1),
571 RPSLKeyword("peering", ATTR_PEERING, 1),
572 RPSLKeyword("blobs", ATTR_BLOBS, 1),
573 RPSLKeyword("mnt-routes", ATTR_MNT_ROUTES, 1),
574 RPSLKeyword("components", ATTR_COMPONENTS, 1),
575 RPSLKeyword("inject", ATTR_INJECT, 1),
576 RPSLKeyword("aggr-mtd", ATTR_AGGR_MTD, 1),
577 RPSLKeyword("aggr-bndry", ATTR_AGGR_BNDRY, 1),
578 RPSLKeyword("rs-members", ATTR_RS_MEMBERS, 1),
579 RPSLKeyword("nichdl", ATTR_NICHDL, 1),
580 RPSLKeyword("auth", ATTR_AUTH, 1),
581 RPSLKeyword("status_inet", ATTR_STATUS_INET, 1),
582 RPSLKeyword("phone", ATTR_PHONE, 1),
583 RPSLKeyword("source", ATTR_SOURCE, 1),
584 RPSLKeyword("refer", ATTR_REFER, 1),
585 RPSLKeyword("country", ATTR_COUNTRY, 1),
586 RPSLKeyword("person", ATTR_PERSON, 1),
587 RPSLKeyword(NULL, 0, 1)
588 };
589
590 Schema schema(rpsl_keywords, rpsl_rules);