<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?rfc toc="yes"?>
<!-- You want a table of contents -->
<?rfc symrefs="yes"?>
<!-- Use symbolic labels for references -->
<?rfc sortrefs="yes"?>
<!-- This sorts the references -->
<?rfc iprnotified="no" ?>
<!-- Change to "yes" if someone has disclosed IPR for the draft -->
<?rfc compact="yes"?>
<!-- This defines the specific filename and version number of your draft (and inserts the appropriate IETF boilerplate --> version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="info" consensus="true" docName="draft-ietf-anima-grasp-api-10" indexInclude="true" ipr="trust200902" obsoletes="" updates="" number="8991" prepTime="2021-05-20T22:42:20" scripts="Common,Latin" sortRefs="true" submissionType="IETF" xml:lang="en" tocInclude="true" symRefs="true" sortRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 2.44.0 --> tocDepth="3" tocInclude="true" xml:lang="en">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-anima-grasp-api-10" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc8991" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="GRASP API">Generic API">GeneRic Autonomic Signaling Protocol Application Program Interface (GRASP API)</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-anima-grasp-api-10"/> name="RFC" value="8991" stream="IETF"/>
    <author fullname="Brian E. Carpenter" initials="B. E." initials="B." surname="Carpenter">
      <organization abbrev="Univ. of Auckland"/> Auckland" showOnFrontPage="true"/>
      <address>
        <postal>
          <street>School
          <extaddr>School of Computer Science</street>
          <street>University Science</extaddr>
          <extaddr>University of Auckland</street> Auckland</extaddr>
          <street>PB 92019</street>
          <city>Auckland</city>
          <region/>
          <code>1142</code>
          <country>New Zealand</country>
        </postal>
        <email>brian.e.carpenter@gmail.com</email>
      </address>
    </author>
    <author fullname="Bing Liu" initials="B." role="editor" surname="Liu">
      <organization>Huawei
      <organization showOnFrontPage="true">Huawei Technologies</organization>
      <address>
        <postal>
          <street>Q14,
          <extaddr>Q14, Huawei Campus</street> Campus</extaddr>
          <street>No.156 Beiqing Road</street>
          <city>Hai-Dian District, Beijing</city>
          <code>100095</code>
          <country>P.R. China</country>
          <country>China</country>
        </postal>
        <email>leo.liubing@huawei.com</email>
      </address>
    </author>
    <author fullname="Wendong Wang" initials="W." surname="Wang  ">
      <organization>BUPT surname="Wang">
      <organization showOnFrontPage="true">BUPT University</organization>
      <address>
        <postal>
          <street>Beijing
          <extaddr>Beijing University of Posts &amp; Telecom.</street> Telecom.</extaddr>
          <street>No.10 Xitucheng Road</street>
          <city>Hai-Dian District, Beijing 100876</city>
          <country>P.R. China</country>
          <country>China</country>
        </postal>
        <email>wdwang@bupt.edu.cn</email>
      </address>
    </author>
    <author fullname="Xiangyang Gong" initials="X." surname="Gong">
      <organization>BUPT
      <organization showOnFrontPage="true">BUPT University</organization>
      <address>
        <postal>
          <street>Beijing
          <extaddr>Beijing University of Posts &amp; Telecom.</street> Telecom.</extaddr>
          <street>No.10 Xitucheng Road</street>
          <city>Hai-Dian District, Beijing 100876</city>
          <country>P.R. China</country>
          <country>China</country>
        </postal>
        <email>xygong@bupt.edu.cn</email>
      </address>
    </author>
    <!---->
    <date month="05" year="2021"/>
    <abstract>
      <t>This
    <area>Operations and Management</area>
    <workgroup>ANIMA</workgroup>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1">This document is a conceptual outline of an application
      programming interface Application
      Programming Interface (API) for the
      Generic
      GeneRic Autonomic Signaling Protocol (GRASP). Such an API is needed for
      Autonomic Service Agents (ASA) (ASAs) calling the GRASP protocol module to
      exchange autonomic network Autonomic Network messages with other ASAs. Since GRASP is
      designed to support asynchronous operations, the API will need to
      be adapted according to the support for asynchronicity in various
      programming languages and operating systems.</t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This document is not an Internet Standards Track specification; it is
            published for informational purposes.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by the
            Internet Engineering Steering Group (IESG).  Not all documents
            approved by the IESG are candidates for any level of Internet
            Standard; see Section 2 of RFC 7841.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc8991" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2021 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Simplified BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Simplified BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-grasp-api-for-asa">GRASP API for ASA</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2">
              <li pn="section-toc.1-1.2.2.1">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.2.1.1"><xref derivedContent="2.1" format="counter" sectionFormat="of" target="section-2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-design-assumptions">Design Assumptions</xref></t>
              </li>
              <li pn="section-toc.1-1.2.2.2">
                <t indent="0" pn="section-toc.1-1.2.2.2.1"><xref derivedContent="2.2" format="counter" sectionFormat="of" target="section-2.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-asynchronous-operations">Asynchronous Operations</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2.2.2">
                  <li pn="section-toc.1-1.2.2.2.2.1">
                    <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.2.2.2.1.1"><xref derivedContent="2.2.1" format="counter" sectionFormat="of" target="section-2.2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-alternative-asynchronous-me"> Alternative Asynchronous Mechanisms</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.2.2.2">
                    <t indent="0" pn="section-toc.1-1.2.2.2.2.2.1"><xref derivedContent="2.2.2" format="counter" sectionFormat="of" target="section-2.2.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-multiple-negotiation-scenar">Multiple Negotiation Scenario</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.2.2.3">
                    <t indent="0" pn="section-toc.1-1.2.2.2.2.3.1"><xref derivedContent="2.2.3" format="counter" sectionFormat="of" target="section-2.2.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-overlapping-sessions-and-op">Overlapping Sessions and Operations</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.2.2.4">
                    <t indent="0" pn="section-toc.1-1.2.2.2.2.4.1"><xref derivedContent="2.2.4" format="counter" sectionFormat="of" target="section-2.2.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-session-termination">Session Termination</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.2.2.3">
                <t indent="0" pn="section-toc.1-1.2.2.3.1"><xref derivedContent="2.3" format="counter" sectionFormat="of" target="section-2.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-api-definition">API Definition</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2.3.2">
                  <li pn="section-toc.1-1.2.2.3.2.1">
                    <t indent="0" pn="section-toc.1-1.2.2.3.2.1.1"><xref derivedContent="2.3.1" format="counter" sectionFormat="of" target="section-2.3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-overview-of-functions">Overview of Functions</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.3.2.2">
                    <t indent="0" pn="section-toc.1-1.2.2.3.2.2.1"><xref derivedContent="2.3.2" format="counter" sectionFormat="of" target="section-2.3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-parameters-and-data-structu">Parameters and Data Structures</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.3.2.3">
                    <t indent="0" pn="section-toc.1-1.2.2.3.2.3.1"><xref derivedContent="2.3.3" format="counter" sectionFormat="of" target="section-2.3.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-registration">Registration</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.3.2.4">
                    <t indent="0" pn="section-toc.1-1.2.2.3.2.4.1"><xref derivedContent="2.3.4" format="counter" sectionFormat="of" target="section-2.3.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-discovery">Discovery</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.3.2.5">
                    <t indent="0" pn="section-toc.1-1.2.2.3.2.5.1"><xref derivedContent="2.3.5" format="counter" sectionFormat="of" target="section-2.3.5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-negotiation">Negotiation</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.3.2.6">
                    <t indent="0" pn="section-toc.1-1.2.2.3.2.6.1"><xref derivedContent="2.3.6" format="counter" sectionFormat="of" target="section-2.3.6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-synchronization-and-floodin">Synchronization and Flooding</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.3.2.7">
                    <t indent="0" pn="section-toc.1-1.2.2.3.2.7.1"><xref derivedContent="2.3.7" format="counter" sectionFormat="of" target="section-2.3.7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-invalid-message-function">Invalid Message Function</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.5.2">
              <li pn="section-toc.1-1.5.2.1">
                <t indent="0" pn="section-toc.1-1.5.2.1.1"><xref derivedContent="5.1" format="counter" sectionFormat="of" target="section-5.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.5.2.2">
                <t indent="0" pn="section-toc.1-1.5.2.2.1"><xref derivedContent="5.2" format="counter" sectionFormat="of" target="section-5.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-error-codes">Error Codes</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2">
              <li pn="section-toc.1-1.6.2.1">
                <t indent="0" pn="section-toc.1-1.6.2.1.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-a.1"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgements">Acknowledgements</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>As toc="include" removeInRFC="false" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">As defined in <xref target="I-D.ietf-anima-reference-model"/>, target="RFC8993" format="default" sectionFormat="of" derivedContent="RFC8993"/>, the
      Autonomic Service Agent (ASA)
      is the atomic entity of an autonomic function, and it is instantiated
      on autonomic nodes. These nodes are members of a secure Autonomic Control Plane (ACP)
      such as defined by <xref target="I-D.ietf-anima-autonomic-control-plane"/>.</t>

      <t>When target="RFC8994" format="default" sectionFormat="of" derivedContent="RFC8994"/>.</t>
      <t indent="0" pn="section-1-2">When ASAs communicate with each other, they should
      use the Generic GeneRic Autonomic Signaling Protocol (GRASP) <xref target="I-D.ietf-anima-grasp"/>. target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>.
      GRASP relies on the message confidentiality and integrity provided by the ACP,
      with the ACP; a
      consequence of this is that all nodes in a
      given autonomic network Autonomic Network share the same trust boundary, i.e., the boundary of the ACP.
      Nodes that have not successfully joined the ACP cannot send, receive receive, or intercept GRASP messages
      via the ACP, ACP and cannot usurp ACP addresses.
      An ASA runs in an ACP node and therefore benefits from the node's security properties when
      transmitting over the ACP, i.e.,
      message integrity, message confidentiality confidentiality, and the fact that unauthorized nodes cannot join the ACP.
      All ASAs within a given autonomic network Autonomic Network therefore trust each other's messages. For these reasons, the
      API defined in this document has no explicit security features.
      </t>

      <t>An
      <t indent="0" pn="section-1-3">An important feature of GRASP is the concept of a GRASP objective. This is a data structure
      encoded, like all GRASP messages, in CBOR <xref target="RFC8949"/>. Concise Binary Object Representation (CBOR) <xref target="RFC8949" format="default" sectionFormat="of" derivedContent="RFC8949"/>.
      Its main contents are a name and a value, explained at more length in the 'Terminology' Terminology section
      of <xref target="I-D.ietf-anima-grasp"/>. target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>. When an objective is passed
      from one ASA to another using GRASP, its value is either conveyed in one direction
      (by a process of synchronization or flooding), flooding) or negotiated bilaterally. The
      semantics of the value are opaque to GRASP and therefore to the API. Each objective
      must be accurately specified in a dedicated specification, as discussed in the
      'Objective Options' section of <xref target="I-D.ietf-anima-grasp"/>.
      "Objective Options" (<xref target="RFC8990" section="2.10" sectionFormat="of" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8990#section-2.10" derivedContent="RFC8990"/>).
      In particular, the specification will define the syntax and semantics of the
      value of the objective, whether and how it supports a negotiation process,
      whether it supports a dry run dry-run mode, and any other details needed for interoperability.
      The use of CBOR, with CDDL <xref target="RFC8610"/> Concise Data Definition Language (CDDL) <xref target="RFC8610" format="default" sectionFormat="of" derivedContent="RFC8610"/> as the data definition language,
      allows the value to be passed between ASAs regardless of the programming languages
      in use. Data storage
      and consistency during negotiation are the responsibility of the ASAs involved.
      Additionally, GRASP needs to cache the latest values of objectives that are
      received by flooding.</t>

      <t>As <xref target="sw"/>
      <t indent="0" pn="section-1-4">As <xref target="sw" format="default" sectionFormat="of" derivedContent="Figure 1"/> shows, a GRASP implementation could contain several
      sub-layers. The bottom layer is the GRASP base protocol module, which is only
      responsible for sending and receiving GRASP messages and maintaining
      shared data structures. Above that is the basic API described in this
      document. The upper layer contains
      some extended API functions based upon the GRASP basic protocol. For example,
      <xref target="I-D.ietf-anima-grasp-distribution"/> target="I-D.ietf-anima-grasp-distribution" format="default" sectionFormat="of" derivedContent="GRASP-DISTRIB"/> describes a possible extended
      function.</t>
      <figure anchor="sw">
        <name>Software layout</name> anchor="sw" align="left" suppress-title="false" pn="figure-1">
        <name slugifiedName="name-software-layout">Software Layout</name>
        <artwork align="center" name="" type="" alt=""><![CDATA[ alt="" pn="section-1-5.1">
 +--------------+          +--------------+
 |     ASAs     |          |     ASAs     |
 +--------------+          +--------------+
   |          |                    |
   | +------------------+          |
   | | GRASP Extended   |          |
   | | Function API     |          |
   | +------------------+          |
   |          |                    |
+------------------------------------------+
|         Basic GRASP API Library          |
+------------------------------------------+
                    |
            IPC or system call
                    |
+------------------------------------------+
|  GRASP Core                              |
|  (functions, data structures, daemon(s)) |
+------------------------------------------+
]]></artwork>
</artwork>
      </figure>

      <t>Multiple
      <t indent="0" pn="section-1-6">Multiple ASAs in a single node will share the same instance of GRASP, much as
      multiple applications share a single TCP/IP stack. This aspect is hidden from
      individual ASAs by the API, API and is not further discussed here.</t>

      <t>It
      <t indent="0" pn="section-1-7">It is desirable that ASAs can be designed as portable user-space programs
      using a system-independent API. In many implementations, the GRASP code will therefore
      be split between user space and kernel space. In user space, library functions provide the API
      and communicate directly with ASAs. In kernel space is space, a daemon, or a set
      of sub-services, providing provides GRASP core functions that are
      independent of specific ASAs, such as multicast handling and relaying, and
      common data structures structures, such as the discovery cache. The GRASP API
      library would need to communicate with the GRASP core via an inter-process interprocess
      communication (IPC) or a system call mechanism. The details of this are system-dependent.
      </t>

      <t>Both
      <t indent="0" pn="section-1-8">Both the GRASP library and the extended function modules should
      be available to the ASAs.
      However, since the extended functions are expected to be added in an incremental
      manner, they will be the subject of future documents.
      This document only describes the basic GRASP API.</t>

      <t>The
      <t indent="0" pn="section-1-9">The functions provided by the API do not map one-to-one onto GRASP messages. Rather,
      they are intended to offer convenient support for message sequences (such as a discovery
      request followed by responses from several peers, peers
      or a negotiation request followed by various possible responses).
      This choice was made to assist ASA programmers in writing
      code based on their application requirements rather than needing to
      understand protocol details.</t>

      <t>Note that a simple autonomic node might contain very few ASAs in
      <t indent="0" pn="section-1-10">
      In addition to containing the autonomic infrastructure components described in
      <xref target="I-D.ietf-anima-bootstrapping-keyinfra"/> target="RFC8994" format="default" sectionFormat="of" derivedContent="RFC8994"/>
      and <xref target="I-D.ietf-anima-autonomic-control-plane"/>. target="RFC8995" format="default" sectionFormat="of" derivedContent="RFC8995"/>, a simple autonomic node might contain very few ASAs.
      Such a node might directly integrate a GRASP protocol stack in
      its code and therefore not
      require this API to be installed. However, the programmer would then need
      a deeper understanding of the GRASP protocol than what is needed to use the API.</t>

      <t>This
      <t indent="0" pn="section-1-11">This document gives a conceptual outline of the API. It is not a formal
      specification for any particular programming language or operating system,
      and it is expected that details will be clarified in individual implementations.</t>
    </section>
    <section numbered="true" toc="default">
      <name>GRASP toc="include" removeInRFC="false" pn="section-2">
      <name slugifiedName="name-grasp-api-for-asa">GRASP API for ASA</name>
      <section numbered="true" toc="default">
        <name>Design toc="include" removeInRFC="false" pn="section-2.1">
        <name slugifiedName="name-design-assumptions">Design Assumptions</name>
        <t>The assumption of this document is
        <t indent="0" pn="section-2.1-1">The design assumes that an Autonomic Service Agent
        (ASA)
        ASA needs to call a separate GRASP implementation. The latter handles protocol details
        (security, sending and listening for GRASP messages, waiting, caching
        discovery results, negotiation looping, sending and receiving
        sychronization
        synchronization data, etc.) but understands nothing about individual
        GRASP objectives (Section 2.10 of (see <xref target="I-D.ietf-anima-grasp"/>). target="RFC8990" sectionFormat="of" section="2.10" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8990#section-2.10" derivedContent="RFC8990"/>).
        The semantics of objectives are unknown to the GRASP
        protocol and are handled only by the ASAs. Thus, this is an
        abstract API for use by ASAs. Individual
        language bindings should be defined in separate documents.</t>
        <t>Different
        <t indent="0" pn="section-2.1-2">Different ASAs may make different use of utilize GRASP features, such as: features differently, by using GRASP for:
        </t>
        <ul spacing="normal">
          <li>Use GRASP only for discovery purposes.</li>
          <li>Use GRASP negotiation spacing="normal" bare="false" empty="false" indent="3" pn="section-2.1-3">
          <li pn="section-2.1-3.1">discovery purposes only.</li>
          <li pn="section-2.1-3.2">negotiation but only as an initiator (client).</li>
          <li>Use GRASP negotiation
          <li pn="section-2.1-3.3">negotiation but only as a responder.</li>
          <li>Use GRASP negotiation
          <li pn="section-2.1-3.4">negotiation as an initiator or responder.</li>
          <li>Use GRASP synchronization
          <li pn="section-2.1-3.5">synchronization but only as an initiator (recipient).</li>
          <li>Use GRASP synchronization
          <li pn="section-2.1-3.6">synchronization but only as a responder and/or flooder.</li>
          <li>Use GRASP synchronization
          <li pn="section-2.1-3.7">synchronization as an initiator, responder responder, and/or flooder.</li>
        </ul>
        <t>
        <t indent="0" pn="section-2.1-4">
        The API also assumes that one ASA may support multiple objectives. Nothing prevents
        an ASA from supporting some objectives for synchronization and others for negotiation.
        </t>
        <t>The
        <t indent="0" pn="section-2.1-5">The API design assumes that the operating system and programming language
        provide a mechanism for simultaneous asynchronous operations. This is discussed
        in detail in <xref target="asynchop"/>.</t>

        <t>A target="asynchop" format="default" sectionFormat="of" derivedContent="Section 2.2"/>.</t>
        <t indent="0" pn="section-2.1-6">A few items are out of scope in this version, since practical experience is required before including them:</t>
        <ul spacing="normal">
          <li>Authorization spacing="normal" bare="false" empty="false" indent="3" pn="section-2.1-7">
          <li pn="section-2.1-7.1">Authorization of ASAs is not defined as part of GRASP and is a subject for future study.</li>
          <li>User-supplied
          <li pn="section-2.1-7.2">User-supplied explicit locators for an objective are not supported. The GRASP core will
          supply the locator, using the IP address of the node concerned.</li>
          <li>The Rapid
          <li pn="section-2.1-7.3">The rapid mode of GRASP (Section 2.5.4 of <xref target="I-D.ietf-anima-grasp"/>) (<xref target="RFC8990" sectionFormat="of" section="2.5.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8990#section-2.5.4" derivedContent="RFC8990"/>)
          is not supported.</li>
        </ul>
      </section>
      <section anchor="asynchop" numbered="true" toc="default">
        <name>Asynchronous toc="include" removeInRFC="false" pn="section-2.2">
        <name slugifiedName="name-asynchronous-operations">Asynchronous Operations</name>
        <t>GRASP
        <t indent="0" pn="section-2.2-1">GRASP depends on asynchronous operations and wait states, and some of its messages
    are not idempotent, meaning that repeating a message may cause repeated changes
    of state in the recipient ASA. Many ASAs will
    need to support several concurrent operations; for example example, an ASA might need
    to negotiate one objective with a peer while discovering and synchronizing
    a different objective with a different peer. Alternatively, an ASA which that
    acts as a resource manager might need to run simultaneous negotiations
    for a given objective with multiple different peers. Such an ASA will probably
    need to support uninterruptible atomic changes to its internal data structures,
    using a mechanism provided by the operating system and programming language in use.</t>
        <section anchor="asynchmech" numbered="true" toc="default">
        <name> toc="include" removeInRFC="false" pn="section-2.2.1">
          <name slugifiedName="name-alternative-asynchronous-me"> Alternative Asynchronous Mechanisms</name>
    <t>Thus, some
          <t indent="0" pn="section-2.2.1-1">Some ASAs need to support asynchronous operations, and therefore operations; therefore,
    the GRASP core must do so. Depending on both the
    operating system and the programming language in use, there are various
    techniques for such parallel operations, three of which we
    consider here: multi-threading, multithreading, an event loop structure using polling,
    and an event loop structure using callback functions.</t>
          <ol spacing="normal" type="1">
          <li>In multi-threading, type="1" indent="adaptive" start="1" pn="section-2.2.1-2">
          <li pn="section-2.2.1-2.1" derivedCounter="1.">In multithreading, the operating system and language will provide
    the necessary support for asynchronous operations, including creation
    of new threads, context switching between threads, queues, locks,
    and implicit wait states. In this case, API calls can be treated as simple
    synchronous function calls within their own thread, even if the function includes
    wait states, blocking blocking, and queueing. Concurrent operations will each run
    in their own threads. For example, the discover() call may not return
    until discovery results have arrived or a timeout has occurred. If the ASA
    has other work to do, the discover() call must be in a thread of its own.</li>
          <li>In
            <li pn="section-2.2.1-2.2" derivedCounter="2.">In an event loop implementation with polling, blocking calls
    are not acceptable. Therefore Therefore, all calls must be non-blocking, and
    the main loop could support multiple GRASP sessions in parallel
    by repeatedly polling each one for a change of state. To facilitate this, the
    API implementation would provide non-blocking versions of all the functions that
    otherwise involve blocking and queueing. In these calls, a 'noReply' code
    will be returned by each call instead of blocking, until such time as the event
    for which it is waiting (or a failure) has occurred. Thus, for example, discover()
    would return 'noReply' instead of waiting until discovery has succeeded
    or timed out. The discover() call would be repeated in every cycle of the
    main loop until it completes. Effectively, it becomes a polling call.</li>
          <li>It
            <li pn="section-2.2.1-2.3" derivedCounter="3.">It was noted earlier that some GRASP messages are not idempotent; in particular particular,
          this applies to each step in a negotiation session - -- sending the same message
          twice might produce unintended side effects. This is not affected by
          event loop polling: repeating a call after a 'noReply' does not
          repeat a message; it simply checks whether a reply has been received.</li>
          <li>In
            <li pn="section-2.2.1-2.4" derivedCounter="4.">In an event loop implementation with callbacks, the ASA programmer would
    provide a callback function for each asynchronous operation.
    This would be called asynchronously when a reply is received or a failure such as a
    timeout occurs.</li>
          </ol>
        </section>
        <section anchor="multineg" numbered="true" toc="default">
        <name>Multiple toc="include" removeInRFC="false" pn="section-2.2.2">
          <name slugifiedName="name-multiple-negotiation-scenar">Multiple Negotiation Scenario</name>

        <t>The
          <t indent="0" pn="section-2.2.2-1">The design of GRASP allows the following scenario. Consider
    an ASA "A" that acts as a resource allocator for some objective. An ASA "B" launches
    a negotiation with "A" to obtain or release a quantity of the resource. While this negotatition negotiation
    is under way, "B" chooses to launch a second simultaneous negotiation with "A" for a different
    quantity of the same resource. "A" must therefore conduct two separate negotiation sessions
    at the same time with the same peer, peer and must not mix them up.</t>
        <t>Note
          <t indent="0" pn="section-2.2.2-2">Note that ASAs could be designed to avoid such a scenario, i.e. i.e., restricted to exactly one
    negotiation session at a time for a given objective, but this would be a voluntary
    restriction not required by the GRASP protocol. In fact it is an assumption of fact, GRASP assumes
    that any ASA managing a resource may need to conduct multiple parallel negotiations,
    possibly with the same peer. Communication patterns could be very complex, with a group
    of ASAs overlapping negotiations among themselves, as described in
    <xref target="I-D.ciavaglia-anima-coordination"/>. target="I-D.ciavaglia-anima-coordination" format="default" sectionFormat="of" derivedContent="ANIMA-COORD"/>.
    Therefore, the API design allows for such scenarios.</t>
        <t>In
          <t indent="0" pn="section-2.2.2-3">In the callback model, for the scenario just described,
    the ASAs "A" and "B" will each provide two instances of the callback function, one for
    each session. For this reason, each ASA must be
    able to distinguish the two sessions, and the peer's IP address is not sufficient for this.
    It is also not safe to rely on transport port numbers for this, since future variants of GRASP
    might use shared ports rather than a separate port per session. Hence Hence, the GRASP design
    includes a session identifier. Session ID. Thus, when necessary, a session handle (see the next section) is
    used in the API to distinguish simultaneous GRASP sessions from each other, so that any
    number of sessions may proceed asynchronously in parallel.</t>
        </section>
        <section anchor="overlap" numbered="true" toc="default">
        <name>Overlapping toc="include" removeInRFC="false" pn="section-2.2.3">
          <name slugifiedName="name-overlapping-sessions-and-op">Overlapping Sessions and Operations</name>
        <t>A
          <t indent="0" pn="section-2.2.3-1">A GRASP session consists of a finite sequence of messages (for discovery,
        synchronization, or negotiation) between two ASAs. It is uniquely identified
        on the wire
        by a pseudo-random session identifier pseudorandom Session ID plus the IP address
        of the initiator of the session. Further details are given in
        the section 'Session Identifier' of <xref target="I-D.ietf-anima-grasp"/>.</t>

        <t>On
        "Session Identifier (Session ID)" (<xref target="RFC8990" section="2.7" sectionFormat="of" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8990#section-2.7" derivedContent="RFC8990"/>).</t>
          <t indent="0" pn="section-2.2.3-2">On the first call in a new GRASP session, the API returns a 'session_handle'
        handle that uniquely identifies the session within the API, so that multiple overlapping
        sessions can be distinguished. A likely implementation is to form the
        handle from the underlying GRASP Session ID and IP address.
        This handle must be used in all subsequent
        calls for the same session. Also see <xref target="sessn"/>.</t>

        <t>An target="sessn" format="default" sectionFormat="of" derivedContent="Section 2.3.2.8"/>.</t>
          <t indent="0" pn="section-2.2.3-3">An additional mechanism that might increase efficiency for polling
    implementations is to add a general call, say notify(), which would check the
    status of all outstanding operations for the calling ASA and return the session_handle values
    for all sessions that have changed state. This would eliminate the need for repeated calls
    to the individual functions returning a 'noReply'. This call is not described below
    as the details are likely to be implementation-specific.</t>
        <t>An implementation specific.</t>
          <t indent="0" pn="section-2.2.3-4">An implication of the above for all GRASP implementations is that the GRASP core
    must keep state for each GRASP operation in progress, most likely keyed by the GRASP
    Session ID and the GRASP source address of the session initiator. Even in a threaded
    implementation, the GRASP core will need such state internally. The session_handle
    parameter exposes this aspect of the implementation.</t>
        </section>
        <section anchor="termin" numbered="true" toc="default">
        <name>Session toc="include" removeInRFC="false" pn="section-2.2.4">
          <name slugifiedName="name-session-termination">Session Termination</name>
        <t>GRASP
          <t indent="0" pn="section-2.2.4-1">GRASP sessions may terminate for numerous reasons.
        A session ends when discovery succeeds or times out, when negotiation succeeds
        or fails, when a synchronization result is delivered, when the other end
        fails to respond before a timeout expires, when a loop count expires, or
        when
        a network socket error occurs. Note that a timeout at one end of
        a session might result in a timeout or a socket error at the other end,
        since GRASP does not send error messages in this case. In all cases, the API
        will return an appropriate code to the caller, which should then release any reserved
        resources. After failure cases, the GRASP specification recommends an exponential
        backoff before retrying.</t>
        </section>
      </section>
      <section numbered="true" toc="default">
        <name>API definition</name> toc="include" removeInRFC="false" pn="section-2.3">
        <name slugifiedName="name-api-definition">API Definition</name>
        <section numbered="true" toc="default">
          <name>Overview toc="include" removeInRFC="false" pn="section-2.3.1">
          <name slugifiedName="name-overview-of-functions">Overview of Functions</name>
          <t>The
          <t indent="0" pn="section-2.3.1-1">The functions provided by the API fall into several groups:</t>
          <ul>
            <li>Registration.
          <dl newline="false" spacing="normal" indent="3" pn="section-2.3.1-2">
            <dt pn="section-2.3.1-2.1">Registration:</dt>
            <dd pn="section-2.3.1-2.2"> These functions allow an ASA to register itself
            with the GRASP core, core and allow a registered ASA to register the GRASP
            objectives that it will manipulate.</li>
            <li>Discovery. manipulate.</dd>
            <dt pn="section-2.3.1-2.3">Discovery:</dt>
            <dd pn="section-2.3.1-2.4"> This function allows an ASA that needs to initiate
            negotiation or synchronization of a particular objective to discover
            a peer willing to respond.</li>
            <li>Negotiation. respond.</dd>
            <dt pn="section-2.3.1-2.5">Negotiation:</dt>
            <dd pn="section-2.3.1-2.6"> These functions allow an ASA to act as an initiator
            (requester) or responder (listener) for a GRASP negotiation session.
            After initiation, negotiation is a symmetric process, so most of the
            functions can be used by either party.</li>
            <li>Synchronization. party.</dd>
            <dt pn="section-2.3.1-2.7">Synchronization:</dt>
            <dd pn="section-2.3.1-2.8"> These functions allow an ASA to to act as an initiator
            (requester) or responder (listener and data source) for a GRASP
            synchronization session.</li>
            <li>Flooding. session.</dd>
            <dt pn="section-2.3.1-2.9">Flooding:</dt>
            <dd pn="section-2.3.1-2.10"> These functions allow an ASA to send and receive
            an objective that is flooded to all nodes of the ACP.</li>
          </ul>

          <t>Some ACP.</dd>
          </dl>
          <t indent="0" pn="section-2.3.1-3">Some example logic flows for a resource management ASA are given in
          <xref target="I-D.ietf-anima-asa-guidelines"/>, target="I-D.ietf-anima-asa-guidelines" format="default" sectionFormat="of" derivedContent="ASA-GUIDE"/>, which may be of help
          in understanding the following descriptions.
          The next section describes parameters and data structures used in multiple API calls.
          The following sections describe various groups of function APIs. Those APIs that
          do not list asynchronous mechanisms are implicitly synchronous in their behaviour.</t> behavior.</t>
        </section>
        <section numbered="true" toc="default">
          <name>Parameters toc="include" removeInRFC="false" pn="section-2.3.2">
          <name slugifiedName="name-parameters-and-data-structu">Parameters and data structures</name> Data Structures</name>
          <section numbered="true" toc="default">
            <name>Integers</name>
            <t>In toc="exclude" removeInRFC="false" pn="section-2.3.2.1">
            <name slugifiedName="name-integers">Integers</name>
            <t indent="0" pn="section-2.3.2.1-1">In this API, integers are assumed to be 32 bit 32-bit unsigned integers (uint32_t) unless otherwise indicated.</t>
          </section>
          <section numbered="true" toc="default">
            <name>Errorcode</name>
            <t>All toc="exclude" removeInRFC="false" pn="section-2.3.2.2">
            <name slugifiedName="name-errorcode">Errorcode</name>
            <t indent="0" pn="section-2.3.2.2-1">All functions in the API have an unsigned 'errorcode' integer as their return value (the first return value
       in languages that allow multiple return values). An errorcode of zero indicates success.
       Any other value indicates failure of some kind. The first three errorcodes have special importance:
            </t>
            <ol
            <dl newline="false" spacing="normal" type="1">
              <li>Declined: indent="3" pn="section-2.3.2.2-2">
              <dt pn="section-2.3.2.2-2.1">1 - Declined:</dt>
              <dd pn="section-2.3.2.2-2.2"> used to indicate that the other end has sent a GRASP Negotiation End message (M_END) with a Decline option (O_DECLINE).</li>
              <li>No reply: (O_DECLINE).</dd>
              <dt pn="section-2.3.2.2-2.3">2 - No reply:</dt>
              <dd pn="section-2.3.2.2-2.4"> used in non-blocking calls to indicate that the other end has sent no reply so far (see <xref target="asynchop"/>).</li>
              <li>Unspecified error: target="asynchop" format="default" sectionFormat="of" derivedContent="Section 2.2"/>).</dd>
              <dt pn="section-2.3.2.2-2.5">3 - Unspecified error:</dt>
              <dd pn="section-2.3.2.2-2.6"> used when no more specific error code applies.</li>
            </ol>
            <t><xref target="ErrAppx"/> codes apply.</dd>
            </dl>
            <t indent="0" pn="section-2.3.2.2-3"><xref target="ErrAppx" format="default" sectionFormat="of" derivedContent="Appendix A"/> gives a full list of currently suggested error codes, based on
       implementation experience. While there is no absolute requirement for all implementations
       to use the same error codes, this is highly recommended for portability of applications.</t>
          </section>
          <section anchor="tout" numbered="true" toc="default">
            <name>Timeout</name>
            <t>Wherever toc="exclude" removeInRFC="false" pn="section-2.3.2.3">
            <name slugifiedName="name-timeout">Timeout</name>
            <t indent="0" pn="section-2.3.2.3-1">Whenever a 'timeout' parameter appears, it is an unsigned integer expressed
       in milliseconds. Except for the discover() function, if If it is zero, the GRASP
       default timeout (GRASP_DEF_TIMEOUT, (GRASP_DEF_TIMEOUT; see <xref target="I-D.ietf-anima-grasp"/>) target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>) will apply.  An exception is the discover() function, which has a different interpretation of a zero timeout. If no response
       is received before the timeout expires, the call will fail unless otherwise noted.</t>
          </section>
          <section numbered="true" toc="default">
            <name>Objective</name>
            <t>An toc="exclude" removeInRFC="false" pn="section-2.3.2.4">
            <name slugifiedName="name-objective">Objective</name>
            <t indent="0" pn="section-2.3.2.4-1">An 'objective' parameter is a data structure with the following components:
            </t>
            <ul spacing="normal">
              <li>name
            <dl newline="false" spacing="normal" indent="3" pn="section-2.3.2.4-2">
              <dt pn="section-2.3.2.4-2.1">name (UTF-8 string) - the string):</dt>
              <dd pn="section-2.3.2.4-2.2">The objective's name</li>
              <li>neg name</dd>
              <dt pn="section-2.3.2.4-2.3">neg (Boolean flag) - True flag):</dt>
              <dd pn="section-2.3.2.4-2.4">True if objective supports negotiation (default False)</li>
              <li>synch False)</dd>
              <dt pn="section-2.3.2.4-2.5">synch (Boolean flag) - True flag):</dt>
              <dd pn="section-2.3.2.4-2.6">True if objective supports synchronization (default False)</li>
              <li>
                <t>dry False)</dd>
              <dt pn="section-2.3.2.4-2.7">dry (Boolean flag) - True flag):</dt>
              <dd pn="section-2.3.2.4-2.8">
                <t indent="0" pn="section-2.3.2.4-2.8.1">True if objective supports dry-run negotiation (default False)
                </t>
                <ul spacing="normal">
                  <!-- <li>Note 1: All objectives are assumed to support discovery, so there is no Boolean for that.</li> -->
                  <li>Note 1: Only False)</t>
                <dl newline="false" spacing="compact" indent="3" pn="section-2.3.2.4-2.8.2">
                  <dt pn="section-2.3.2.4-2.8.2.1">Note 1:</dt>
                  <dd pn="section-2.3.2.4-2.8.2.2">Only one of 'synch' or 'neg' may be True.</li>
                  <li>Note 2: 'dry' True.</dd>
                  <dt pn="section-2.3.2.4-2.8.2.3">Note 2:</dt>
                  <dd pn="section-2.3.2.4-2.8.2.4">'dry' must not be True unless 'neg' is also True.</li>
                  <li>Note 3: True.</dd>
                  <dt pn="section-2.3.2.4-2.8.2.5">Note 3:</dt>
                  <dd pn="section-2.3.2.4-2.8.2.6"> In some programming languages languages, the preferred implementation
                  may be to represent the Boolean flags as bits in a single byte,
                  which is how they are encoded in GRASP messages.
                  In other languages languages, an enumeration might be preferable.</li>
                </ul>
              </li>
              <li>loop_count preferable.</dd>
                </dl>
              </dd>
              <dt pn="section-2.3.2.4-2.9">loop_count (unsigned integer, uint8_t) - Limit uint8_t):</dt>
              <dd pn="section-2.3.2.4-2.10">Limit on negotiation steps steps, etc. (default GRASP_DEF_LOOPCT, GRASP_DEF_LOOPCT;
        see <xref target="I-D.ietf-anima-grasp"/>) target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>).
        The 'loop_count' is set to a suitable value by the initiator of a negotiation, to prevent
                indefinite loops. It is also used to limit the propagation of discovery and flood messages.</li>
              <li>
                <t>value - a messages.</dd>
              <dt pn="section-2.3.2.4-2.11">value:</dt>
              <dd pn="section-2.3.2.4-2.12">
                <t indent="0" pn="section-2.3.2.4-2.12.1">A specific data structure expressing the value of the objective. The
                format is language dependent, with the constraint that it can be validly
                represented in CBOR <xref target="RFC8949"/>.
                </t>
                <t>An target="RFC8949" format="default" sectionFormat="of" derivedContent="RFC8949"/>.</t>
                <ul spacing="normal" empty="true" bare="false" indent="3" pn="section-2.3.2.4-2.12.2">
                  <li pn="section-2.3.2.4-2.12.2.1">An important advantage of CBOR is that the value of an objective can be completely
                opaque to the GRASP core yet pass transparently through it to and from the ASA.
                Although the GRASP core must validate the format and syntax of GRASP messages,
                it cannot validate the value of an objective; all it can do is detect
                malformed CBOR. The handling of decoding errors depends on the CBOR library
                in use, but a corresponding error code ('CBORfail') is defined in the API
                and will be returned to the ASA if a faulty message can be assigned
                to a current GRASP session. However, it is the responsibility of
                each ASA to validate the value of a received objective, as discussed
                in Section 5.3 of <xref target="RFC8949"/>. target="RFC8949" sectionFormat="of" section="5.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8949#section-5.3" derivedContent="RFC8949"/>.
                If the programming language in use is suitably object-oriented, the GRASP API
                may deserialize the value and present it to the ASA as an object.
                If not, it will be presented as a CBOR data item. In all cases, the syntax
                and semantics of the objective value are the responsibility of the ASA.</t>
                <t>
                A ASA.</li>
                  <li pn="section-2.3.2.4-2.12.2.2">A requirement for all language mappings and all API implementations is
                that, regardless of what other options exist for a language-specific representation
                of the value, there is always an option to use a raw CBOR data item as the value.
                The API will then wrap this with CBOR Tag 24 as an encoded CBOR data item
                for transmission via GRASP, and unwrap it after reception. By this means,
                ASAs will be able to communicate regardless of programming language.
                </t>
                </li>
                </ul>

                <t>The
              </dd>
            </dl>
            <t indent="0" pn="section-2.3.2.4-3">The 'name' and 'value' fields are of variable length. GRASP does not set a maximum
                length for these fields, but only for the total length of a GRASP message. Implementations
                might impose length limits.</t>
                <t>
            <t indent="0" pn="section-2.3.2.4-4">
           An example data structure definition for an objective in the C language,
           using at least the C99 version, and
           assuming the use of a particular CBOR library <xref target="libcbor"/>, target="libcbor" format="default" sectionFormat="of" derivedContent="libcbor"/>, is:
            </t>
                <artwork align="center" name="" type="" alt=""><![CDATA[
            <sourcecode type="c" markers="false" pn="section-2.3.2.4-5">
 typedef struct {
    unsigned char *name;
    uint8_t flags;            // flag bits as defined by GRASP
    uint8_t loop_count;
    uint32_t value_size;      // size of value in bytes
    cbor_mutable_data cbor_value;
                             // CBOR bytestring (libcbor/cbor/data.h)
                 } objective;
]]></artwork>
                <t>
</sourcecode>
            <t indent="0" pn="section-2.3.2.4-6">
           An example data structure definition for an objective in the Python language (version 3.4 or later) is:
            </t>
                <artwork align="center" name="" type="" alt=""><![CDATA[
            <sourcecode type="python" markers="false" pn="section-2.3.2.4-7">
 class objective:
    """A GRASP objective"""
    def __init__(self, name):
        self.name = name        #Unique name (string)
        self.negotiate = False  #True if objective supports negotiation supported
        self.dryrun = False     #True if objective supports dry-run neg. supported
        self.synch = False      #True if objective supports synch synchronization supported
        self.loop_count = GRASP_DEF_LOOPCT  # Default starting value
        self.value = None       #Place holder; any valid Python object
]]></artwork>
</sourcecode>
          </section>
          <section anchor="asaL" numbered="true" toc="default">
            <name>ASA_locator</name>
            <t>An 'ASA_locator' toc="exclude" removeInRFC="false" pn="section-2.3.2.5">
            <name slugifiedName="name-asa_locator">asa_locator</name>
            <t indent="0" pn="section-2.3.2.5-1">An 'asa_locator' parameter is a data structure with the following contents:
            </t>
            <ul spacing="normal">
              <li>locator - The
            <dl spacing="normal" indent="3" newline="false" pn="section-2.3.2.5-2">
              <dt pn="section-2.3.2.5-2.1">locator:</dt>
              <dd pn="section-2.3.2.5-2.2">The actual locator, either an IP address or an ASCII string.</li>
              <li>ifi (unsigned integer) - The string.</dd>
              <dt pn="section-2.3.2.5-2.3">ifi (unsigned integer):</dt>
              <dd pn="section-2.3.2.5-2.4">The interface identifier index via which this was discovered (of limited
              use to most ASAs).</li>
              <li>expire ASAs).</dd>
              <dt pn="section-2.3.2.5-2.5">expire (system dependent type) - The type):</dt>
              <dd pn="section-2.3.2.5-2.6">The time on the local system clock when this locator will expire from the cache</li>
              <li><t>The cache.</dd>
              <dt pn="section-2.3.2.5-2.7">The following cover covers all locator types currently supported by GRASP:</t>
              <ul><li>is_ipaddress GRASP:</dt>
              <dd pn="section-2.3.2.5-2.8">
                <ul bare="false" empty="false" indent="3" spacing="normal" pn="section-2.3.2.5-2.8.1">
                  <li pn="section-2.3.2.5-2.8.1.1">is_ipaddress (Boolean) - True if the locator is an IP address</li>
                  <li>is_fqdn address.</li>
                  <li pn="section-2.3.2.5-2.8.1.2">is_fqdn (Boolean) -  True if the locator is an FQDN</li>
                  <li>is_uri a Fully Qualified Domain Name (FQDN).</li>
                  <li pn="section-2.3.2.5-2.8.1.3">is_uri (Boolean) -  True if the locator is a URI</li>
                  <li>These URI.</li>
                </ul>
                <t indent="0" pn="section-2.3.2.5-2.8.2">These options are mutually exclusive. Depending on the programming language, they could
		  be represented as a bit pattern or an enumeration.</li></ul></li>
              <li>diverted (Boolean) - True enumeration.</t>
              </dd>
              <dt pn="section-2.3.2.5-2.9">diverted (Boolean):</dt>
              <dd pn="section-2.3.2.5-2.10">True if the locator was discovered via a Divert option</li>
              <li>protocol (unsigned integer) - Applicable option.</dd>
              <dt pn="section-2.3.2.5-2.11">protocol (unsigned integer):</dt>
              <dd pn="section-2.3.2.5-2.12">Applicable transport protocol (IPPROTO_TCP or IPPROTO_UDP).
              These constants are defined in the CDDL specification of GRASP <xref target="I-D.ietf-anima-grasp"/>.</li>
              <li>port (unsigned integer) - Applicable target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>.</dd>
              <dt pn="section-2.3.2.5-2.13">port (unsigned integer):</dt>
              <dd pn="section-2.3.2.5-2.14">Applicable port number</li>
            </ul>

            <t>The number.</dd>
            </dl>
            <t indent="0" pn="section-2.3.2.5-3">The 'locator' field is of variable length in the case of an FQDN or a URI. GRASP does not set a maximum
                length for this field, but only for the total length of a GRASP message. Implementations
                might impose length limits.</t>
            <t>It
            <t indent="0" pn="section-2.3.2.5-4">It should be noted that when one ASA discovers the ASA_locator asa_locator of another, there is no
            explicit authentication mechanism. In accordance with the trust model provided by the
            secure ACP, ASAs are presumed to provide correct locators in response to discovery.
            See the section 'Locator Options' of <xref target="I-D.ietf-anima-grasp"/> "Locator Options" (<xref target="RFC8990" section="2.9.5" sectionFormat="of" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8990#section-2.9.5" derivedContent="RFC8990"/>) for further details.</t>
          </section>
          <section numbered="true" toc="default">
            <name>Tagged_objective</name>
            <t>A toc="exclude" removeInRFC="false" pn="section-2.3.2.6">
            <name slugifiedName="name-tagged_objective">Tagged_objective</name>
            <t indent="0" pn="section-2.3.2.6-1">A 'tagged_objective' parameter is a data structure with the following contents:
            </t>
            <ul spacing="normal">
              <li>objective - An objective</li>
              <li>locator - The ASA_locator
            <dl spacing="normal" indent="3" newline="false" pn="section-2.3.2.6-2">
              <dt pn="section-2.3.2.6-2.1">objective:</dt>
              <dd pn="section-2.3.2.6-2.2">An objective.</dd>
              <dt pn="section-2.3.2.6-2.3">locator:</dt>
              <dd pn="section-2.3.2.6-2.4">The asa_locator associated with the objective, or a null value.</li>
            </ul> value.</dd>
            </dl>
          </section>
          <section numbered="true" toc="default">
            <name>Asa_handle</name>
            <t>Although toc="exclude" removeInRFC="false" pn="section-2.3.2.7">
            <name slugifiedName="name-asa_handle">asa_handle</name>
            <t indent="0" pn="section-2.3.2.7-1">Although an authentication and authorization scheme for ASAs has not been defined, the API
       provides a very simple hook for such a scheme. When an ASA starts up, it registers itself
       with the GRASP core, which provides it with an opaque handle that, although not cryptographically
       protected, would be difficult for a third party to predict. The ASA must present this handle
       in future calls. This mechanism will prevent some elementary errors or trivial attacks
       such as an ASA manipulating an objective it has not registered to use.</t>
            <t>Thus,
            <t indent="0" pn="section-2.3.2.7-2">Thus, in most calls, an 'asa_handle' parameter is required. It is generated when an ASA
       first registers with GRASP, and the ASA must then store the asa_handle
       and use it in every subsequent GRASP call. Any call in which an invalid handle is presented will fail.
       It is an up to 32-bit opaque value (for example example, represented as a uint32_t, depending on the language).
       Since it is only used locally, and not in GRASP messages, it is only required to be unique
       within the local GRASP instance. It is valid until the ASA terminates.
       It should be unpredictable; a possible implementation is to use the same mechanism that GRASP
       uses to generate Session Identifiers IDs (see <xref target="sessn"/>).</t> target="sessn" format="default" sectionFormat="of" derivedContent="Section 2.3.2.8"/>).</t>
          </section>
          <section anchor="sessn" numbered="true" toc="default">
            <name>Session_handle toc="exclude" removeInRFC="false" pn="section-2.3.2.8">
            <name slugifiedName="name-session_handle-and-callback">Session_handle and Callbacks</name>
            <t>In
            <t indent="0" pn="section-2.3.2.8-1">In some calls, a 'session_handle' parameter is required. This is an opaque data
       structure as far as the ASA is concerned,
       used to identify calls to the API as belonging to a specific GRASP session
       (see <xref target="overlap"/>). target="overlap" format="default" sectionFormat="of" derivedContent="Section 2.2.3"/>).
       It will be provided as a parameter in callback functions.
       As well as distinguishing calls from different sessions, it also allows GRASP
       to detect and ignore calls from non-existent or timed-out sessions. </t>

       <t>In
            <t indent="0" pn="section-2.3.2.8-2">In an event loop implementation, callback functions (<xref target="asynchmech"/>) target="asynchmech" format="default" sectionFormat="of" derivedContent="Section 2.2.1"/>) may be
       supported for all API functions that involve waiting for a remote operation:
            </t>
            <ul empty="true" spacing="normal">
          <li>discover() spacing="normal" bare="false" indent="3" pn="section-2.3.2.8-3">
              <li pn="section-2.3.2.8-3.1">discover() whose callback would be discovery_received().</li>
          <li>request_negotiate()
              <li pn="section-2.3.2.8-3.2">request_negotiate() whose callback would be negotiate_step_received().</li>
          <li>negotiate_step()
              <li pn="section-2.3.2.8-3.3">negotiate_step() whose callback would be negotiate_step_received().</li>
          <li>listen_negotiate()
              <li pn="section-2.3.2.8-3.4">listen_negotiate() whose callback would be negotiate_step_received().</li>
          <li>synchronize()
              <li pn="section-2.3.2.8-3.5">synchronize() whose callback would be synchronization_received().</li>
            </ul>
        <t>Further
            <t indent="0" pn="section-2.3.2.8-4">Further details of callbacks are implementation-dependent.</t> implementation dependent.</t>
          </section>
        </section>
        <section anchor="regi" numbered="true" toc="default">
          <name>Registration</name>
          <t>These toc="include" removeInRFC="false" pn="section-2.3.3">
          <name slugifiedName="name-registration">Registration</name>
          <t indent="0" pn="section-2.3.3-1">These functions are used to register an ASA, and the objectives that it modifies,
            with the GRASP module.  In the absence of an authorization
            model, these functions are very simple simple, but they will avoid multiple ASAs choosing the
            same name, name and will prevent multiple ASAs manipulating the same objective.
            If an authorization model is added to GRASP, these API calls would
            need to be modified accordingly.</t>
          <ul spacing="normal">
            <li>
              <t>register_asa()</t>
              <t>All spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.3-2">
            <li pn="section-2.3.3-2.1">
              <t indent="0" pn="section-2.3.3-2.1.1">register_asa()</t>
              <t indent="0" pn="section-2.3.3-2.1.2">All ASAs must use this call before issuing any other API calls.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.3-2.1.3">
                <li pn="section-2.3.3-2.1.3.1">
                  <t indent="0" pn="section-2.3.3-2.1.3.1.1">Input parameter:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>name
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.3-2.1.3.1.2">
                    <li pn="section-2.3.3-2.1.3.1.2.1">name of the ASA (UTF-8 string)</dd>
                  </dl> string)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.3-2.1.3.2">
                  <t indent="0" pn="section-2.3.3-2.1.3.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode (unsigned integer)</dd>
                    <dt/>
                    <dd>asa_handle
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.3-2.1.3.2.2">
                    <li pn="section-2.3.3-2.1.3.2.2.1">errorcode (unsigned integer)</li>
                    <li pn="section-2.3.3-2.1.3.2.2.2">asa_handle (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>This initialises
                <li pn="section-2.3.3-2.1.3.3">This initializes the state in the GRASP module for the calling entity (the ASA).
               In the case of success, an 'asa_handle' is returned returned, which the ASA must present in
               all subsequent calls.
               In the case of failure, the ASA has not been authorized and cannot operate.
               The 'asa_handle' value is undefined.</li>
              </ul>
            </li>
            <li>
              <t>deregister_asa()</t>
            <li pn="section-2.3.3-2.2">
              <t indent="0" pn="section-2.3.3-2.2.1">deregister_asa()</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.3-2.2.2">
                <li pn="section-2.3.3-2.2.2.1">
                  <t indent="0" pn="section-2.3.3-2.2.2.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>name
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.3-2.2.2.1.2">
                    <li pn="section-2.3.3-2.2.2.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.3-2.2.2.1.2.2">name of the ASA (UTF-8 string)</dd>
                  </dl> string)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.3-2.2.2.2">
                  <t indent="0" pn="section-2.3.3-2.2.2.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.3-2.2.2.2.2">
                    <li pn="section-2.3.3-2.2.2.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.3-2.2.2.3">This removes all state in the GRASP module for the calling entity (the ASA), ASA)
             and deregisters any objectives it has registered. Note that these actions must
             also happen automatically if an ASA exits.</li>
                <li>Note -
                <li pn="section-2.3.3-2.2.2.4">Note -- the ASA name is is, strictly speaking speaking, redundant in this call, call but is present to
                detect and reject erroneous deregistrations.</li>
              </ul>
            </li>
            <li>
              <t>register_objective()</t>
              <t>ASAs
            <li pn="section-2.3.3-2.3">
              <t indent="0" pn="section-2.3.3-2.3.1">register_objective()</t>
              <t indent="0" pn="section-2.3.3-2.3.2">ASAs must use this call for any objective whose value they need to transmit
              by negotiation, synchronization synchronization, or flooding.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.3-2.3.3">
                <li pn="section-2.3.3-2.3.3.1">
                  <t indent="0" pn="section-2.3.3-2.3.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                    <dt/>
                    <dd>ttl
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.3-2.3.3.1.2">
                    <li pn="section-2.3.3-2.3.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.3-2.3.3.1.2.2">objective (structure)</li>
                    <li pn="section-2.3.3-2.3.3.1.2.3">ttl (unsigned integer - -- default GRASP_DEF_TIMEOUT)</dd>
                    <dt/>
                    <dd>discoverable GRASP_DEF_TIMEOUT)</li>
                    <li pn="section-2.3.3-2.3.3.1.2.4">discoverable (Boolean - -- default False)</dd>
                    <dt/>
                    <dd>overlap False)</li>
                    <li pn="section-2.3.3-2.3.3.1.2.5">overlap (Boolean - -- default False)</dd>
                    <dt/>
                    <dd>local False)</li>
                    <li pn="section-2.3.3-2.3.3.1.2.6">local (Boolean - -- default False)</dd>
                  </dl> False)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.3-2.3.3.2">
                  <t indent="0" pn="section-2.3.3-2.3.3.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.3-2.3.3.2.2">
                    <li pn="section-2.3.3-2.3.3.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.3-2.3.3.3">This registers an objective that this ASA may modify
                and transmit to other ASAs by flooding or negotiation. It is not necessary to register
                an objective that is only received by GRASP synchronization or flooding.
                The 'objective' becomes a candidate for discovery. However, discovery
                responses should not be enabled until the ASA calls listen_negotiate() or
                listen_synchronize(), showing that it is able to act as a responder.
                The ASA may negotiate the objective or send synchronization or flood data.
                Registration is not needed for "read-only" operations, i.e., the ASA only wants
                to receive synchronization or flooded data for the objective concerned. </li>
                <li>The
                <li pn="section-2.3.3-2.3.3.4">The 'ttl' parameter is the valid lifetime (time to live) in milliseconds of any
                discovery response generated for this objective. The default value should be the GRASP
                default timeout (GRASP_DEF_TIMEOUT, (GRASP_DEF_TIMEOUT; see <xref target="I-D.ietf-anima-grasp"/>).</li>
                <li>If target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>).</li>
                <li pn="section-2.3.3-2.3.3.5">If the parameter 'discoverable' is True, the objective
                is immediately discoverable. This is
                intended for objectives that are only defined for GRASP discovery, discovery
                and which that do not support negotiation or synchronization.</li>
                <li>If
                <li pn="section-2.3.3-2.3.3.6">If the parameter 'overlap' is True, more than one ASA may register this objective
                in the same GRASP instance. This is of value for life cycle management
                of ASAs <xref target="I-D.ietf-anima-asa-guidelines"/> target="I-D.ietf-anima-asa-guidelines" format="default" sectionFormat="of" derivedContent="ASA-GUIDE"/> and must be
                used consistently for a given objective (always True or always False).</li>
                <li>If
                <li pn="section-2.3.3-2.3.3.7">If the parameter 'local' is True, discovery must return a link-local address.
                This feature is for objectives that must be restricted to the local link.</li>
                <li>This
                <li pn="section-2.3.3-2.3.3.8">This call may be repeated for multiple objectives.</li>
              </ul>
            </li>
            <li>
              <t>deregister_objective()</t>
            <li pn="section-2.3.3-2.4">
              <t indent="0" pn="section-2.3.3-2.4.1">deregister_objective()</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.3-2.4.2">
                <li pn="section-2.3.3-2.4.2.1">
                  <t indent="0" pn="section-2.3.3-2.4.2.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.3-2.4.2.1.2">
                    <li pn="section-2.3.3-2.4.2.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.3-2.4.2.1.2.2">objective (structure)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.3-2.4.2.2">
                  <t indent="0" pn="section-2.3.3-2.4.2.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.3-2.4.2.2.2">
                    <li pn="section-2.3.3-2.4.2.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>The
                <li pn="section-2.3.3-2.4.2.3">The 'objective' must have been registered by the calling ASA; if not, this call fails.
             Otherwise, it removes all state in the GRASP module for the given objective.</li>
              </ul>
            </li>
          </ul>
          <!-- End of registration functions -->
        </section>
        <section numbered="true" toc="default">
          <name>Discovery</name> toc="include" removeInRFC="false" pn="section-2.3.4">
          <name slugifiedName="name-discovery">Discovery</name>
          <ul spacing="normal">
            <li>
              <t>discover()</t>
              <t>This spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.4-1">
            <li pn="section-2.3.4-1.1">
              <t indent="0" pn="section-2.3.4-1.1.1">discover()</t>
              <t indent="0" pn="section-2.3.4-1.1.2">This function may be used by any ASA to discover peers handling a given objective.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.4-1.1.3">
                <li pn="section-2.3.4-1.1.3.1">
                  <t indent="0" pn="section-2.3.4-1.1.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                    <dt/>
                    <dd>timeout (unsigned integer)</dd>
                    <dt/>
                    <dd>minimum_TTL
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.4-1.1.3.1.2">
                    <li pn="section-2.3.4-1.1.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.4-1.1.3.1.2.2">objective (structure)</li>
                    <li pn="section-2.3.4-1.1.3.1.2.3">timeout (unsigned integer)</li>
                    <li pn="section-2.3.4-1.1.3.1.2.4">minimum_TTL (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.4-1.1.3.2">
                  <t indent="0" pn="section-2.3.4-1.1.3.2.1">Return values:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode (unsigned integer)</dd>
                    <dt/>
                    <dd>locator_list (structure)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.4-1.1.3.2.2">
                    <li pn="section-2.3.4-1.1.3.2.2.1">errorcode (unsigned integer)</li>
                    <li pn="section-2.3.4-1.1.3.2.2.2">locator_list (structure)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.4-1.1.3.3">This returns a list of discovered 'ASA_locator's 'asa_locators' for the given objective.
                An empty list means that no locators were discovered within the timeout.
                Note that this structure includes all the fields described in <xref target="asaL"/>. target="asaL" format="default" sectionFormat="of" derivedContent="Section 2.3.2.5"/>.
             </li>
                <li>The
                <li pn="section-2.3.4-1.1.3.4">The parameter 'minimum_TTL' must be greater than or equal to
                    zero. Any locally cached locators for the objective whose
                    remaining time to live in milliseconds is less than or equal to
                    'minimum_TTL' are deleted first. Thus Thus, 'minimum_TTL' = 0 will
                    flush all entries. Note that this will not affect sessions already
                    in progress using the deleted locators.</li>
                <li>If
                <li pn="section-2.3.4-1.1.3.5">If the parameter 'timeout' is zero, any remaining locally cached locators for the
                objective are returned immediately immediately, and no other action is taken. (Thus,
                a call with 'minimum_TTL' and 'timeout' both equal to zero is pointless.)</li>
                <li>If
                <li pn="section-2.3.4-1.1.3.6">If the parameter 'timeout' is greater than zero,
                GRASP discovery is performed, and all results obtained before the timeout in milliseconds
                expires are returned. If no results are obtained, an empty list is returned after the timeout.
                That is not an error condition. GRASP discovery is not a deterministic process.
                If there are multiple nodes handling an objective, none, some some, or all of them
                will be discovered before the timeout expires.</li>
                <li><t>Asynchronous Mechanisms:</t><ul>
                <li>Threaded implementation: This
                <li pn="section-2.3.4-1.1.3.7">
                  <t indent="0" pn="section-2.3.4-1.1.3.7.1">Asynchronous Mechanisms:</t>
                  <dl indent="3" newline="false" spacing="normal" pn="section-2.3.4-1.1.3.7.2">
                    <dt pn="section-2.3.4-1.1.3.7.2.1">Threaded implementation:</dt>
                    <dd pn="section-2.3.4-1.1.3.7.2.2">This should be called in a separate thread
                if asynchronous operation is required.</li>
                <li>Event required.</dd>
                    <dt pn="section-2.3.4-1.1.3.7.2.3">Event loop implementation: An implementation:</dt>
                    <dd pn="section-2.3.4-1.1.3.7.2.4">An additional in/out 'session_handle' parameter is used.
                If the 'errorcode' parameter has the value 2 ('noReply'),
                no response has been received so far. The 'session_handle' parameter must be presented
                in subsequent calls.
                A callback may be used in the case of a non-zero timeout.</li></ul></li> timeout.</dd>
                  </dl>
                </li>
              </ul>
            </li>
          </ul>
        </section>
        <!-- End of discovery functions -->
        <section numbered="true" toc="default">
          <name>Negotiation</name>

          <t>Since toc="include" removeInRFC="false" pn="section-2.3.5">
          <name slugifiedName="name-negotiation">Negotiation</name>
          <t indent="0" pn="section-2.3.5-1">Since the negotiation mechanism is different from a typical client/server
          exchange, <xref target="negfig"/> target="negfig" format="default" sectionFormat="of" derivedContent="Figure 2"/> illustrates the sequence of calls and GRASP
          messages in a negotiation. Note that after the first protocol exchange, the process
          is symmetrical, with negotiating steps strictly alternating between the two sides.
          Either side can end the negotiation. Also, the side that is due to respond
          next can insert a delay at any time, to extend the other side's timeout.
          This would be used, for example, if an ASA needed to negotiate with
          a third party before continuing with the current negotiation.</t>

          <t>The
          <t indent="0" pn="section-2.3.5-2">The loop count embedded in the objective that is the subject of
          negotiation is initialised initialized by the ASA that starts a negotiation, negotiation
          and is then decremented by the GRASP core at each step, prior to
          sending each M_NEGOTIATE message. If it reaches
          zero, the negotiation will fail fail, and each side will receive an error code.</t>
          <figure anchor="negfig">
        <name>Negotiation sequence</name> anchor="negfig" align="left" suppress-title="false" pn="figure-2">
            <name slugifiedName="name-negotiation-sequence">Negotiation Sequence</name>
            <artwork align="center" name="" type="" alt=""><![CDATA[ alt="" pn="section-2.3.5-3.1">
Initiator                         Responder
---------                         ---------

                                  listen_negotiate() \ Await request

request_negotiate()
          M_REQ_NEG      ->      -&gt;       negotiate_step()   \ Open session,
                         <-
                         &lt;-      M_NEGOTIATE         / start negotiation
negotiate_step()
        M_NEGOTIATE      ->      -&gt;       negotiate_step()   \ Continue
                         <-
                         &lt;-      M_NEGOTIATE         / negotiation
                         ...
negotiate_wait()                                     \ Insert
        M_WAIT           ->           -&gt;                          / delay
negotiate_step()
        M_NEGOTIATE      ->      -&gt;       negotiate_step()   \ Continue
                         <-
                         &lt;-      M_NEGOTIATE         / negotiation
negotiate_step()
        M_NEGOTIATE      ->      -&gt;       end_negotiate()    \ End
                         <-
                         &lt;-      M_END               / negotiation

                                                     \ Process results
]]></artwork>
</artwork>
          </figure>

        <t>As
          <t indent="0" pn="section-2.3.5-4">As the negotiation proceeds, each side will update the value of the objective in accordance with
        its particular semantics, defined in the specification of the objective. Although many objectives
        will have values that can be ordered, so that negotiation can be a simple bidding process, this it
        is not a requirement.</t>
        <t>Failure
          <t indent="0" pn="section-2.3.5-5">Failure to agree, a timeout, or loop count exhaustion may all end a negotiation session, but none
        of these cases is a are protocol failure.</t> failures.</t>
          <ul spacing="normal">
            <li>
              <t>request_negotiate()</t>
              <t>This spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.5-6">
            <li pn="section-2.3.5-6.1">
              <t indent="0" pn="section-2.3.5-6.1.1">request_negotiate()</t>
              <t indent="0" pn="section-2.3.5-6.1.2">This function is used by any ASA to initiate negotiation of a GRASP objective as a requester (client).</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.5-6.1.3">
                <li pn="section-2.3.5-6.1.3.1">
                  <t indent="0" pn="section-2.3.5-6.1.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                    <dt/>
                    <dd>peer (ASA_locator)</dd>
                    <dt/>
                    <dd>timeout
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.1.3.1.2">
                    <li pn="section-2.3.5-6.1.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.5-6.1.3.1.2.2">objective (structure)</li>
                    <li pn="section-2.3.5-6.1.3.1.2.3">peer (asa_locator)</li>
                    <li pn="section-2.3.5-6.1.3.1.2.4">timeout (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.5-6.1.3.2">
                  <t indent="0" pn="section-2.3.5-6.1.3.2.1">Return values:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode (unsigned integer)</dd>
                    <dt/>
                    <dd>session_handle
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.1.3.2.2">
                    <li pn="section-2.3.5-6.1.3.2.2.1">errorcode (unsigned integer)</li>
                    <li pn="section-2.3.5-6.1.3.2.2.2">session_handle (structure) (undefined unless successful)</dd>
                    <dt/>
                    <dd>proffered_objective successful)</li>
                    <li pn="section-2.3.5-6.1.3.2.2.3">proffered_objective (structure) (undefined unless successful)</dd>
                    <dt/>
                    <dd>reason successful)</li>
                    <li pn="section-2.3.5-6.1.3.2.2.4">reason (string) (empty unless negotiation declined)</dd>
                  </dl> declined)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.5-6.1.3.3">This function opens a negotiation session between two ASAs. Note that GRASP currently
                does not support multi-party multiparty negotiation, which would need to be added as an extended
                function.</li>
                <li>The
                <li pn="section-2.3.5-6.1.3.4">The 'objective' parameter must
             include the requested value, and its loop count should be set to a
             suitable starting value by the ASA. If not, the GRASP default will apply.</li>
                <li>Note
                <li pn="section-2.3.5-6.1.3.5">Note that a given negotiation session may or may not be a dry-run negotiation;
             the two modes must not be mixed in a single session.</li>
                <li>The
                <li pn="section-2.3.5-6.1.3.6">The 'peer' parameter is the target node; it must be an 'ASA_locator' 'asa_locator' as returned
             by discover(). If 'peer' is null, GRASP discovery is automatically performed first to find
             a suitable peer (i.e., any node that supports the objective in question).</li>
                <li>The
                <li pn="section-2.3.5-6.1.3.7">The 'timeout' parameter is described in <xref target="tout"/>.</li>
                <li>
                  <t>If target="tout" format="default" sectionFormat="of" derivedContent="Section 2.3.2.3"/>.</li>
                <li pn="section-2.3.5-6.1.3.8">
                  <t indent="0" pn="section-2.3.5-6.1.3.8.1">If the 'errorcode' return value is 0, the negotiation has successfully
             started. There are then two cases:
                  </t>
                  <ol spacing="normal" type="1">
                    <li>The type="1" indent="adaptive" start="1" pn="section-2.3.5-6.1.3.8.2">
                    <li pn="section-2.3.5-6.1.3.8.2.1" derivedCounter="1.">The 'session_handle' parameter is null. In this case case, the negotiation
              has succeeded with one exchange of messages messages, and the peer has accepted the request. The returned
              'proffered_objective' contains the value accepted by the peer, which is
              therefore equal to the value in the requested 'objective'. For this reason,
              no session handle is needed, since the session has ended.</li>
                    <li>
                      <t>The
                    <li pn="section-2.3.5-6.1.3.8.2.2" derivedCounter="2.">
                      <t indent="0" pn="section-2.3.5-6.1.3.8.2.2.1">The 'session_handle' parameter is not null. In this case case, negotiation
              must continue. The 'session_handle' must be presented in all subsequent negotiation steps.
              The returned 'proffered_objective' contains the first value
              proffered by the negotiation peer in the first exchange of messages;
              in other words words, it is a counter-offer.
              The contents of this instance of the objective
              must be used to prepare the next negotiation step (see negotiate_step() below) because
              it contains the updated loop count, sent by the negotiation peer.
              The GRASP code automatically decrements the loop count by 1 at each step, step
              and returns an error if it becomes zero. Since this terminates the
              negotiation, the other end will experience a timeout, which will
              terminate the other end of the session.

                      </t>
                      <t>
                      <t indent="0" pn="section-2.3.5-6.1.3.8.2.2.2">
              This function must be followed by calls to 'negotiate_step' and/or 'negotiate_wait'
              and/or 'end_negotiate' until the negotiation ends. 'request_negotiate' may then be called
              again to start a new negotiation.</t>
                    </li>
                  </ol>
                </li>
                <li>If
                <li pn="section-2.3.5-6.1.3.9">If the 'errorcode' parameter has the value 1 ('declined'), the negotiation has been declined
             by the peer (M_END and O_DECLINE features of GRASP). The 'reason' string is then available for
             information and diagnostic use, but it may be a null string. For this and any other error code,
             an exponential backoff is recommended before any retry (see <xref target="security"/>).</li>
                <li><t>Asynchronous Mechanisms:</t><ul>
                <li>Threaded implementation: This target="security" format="default" sectionFormat="of" derivedContent="Section 3"/>).</li>
                <li pn="section-2.3.5-6.1.3.10">
                  <t indent="0" pn="section-2.3.5-6.1.3.10.1">Asynchronous Mechanisms:</t>
                  <dl indent="3" newline="false" spacing="normal" pn="section-2.3.5-6.1.3.10.2">
                    <dt pn="section-2.3.5-6.1.3.10.2.1">Threaded implementation:</dt>
                    <dd pn="section-2.3.5-6.1.3.10.2.2">This should be called in a separate thread
                if asynchronous operation is required.</li>
                <li>Event required.</dd>
                    <dt pn="section-2.3.5-6.1.3.10.2.3">Event loop implementation: The implementation:</dt>
                    <dd pn="section-2.3.5-6.1.3.10.2.4">The 'session_handle' parameter is used to distinguish
                multiple simultaneous sessions. If the 'errorcode' parameter has the value 2 ('noReply'),
                no response has been received so far. The 'session_handle' parameter must be presented
                in subsequent calls.</li></ul></li>

                <li>Use calls.</dd>
                  </dl>
                </li>
                <li pn="section-2.3.5-6.1.3.11">Use of dry run mode: This dry-run mode must be consistent within a GRASP session. The state of the 'dry'
             flag in the initial request_negotiate() call must be the same in all subsequent negotiation
             steps of the same session. The semantics of the dry run dry-run mode are built into the ASA; GRASP
             merely carries the flag bit.</li>
                <li>Special
                <li pn="section-2.3.5-6.1.3.12">Special note for the ACP infrastructure ASA: It is likely that this ASA will need to
             discover and negotiate with its peers in each of its on-link neighbors. It will therefore need to
             know not only the link-local IP address but also the physical interface and transport port for
             connecting to each neighbor. One implementation approach to this is to include these
             details in the 'session_handle' data structure, which is opaque to normal ASAs.</li>
              </ul>
            </li>
            <li>
              <t>listen_negotiate()</t>
              <t>This
            <li pn="section-2.3.5-6.2">
              <t indent="0" pn="section-2.3.5-6.2.1">listen_negotiate()</t>
              <t indent="0" pn="section-2.3.5-6.2.2">This function is used by an ASA to start acting as a negotiation responder (listener)
              for a given GRASP objective.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.5-6.2.3">
                <li pn="section-2.3.5-6.2.3.1">
                  <t indent="0" pn="section-2.3.5-6.2.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.2.3.1.2">
                    <li pn="section-2.3.5-6.2.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.5-6.2.3.1.2.2">objective (structure)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.5-6.2.3.2">
                  <t indent="0" pn="section-2.3.5-6.2.3.2.1">Return values:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode (unsigned integer)</dd>
                    <dt/>
                    <dd>session_handle
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.2.3.2.2">
                    <li pn="section-2.3.5-6.2.3.2.2.1">errorcode (unsigned integer)</li>
                    <li pn="section-2.3.5-6.2.3.2.2.2">session_handle (structure) (undefined unless successful)</dd>
                    <dt/>
                    <dd>requested_objective successful)</li>
                    <li pn="section-2.3.5-6.2.3.2.2.3">requested_objective (structure) (undefined unless successful)</dd>
                  </dl> successful)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.5-6.2.3.3">This function instructs GRASP to listen for negotiation
             requests for the given 'objective'. It also enables discovery responses for the objective,
		as mentioned under register_objective() in <xref target="regi"/>.</li>
                <li><t>Asynchronous Mechanisms:</t><ul>
                <li>Threaded implementation: It target="regi" format="default" sectionFormat="of" derivedContent="Section 2.3.3"/>.</li>
                <li pn="section-2.3.5-6.2.3.4">
                  <t indent="0" pn="section-2.3.5-6.2.3.4.1">Asynchronous Mechanisms:</t>
                  <dl indent="3" newline="false" spacing="normal" pn="section-2.3.5-6.2.3.4.2">
                    <dt pn="section-2.3.5-6.2.3.4.2.1">Threaded implementation:</dt>
                    <dd pn="section-2.3.5-6.2.3.4.2.2">It will block waiting for an incoming request, so
             it should be called in a separate thread if asynchronous operation is required.
             Unless there is an unexpected failure, this call only returns after an
             incoming negotiation request.
             If the ASA supports multiple simultaneous transactions, a new sub-thread must
             be spawned for each new session, so that listen_negotiate() can
             be called again immediately.</li>
                <li>Event immediately.</dd>
                    <dt pn="section-2.3.5-6.2.3.4.2.3">Event loop implementation: A implementation:</dt>
                    <dd pn="section-2.3.5-6.2.3.4.2.4">A 'session_handle' parameter is used
                to distinguish individual sessions.
             If the ASA supports multiple simultaneous transactions, a new event must be inserted
             in the event loop for each new session, so that listen_negotiate() can
		be reactivated immediately.</li></ul></li>
                <li>This immediately.</dd>
                  </dl>
                </li>
                <li pn="section-2.3.5-6.2.3.5">This call only returns (threaded model) or triggers (event loop) after an
             incoming negotiation request. When this occurs,
             'requested_objective' contains the first value requested by
             the negotiation peer. The contents of this instance of the objective
              must be used in the subsequent negotiation call because
              it contains the loop count sent by the negotiation peer. The 'session_handle' must be
             presented in all subsequent negotiation steps. </li>
                <li>This
                <li pn="section-2.3.5-6.2.3.6">This function must be followed by calls to 'negotiate_step' and/or 'negotiate_wait'
             and/or 'end_negotiate' until the negotiation ends.</li>
                <li>If
                <li pn="section-2.3.5-6.2.3.7">If an ASA is capable of handling multiple negotiations simultaneously, it may
             call 'listen_negotiate' simultaneously from multiple threads, or insert multiple events.
             The API and GRASP implementation
             must support re-entrant use of the listening state and the negotiation calls. Simultaneous
             sessions will be distinguished by the threads or events themselves,
             the GRASP session handles, and the underlying unicast transport sockets.</li>
              </ul>
            </li>
            <li>
              <t>stop_listen_negotiate()</t>
              <t>This
            <li pn="section-2.3.5-6.3">
              <t indent="0" pn="section-2.3.5-6.3.1">stop_listen_negotiate()</t>
              <t indent="0" pn="section-2.3.5-6.3.2">This function is used by an ASA to stop acting as a responder (listener) for a given GRASP objective.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.5-6.3.3">
                <li pn="section-2.3.5-6.3.3.1">
                  <t indent="0" pn="section-2.3.5-6.3.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.3.3.1.2">
                    <li pn="section-2.3.5-6.3.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.5-6.3.3.1.2.2">objective (structure)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.5-6.3.3.2">
                  <t indent="0" pn="section-2.3.5-6.3.3.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.3.3.2.2">
                    <li pn="section-2.3.5-6.3.3.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>Instructs
                <li pn="section-2.3.5-6.3.3.3">Instructs GRASP to stop listening for negotiation
		requests for the given objective, i.e., cancels 'listen_negotiate'.</li>
                <li><t>Asynchronous Mechanisms:</t><ul>
                <li>Threaded implementation: Must
                <li pn="section-2.3.5-6.3.3.4">
                  <t indent="0" pn="section-2.3.5-6.3.3.4.1">Asynchronous Mechanisms:</t>
                  <dl indent="3" newline="false" spacing="normal" pn="section-2.3.5-6.3.3.4.2">
                    <dt pn="section-2.3.5-6.3.3.4.2.1">Threaded implementation:</dt>
                    <dd pn="section-2.3.5-6.3.3.4.2.2">Must be called
             from a different thread than 'listen_negotiate'. </li>
                <li>Event </dd>
                    <dt pn="section-2.3.5-6.3.3.4.2.3">Event loop implementation: no implementation:</dt>
                    <dd pn="section-2.3.5-6.3.3.4.2.4">No special considerations.</li></ul></li> considerations.</dd>
                  </dl>
                </li>
              </ul>
            </li>
            <li>
              <t>negotiate_step()</t>
              <t>This
            <li pn="section-2.3.5-6.4">
              <t indent="0" pn="section-2.3.5-6.4.1">negotiate_step()</t>
              <t indent="0" pn="section-2.3.5-6.4.2">This function is used by either ASA in a negotiation session to make the next step in negotiation.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.5-6.4.3">
                <li pn="section-2.3.5-6.4.3.1">
                  <t indent="0" pn="section-2.3.5-6.4.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>session_handle (structure)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                    <dt/>
                    <dd>timeout
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.4.3.1.2">
                    <li pn="section-2.3.5-6.4.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.5-6.4.3.1.2.2">session_handle (structure)</li>
                    <li pn="section-2.3.5-6.4.3.1.2.3">objective (structure)</li>
                    <li pn="section-2.3.5-6.4.3.1.2.4">timeout (unsigned integer) as described in <xref target="tout"/></dd>
                  </dl> target="tout" format="default" sectionFormat="of" derivedContent="Section 2.3.2.3"/></li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.5-6.4.3.2">
                  <t indent="0" pn="section-2.3.5-6.4.3.2.1">Return values:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>Exactly
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.4.3.2.2">
                    <li pn="section-2.3.5-6.4.3.2.2.1">Exactly as for 'request_negotiate'</dd>
                  </dl> 'request_negotiate'</li>
                  </ul>
                </li>
                <li>Executes
                <li pn="section-2.3.5-6.4.3.3">Executes the next negotation negotiation step with the peer. The 'objective' parameter
                contains the next value being proffered by the ASA in this step. It must also
                contain the latest 'loop_count' value received from request_negotiate()
                or negotiate_step().</li>
                <li><t>Asynchronous Mechanisms:</t><ul>
                <li>Threaded implementation: Usually
                <li pn="section-2.3.5-6.4.3.4">
                  <t indent="0" pn="section-2.3.5-6.4.3.4.1">Asynchronous Mechanisms:</t>
                  <dl indent="3" newline="false" spacing="normal" pn="section-2.3.5-6.4.3.4.2">
                    <dt pn="section-2.3.5-6.4.3.4.2.1">Threaded implementation:</dt>
                    <dd pn="section-2.3.5-6.4.3.4.2.2">Usually called in the same thread as the
                preceding 'request_negotiate' or 'listen_negotiate',
                with the same value of 'session_handle'.</li>
                <li>Event 'session_handle'.</dd>
                    <dt pn="section-2.3.5-6.4.3.4.2.3">Event loop implementation: Must implementation:</dt>
                    <dd pn="section-2.3.5-6.4.3.4.2.4">Must use the same value of 'session_handle' returned by the
             preceding 'request_negotiate' or 'listen_negotiate'.</li></ul></li> 'listen_negotiate'.</dd>
                  </dl>
                </li>
              </ul>
            </li>
            <li>
              <t>negotiate_wait()</t>
              <t>This
            <li pn="section-2.3.5-6.5">
              <t indent="0" pn="section-2.3.5-6.5.1">negotiate_wait()</t>
              <t indent="0" pn="section-2.3.5-6.5.2">This function is used by either ASA in a negotiation session to delay the next step in negotiation.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.5-6.5.3">
                <li pn="section-2.3.5-6.5.3.1">
                  <t indent="0" pn="section-2.3.5-6.5.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>session_handle (structure)</dd>
                    <dt/>
                    <dd>timeout
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.5.3.1.2">
                    <li pn="section-2.3.5-6.5.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.5-6.5.3.1.2.2">session_handle (structure)</li>
                    <li pn="section-2.3.5-6.5.3.1.2.3">timeout (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.5-6.5.3.2">
                  <t indent="0" pn="section-2.3.5-6.5.3.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.5.3.2.2">
                    <li pn="section-2.3.5-6.5.3.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>Requests
                <li pn="section-2.3.5-6.5.3.3">Requests the remote peer to delay the negotiation session by 'timeout' milliseconds,
                thereby extending the original timeout. This
                function simply triggers a GRASP Confirm Waiting message (see <xref target="I-D.ietf-anima-grasp"/> target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>
                for details).</li>
                <li><t>Asynchronous Mechanisms:</t><ul>
                <li>Threaded implementation: Called
                <li pn="section-2.3.5-6.5.3.4">
                  <t indent="0" pn="section-2.3.5-6.5.3.4.1">Asynchronous Mechanisms:</t>
                  <dl indent="3" newline="false" spacing="normal" pn="section-2.3.5-6.5.3.4.2">
                    <dt pn="section-2.3.5-6.5.3.4.2.1">Threaded implementation:</dt>
                    <dd pn="section-2.3.5-6.5.3.4.2.2">Called in the same thread as the preceding
                'request_negotiate' or 'listen_negotiate', with the same value of 'session_handle'.</li>
                <li>Event 'session_handle'.</dd>
                    <dt pn="section-2.3.5-6.5.3.4.2.3">Event loop implementation: Must implementation:</dt>
                    <dd pn="section-2.3.5-6.5.3.4.2.4">Must use the same value of 'session_handle' returned by the
             preceding 'request_negotiate' or 'listen_negotiate'.</li></ul></li> 'listen_negotiate'.</dd>
                  </dl>
                </li>
              </ul>
            </li>
            <li>
              <t>end_negotiate()</t>
              <t>This
            <li pn="section-2.3.5-6.6">
              <t indent="0" pn="section-2.3.5-6.6.1">end_negotiate()</t>
              <t indent="0" pn="section-2.3.5-6.6.2">This function is used by either ASA in a negotiation session to end a negotiation.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.5-6.6.3">
                <li pn="section-2.3.5-6.6.3.1">
                  <t indent="0" pn="section-2.3.5-6.6.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>session_handle (structure)</dd>
                    <dt/>
                    <dd>result (Boolean)</dd>
                    <dt/>
                    <dd>reason
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.6.3.1.2">
                    <li pn="section-2.3.5-6.6.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.5-6.6.3.1.2.2">session_handle (structure)</li>
                    <li pn="section-2.3.5-6.6.3.1.2.3">result (Boolean)</li>
                    <li pn="section-2.3.5-6.6.3.1.2.4">reason (UTF-8 string)</dd>
                  </dl> string)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.5-6.6.3.2">
                  <t indent="0" pn="section-2.3.5-6.6.3.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.5-6.6.3.2.2">
                    <li pn="section-2.3.5-6.6.3.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>
                  <t>End
                <li pn="section-2.3.5-6.6.3.3">
                  <t indent="0" pn="section-2.3.5-6.6.3.3.1">End the negotiation session. session:
                  </t>
                  <t>
                  <t indent="0" pn="section-2.3.5-6.6.3.3.2">
             'result' = True for accept (successful negotiation), and False for decline (failed negotiation).
                  </t>
                  <t>
                  <t indent="0" pn="section-2.3.5-6.6.3.3.3">
             'reason' = string describing reason for decline (may be null; ignored if accept).</t>
                </li>
                <li><t>Asynchronous Mechanisms:</t><ul>
                <li>Threaded implementation: Called
                <li pn="section-2.3.5-6.6.3.4">
                  <t indent="0" pn="section-2.3.5-6.6.3.4.1">Asynchronous Mechanisms:</t>
                  <dl indent="3" newline="false" spacing="normal" pn="section-2.3.5-6.6.3.4.2">
                    <dt pn="section-2.3.5-6.6.3.4.2.1">Threaded implementation:</dt>
                    <dd pn="section-2.3.5-6.6.3.4.2.2">Called in the same thread as the preceding 'request_negotiate' or 'listen_negotiate',
             with the same value of 'session_handle'.</li>
                <li>Event 'session_handle'.</dd>
                    <dt pn="section-2.3.5-6.6.3.4.2.3">Event loop implementation: Must implementation:</dt>
                    <dd pn="section-2.3.5-6.6.3.4.2.4">Must use the same value of 'session_handle' returned by the
             preceding 'request_negotiate' or 'listen_negotiate'.</li></ul></li> 'listen_negotiate'.</dd>
                  </dl>
                </li>
              </ul>
            </li>
          </ul>
        </section>
        <!-- End of negotiation functions -->
        <section numbered="true" toc="default">
          <name>Synchronization toc="include" removeInRFC="false" pn="section-2.3.6">
          <name slugifiedName="name-synchronization-and-floodin">Synchronization and Flooding</name>
          <ul spacing="normal">
            <li>
              <t>synchronize()</t>
              <t>This spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.6-1">
            <li pn="section-2.3.6-1.1">
              <t indent="0" pn="section-2.3.6-1.1.1">synchronize()</t>
              <t indent="0" pn="section-2.3.6-1.1.2">This function is used by any ASA to cause synchronization of a GRASP objective as a requester (client).</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.6-1.1.3">
                <li pn="section-2.3.6-1.1.3.1">
                  <t indent="0" pn="section-2.3.6-1.1.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                    <dt/>
                    <dd>peer (ASA_locator)</dd>
                    <dt/>
                    <dd>timeout
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.1.3.1.2">
                    <li pn="section-2.3.6-1.1.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.6-1.1.3.1.2.2">objective (structure)</li>
                    <li pn="section-2.3.6-1.1.3.1.2.3">peer (asa_locator)</li>
                    <li pn="section-2.3.6-1.1.3.1.2.4">timeout (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.6-1.1.3.2">
                  <t indent="0" pn="section-2.3.6-1.1.3.2.1">Return values:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode (unsigned integer)</dd>
                    <dt/>
                    <dd>result
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.1.3.2.2">
                    <li pn="section-2.3.6-1.1.3.2.2.1">errorcode (unsigned integer)</li>
                    <li pn="section-2.3.6-1.1.3.2.2.2">result (structure) (undefined unless successful)</dd>
                  </dl> successful)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.6-1.1.3.3">This call requests the synchronized value of the given 'objective'.</li>
                <!-- <li>Since this is essentially a read operation, any ASA can do it, unless
                an authorization model is added to GRASP in future. Therefore
                the API checks that the ASA is registered,  but the objective does not need to
                be registered by the calling ASA.</li> -->
                <li>If
                <li pn="section-2.3.6-1.1.3.4">If the 'peer' parameter is null, and the objective is already
                available in the local cache, the flooded objective is returned immediately
                in the 'result' parameter. In this case, the 'timeout' is ignored.</li>
                <li>
                <li pn="section-2.3.6-1.1.3.5"> If the 'peer' parameter is not null, or a cached value
                is not available, synchronization with a discovered ASA is performed.
                If successful, the retrieved objective is returned
                in the 'result' value.</li>
                <li>The
                <li pn="section-2.3.6-1.1.3.6">The 'peer' parameter is an 'ASA_locator' 'asa_locator' as returned by discover().
                If 'peer' is null, GRASP discovery is automatically performed first to find
                a suitable peer (i.e., any node that supports the objective in question).</li>
                <li>The
                <li pn="section-2.3.6-1.1.3.7">The 'timeout' parameter is described in <xref target="tout"/>.</li>
                <li>This target="tout" format="default" sectionFormat="of" derivedContent="Section 2.3.2.3"/>.</li>
                <li pn="section-2.3.6-1.1.3.8">This call should be repeated whenever the latest value is needed.</li>
                <li><t>Asynchronous Mechanisms:</t><ul>
                <li>Threaded implementation: Call
                <li pn="section-2.3.6-1.1.3.9">
                  <t indent="0" pn="section-2.3.6-1.1.3.9.1">Asynchronous Mechanisms:</t>
                  <dl indent="3" newline="false" spacing="normal" pn="section-2.3.6-1.1.3.9.2">
                    <dt pn="section-2.3.6-1.1.3.9.2.1">Threaded implementation:</dt>
                    <dd pn="section-2.3.6-1.1.3.9.2.2">Call in a separate thread if asynchronous operation is required.</li>
                <li>Event required.</dd>
                    <dt pn="section-2.3.6-1.1.3.9.2.3">Event loop implementation: An implementation:</dt>
                    <dd pn="section-2.3.6-1.1.3.9.2.4">An additional in/out 'session_handle' parameter is used,
                as in request_negotiate(). If the 'errorcode' parameter has the value 2 ('noReply'),
                no response has been received so far. The 'session_handle' parameter must be presented
                in subsequent calls.</li></ul></li>
                <!-- <li>Since this is essentially a read operation, any ASA can use
             it. Therefore GRASP checks that the calling ASA is registered but the
             objective does not need to be registered by the calling ASA.</li> -->
                <li>In calls.</dd>
                  </dl>
                </li>
                <li pn="section-2.3.6-1.1.3.10">In the case of failure, an exponential backoff is recommended before
                retrying (<xref target="security"/>).</li> target="security" format="default" sectionFormat="of" derivedContent="Section 3"/>).</li>
              </ul>
            </li>
            <li>
              <t>listen_synchronize()</t>
              <t>This
            <li pn="section-2.3.6-1.2">
              <t indent="0" pn="section-2.3.6-1.2.1">listen_synchronize()</t>
              <t indent="0" pn="section-2.3.6-1.2.2">This function is used by an ASA to start acting as a synchronization responder (listener)
              for a given GRASP objective.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.6-1.2.3">
                <li pn="section-2.3.6-1.2.3.1">
                  <t indent="0" pn="section-2.3.6-1.2.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.2.3.1.2">
                    <li pn="section-2.3.6-1.2.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.6-1.2.3.1.2.2">objective (structure)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.6-1.2.3.2">
                  <t indent="0" pn="section-2.3.6-1.2.3.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.2.3.2.2">
                    <li pn="section-2.3.6-1.2.3.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.6-1.2.3.3">This instructs GRASP to listen for synchronization
             requests for the given objective, objective and to
             respond with the value given in the 'objective' parameter.
             It also enables discovery responses for the objective,
             as mentioned under register_objective() in <xref target="regi"/>.</li>
                <li>This target="regi" format="default" sectionFormat="of" derivedContent="Section 2.3.3"/>.</li>
                <li pn="section-2.3.6-1.2.3.4">This call is non-blocking and may be repeated whenever the value changes.</li>
              </ul>
            </li>
            <li>
              <t>stop_listen_synchronize()</t>
              <t>This
            <li pn="section-2.3.6-1.3">
              <t indent="0" pn="section-2.3.6-1.3.1">stop_listen_synchronize()</t>
              <t indent="0" pn="section-2.3.6-1.3.2">This function is used by an ASA to stop acting as a synchronization responder (listener)
              for a given GRASP objective.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.6-1.3.3">
                <li pn="section-2.3.6-1.3.3.1">
                  <t indent="0" pn="section-2.3.6-1.3.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.3.3.1.2">
                    <li pn="section-2.3.6-1.3.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.6-1.3.3.1.2.2">objective (structure)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.6-1.3.3.2">
                  <t indent="0" pn="section-2.3.6-1.3.3.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.3.3.2.2">
                    <li pn="section-2.3.6-1.3.3.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.6-1.3.3.3">This call instructs GRASP to stop listening for synchronization
             requests for the given 'objective', i.e. i.e., it cancels a previous listen_synchronize.</li>
              </ul>
            </li>
            <li>
              <t>flood()</t>
              <t>This
            <li pn="section-2.3.6-1.4">
              <t indent="0" pn="section-2.3.6-1.4.1">flood()</t>
              <t indent="0" pn="section-2.3.6-1.4.2">This function is used by an ASA to flood one or more GRASP objectives
              throughout the autonomic network.</t>
              <t>Note Autonomic Network.</t>
              <t indent="0" pn="section-2.3.6-1.4.3">Note that each GRASP node caches all flooded objectives that it receives, until
              each one's time-to-live time to live expires. Cached objectives are tagged with their origin
              as well as an expiry time, so multiple
              copies of the same objective may be cached simultaneously. Further details
              are given in the section 'Flood "Flood Synchronization Message' of
              <xref target="I-D.ietf-anima-grasp"/></t> Message" (<xref target="RFC8990" section="2.8.11" sectionFormat="of" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8990#section-2.8.11" derivedContent="RFC8990"/>).</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.6-1.4.4">
                <li pn="section-2.3.6-1.4.4.1">
                  <t indent="0" pn="section-2.3.6-1.4.4.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>ttl (unsigned integer)</dd>
                    <dt/>
                    <dd>tagged_objective_list (structure)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.4.4.1.2">
                    <li pn="section-2.3.6-1.4.4.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.6-1.4.4.1.2.2">ttl (unsigned integer)</li>
                    <li pn="section-2.3.6-1.4.4.1.2.3">tagged_objective_list (structure)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.6-1.4.4.2">
                  <t indent="0" pn="section-2.3.6-1.4.4.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.4.4.2.2">
                    <li pn="section-2.3.6-1.4.4.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.6-1.4.4.3">This call instructs GRASP to flood the given synchronization
             objective(s) and their value(s) and associated locator(s) to all GRASP nodes.</li>
                <li>The
                <li pn="section-2.3.6-1.4.4.4">The 'ttl' parameter is the valid lifetime (time to live) of
             the flooded data in milliseconds (0 = infinity)</li>
                <li>The infinity).</li>
                <li pn="section-2.3.6-1.4.4.5">The 'tagged_objective_list' parameter is a list of one or more 'tagged_objective'
             couplets.
             The 'locator' parameter that tags each objective is normally null but may
             be a valid 'ASA_locator'. 'asa_locator'.
             Infrastructure ASAs needing to flood an {address, protocol, port} 3-tuple
             with an objective create an ASA_locator asa_locator object to do so. If the IP address
             in that locator is the unspecified address
             ('::')
             ('::'), it is replaced by the link-local address of the sending node in each
             copy of the flood multicast, which will be forced to have a loop count of 1.
             This feature is for objectives that must be restricted to the local link.
             </li>
                <li>The
                <li pn="section-2.3.6-1.4.4.6">The function checks that the ASA registered each objective.</li>
                <li>This
                <li pn="section-2.3.6-1.4.4.7">This call may be repeated whenever any value changes.</li>
              </ul>
            </li>
            <li>
              <t>get_flood()</t>
              <t>This
            <li pn="section-2.3.6-1.5">
              <t indent="0" pn="section-2.3.6-1.5.1">get_flood()</t>
              <t indent="0" pn="section-2.3.6-1.5.2">This function is used by any ASA to obtain the current value of a flooded GRASP objective.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.6-1.5.3">
                <li pn="section-2.3.6-1.5.3.1">
                  <t indent="0" pn="section-2.3.6-1.5.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>objective (structure)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.5.3.1.2">
                    <li pn="section-2.3.6-1.5.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.6-1.5.3.1.2.2">objective (structure)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.6-1.5.3.2">
                  <t indent="0" pn="section-2.3.6-1.5.3.2.1">Return values:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode (unsigned integer)</dd>
                    <dt/>
                    <dd>tagged_objective_list
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.5.3.2.2">
                    <li pn="section-2.3.6-1.5.3.2.2.1">errorcode (unsigned integer)</li>
                    <li pn="section-2.3.6-1.5.3.2.2.2">tagged_objective_list (structure) (undefined unless successful)</dd>
                  </dl> successful)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.6-1.5.3.3">This call instructs GRASP to return the given synchronization
             objective if it has been flooded and its lifetime has not expired. </li>
                <!-- <li>Since this is essentially a read operation, any ASA can do
             it. Therefore the API checks that the ASA is registered but the
             objective does not need to be registered by the calling ASA.</li> -->
                <li>The
                <li pn="section-2.3.6-1.5.3.4">The 'tagged_objective_list' parameter is a list of 'tagged_objective'
             couplets, each one being a copy of the flooded objective and a coresponding corresponding locator.
             Thus
             Thus, if the same objective has been flooded by multiple ASAs, the recipient can distinguish
             the copies.</li>
                <li>Note
                <li pn="section-2.3.6-1.5.3.5">Note that this call is for advanced ASAs. In a simple case, an ASA can simply call
             synchronize() in order to get a valid flooded objective.</li>
              </ul>
            </li>
            <li>
              <t>expire_flood()</t>
              <t>This
            <li pn="section-2.3.6-1.6">
              <t indent="0" pn="section-2.3.6-1.6.1">expire_flood()</t>
              <t indent="0" pn="section-2.3.6-1.6.2">This function may be used by an ASA to expire specific entries in the local GRASP flood cache.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.6-1.6.3">
                <li pn="section-2.3.6-1.6.3.1">
                  <t indent="0" pn="section-2.3.6-1.6.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>tagged_objective (structure)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.6.3.1.2">
                    <li pn="section-2.3.6-1.6.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.6-1.6.3.1.2.2">tagged_objective (structure)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.6-1.6.3.2">
                  <t indent="0" pn="section-2.3.6-1.6.3.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.6-1.6.3.2.2">
                    <li pn="section-2.3.6-1.6.3.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>This
                <li pn="section-2.3.6-1.6.3.3">This is a call that can only be used after a preceding
             call to get_flood() by an ASA that is capable of deciding
             that the flooded value is stale or invalid. Use with care.</li>
                <li>The
                <li pn="section-2.3.6-1.6.3.4">The 'tagged_objective' parameter is the one to be expired.</li>
              </ul>
            </li>
          </ul>
        </section>
        <!-- End of synchronization functions -->
        <section numbered="true" toc="default">
          <name>Invalid toc="include" removeInRFC="false" pn="section-2.3.7">
          <name slugifiedName="name-invalid-message-function">Invalid Message Function</name>
          <ul spacing="normal">
            <li>
              <t>send_invalid()</t>
              <t>This spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.7-1">
            <li pn="section-2.3.7-1.1">
              <t indent="0" pn="section-2.3.7-1.1.1">send_invalid()</t>
              <t indent="0" pn="section-2.3.7-1.1.2">This function may be used by any ASA to stop an ongoing GRASP session.</t>
              <ul spacing="normal">
                <li>
                  <t>Input spacing="normal" bare="false" empty="false" indent="3" pn="section-2.3.7-1.1.3">
                <li pn="section-2.3.7-1.1.3.1">
                  <t indent="0" pn="section-2.3.7-1.1.3.1.1">Input parameters:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>asa_handle (unsigned integer)</dd>
                    <dt/>
                    <dd>session_handle (structure)</dd>
                    <dt/>
                    <dd>info (bytes)</dd>
                  </dl>
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.7-1.1.3.1.2">
                    <li pn="section-2.3.7-1.1.3.1.2.1">asa_handle (unsigned integer)</li>
                    <li pn="section-2.3.7-1.1.3.1.2.2">session_handle (structure)</li>
                    <li pn="section-2.3.7-1.1.3.1.2.3">info (bytes)</li>
                  </ul>
                </li>
                <li>
                  <t>Return
                <li pn="section-2.3.7-1.1.3.2">
                  <t indent="0" pn="section-2.3.7-1.1.3.2.1">Return value:</t>
                  <dl newline="false" spacing="normal">
                    <dt/>
                    <dd>errorcode
                  <ul empty="true" bare="false" indent="3" spacing="normal" pn="section-2.3.7-1.1.3.2.2">
                    <li pn="section-2.3.7-1.1.3.2.2.1">errorcode (unsigned integer)</dd>
                  </dl> integer)</li>
                  </ul>
                </li>
                <li>
                  <t>Sends
                <li pn="section-2.3.7-1.1.3.3">
                  <t indent="0" pn="section-2.3.7-1.1.3.3.1">Sends a GRASP Invalid Message (M_INVALID) message, message (M_INVALID), as described in
             <xref target="I-D.ietf-anima-grasp"/>. Should target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>. It should not be used if end_negotiate() would be sufficient.
             Note that this message may be used in response to any unicast GRASP message that the receiver
             cannot interpret correctly. In most cases cases, this message will be generated internally by a
             GRASP implementation.
                  </t>
                  <t>
                  <t indent="0" pn="section-2.3.7-1.1.3.3.2">
             'info' = optional diagnostic data supplied by the ASA. May It may be raw bytes from the invalid message.</t>
                </li>
              </ul>
            </li>
          </ul>
        </section>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>Implementation Status [RFC Editor: please remove]</name>
      <t>A prototype open source Python implementation of GRASP, including
    an API similar to this document, has been used
    to verify the concepts for the threaded model. It may be found at
    <eref target="https://github.com/becarpenter/graspy"/>
    with associated documentation and demonstration ASAs.
      </t>
    </section>
    <!---->

    <section anchor="security" numbered="true" toc="default">
      <name>Security toc="include" removeInRFC="false" pn="section-3">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t>Security
      <t indent="0" pn="section-3-1">Security considerations for the GRASP protocol are discussed in <xref target="I-D.ietf-anima-grasp"/>. target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>.
      These include denial of service denial-of-service issues, even though these are considered a low risk in the ACP. In various
      places
      places, GRASP recommends an exponential backoff. An ASA using the API should use exponential backoff
      after failed discover(), req_negotiate() req_negotiate(), or synchronize() operations. The timescale for such backoffs
      depends on the semantics of the GRASP objective concerned. Additionally, a flood() operation should
      not be repeated at shorter intervals than is useful. The appropriate interval depends on the semantics
      of the GRASP objective concerned. These precautions are intended to assist the detection of
      denial of service
      denial-of-service attacks.</t>

      <t>As
      <t indent="0" pn="section-3-2">As a general precaution, all ASAs able to handle multiple negotiation or synchronization requests
      in parallel may protect themselves against a denial of service denial-of-service attack by limiting the number
      of requests they handle simultaneously and silently discarding excess requests. It might also
      be useful for the GRASP core to limit the number of objectives registered by a given ASA, the
      total number of ASAs registered, and the total number of simultaneous sessions,
      to protect system resources. During times of high autonomic activity, such as recovery
      from widespread faults, ASAs may experience many GRASP session failures. Guidance on
      making ASAs suitably robust is given in <xref target="I-D.ietf-anima-asa-guidelines"/>.</t>

      <t>As target="I-D.ietf-anima-asa-guidelines" format="default" sectionFormat="of" derivedContent="ASA-GUIDE"/>.</t>
      <t indent="0" pn="section-3-3">As noted earlier, the trust model is that all ASAs in a given autonomic network Autonomic Network communicate via a secure
      autonomic control plane and therefore plane; therefore, they trust each other's messages.
      Specific authorization of ASAs to use particular GRASP objectives is a subject for future study, also briefly
      discussed in <xref target="I-D.ietf-anima-grasp"/>.</t>

      <t>The target="RFC8990" format="default" sectionFormat="of" derivedContent="RFC8990"/>.</t>
      <t indent="0" pn="section-3-4">The careful reader will observe that a malicious ASA could extend a negotiation session
      indefinitely by use of the negotiate_wait() function or by manipulating the loop count
      of an objective. A robustly implemented ASA could detect such behavior by a peer
      and break off negotiation.</t>

      <t>The
      <t indent="0" pn="section-3-5">The 'asa_handle' is used in the API as a first line of defence defense against a malware process attempting
      to imitate a legitimately registered ASA. The 'session_handle' is used in the API as a first line
      of defence defense against a malware process attempting to hijack a GRASP session. Both these handles
      are likely to be created using GRASP's 32-bit pseudo-random session pseudorandom Session ID. By construction, GRASP avoids
      the risk of session Session ID collisions (see the section 'Session Identifier' of <xref target="I-D.ietf-anima-grasp"/>). "Session Identifier (Session ID)", <xref target="RFC8990" section="2.7" sectionFormat="of" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8990#section-2.7" derivedContent="RFC8990"/>).
      There remains a finite probability that an attacker could guess a session Session ID, session_handle, or asa_handle.
      However, this would only be of value to an attacker that had already penetrated the ACP, which would
      allow many other simpler forms of attack than hijacking GRASP sessions.</t>
    </section>
    <section anchor="iana" numbered="true" toc="default">
      <name>IANA toc="include" removeInRFC="false" pn="section-4">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t>This
      <t indent="0" pn="section-4-1">This document makes has no request of the IANA.</t>
      <!-- <t>Open question: Do we need an IANA registry for the error codes?</t> -->
    </section>
    <section anchor="ack" numbered="true" toc="default">
      <name>Acknowledgements</name>
      <t>Excellent suggestions were made by
      Ignas Bagdonas,
      Carsten Bormann,
      Laurent Ciavaglia,
      Roman Danyliw,
      Toerless Eckert,
      Benjamin Kaduk
      Erik Kline,
      Murray Kucherawy,
      Paul Kyzivat,
      Guangpeng Li,
      Michael Richardson,
      Joseph Salowey,
      Eric Vyncke,
      Magnus Westerlund,
      Rob Wilton,
      and other participants in the ANIMA WG and the IESG.</t> actions.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8610.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8949.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-anima-grasp.xml"/>
      </references>
      <references>
        <name>Informative
    <displayreference target="I-D.ietf-anima-grasp-distribution" to="GRASP-DISTRIB"/>
    <displayreference target="I-D.ciavaglia-anima-coordination" to="ANIMA-COORD"/>
    <displayreference target="I-D.ietf-anima-asa-guidelines" to="ASA-GUIDE"/>
    <references pn="section-5">
      <name slugifiedName="name-references">References</name>
      <references pn="section-5.1">
        <name slugifiedName="name-normative-references">Normative References</name>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-anima-reference-model.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-anima-grasp-distribution.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-anima-autonomic-control-plane.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-anima-bootstrapping-keyinfra.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ciavaglia-anima-coordination.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-anima-asa-guidelines.xml"/>
        <reference anchor="libcbor" target="https://libcbor.readthedocs.io/"> anchor="RFC8610" target="https://www.rfc-editor.org/info/rfc8610" quoteTitle="true" derivedAnchor="RFC8610">
          <front>
            <title>libcbor - Documentation</title>
            <title>Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures</title>
            <author fullname="Pavel Kalvoda"/> initials="H." surname="Birkholz" fullname="H. Birkholz">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="C." surname="Vigano" fullname="C. Vigano">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="C." surname="Bormann" fullname="C. Bormann">
              <organization showOnFrontPage="true"/>
            </author>
            <date month="December" year="2020"/> year="2019" month="June"/>
            <abstract>
              <t indent="0">This document proposes a notational convention to express Concise Binary Object Representation (CBOR) data structures (RFC 7049).  Its main goal is to provide an easy and unambiguous way to express structures for protocol messages and data formats that use CBOR or JSON.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8610"/>
          <seriesInfo name="DOI" value="10.17487/RFC8610"/>
        </reference>
      </references>
    </references>
    <section anchor="ErrAppx" numbered="true" toc="default">
      <name>Error Codes</name>
      <t>This Appendix lists the error codes defined so far on
        <reference anchor="RFC8949" target="https://www.rfc-editor.org/info/rfc8949" quoteTitle="true" derivedAnchor="RFC8949">
          <front>
            <title>Concise Binary Object Representation (CBOR)</title>
            <author initials="C." surname="Bormann" fullname="C. Bormann">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Hoffman" fullname="P. Hoffman">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2020" month="December"/>
            <abstract>
              <t indent="0">The Concise Binary Object Representation (CBOR) is a data format whose design goals include the basis possibility of
      implementation experience, with suggested symbolic names extremely small code size, fairly small message size, and corresponding descriptive strings in English. It is expected that complete API
      implementations will provide extensibility without the need for localisation of these descriptive strings, version negotiation. These design goals make it different from earlier binary serializations such as ASN.1 and that additional error codes will be needed according to implementation details.</t>
      <t>The error codes that may only be returned by one or two functions
      are annotated accordingly, MessagePack.</t>
              <t indent="0">This document obsoletes RFC 7049, providing editorial improvements, new details, and errata fixes while keeping full compatibility with the others may be returned interchange format of RFC 7049.  It does not create a new version of the format.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="94"/>
          <seriesInfo name="RFC" value="8949"/>
          <seriesInfo name="DOI" value="10.17487/RFC8949"/>
        </reference>
        <reference anchor="RFC8990" target="https://www.rfc-editor.org/info/rfc8990" quoteTitle="true" derivedAnchor="RFC8990">
          <front>
            <title>GeneRic Autonomic Signaling Protocol (GRASP)</title>
            <author initials="C" surname="Bormann" fullname="Carsten Bormann">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="B" surname="Carpenter" fullname="Brian Carpenter" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="B" surname="Liu" fullname="Bing Liu" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date month="May" year="2021"/>
          </front>
          <seriesInfo name="RFC" value="8990"/>
          <seriesInfo name="DOI" value="10.17487/RFC8990"/>
        </reference>
      </references>
      <references pn="section-5.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="I-D.ciavaglia-anima-coordination" quoteTitle="true" target="https://tools.ietf.org/html/draft-ciavaglia-anima-coordination-01" derivedAnchor="ANIMA-COORD">
          <front>
            <title>Autonomic Functions Coordination</title>
            <author fullname="Laurent Ciavaglia">
	 </author>
            <author fullname="Pierre Peloso">
	 </author>
            <date month="March" day="21" year="2016"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ciavaglia-anima-coordination-01"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="I-D.ietf-anima-asa-guidelines" quoteTitle="true" target="https://tools.ietf.org/html/draft-ietf-anima-asa-guidelines-00" derivedAnchor="ASA-GUIDE">
          <front>
            <title>Guidelines for Autonomic Service Agents</title>
            <author fullname="Brian Carpenter">
	 </author>
            <author fullname="Laurent Ciavaglia">
              <organization showOnFrontPage="true">Nokia</organization>
            </author>
            <author fullname="Sheng Jiang">
              <organization showOnFrontPage="true">Huawei Technologies Co., Ltd</organization>
            </author>
            <author fullname="Pierre Peloso">
              <organization showOnFrontPage="true">Nokia</organization>
            </author>
            <date month="November" day="14" year="2020"/>
            <abstract>
              <t indent="0">   This document proposes guidelines for the design of Autonomic Service
   Agents for autonomic networks, as a contribution to describing an
   autonomic ecosystem.  It is based on the Autonomic Network
   Infrastructure outlined in the ANIMA reference model, using the
   Autonomic Control Plane and the Generic Autonomic Signaling Protocol.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-anima-asa-guidelines-00"/>
          <format type="TXT" target="https://www.ietf.org/archive/id/draft-ietf-anima-asa-guidelines-00.txt"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="I-D.ietf-anima-grasp-distribution" quoteTitle="true" target="https://tools.ietf.org/html/draft-ietf-anima-grasp-distribution-02" derivedAnchor="GRASP-DISTRIB">
          <front>
            <title>Information Distribution over GRASP</title>
            <author fullname="Bing Liu">
              <organization showOnFrontPage="true">Huawei Technologies</organization>
            </author>
            <author fullname="Xun Xiao">
              <organization showOnFrontPage="true">MRC, Huawei Technologies</organization>
            </author>
            <author fullname="Artur Hecker">
              <organization showOnFrontPage="true">MRC, Huawei Technologies</organization>
            </author>
            <author fullname="Sheng Jiang">
              <organization showOnFrontPage="true">Huawei Technologies</organization>
            </author>
            <author fullname="Zoran Despotovic">
              <organization showOnFrontPage="true">MRC, Huawei Technologies</organization>
            </author>
            <author fullname="Brian Carpenter">
              <organization showOnFrontPage="true">School of Computer Science, University of Auckland</organization>
            </author>
            <date month="March" day="8" year="2021"/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-anima-grasp-distribution-02"/>
          <refcontent>Work in Progress</refcontent>
        </reference>
        <reference anchor="libcbor" target="https://libcbor.readthedocs.io/" quoteTitle="true" derivedAnchor="libcbor">
          <front>
            <title>libcbor - libcbor 0.8.0 documentation</title>
            <author fullname="Pavel Kalvoda" surname="Kalvoda" initials="P"/>
            <date month="April" year="2021"/>
          </front>
        </reference>
        <reference anchor="RFC8993" target="https://www.rfc-editor.org/info/rfc8993" quoteTitle="true" derivedAnchor="RFC8993">
          <front>
            <title>A Reference Model for Autonomic Networking</title>
            <author initials="M" surname="Behringer" fullname="Michael Behringer" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="B" surname="Carpenter" fullname="Brian Carpenter">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="T" surname="Eckert" fullname="Toerless Eckert">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="L" surname="Ciavaglia" fullname="Laurent Ciavaglia">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J" surname="Nobre" fullname="Jeferson Nobre">
              <organization showOnFrontPage="true"/>
            </author>
            <date month="May" year="2021"/>
          </front>
          <seriesInfo name="RFC" value="8993"/>
          <seriesInfo name="DOI" value="10.17487/RFC8993"/>
        </reference>
        <reference anchor="RFC8994" target="https://www.rfc-editor.org/info/rfc8994" quoteTitle="true" derivedAnchor="RFC8994">
          <front>
            <title>An Autonomic Control Plane (ACP)</title>
            <author initials="T" surname="Eckert" fullname="Toerless Eckert" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M" surname="Behringer" fullname="Michael Behringer" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="S" surname="Bjarnason" fullname="Steinthor Bjarnason">
              <organization showOnFrontPage="true"/>
            </author>
            <date month="May" year="2021"/>
          </front>
          <seriesInfo name="RFC" value="8994"/>
          <seriesInfo name="DOI" value="10.17487/RFC8994"/>
        </reference>
        <reference anchor="RFC8995" target="https://www.rfc-editor.org/info/rfc8995" quoteTitle="true" derivedAnchor="RFC8995">
          <front>
            <title>Bootstrapping Remote Secure Key Infrastructure (BRSKI)</title>
            <author initials="M" surname="Pritikin" fullname="Max Pritikin">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M" surname="Richardson" fullname="Michael Richardson">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="T" surname="Eckert" fullname="Toerless Eckert">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M" surname="Behringer" fullname="Michael Behringer">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K" surname="Watsen" fullname="Kent Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <date month="May" year="2021"/>
          </front>
          <seriesInfo name="RFC" value="8995"/>
          <seriesInfo name="DOI" value="10.17487/RFC8995"/>
        </reference>
      </references>
    </references>
    <section anchor="ErrAppx" numbered="true" toc="include" removeInRFC="false" pn="section-appendix.a">
      <name slugifiedName="name-error-codes">Error Codes</name>
      <t indent="0" pn="section-appendix.a-1">This appendix lists the error codes defined so far on the basis of
      implementation experience, with suggested symbolic names
      and corresponding descriptive strings in English. It is expected that complete API
      implementations will provide for localization of these descriptive strings,
      and that additional error codes will be needed according to implementation details.</t>
      <t indent="0" pn="section-appendix.a-2">The error codes that may only be returned by one or two functions
      are annotated accordingly, and the others may be returned by numerous
      functions. The 'noSecurity'
      error will be returned to most calls if GRASP is running in an insecure mode
      (i.e., with no secure substrate such as the ACP),
      except for the specific DULL usage mode described in the section
      'Discovery
      "Discovery Unsolicited Link-Local' of <xref target="I-D.ietf-anima-grasp"/>.</t>
      <artwork name="" type="" Link-Local (DULL) GRASP" (<xref target="RFC8990" section="2.5.2" sectionFormat="of" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8990#section-2.5.2" derivedContent="RFC8990"/>.</t>
      <table anchor="table1_error_codes" align="center" pn="table-1">
        <name slugifiedName="name-error-codes-2">Error Codes</name>
        <thead>
          <tr>
            <th align="left" alt=""><![CDATA[
ok               0 "OK"
declined         1 "Declined" colspan="1" rowspan="1">Name</th>
            <th align="left" colspan="1" rowspan="1">Error Code</th>
            <th align="left" colspan="1" rowspan="1">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left" colspan="1" rowspan="1">ok</td>
            <td align="left" colspan="1" rowspan="1">0</td>
            <td align="left" colspan="1" rowspan="1">"OK"</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">declined</td>
            <td align="left" colspan="1" rowspan="1">1</td>
            <td align="left" colspan="1" rowspan="1">"Declined" (req_negotiate, negotiate_step)
noReply          2 "No negotiate_step)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noReply</td>
            <td align="left" colspan="1" rowspan="1">2</td>
            <td align="left" colspan="1" rowspan="1">"No reply" (indicates waiting state in event loop calls)
unspec           3 "Unspecified error"
ASAfull          4 "ASA calls)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">unspec</td>
            <td align="left" colspan="1" rowspan="1">3</td>
            <td align="left" colspan="1" rowspan="1">"Unspecified error"</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">ASAfull</td>
            <td align="left" colspan="1" rowspan="1">4</td>
            <td align="left" colspan="1" rowspan="1">"ASA registry full"  (register_asa)
dupASA           5 "Duplicate (register_asa)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">dupASA</td>
            <td align="left" colspan="1" rowspan="1">5</td>
            <td align="left" colspan="1" rowspan="1">"Duplicate ASA name" (register_asa)
noASA            6 "ASA (register_asa)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noASA</td>
            <td align="left" colspan="1" rowspan="1">6</td>
            <td align="left" colspan="1" rowspan="1">"ASA not registered"
notYourASA       7 "ASA registered"</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">notYourASA</td>
            <td align="left" colspan="1" rowspan="1">7</td>
            <td align="left" colspan="1" rowspan="1">"ASA registered but not by you"
                                         (deregister_asa)
notBoth          8 "Objective (deregister_asa)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">notBoth</td>
            <td align="left" colspan="1" rowspan="1">8</td>
            <td align="left" colspan="1" rowspan="1">"Objective cannot support both negotiation
          and synchronization" (register_obj)
notDry           9 "Dry-run (register_obj)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">notDry</td>
            <td align="left" colspan="1" rowspan="1">9</td>
            <td align="left" colspan="1" rowspan="1">"Dry-run allowed only with negotiation"
                                         (register_obj)
notOverlap      10 "Overlap
          (register_obj)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">notOverlap</td>
            <td align="left" colspan="1" rowspan="1">10</td>
            <td align="left" colspan="1" rowspan="1">"Overlap not supported by this implementation"
                                         (register_obj)
objFull         11 "Objective
          (register_obj)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">objFull</td>
            <td align="left" colspan="1" rowspan="1">11</td>
            <td align="left" colspan="1" rowspan="1">"Objective registry full"
                                         (register_obj)
objReg          12 "Objective (register_obj)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">objReg</td>
            <td align="left" colspan="1" rowspan="1">12</td>
            <td align="left" colspan="1" rowspan="1">"Objective already registered"
                                         (register_obj)
notYourObj      13 "Objective (register_obj)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">notYourObj</td>
            <td align="left" colspan="1" rowspan="1">13</td>
            <td align="left" colspan="1" rowspan="1">"Objective not registered by this ASA"
notObj          14 "Objective ASA"</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">notObj</td>
            <td align="left" colspan="1" rowspan="1">14</td>
            <td align="left" colspan="1" rowspan="1">"Objective not found"
notNeg          15 "Objective found"</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">notNeg</td>
            <td align="left" colspan="1" rowspan="1">15</td>
            <td align="left" colspan="1" rowspan="1">"Objective not negotiable" (req_negotiate, listen_negotiate)
noSecurity      16 "No security"
noDiscReply     17 "No listen_negotiate)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noSecurity</td>
            <td align="left" colspan="1" rowspan="1">16</td>
            <td align="left" colspan="1" rowspan="1">"No security"</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noDiscReply</td>
            <td align="left" colspan="1" rowspan="1">17</td>
            <td align="left" colspan="1" rowspan="1">"No reply to discovery"
                              (req_negotiate)
sockErrNegRq    18 "Socket (req_negotiate)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">sockErrNegRq</td>
            <td align="left" colspan="1" rowspan="1">18</td>
            <td align="left" colspan="1" rowspan="1">"Socket error sending negotiation request"
                              (req_negotiate)
noSession       19 "No session"
noSocket        20 "No socket"
loopExhausted   21 "Loop (req_negotiate)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noSession</td>
            <td align="left" colspan="1" rowspan="1">19</td>
            <td align="left" colspan="1" rowspan="1">"No session"</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noSocket</td>
            <td align="left" colspan="1" rowspan="1">20</td>
            <td align="left" colspan="1" rowspan="1">"No socket"</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">loopExhausted</td>
            <td align="left" colspan="1" rowspan="1">21</td>
            <td align="left" colspan="1" rowspan="1">"Loop count exhausted" (negotiate_step)
sockErrNegStep  22 "Socket (negotiate_step)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">sockErrNegStep</td>
            <td align="left" colspan="1" rowspan="1">22</td>
            <td align="left" colspan="1" rowspan="1">"Socket error sending negotiation step"
                                          (negotiate_step)
noPeer          23 (negotiate_step)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noPeer</td>
            <td align="left" colspan="1" rowspan="1">23</td>
            <td align="left" colspan="1" rowspan="1"> "No negotiation peer" (req_negotiate, negotiate_step)
CBORfail        24 "CBOR negotiate_step)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">CBORfail</td>
            <td align="left" colspan="1" rowspan="1">24</td>
            <td align="left" colspan="1" rowspan="1">"CBOR decode failure" (req_negotiate, negotiate_step, synchronize)
invalidNeg      25 "Invalid synchronize)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">invalidNeg</td>
            <td align="left" colspan="1" rowspan="1">25</td>
            <td align="left" colspan="1" rowspan="1">"Invalid Negotiate message" (req_negotiate, negotiate_step)
invalidEnd      26 "Invalid negotiate_step)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">invalidEnd</td>
            <td align="left" colspan="1" rowspan="1">26</td>
            <td align="left" colspan="1" rowspan="1">"Invalid end message" (req_negotiate, negotiate_step)
noNegReply      27 "No negotiate_step)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noNegReply</td>
            <td align="left" colspan="1" rowspan="1">27</td>
            <td align="left" colspan="1" rowspan="1">"No reply to negotiation step" (req_negotiate, negotiate_step)
noValidStep     28 "No negotiate_step)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noValidStep</td>
            <td align="left" colspan="1" rowspan="1">28</td>
            <td align="left" colspan="1" rowspan="1">"No valid reply to negotiation step" (req_negotiate, negotiate_step)
sockErrWait     29 "Socket negotiate_step)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">sockErrWait</td>
            <td align="left" colspan="1" rowspan="1">29</td>
            <td align="left" colspan="1" rowspan="1">"Socket error sending wait message"
                              (negotiate_wait)
sockErrEnd      30 "Socket (negotiate_wait)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">sockErrEnd</td>
            <td align="left" colspan="1" rowspan="1">30</td>
            <td align="left" colspan="1" rowspan="1">"Socket error sending end message" (end_negotiate, send_invalid)
IDclash         31 "Incoming send_invalid)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">IDclash</td>
            <td align="left" colspan="1" rowspan="1">31</td>
            <td align="left" colspan="1" rowspan="1">"Incoming request Session ID clash"
                              (listen_negotiate)
notSynch        32 (listen_negotiate)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">notSynch</td>
            <td align="left" colspan="1" rowspan="1">32</td>
            <td align="left" colspan="1" rowspan="1"> "Not a synchronization objective" (synchronize, get_flood)
notFloodDisc    33 "Not get_flood)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">notFloodDisc</td>
            <td align="left" colspan="1" rowspan="1">33</td>
            <td align="left" colspan="1" rowspan="1">"Not flooded and no reply to discovery"
                              (synchronize)
sockErrSynRq    34 "Socket (synchronize)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">sockErrSynRq</td>
            <td align="left" colspan="1" rowspan="1">34</td>
            <td align="left" colspan="1" rowspan="1">"Socket error sending synch request"
                              (synchronize)
noListener      35 "No (synchronize)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noListener</td>
            <td align="left" colspan="1" rowspan="1">35</td>
            <td align="left" colspan="1" rowspan="1">"No synch listener"
                              (synchronize)
noSynchReply    36 "No (synchronize)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noSynchReply</td>
            <td align="left" colspan="1" rowspan="1">36</td>
            <td align="left" colspan="1" rowspan="1">"No reply to synchronization request"
                              (synchronize)
noValidSynch    37 "No (synchronize)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">noValidSynch</td>
            <td align="left" colspan="1" rowspan="1">37</td>
            <td align="left" colspan="1" rowspan="1">"No valid reply to synchronization request"
                              (synchronize)
invalidLoc      38 "Invalid (synchronize)</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">invalidLoc</td>
            <td align="left" colspan="1" rowspan="1">38</td>
            <td align="left" colspan="1" rowspan="1">"Invalid locator" (flood)
  ]]></artwork>
    </section> (flood)</td>
          </tr>
        </tbody>
      </table>
      <section anchor="changes" numbered="true" toc="default">
      <name>Change log [RFC Editor: Please remove]</name>

      <t>draft-ietf-anima-grasp-api-10, 2021-01:</t>
      <ul>
      <li>Closed two final IESG comments</li>
      </ul>

      <t>draft-ietf-anima-grasp-api-09, 2020-12:</t>
      <ul>
      <li>Added short discussions of CBOR usage and verification.</li>
      <li>Added section on session termination.</li>
      <li>Clarified that integers are uint32 or uint8.</li>
      <li>Minor technical correction to timeout specification.</li>
      <li>Clarified sequencing of negotiation messages.</li>
      <li>Minor technical addition to request_negotiate() anchor="ack" numbered="false" toc="include" removeInRFC="false" pn="section-a.1">
        <name slugifiedName="name-acknowledgements">Acknowledgements</name>
        <t indent="0" pn="section-a.1-1">Excellent suggestions were made by
      <contact fullname="Ignas Bagdonas"/>,
      <contact fullname="Carsten Bormann"/>,
      <contact fullname="Laurent Ciavaglia"/>,
      <contact fullname="Roman Danyliw"/>,
      <contact fullname="Toerless Eckert"/>,
      <contact fullname="Benjamin Kaduk"/>,
      <contact fullname="Erik Kline"/>,
      <contact fullname="Murray Kucherawy"/>,
      <contact fullname="Paul Kyzivat"/>,
      <contact fullname="Guangpeng Li"/>,
      <contact fullname="Michael Richardson"/>,
      <contact fullname="Joseph Salowey"/>,
      <contact fullname="Éric Vyncke"/>,
      <contact fullname="Magnus Westerlund"/>,
      <contact fullname="Rob Wilton"/>,
      and synchronize() in event loop model.</li>
      <li>Expanded several points other participants in Security Considerations,
          including precautions against resource exhaustion.</li>
      <li>Other clarifications and minor reorganizations; removed some duplicated text.</li>
      <li>Updated references.</li>
      </ul>

      <t>draft-ietf-anima-grasp-api-08, 2020-11:</t>
      <ul>
      <li>Clarified trust model</li>
      <li>Added explanations of GRASP objectives and sessions</li>
      <li>Added note about non-idempotent messages</li>
      <li>Added overview of API functions, and annotated each function with a brief description</li>
      <li>Added protocol diagram for negotiation session</li>
      <li>Clarified (absence of) authorization model</li>
      <li>Changed precise semantics of synchronize() for flooded objectives</li>
      <li>Clarified caching of flooded objectives</li>
      <li>Changed 'age_limit' to 'minimum_TTL'</li>
      <li>Improved security considerations, including DOS precautions</li>
      <li>Annotated error codes to indicate which functions generate which errors</li>
      <li>Other clarifications from Last Call reviews</li>
      </ul>

      <t>draft-ietf-anima-grasp-api-07, 2020-10-13:</t>
      <ul><li>Improved diagram and its description</li>
      <li>Added pointer to example logic flows</li>
      <li>Added note on variable length parameters</li>
      <li>Clarified that API decrements loop count automatically</li>
      <li>Other corrections the ANIMA WG and clarifications from AD review</li>
      </ul>

      <t>draft-ietf-anima-grasp-api-06, 2020-06-07:</t>
      <ul><li>Improved diagram</li>
      <li>Numerous clarifications and layout changes</li>
      </ul>

      <t>draft-ietf-anima-grasp-api-05, 2020-05-08:</t>
      <ul><li>Converted to xml2rfc v3</li>
      <li>Editorial fixes.</li>
      </ul>

      <t>draft-ietf-anima-grasp-api-04, 2019-10-07:</t>
      <ul><li>Improved discussion the IESG.</t>
      </section>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.b">
      <name slugifiedName="name-authors-addresses">Authors' Addresses</name>
      <author fullname="Brian E. Carpenter" initials="B." surname="Carpenter">
        <organization abbrev="Univ. of layering, mentioned daemon.</li>
      <li>Added callbacks and improved description Auckland" showOnFrontPage="true"/>
        <address>
          <postal>
            <extaddr>School of asynchronous operations.</li>
       <li>Described use case for 'session_handle'.</li>
      <li>More explanation of 'asa_handle'.</li>
      <li>Change 'discover' to use 'age_limit' instead Computer Science</extaddr>
            <extaddr>University of 'flush'.</li>
      <li>Clarified use Auckland</extaddr>
            <street>PB 92019</street>
            <city>Auckland</city>
            <region/>
            <code>1142</code>
            <country>New Zealand</country>
          </postal>
          <email>brian.e.carpenter@gmail.com</email>
        </address>
      </author>
      <author fullname="Bing Liu" initials="B." role="editor" surname="Liu">
        <organization showOnFrontPage="true">Huawei Technologies</organization>
        <address>
          <postal>
            <extaddr>Q14, Huawei Campus</extaddr>
            <street>No.156 Beiqing Road</street>
            <city>Hai-Dian District, Beijing</city>
            <code>100095</code>
            <country>China</country>
          </postal>
          <email>leo.liubing@huawei.com</email>
        </address>
      </author>
      <author fullname="Wendong Wang" initials="W." surname="Wang">
        <organization showOnFrontPage="true">BUPT University</organization>
        <address>
          <postal>
            <extaddr>Beijing University of 'dry run'.</li>
      <li>Editorial improvements.</li></ul>

      <t>draft-ietf-anima-grasp-api-03, 2019-01-21:</t>
      <ul><li>Replaced empty "logic flows" section by "implementation status".</li>
      <li>Minor clarifications.</li>
      <li>Editorial improvements.</li></ul>

      <t>draft-ietf-anima-grasp-api-02, 2018-06-30:</t>
      <ul><li>Additional suggestion for event-loop API.</li>
      <li>Discussion Posts &amp; Telecom.</extaddr>
            <street>No.10 Xitucheng Road</street>
            <city>Hai-Dian District, Beijing 100876</city>
            <country>China</country>
          </postal>
          <email>wdwang@bupt.edu.cn</email>
        </address>
      </author>
      <author fullname="Xiangyang Gong" initials="X." surname="Gong">
        <organization showOnFrontPage="true">BUPT University</organization>
        <address>
          <postal>
            <extaddr>Beijing University of error code values.</li></ul>

      <t>draft-ietf-anima-grasp-api-01, 2018-03-03:</t>
      <ul><li>Editorial updates</li></ul>
      <t>draft-ietf-anima-grasp-api-00, 2017-12-23:</t>
      <ul><li>WG adoption</li>
      <li>Editorial improvements.</li></ul>

      <t>draft-liu-anima-grasp-api-06, 2017-11-24:</t>
      <ul><li>Improved description of event-loop model.</li>
      <li>Changed intended status to Informational.</li>
      <li>Editorial improvements.</li></ul>

      <t>draft-liu-anima-grasp-api-05, 2017-10-02:</t>
      <ul><li>Added send_invalid()</li></ul>
      <t>draft-liu-anima-grasp-api-04, 2017-06-30:</t>
      <ul><li>Noted that simple nodes might not include the API.</li>
      <li>Minor clarifications.</li></ul>

      <t>draft-liu-anima-grasp-api-03, 2017-02-13:</t>
      <ul><li>Changed error return to integers.</li>
      <li>Required all implementations to accept objective values in CBOR.</li>
      <li>Added non-blocking alternatives.</li></ul>

      <t>draft-liu-anima-grasp-api-02, 2016-12-17:</t>
      <ul><li>Updated for draft-ietf-anima-grasp-09</li></ul>

      <t>draft-liu-anima-grasp-api-02, 2016-09-30:</t>
      <ul><li>Added items for draft-ietf-anima-grasp-07</li>
      <li>Editorial corrections</li></ul>

      <t>draft-liu-anima-grasp-api-01, 2016-06-24:</t>
      <ul><li>Updated for draft-ietf-anima-grasp-05</li>
      <li>Editorial corrections
      </li></ul>
      <t>draft-liu-anima-grasp-api-00, 2016-04-04:</t>
      <ul><li>Initial version</li></ul> Posts &amp; Telecom.</extaddr>
            <street>No.10 Xitucheng Road</street>
            <city>Hai-Dian District, Beijing 100876</city>
            <country>China</country>
          </postal>
          <email>xygong@bupt.edu.cn</email>
        </address>
      </author>
    </section>
  </back>
</rfc>