<!DOCTYPE ripe_attributes SYSTEM "attributes.dtd">

<ripe_attributes version="$Revision: 1.2 $" author="$Author: shane $">

  <ripe_attribute name="address" code="ad">
    <description>
      Full postal address of a contact.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="admin-c" code="ac">
    <description>
   References an on-site administrative contact.
    </description>
    <syntax>nic-handle</syntax>

    <representation> 
    <sqltable name="admin_c">
      <insert qtype="ud_aux__">
        INSERT admin_c 
        SELECT %d, %ld, person_role.object_id, %d 
        FROM person_role 
        WHERE person_role.nic_hdl='%s'
      </insert>
      <update qtype="ud_ax_pr">
        UPDATE admin_c
        SET thread_id=%d
        WHERE object_id=%ld
        AND pe_ro_id=%ld
      </update>
      <dummy qtype="ud_ax_pr">
        INSERT person_role 
        SET thread_id=%d, object_id=%ld, nic_hdl='%s', object_type=%d, dummy=1
      </dummy>
    </sqltable>
    </representation>
    <keys searchable="inverse">
      <foreign value="nh"/>
      
      <queries>
        <sqlquery keytype="wk_name" class="ANY">
          SELECT i.object_id
          FROM   admin_c i, %s
          WHERE  %s
          AND    i.pe_ro_id = N00.object_id
	  AND	 i.thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_nic_hdl" class="ANY">
          SELECT i.object_id
          FROM   admin_c i, person_role
          WHERE  i.pe_ro_id = person_role.object_id
          AND    person_role.nic_hdl  = '%s'
	  AND	 i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="aggr-mtd" code="ag">
      <description>
   Specifies how the aggregate is generated.
      </description>
      <syntax>aggr-mtd</syntax>
  </ripe_attribute>

  <ripe_attribute name="aggr-bndry" code="ab">
      <description>
   Defines a set of ASes, which form the aggregation boundary.
      </description>
      <syntax>aggr-bndry</syntax>
  </ripe_attribute>

  <ripe_attribute name="alias" code="az">
     <description>
   The canonical DNS name for the router.
     </description>
     <syntax>domain-name</syntax>
  </ripe_attribute>

  <ripe_attribute name="as-name" code="aa">
      <description>
   A descriptive name associated with an AS.
      </description>
      <syntax>object-name</syntax>
   </ripe_attribute>


  <ripe_attribute name="as-set" code="as">
    <description>
   Defines the name of the set.
    </description>
    <syntax>as-set</syntax>

    <representation>
    <sqltable name="as_set">
      <insert qtype="ud_main_">
        INSERT as_set
        SET thread_id=%d, object_id=%ld, as_set='%s', dummy=0
      </insert>
      <update qtype="ud_main_">
        UPDATE as_set
        SET thread_id=%d
        WHERE object_id=%ld
      </update>
      <select qtype="ud_main_">
        as_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_assetname">
          SELECT object_id
          FROM   as_set
          WHERE  as_set = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="auth" code="at">
    <description>
   Defines an authentication scheme to be used.
    </description>
    <syntax>auth-scheme</syntax>

    <representation>
    <sqltable name="auth">
      <insert qtype="ud_lf_at">
        INSERT auth
        SET thread_id=%d, object_id=%ld, object_type=%d, auth='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE auth
        SET thread_id=%d
        WHERE object_id=%ld
        AND auth='%s'
      </update>
    </sqltable>
    </representation>
  </ripe_attribute>

  <ripe_attribute name="author" code="ah">
    <description>
   References a limerick author.
    </description>
    <syntax>nic-handle</syntax>
    <representation>
      <sqltable name="author">
        <insert qtype="ud_aux__">
          INSERT author
          SELECT %d, %ld, person_role.object_id, %d
          FROM person_role
          WHERE person_role.nic_hdl='%s'
        </insert>
        <update qtype="ud_ax_pr">
          UPDATE author
          SET thread_id=%d
          WHERE object_id=%ld
          AND pe_ro_id=%ld
        </update>
        <dummy qtype="ud_ax_pr">
          INSERT person_role
          SET thread_id=%d, object_id=%ld, nic_hdl='%s', object_type=%d, dummy=1
        </dummy>
      </sqltable>
    </representation>
    <keys searchable="inverse">
      <foreign value="nh"/>
      <queries>
        <sqlquery keytype="wk_name" class="ANY">
          SELECT i.object_id
          FROM   author i, %s
          WHERE  %s
          AND    i.pe_ro_id = N00.object_id
          AND    i.thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_nic_hdl" class="ANY">
          SELECT i.object_id
          FROM   person_role, author i
          WHERE  person_role.object_id = i.pe_ro_id
          AND    person_role.nic_hdl  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="certif" code="ce">
     <description>
   Contains the public key.
     </description>
     <syntax>public-key</syntax>
  </ripe_attribute>

  <ripe_attribute name="changed" code="ch">
    <description>
   Specifies who submitted the update, and when the object was
   updated. 
    </description>
    <syntax>changed</syntax>
  </ripe_attribute>

  <ripe_attribute name="components" code="co">
    <description>
   The "components:" attribute defines what component routes are
   used to form the aggregate.  
    </description>
    <syntax>components</syntax>
  </ripe_attribute>

  <ripe_attribute name="country" code="cy">
    <description>
   Identifies the country.
    </description>
    <syntax>country-code</syntax>
  </ripe_attribute>

  <ripe_attribute name="cross-nfy" code="cn">
    <description>
   References a NIC-handle pointing to a person or role object,
   the email address of which will be used for notification about
   the addition or removal of route objects, which overlap the
   prefixes of the already registered route objects. 
    </description>
    <syntax>nic-handle</syntax>
    <representation>
      <sqltable name="cross_nfy">
        <insert qtype="ud_aux__">
          INSERT cross_nfy
          SELECT %d, %ld, person_role.object_id, %d
          FROM person_role
          WHERE person_role.nic_hdl='%s'
        </insert>
        <update qtype="ud_ax_pr">
          UPDATE cross_nfy
          SET thread_id=%d
          WHERE object_id=%ld
          AND pe_ro_id=%ld
        </update>
        <dummy qtype="ud_ax_pr">
          INSERT person_role
          SET thread_id=%d, object_id=%ld, nic_hdl='%s', object_type=%d, dummy=1
        </dummy>
      </sqltable>
    </representation>
    <keys searchable="inverse">
      <foreign value="nh"/>
      <queries>
        <sqlquery keytype="wk_nic_hdl" class="ANY">
          SELECT i.object_id
          FROM   person_role, cross_nfy i
          WHERE  person_role.object_id = i.pe_ro_id
          AND    person_role.nic_hdl  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="default" code="df">
     <description>
   Specifies default routing policies.
     </description>
     <syntax>default</syntax>
  </ripe_attribute>
  
  <ripe_attribute name="descr" code="de">
    <description>
   A short decription related to the object.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="dom-net" code="di">
    <description>
   List of IP networks in a domain.
    </description>
    <syntax><ripe-list/>ipv4-address</syntax>
  </ripe_attribute>

  <ripe_attribute name="domain" code="dn">
    <description>
   Domain name.
    </description>
    <syntax>domain-name</syntax>

    <representation>
        <sqltable name="domain">
              <insert qtype="ud_main_">
                INSERT domain
                SET thread_id=%d, object_id=%ld, domain='%s'
              </insert>
              <update qtype="ud_main_"></update>
              <select qtype="ud_main_">
                domain='%s' AND
              </select>
        </sqltable>
        <radixtrees family="RX_FAM_RT">
             <IP_V4>
                SELECT domain.object_id,prefix,prefix_length,domain
                FROM inaddr_arpa,domain
                WHERE domain.object_id = inaddr_arpa.object_id
                AND   inaddr_arpa.thread_id = 0
             </IP_V4>
             <IP_V6>
                SELECT domain.object_id, msb, lsb, prefix_length, domain
                FROM ip6int,domain
                WHERE domain.object_id = ip6int.object_id
                AND ip6int.thread_id = 0
             </IP_V6>
        </radixtrees>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_domain">
          SELECT object_id
          FROM   domain
          WHERE  domain = '%s'
          AND    thread_id = 0
        </sqlquery>
        <radixquery keytype="wk_iprange"   space="IP_V4" />
        <radixquery keytype="wk_ipprefix"  space="IP_V4" />
        <radixquery keytype="wk_ipaddress" space="IP_V4" />
        <radixquery keytype="wk_ip6prefix" space="IP_V6" />
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="e-mail" code="em">
    <description>
   The e-mail address of a person or role.
    </description>
    <syntax>e-mail</syntax>
    <representation>
    <sqltable name="e_mail">
     <insert qtype="ud_lf_ot">
        INSERT e_mail
        SET thread_id=%d, object_id=%ld, object_type=%d, e_mail='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE e_mail
        SET thread_id=%d
        WHERE object_id=%ld
        AND e_mail='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <queries>
        <sqlquery keytype="wk_email" class="ANY">
          SELECT object_id
          FROM   e_mail i
          WHERE  i.e_mail = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="export" code="ex">
    <description>
   Specifies an export policy expression.
    </description>
    <syntax>export</syntax>
  </ripe_attribute>

  <ripe_attribute name="export-comps" code="ec">
    <description>
   Defines the set's policy filter, a logical expression which
   when applied to a set of routes returns a subset of these
   routes.
    </description>
    <syntax>filter</syntax>
  </ripe_attribute>

  <ripe_attribute name="fax-no" code="fx">
    <description>
   The fax number of a contact.
    </description>
    <syntax>telephone-number</syntax>
  </ripe_attribute>

  <ripe_attribute name="filter" code="fi">
    <description>
   Defines the set's policy filter.
    </description>
    <syntax>filter</syntax>

    <representation> 
    <sqltable name="filter_set">
      <insert qtype="ud_ma_u2">
        UPDATE %s SET thread_id=%d, filter='%s' 
        WHERE object_id=%ld
      </insert>
      <update qtype="ud_ma_u2">
        UPDATE %s SET thread_id=%d, filter='%s' 
        WHERE object_id=%ld
      </update>
    </sqltable>
    </representation>
  </ripe_attribute>

  <ripe_attribute name="filter-set" code="fs">
    <description>
   Defines the name of the filter. 
    </description>
    <syntax>filter-set</syntax>

    <representation> 
    <sqltable name="filter_set">
	<insert qtype="ud_main_">
        INSERT filter_set 
        SET thread_id=%d, object_id=%ld, filter_set='%s', filter='-'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        filter_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_filterset">
	SELECT object_id
	FROM   filter_set 
	WHERE  filter_set='%s'
	AND    thread_id=0
	</sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="fingerpr" code="fp">
    <description>
   A fingerprint of a key certificate generated by the database.
    </description>
    <syntax>fingerpr</syntax>
  </ripe_attribute>

  <ripe_attribute name="holes" code="ho">
    <description>
   Lists the component address prefixes that are not reachable
   through the aggregate route (perhaps that part of the address
   space is unallocated).
    </description>
    <syntax><list/>address-prefix</syntax>
  </ripe_attribute>

  <ripe_attribute name="ifaddr" code="if">
    <description>
   Specifies an interface address within an Internet router.
    </description>
    <syntax>ifaddr</syntax>
    <representation>
      <sqltable name="ifaddr">
        <insert qtype="ud_lf_if">
          INSERT ifaddr
          SET thread_id=%d, object_id=%ld, ifaddr=%u
        </insert>
        <update qtype="ud_lf_if">
          UPDATE ifaddr
          SET thread_id=%d
          WHERE object_id=%ld
          AND ifaddr=%u
        </update>
      </sqltable>
    </representation>
    <keys searchable="lookup">
      <queries>
        <sqlquery keytype="wk_ipaddress" class="ir">
          SELECT object_id
          FROM   ifaddr
          WHERE  ifaddr &gt;= %u
          AND    ifaddr &lt;= %u
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="import" code="ip">
     <description>
   Specifies import policy expression.
     </description>
     <syntax>import</syntax>
  </ripe_attribute>

  <ripe_attribute name="inetnum" code="in">
    <description>
   Specifies a range of IPv4 that inetnum object presents. The
   ending address should be greater than the starting one.
    </description>
    <syntax>inetnum</syntax>

    <representation>
    <sqltable name="">
      <insert qtype="ud_ma_in">
        INSERT inetnum
        SET thread_id=%d, object_id=%ld, begin_in=%u, end_in=%u
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_ma_in">
        begin_in=%u AND end_in=%u AND
      </select>
    </sqltable>
       <radixtrees family="RX_FAM_IN">
             <IP_V4>
                SELECT  object_id,begin_in,end_in
                FROM    inetnum
                WHERE   thread_id = 0
             </IP_V4>
        </radixtrees>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <radixquery keytype="wk_iprange"   space="IP_V4" />
        <radixquery keytype="wk_ipprefix"  space="IP_V4" />
        <radixquery keytype="wk_ipaddress" space="IP_V4" />
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="inet6num" code="i6">
    <description>
   Specifies a range of IPv6 addresses in prefix notation.
    </description>
    <syntax>inet6num</syntax>

    <representation>
     <sqltable name="inet6num">
      <insert qtype="ud_ma_i6">
        INSERT inet6num
        SET thread_id=%d, object_id=%ld,
                i6_msb='%llu', i6_lsb='%llu',
                prefix_length=%u
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_ma_i6">
         i6_msb='%llu' AND i6_lsb='%llu' AND prefix_length=%u AND
      </select>
     </sqltable>
     <radixtrees family="RX_FAM_RT">
        <IP_V6>
                SELECT object_id,i6_msb,i6_lsb,prefix_length
                FROM   inet6num
                WHERE  thread_id = 0
        </IP_V6>
        </radixtrees>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <radixquery keytype="wk_ip6prefix" space="IP_V6"/>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="inject" code="ij">
    <description>
   Specifies which routers perform the aggregation and when they
   perform it.
    </description>
    <syntax>inject</syntax>
  </ripe_attribute>

  <ripe_attribute name="key-cert" code="kc">
    <description>
   Defines the public key stored in the database.
    </description>
    <syntax>key-cert</syntax>
    <representation>
      <sqltable name="key_cert">
        <insert qtype="ud_main_">
          INSERT key_cert
          SET thread_id=%d, object_id=%ld, key_cert='%s'
        </insert>
        <update qtype="ud_main_"></update>
        <select qtype="ud_main_">
          key_cert='%s' AND
        </select>
      </sqltable>
    </representation>
    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_key_cert">
          SELECT object_id
          FROM   key_cert
          WHERE  key_cert = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="mbrs-by-ref" code="mr">
    <description>
   This attribute can be used in all "set" objects; it allows
   indirect population of a set. If this attribute is used, the
   set also includes objects of the corresponding type (aut-num
   objects for as-set, for example) that are protected by one of
   these maintainers and whose "member-of:" attributes refer to
   the name of the set. If the value of a "mbrs-by-ref:"
   attribute is ANY, any object of the corresponding type
   referring to the set is a member of the set. If the
   "mbrs-by-ref:" attribute is missing, the set is defined
   explicitly by the "members:" attribute.
    </description>
    <syntax><list/>mbrs-by-ref</syntax>

    <representation>
    <sqltable name="mbrs_by_ref">
      <insert qtype="ud_ax_mr">
        INSERT mbrs_by_ref
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mr">
        UPDATE mbrs_by_ref
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
        SELECT MR.object_id
        FROM   mbrs_by_ref MR, mntner MT
        WHERE  MT.mntner = '%s'
        AND    MT.dummy = 0
        AND    MT.object_id = MR.mnt_id
        AND    MR.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute xmlname="members-as" name="members" code="ms">
    <description>
   Lists the members of the set.
    </description>
    <syntax><list/>members-as</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="members-is" name="members" code="ms">
    <description>
   Lists the members of the set.
    </description>
    <syntax><list/>members-is</syntax>
  </ripe_attribute>


  <ripe_attribute xmlname="members-rs" name="members" code="ms">
    <description>
   Lists the members of the set.
    </description>
    <syntax><list/>members-rs</syntax>
  </ripe_attribute>

  <ripe_attribute name="method" code="mh">
    <description>
   Defines the type of the public key.
    </description>
    <syntax>method</syntax>
  </ripe_attribute>

  <ripe_attribute name="mnt-by" code="mb">
    <description>
   Specifies the identifier of a registered mntner object used
   for authorisation of operations performed with the object
   that contains this attribute.
    </description>
    <syntax><list/>object-name</syntax>

    <representation> 
    <sqltable name="mnt_by">
      <insert qtype="ud_aux__">
        INSERT mnt_by 
        SELECT %d, %ld, mntner.object_id, %d 
        FROM mntner WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mt">
        UPDATE mnt_by
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner 
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id
          FROM   mntner, mnt_by i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner = '%s'
	  AND	 i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="mnt-lower" code="ml">
    <description>
   Specifies the identifier of a registered mntner object used
   for hierarchical authorisation.  Protects creation of objects
   directly (one level) below in the hierarchy of an object type
   (only for inetnum, inet6num, as-block, aut-num, route or
   domain objects).  The authentication method of this maintainer
   object will then be used upon creation of any object directly
   below the object that contains the "mnt-lower:" attribute.
    </description>
    <syntax><list/>object-name</syntax>

    <representation>
    <sqltable name="mnt_lower">
      <insert qtype="ud_aux__">
        INSERT mnt_lower
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mt">
        UPDATE mnt_lower
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id
          FROM   mntner, mnt_lower i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="mnt-nfy" code="mn">
    <description>
   Specifies the e-mail address to be notified when an object
   protected by a mntner is successfully updated.
    </description>
    <syntax>e-mail</syntax>

    <representation>
    <sqltable name="mnt_nfy">
      <insert qtype="ud_leaf_">
        INSERT mnt_nfy
        SET thread_id=%d, object_id=%ld, mnt_nfy='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE mnt_nfy
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_nfy='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_email" class="mt">
          SELECT object_id
          FROM   mnt_nfy
          WHERE  mnt_nfy = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

 <ripe_attribute name="mnt-routes" code="mu">
    <description>
   This attribute references a maintainer object which is used in
   determining authorisation for the creation of route objects.
   After the reference to the maintainer, an optional list of
   prefix ranges inside of curly braces or the keyword "ANY" may
   follow. The default, when no additional set items are
   specified, is "ANY" or all more specifics. Please refer to
   RFC-2622 for more information.
    </description>
    <syntax>mnt-routes</syntax>

    <representation>
    <sqltable name="mnt_routes">
      <insert qtype="ud_ax_mu">
        INSERT mnt_routes
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mu">
        UPDATE mnt_routes
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>

      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id
          FROM   mntner, mnt_routes i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner  = '%s'
        </sqlquery>
      </queries>
    </keys>  
  </ripe_attribute>

  <ripe_attribute name="mntner" code="mt">
    <description>
   A unique identifier of the mntner object.
    </description>
    <syntax>object-name</syntax>

    <representation>
    <sqltable name="mntner">
      <insert qtype="ud_main_">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=0
      </insert>
      <update qtype="ud_main_">
        UPDATE mntner
        SET thread_id=%d
        WHERE object_id=%ld
      </update>
      <select qtype="ud_main_">
        mntner='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_mntner">
          SELECT object_id
          FROM   mntner
          WHERE  mntner = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="netname" code="na">
    <description>
   The name of a range of IP address space.
    </description>
    <syntax>netname</syntax>

    <representation>
    <sqltable name="">
      <insert qtype="ud_ma_u2">
        UPDATE %s
        SET thread_id=%d, netname='%s'
        WHERE object_id=%ld
      </insert>
      <update qtype="ud_ma_u2">
        UPDATE %s
        SET thread_id=%d, netname='%s'
        WHERE object_id=%ld
      </update>
    </sqltable>
    </representation>

    <keys searchable="lookup">

      <queries>
        <sqlquery keytype="wk_netname" class="in">
          SELECT object_id
          FROM   inetnum
          WHERE  netname = '%s'
          AND    thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_net6name" class="i6">
          SELECT object_id
          FROM   inet6num
          WHERE  netname = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="nic-hdl" code="nh">
    <description>
   Specifies the NIC handle of a role or person object.  When
   creating an object, one can also specify an "AUTO" NIC handle
   by setting the value of the attribute to "AUTO-1" or 
   AUTO-1&lt;Initials&gt;.  In such case the database will assign
   the NIC handle automatically.
    </description>
    <syntax>nic-handle</syntax>

    <representation>
    <sqltable name="person_role">
      <insert qtype="ud_ma_pr">
        INSERT person_role
        SET thread_id=%d, object_type=%d, object_id=%ld, nic_hdl='%s', dummy=0
      </insert>
      <update qtype="ud_ma_pr">
        UPDATE person_role
        SET thread_id=%d, object_type=%d
        WHERE object_id=%ld
      </update>
      <select qtype="ud_main_">
        nic_hdl='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_nic_hdl" class="pn">
          SELECT object_id
          FROM   person_role
          WHERE  nic_hdl = '%s'
          AND    object_type = $(C_PN)
          AND    thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_nic_hdl" class="ro">
          SELECT object_id
          FROM   person_role
          WHERE  nic_hdl = '%s'
          AND    object_type = $(C_RO)
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="notify" code="ny">
    <description>
   Specifies the e-mail address to which notifications of changes
   to an object should be sent.
    </description>
    <syntax>e-mail</syntax>

    <representation> 
    <sqltable name="notify">
      <insert qtype="ud_lf_ot">
        INSERT notify 
        SET thread_id=%d, object_id=%ld, object_type=%d, notify='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE notify 
        SET thread_id=%d 
        WHERE object_id=%ld 
        AND notify='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_email" class="ANY">
          SELECT object_id
          FROM   notify i
          WHERE  i.notify = '%s'
	  AND	 i.thread_id = 0	
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="origin" code="or">
    <description>
   Specifies the AS that originates the route. The corresponding
   aut-num object should be registered in the database.
    </description>
    <syntax>as-number</syntax>
    <representation>
      <sqltable name="route">
        <insert qtype="ud_ma_or">
          UPDATE route
          SET thread_id=%d, origin='%s'
          WHERE object_id=%ld
        </insert>
        <update qtype="ud_main_"></update>
        <select qtype="ud_main_">
          origin='%s' AND
        </select>
      </sqltable>
    </representation>
    <keys searchable="inverse">
      <primary/>
      <queries>
        <sqlquery keytype="wk_autnum" class="rt">
          SELECT object_id
          FROM   route
          WHERE  origin = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="owner" code="ow">
    <description>
   Specifies the owner of the public key.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="peer" code="pe">
    <description>
   Details of any (interior or exterior) router peerings.
    </description>
    <syntax>peer</syntax>
  </ripe_attribute>

  <ripe_attribute name="peering" code="pg">
    <description>
   Defines a peering that can be used for importing or exporting
   routes.
    </description>
    <syntax>peering</syntax>
  </ripe_attribute>

  <ripe_attribute name="person" code="pn">
    <description>
   Specifies the full name of an administrative, technical or
   zone contact person for other objects in the database.  Person
   name cannot contain titles such as "Dr.", "Prof.", "Mv.",
   "Ms.", "Mr.", etc.  It is composed of alphabetic characters.
    </description>
    <syntax>person-name</syntax>

    <representation>
    <sqltable name="names">
      <insert qtype="ud_lf_ot">
        INSERT names
        SET thread_id=%d, object_id=%ld, object_type=%d, name='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE names
        SET thread_id=%d
        WHERE object_id=%ld
        AND name='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="lookup">

      <queries>
        <sqlquery keytype="wk_name">
          SELECT N00.object_id
          FROM   %s
          WHERE  %s
          AND    N00.object_type = $(C_PN)
          AND    N00.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="phone" code="ph">
    <description>
   Specifies a telephone number of the contact.
    </description>
    <syntax>telephone-number</syntax>
  </ripe_attribute>

  <ripe_attribute name="referral-by" code="rb">
    <description>
   This attribute is required in the maintainer object.  It may
   never be altered after the addition of the maintainer.  This
   attribute refers to the maintainer that created this
   maintainer.  It may be multiple if more than one signature
   appeared on the transaction creating the object.
    </description>
    <syntax>object-name</syntax>
    <representation>
    <sqltable name="referral_by">
      <insert qtype="ud_aux__">
        INSERT referral_by
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mt">
        UPDATE referral_by
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="mt"/>
      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id
          FROM   mntner, referral_by i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="remarks" code="rm">
    <description>
   Contains remarks.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="nserver" code="ns">
    <description>
   Specifies the nameservers of the domain.
    </description>
    <syntax><ripe-list/>domain-name</syntax>

    <representation>
    <sqltable name="nserver">
      <insert qtype="ud_leaf_">
        INSERT nserver
        SET thread_id=%d, object_id=%ld, host='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE nserver
        SET thread_id=%d
        WHERE object_id=%ld
        AND host='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_domain" class="dn">
          SELECT object_id
          FROM   nserver
          WHERE  host = '%s'
          AND    thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_ipaddress" class="dn">
          SELECT object_id
          FROM   nserver
          WHERE  host = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="refer" code="rf">
    <description>
   Specifies the referral type, hostname and port that the server
   should use to redirect the query when using referral mechanism
   for lookups for domain objects.
    </description>
    <syntax>refer</syntax>

    <representation>
    <sqltable name="refer">
      <insert qtype="ud_lf_rf">
        INSERT refer
        SET thread_id=%d, object_id=%ld, type=%d, host='%s', port=%d
      </insert>
      <update qtype="ud_lf_rf">
        UPDATE refer
        SET thread_id=%d
        WHERE object_id=%ld
        AND type=%d
        AND host='%s'
        AND port=%d
      </update>
    </sqltable>
    </representation>
  </ripe_attribute>

  <ripe_attribute name="rev-srv" code="rz">
    <description>
   Specifies a DNS nameserver for a range of IP addresses
   represented by the inetnum object that contains this
   attribute.
    </description>
    <syntax><ripe-list/>domain-name</syntax>

    <representation>
    <sqltable name="rev_srv">
      <insert qtype="ud_lf_ot">
        INSERT rev_srv
        SET thread_id=%d, object_id=%ld, object_type=%d, rev_srv='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE rev_srv
        SET thread_id=%d
        WHERE object_id=%ld
        AND rev_srv='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_domain" class="in">
          SELECT object_id
          FROM   rev_srv
          WHERE  rev_srv = '%s'
          AND    thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_domain" class="i6">
          SELECT object_id
          FROM   rev_srv
          WHERE  rev_srv = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="role" code="ro">
    <description>
   Specifies the full name of a role entity, e.g. RIPE DBM.
    </description>
    <syntax>person-name</syntax>

    <representation>
    <sqltable name="names">
      <insert qtype="ud_lf_ot">
        INSERT names
        SET thread_id=%d, object_id=%ld, object_type=%d, name='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE names
        SET thread_id=%d
        WHERE object_id=%ld
        AND name='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="lookup">

      <queries>
        <sqlquery keytype="wk_name">
          SELECT N00.object_id
          FROM   %s
          WHERE  %s
          AND    N00.object_type = $(C_RO)
          AND    N00.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="route-set" code="rs">
    <description>
   Specifies the name of the route set. It is a primary key for
   the route-set object.
    </description>
    <syntax>route-set</syntax>

    <representation>
    <sqltable name="route_set">
      <insert qtype="ud_main_">
        INSERT route_set
        SET thread_id=%d, object_id=%ld, route_set='%s', dummy=0
      </insert>
      <update qtype="ud_main_">
        UPDATE route_set
        SET thread_id=%d
        WHERE object_id=%ld
      </update>
      <select qtype="ud_main_">
        route_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_routesetname">
          SELECT object_id
          FROM   route_set
          WHERE  route_set = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="source" code="so">
    <description>
   Specifies the registry where the object is registered.  Should
   be "RIPE" for the RIPE Database.
    </description>
    <syntax>registry-name</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="status-in" name="status" code="st">
    <description>
   Specifies the status of the address range represented by
   inetnum or inet6num object.
    </description>
    <syntax>status-in</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="status-i6" name="status" code="st">
    <description>
   Specifies the status of the address range represented by
   inetnum or inet6num object.
    </description>
    <syntax>status-i6</syntax>
  </ripe_attribute>

  <ripe_attribute name="sub-dom" code="sd">
    <description>
   Specifies list of sub-domains of a domain.  Domain names are
   relative to the domain represented by the domain object that
   contains this attribute.
    </description>
    <syntax><ripe-list/>subdomain-name</syntax>

    <representation>
    <sqltable name="sub_dom">
      <insert qtype="ud_leaf_">
        INSERT sub_dom
        SET thread_id=%d, object_id=%ld, domain='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE sub_dom
        SET thread_id=%d
        WHERE object_id=%ld
        AND domain='%s'
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_domain" class="dn">
          SELECT object_id
          FROM   sub_dom
          WHERE  domain = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="tech-c" code="tc">
    <description>
   References a technical contact.
    </description>
    <syntax>nic-handle</syntax>

    <representation> 
    <sqltable name="tech_c">
      <insert qtype="ud_aux__">
        INSERT tech_c 
        SELECT %d, %ld, person_role.object_id, %d 
        FROM person_role 
        WHERE person_role.nic_hdl='%s'
      </insert>
      <update qtype="ud_ax_pr">
        UPDATE tech_c
        SET thread_id=%d
        WHERE object_id=%ld
        AND pe_ro_id=%ld
      </update>
      <dummy qtype="ud_ax_pr">
        INSERT person_role 
        SET thread_id=%d, object_id=%ld, nic_hdl='%s', object_type=%d, dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="nh"/>

      <queries>
        <sqlquery keytype="wk_name" class="ANY">
          SELECT i.object_id
          FROM   tech_c i, %s
          WHERE  %s
          AND    i.pe_ro_id = N00.object_id
	  AND	 i.thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_nic_hdl" class="ANY">
          SELECT i.object_id
          FROM   tech_c i, person_role
          WHERE  i.pe_ro_id = person_role.object_id
          AND    person_role.nic_hdl  = '%s'
	  AND	 i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="text" code="tx">
    <description>
   Text of the limerick. Must be humorous, but not malicious or
   insulting.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="trouble" code="tb">
    <description>
   Contains information on who to contact when there are problems.
    </description>
    <syntax>free-form</syntax>
  </ripe_attribute>

  <ripe_attribute name="upd-to" code="dt">
    <description>
   Specifies the e-mail address to be notified when an object
   protected by a mntner is unsuccessfully updated.
    </description>
    <syntax>e-mail</syntax>

    <representation>
    <sqltable name="upd_to">
      <insert qtype="ud_leaf_">
        INSERT upd_to
        SET thread_id=%d, object_id=%ld, upd_to='%s'
      </insert>
      <update qtype="ud_leaf_">
        UPDATE upd_to
        SET thread_id=%d
        WHERE object_id=%ld
        AND upd_to='%s'
      </update>
    </sqltable>
    </representation>

   <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_email" class="mt">
          SELECT object_id
          FROM   upd_to
          WHERE  upd_to = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>

  </ripe_attribute>

  <ripe_attribute name="zone-c" code="zc">
    <description>
   References a zone contact.
    </description>
    <syntax>nic-handle</syntax>

    <representation>
    <sqltable name="zone_c">
      <insert qtype="ud_aux__">
        INSERT zone_c
        SELECT %d, %ld, person_role.object_id, %d
        FROM person_role
        WHERE person_role.nic_hdl='%s'
      </insert>
      <update qtype="ud_ax_pr">
        UPDATE zone_c
        SET thread_id=%d
        WHERE object_id=%ld
        AND pe_ro_id=%ld
      </update>
      <dummy qtype="ud_ax_pr">
        INSERT person_role
        SET thread_id=%d, object_id=%ld, nic_hdl='%s', object_type=%d, dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <foreign value="nh"/>

      <queries>
        <sqlquery keytype="wk_name" class="ANY">
          SELECT i.object_id
          FROM   zone_c i, %s
          WHERE  %s
          AND    i.pe_ro_id = N00.object_id
          AND    i.thread_id = 0
        </sqlquery>
        <sqlquery keytype="wk_nic_hdl" class="ANY">
          SELECT i.object_id
          FROM   zone_c i, person_role
          WHERE  i.pe_ro_id = person_role.object_id
          AND    person_role.nic_hdl  = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="inet-rtr" code="ir">
    <description>
   Fully qualified DNS name of the inet-rtr without trailing ".".
    </description>
    <syntax>domain-name</syntax>

    <representation>
    <sqltable name="inet_rtr">
      <insert qtype="ud_main_">
        INSERT inet_rtr
        SET thread_id=%d, object_id=%ld, inet_rtr='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        inet_rtr='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_domain">
          SELECT object_id
          FROM   inet_rtr
          WHERE  inet_rtr = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="as-block" code="ak">
    <description>
   Range of AS numbers.
    </description>
    <syntax>as-block</syntax>

    <representation>
    <sqltable name="as_block">
      <insert qtype="ud_ma_ak">
        INSERT as_block
        SET thread_id=%d, object_id=%ld, begin_as=%d, end_as=%d
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_ma_ak">
        begin_as=%d AND end_as=%d AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_asrange">
          SELECT object_id
          FROM  as_block
          WHERE begin_as &lt;= %u
          AND   end_as   &gt;= %u
          AND   thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="aut-num" code="an">
    <description>
   The autonomous system number.
    </description>
    <syntax>as-number</syntax>

    <representation>
    <sqltable name="aut_num">
      <insert qtype="ud_main_">
        INSERT aut_num
        SET thread_id=%d, object_id=%ld, aut_num='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        aut_num='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_autnum">
          SELECT object_id
          FROM   aut_num
          WHERE  aut_num = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="limerick" code="li">
    <description>
   Specifies the title of the limerick.
    </description>
    <syntax>limerick</syntax>

    <representation>
    <sqltable name="limerick">
      <insert qtype="ud_main_">
        INSERT limerick
        SET thread_id=%d, object_id=%ld, limerick='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        limerick='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <sqlquery keytype="wk_limerick" >
          SELECT object_id
          FROM   limerick
          WHERE  limerick = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="route" code="rt">
    <description>
   Specifies the prefix of the interAS route. Together with the
   "origin:" attribute,  constitutes a primary key of the route
   object.
    </description>
    <syntax>address-prefix</syntax>

    <representation>
    <sqltable name="route">
      <insert qtype="ud_ma_rt">
        INSERT route
        SET thread_id=%d, object_id=%ld, prefix=%u, prefix_length=%d, dummy=0
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_ma_rt">
        prefix=%u AND prefix_length=%d AND
      </select>
    </sqltable>
    <radixtrees family="RX_FAM_RT">
             <IP_V4>
                SELECT  object_id,prefix,prefix_length,origin
                FROM    route
                WHERE   thread_id = 0
             </IP_V4>
        </radixtrees>
    </representation>

    <keys searchable="lookup">
      <primary/>

      <queries>
        <radixquery keytype="wk_iprange"   space="IP_V4" />
        <radixquery keytype="wk_ipprefix"  space="IP_V4" />
        <radixquery keytype="wk_ipaddress" space="IP_V4" />
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="peering-set" code="ps">
    <description>
   Specifies the name of the peering-set.
    </description>
    <syntax>peering-set</syntax>

    <representation>
    <sqltable name="peering_set">
      <insert qtype="ud_main_">
        INSERT peering_set
        SET thread_id=%d, object_id=%ld, peering_set='%s'
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        peering_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_peeringset">
        SELECT object_id
        FROM   peering_set
        WHERE  peering_set='%s'
        AND    thread_id=0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="rtr-set" code="is">
    <description>
   Defines the name of the rtr-set.
    </description>
    <syntax>rtr-set</syntax>

    <representation>
    <sqltable name="">
      <insert qtype="ud_main_">
        INSERT rtr_set
        SET thread_id=%d, object_id=%ld, rtr_set='%s', dummy=0
      </insert>
      <update qtype="ud_main_"></update>
      <select qtype="ud_main_">
        rtr_set='%s' AND
      </select>
    </sqltable>
    </representation>

    <keys searchable="lookup">
      <primary/>
      <queries>
        <sqlquery keytype="wk_rtrset">
        SELECT object_id
        FROM   rtr_set
        WHERE  rtr_set='%s'
        AND    thread_id=0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute name="local-as" altName="localas" code="la">
    <description>
   Specifies the autonomous system that operates the router.
    </description>
    <syntax>as-number</syntax>

    <representation>
    <sqltable name="">
      <insert qtype="ud_ma_u2">
        UPDATE %s SET thread_id=%d, local_as='%s'
        WHERE object_id=%ld
      </insert>
      <update qtype="ud_ma_u2">
        UPDATE %s SET thread_id=%d, local_as='%s'
        WHERE object_id=%ld
      </update>
    </sqltable>
    </representation>

    <keys searchable="inverse">
      <queries>
        <sqlquery keytype="wk_autnum" class="ir">
          SELECT object_id
          FROM   inet_rtr
          WHERE  local_as  = '%s'
          AND    thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute xmlname="member-of-ir" name="member-of" code="mo">
    <description>
   This attribute can be used in the route, aut-num and inet-rtr
   classes. The value of the "member-of:" attribute identifies a
   set object that this object wants to be a member of.  This
   claim, however, should be acknowledged by a respective
   "mbrs-by-ref:" attribute in the referenced object.
    </description>
    <syntax><list/>rtr-set</syntax>

    <representation>
    <sqltable name="member_of">
      <insert qtype="ud_ax_mo">
        INSERT member_of
        SELECT %d, %ld, %s.object_id, %d
        FROM %s
        WHERE %s.%s='%s'
      </insert>
      <update qtype="ud_ax_mo">
        UPDATE member_of
        SET thread_id=%d
        WHERE object_id=%ld
        AND set_id=%ld
      </update>
      <dummy qtype="ud_ax_mo">
        INSERT %s
        SET thread_id=%d, object_id=%ld, %s='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

    <keys searchable="inverse">

      <queries>
        <sqlquery keytype="wk_routesetname" class="ir">
<!--          SELECT member_of.object_id
          FROM   route_set, member_of
          WHERE  route_set.object_id = member_of.set_id
          AND    route_set='%s'
          AND    route_set.thread_id = 0
-->
        SELECT member_of.object_id
        FROM mbrs_by_ref, member_of, route_set
        LEFT OUTER JOIN mnt_by ON member_of.object_id = mnt_by.object_id
        /* an old object might have no mntner at all */
        WHERE (mbrs_by_ref.mnt_id = 0 OR mbrs_by_ref.mnt_id = mnt_by.mnt_id)
        /* mbrs_by_ref is any or matches the mnt_by of a member */
        AND member_of.set_id = mbrs_by_ref.object_id
        AND route_set.object_id = member_of.set_id
        AND route_set.route_set = '%s'
        AND route_set.thread_id = 0

        </sqlquery>
        <sqlquery keytype="wk_assetname" class="ir">
                <!-- the same as for route_set -->
          SELECT member_of.object_id
          FROM  as_set, member_of, mbrs_by_ref
          LEFT OUTER JOIN mnt_by ON member_of.object_id = mnt_by.object_id
          WHERE (mbrs_by_ref.mnt_id = 0 OR mbrs_by_ref.mnt_id = mnt_by.mnt_id)
          AND member_of.set_id = mbrs_by_ref.object_id
          AND as_set.object_id = member_of.set_id
          AND as_set = '%s'
          AND as_set.thread_id = 0

        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <ripe_attribute xmlname="member-of-an" name="member-of" code="mo">
    <description>
   This attribute can be used in the route, aut-num and inet-rtr
   classes. The value of the "member-of:" attribute identifies a
   set object that this object wants to be a member of.  This
   claim, however, should be acknowledged by a respective
   "mbrs-by-ref:" attribute in the referenced object.
    </description>
    <syntax><list/>as-set</syntax>
  </ripe_attribute>

  <ripe_attribute xmlname="member-of-rt" name="member-of" code="mo">
    <description>
   This attribute can be used in the route, aut-num and inet-rtr
   classes. The value of the "member-of:" attribute identifies a
   set object that this object wants to be a member of.  This
   claim, however, should be acknowledged by a respective
   "mbrs-by-ref:" attribute in the referenced object.
    </description>
    <syntax><list/>route-set</syntax>
  </ripe_attribute>

  <ripe_attribute name="cross-mnt" code="ct">
    <description>
   References mntner(s) to be notified. The "cross-mnt:"
   attribute may be used in:

      * route object - to get a notification for any overlaps
        with the prefix specified in that route object;

      * aut-num object - to get a notification for overlaps with
        any of the prefixes announced in route objects in which
        the given AS number is specified in the "origin:"
        attribute.

   A notification will be sent to mailbox(es) listed in cross-nfy
   and mailbox(es) listed in the "mnt-nfy:" attributes of the
   maintainers referenced by the cross-mnt whenever an
   overlapping route is added or removed.
    </description>
    <syntax><list/>object-name</syntax>

    <representation>
    <sqltable name="cross_mnt">
      <insert qtype="ud_aux__">
        INSERT cross_mnt
        SELECT %d, %ld, mntner.object_id, %d
        FROM mntner
        WHERE mntner.mntner='%s'
      </insert>
      <update qtype="ud_ax_mt">
        UPDATE cross_mnt
        SET thread_id=%d
        WHERE object_id=%ld
        AND mnt_id=%ld
      </update>
      <dummy qtype="ud_ax_mt">
        INSERT mntner
        SET thread_id=%d, object_id=%ld, mntner='%s', dummy=1
      </dummy>
    </sqltable>
    </representation>

     <keys searchable="inverse">
      <foreign value="mt"/>
      <queries>
        <sqlquery keytype="wk_mntner" class="ANY">
          SELECT i.object_id
          FROM   mntner, cross_mnt i
          WHERE  mntner.object_id = i.mnt_id
          AND    mntner.mntner = '%s'
          AND    i.thread_id = 0
        </sqlquery>
      </queries>
    </keys>
  </ripe_attribute>

  <!-- "delete" and "override" are not really attributes but we define 
       them as such for ease of use.  They should be tagged as "pseudo" 
       in the class templates, to avoid it showing up in user queries. -->
  <ripe_attribute name="delete" code="ud">
    <description></description>
    <syntax>free-form</syntax>
  </ripe_attribute>
  <ripe_attribute name="override" code="uo">
    <description></description>
    <syntax>free-form</syntax>
  </ripe_attribute>

</ripe_attributes>
