|
|
@@ -4027,3 +4027,167 @@ diff -Nau include/UD_queries.def.orig include/UD_queries.def
|
|
|
{0, NULL}
|
|
|
}; /* Select */
|
|
|
|
|
|
+Index: modules/qc/query_command.c
|
|
|
+diff -Nau modules/qc/query_command.c.orig modules/qc/query_command.c
|
|
|
+--- modules/qc/query_command.c.orig 2003-07-03 09:55:33.000000000 +0200
|
|
|
++++ modules/qc/query_command.c 2003-12-12 04:38:18.300001000 +0100
|
|
|
+@@ -824,11 +824,12 @@
|
|
|
+ MA_not(query_command->object_type_bitmap);
|
|
|
+ }
|
|
|
+
|
|
|
+- /* XXX: missing checks for "-i" and "-T" versus key types */
|
|
|
++ /* XXX: missing checks for "-i" and "-T" versus key types AV */
|
|
|
+
|
|
|
+ is_ip_key = MA_isset(query_command->keytypes_bitmap, WK_IPADDRESS) ||
|
|
|
+- MA_isset(query_command->keytypes_bitmap, WK_IPRANGE) ||
|
|
|
+- MA_isset(query_command->keytypes_bitmap, WK_IPPREFIX) ||
|
|
|
++ MA_isset(query_command->keytypes_bitmap, WK_IPRANGE) ||
|
|
|
++ MA_isset(query_command->keytypes_bitmap, WK_IPPREFIX) ||
|
|
|
++ MA_isset(query_command->keytypes_bitmap, WK_RANGE ) ||
|
|
|
+ MA_isset(query_command->keytypes_bitmap, WK_IP6PREFIX);
|
|
|
+
|
|
|
+ /* check for use of IP flags on non-IP lookups */
|
|
|
+Index: modules/qi/query_instructions.c
|
|
|
+diff -Nau modules/qi/query_instructions.c.orig modules/qi/query_instructions.c
|
|
|
+--- modules/qi/query_instructions.c.orig 2003-07-03 09:55:34.000000000 +0200
|
|
|
++++ modules/qi/query_instructions.c 2003-12-12 05:14:05.410008000 +0100
|
|
|
+@@ -396,7 +396,7 @@
|
|
|
+ create_name_query(result_buff, q.query, qc->keys);
|
|
|
+ addquery = 1;
|
|
|
+ }
|
|
|
+- else if( q.keytype == WK_IPADDRESS ) { /* ifaddr sql lookups */
|
|
|
++ else if( q.keytype == WK_IPADDRESS || q.keytype == WK_RANGE ) { /* AV ifaddr sql lookups */
|
|
|
+ ip_range_t myrang;
|
|
|
+ unsigned begin, end;
|
|
|
+ ip_keytype_t key_type;
|
|
|
+@@ -2104,6 +2104,10 @@
|
|
|
+ static int valid_query(const Query_command *qc, const Query_t q) {
|
|
|
+ int result=0;
|
|
|
+
|
|
|
++ if (q.keytype == WK_REGID || q.keytype == WK_POP ||
|
|
|
++ q.keytype == WK_TICKET|| q.keytype == WK_RANGE ||
|
|
|
++ q.keytype == WK_PURPOSE ) return 1;
|
|
|
++
|
|
|
+ if (MA_isset(qc->keytypes_bitmap, q.keytype) == 1) {
|
|
|
+ if (q.query != NULL) {
|
|
|
+ switch (q.querytype) {
|
|
|
+Index: modules/rp/rp_load.c
|
|
|
+diff -Nau modules/rp/rp_load.c.orig modules/rp/rp_load.c
|
|
|
+--- modules/rp/rp_load.c.orig 2003-07-03 09:55:36.000000000 +0200
|
|
|
++++ modules/rp/rp_load.c 2003-12-12 04:50:54.680003000 +0100
|
|
|
+@@ -61,6 +61,7 @@
|
|
|
+ pack->type = attr;
|
|
|
+ pack->d.origin = NULL;
|
|
|
+ switch( attr ) {
|
|
|
++ case A_RA: /* AV Range Object */
|
|
|
+ case A_IN:
|
|
|
+ /*
|
|
|
+ read 0-2 from inetnum
|
|
|
+@@ -254,7 +255,7 @@
|
|
|
+
|
|
|
+ dieif ( SQ_execute_query(con, "LOCK TABLES "
|
|
|
+ "route READ, inetnum READ, inet6num READ, "
|
|
|
+- "inaddr_arpa READ, domain READ, ip6int READ ",
|
|
|
++ "inaddr_arpa READ, domain READ, ip6int READ, range READ ",
|
|
|
+ NULL) == -1 );
|
|
|
+
|
|
|
+ do {
|
|
|
+@@ -264,6 +265,9 @@
|
|
|
+ if( !NOERR(err=RP_sql_load_attr_space( A_IN, IP_V4, reg_id, con))) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
++ if( !NOERR(err=RP_sql_load_attr_space( A_RA, IP_V4, reg_id, con))) {
|
|
|
++ break;
|
|
|
++ }
|
|
|
+ #ifndef NO_A_I6
|
|
|
+ if( !NOERR(err=RP_sql_load_attr_space( A_I6, IP_V6, reg_id, con))) {
|
|
|
+ break;
|
|
|
+Index: modules/rp/rp_tree.c
|
|
|
+diff -Nau modules/rp/rp_tree.c.orig modules/rp/rp_tree.c
|
|
|
+--- modules/rp/rp_tree.c.orig 2003-07-03 09:55:36.000000000 +0200
|
|
|
++++ modules/rp/rp_tree.c 2003-12-12 04:56:27.790002000 +0100
|
|
|
+@@ -201,7 +201,8 @@
|
|
|
+ if( NOERR(err=rp_init_attr_tree(reg_id, A_IN))
|
|
|
+ && NOERR(err=rp_init_attr_tree(reg_id, A_RT))
|
|
|
+ && NOERR(err=rp_init_attr_tree(reg_id, A_I6))
|
|
|
+- && NOERR(err=rp_init_attr_tree(reg_id, A_DN)) ) {
|
|
|
++ && NOERR(err=rp_init_attr_tree(reg_id, A_DN))
|
|
|
++ && NOERR(err=rp_init_attr_tree(reg_id, A_RA)) ) { /* AV Init range 2 */
|
|
|
+ return RP_OK;
|
|
|
+ }
|
|
|
+
|
|
|
+Index: modules/ud/ud_core.c
|
|
|
+diff -Nau modules/ud/ud_core.c.orig modules/ud/ud_core.c
|
|
|
+--- modules/ud/ud_core.c.orig 2003-07-03 09:55:49.000000000 +0200
|
|
|
++++ modules/ud/ud_core.c 2003-12-12 04:59:20.420009000 +0100
|
|
|
+@@ -654,6 +654,13 @@
|
|
|
+ /* Determine the attribute type */
|
|
|
+ attribute_type = rpsl_get_attr_id(rpsl_attr_get_name(attribute));
|
|
|
+ /* Get attribute value .It is already clean since we process the flattened copy of the object */
|
|
|
++
|
|
|
++ /* This is kind of ugly but the only possebility for a fast solution */
|
|
|
++ /* Never allow dummy for reg-id, pop and ticket AV */
|
|
|
++ if(attribute_type==A_AX || attribute_type==A_RG ||
|
|
|
++ attribute_type==A_TK || attribute_type==A_PF ||
|
|
|
++ attribute_type==A_UF ) return 1;
|
|
|
++
|
|
|
+ attribute_value = rpsl_attr_get_value(attribute);
|
|
|
+
|
|
|
+ query_fmt = DF_get_dummy_query(attribute_type);
|
|
|
+@@ -917,6 +924,22 @@
|
|
|
+ get_ref_id(tr, "mntner", "mntner", attribute_value, condition));
|
|
|
+ }
|
|
|
+ break;
|
|
|
++ case UD_AX_AX: /* Update as_ref reference AV */
|
|
|
++ g_string_sprintf(tr->query, query_fmt, tr->thread_upd, tr->object_id,
|
|
|
++ get_ref_id(tr, "aut_num", "aut_num", attribute_value, NULL));
|
|
|
++ break;
|
|
|
++ case UD_AX_RG: /* Update reg_ref reference AV */
|
|
|
++ g_string_sprintf(tr->query, query_fmt, tr->thread_upd, tr->object_id,
|
|
|
++ get_ref_id(tr, "reg_id", "reg_id", attribute_value, NULL));
|
|
|
++ break;
|
|
|
++ case UD_AX_PP: /* Update pop reference AV */
|
|
|
++ g_string_sprintf(tr->query, query_fmt, tr->thread_upd, tr->object_id,
|
|
|
++ get_ref_id(tr, "pop", "pop", attribute_value, NULL));
|
|
|
++ break;
|
|
|
++ case UD_AX_PU: /* Update purpose reference AV */
|
|
|
++ g_string_sprintf(tr->query, query_fmt, tr->thread_upd, tr->object_id,
|
|
|
++ get_ref_id(tr, "purpose", "purpose", attribute_value, NULL));
|
|
|
++ break;
|
|
|
+ case UD_LEAF_:
|
|
|
+ g_string_sprintf(tr->query, query_fmt, tr->thread_upd, tr->object_id, attribute_value);
|
|
|
+ break;
|
|
|
+@@ -1144,8 +1167,19 @@
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case UD_AUX__: /* for AUX tables*/
|
|
|
+- g_string_sprintf(tr->query, query_fmt, tr->thread_ins, tr->object_id, tr->class_type, attribute_value);
|
|
|
+- if(!IS_DUMMY_ALLOWED(tr->mode))g_string_sprintfa(tr->query, " AND dummy=0 ");
|
|
|
++ /* AV Never create dummys for this attributes */
|
|
|
++ if(attribute_type==A_AX || attribute_type==A_RG ||
|
|
|
++ attribute_type==A_TK || attribute_type==A_PF ||
|
|
|
++ attribute_type==A_UF )
|
|
|
++ {
|
|
|
++ g_string_sprintf(tr->query, query_fmt, tr->thread_ins, tr->object_id,
|
|
|
++ tr->class_type, attribute_value);
|
|
|
++ }
|
|
|
++ else {
|
|
|
++ g_string_sprintf(tr->query, query_fmt, tr->thread_ins, tr->object_id,
|
|
|
++ tr->class_type, attribute_value);
|
|
|
++ if(!IS_DUMMY_ALLOWED(tr->mode))g_string_sprintfa(tr->query, " AND dummy=0 ");
|
|
|
++ }
|
|
|
+ break;
|
|
|
+ case UD_AX_MO: /* for member_of table*/
|
|
|
+ set_name = get_set_name(tr->class_type);
|
|
|
+Index: modules/ud/ud_rx.c
|
|
|
+diff -Nau modules/ud/ud_rx.c.orig modules/ud/ud_rx.c
|
|
|
+--- modules/ud/ud_rx.c.orig 2003-07-03 09:55:49.000000000 +0200
|
|
|
++++ modules/ud/ud_rx.c 2003-12-11 03:58:26.000002000 +0100
|
|
|
+@@ -44,6 +44,7 @@
|
|
|
+ const gchar *attribute_value;
|
|
|
+
|
|
|
+ switch(attribute_type){
|
|
|
++ case A_RA: /* AV range object */
|
|
|
+ case A_IN:
|
|
|
+ case A_RT:
|
|
|
+ case A_I6:
|