<?xml version="1.0" encoding="UTF-8"?>

<!--  $Id: nmap.xsd,v 1.1 2003/06/18 01:40:35 visigoth_6 Exp $  -->
<!-- Schema Notes:
This schema defines the XML used by nmap (hopeuflly)
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:element name="nmaprun" type="NRun"/>

  <xsd:complexType name="NRun">
    <xsd:sequence>
      <xsd:element name="scaninfo" type="NScanInfo"/>
      <xsd:element name="verbose" type="NVerbose"/>
      <xsd:element name="debugging" type="NDebug"/>
      <xsd:element name="host" type="NHost" minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element name="runstats" type="NRunStats"/>
    </xsd:sequence>
    <xsd:attribute name="scanner" type="xsd:string"/>
    <xsd:attribute name="args" type="xsd:string"/>
    <xsd:attribute name="start" type="xsd:int"/>
    <xsd:attribute name="version" type="xsd:string"/>
    <xsd:attribute name="xmloutputversion" type="xsd:string"/>
  </xsd:complexType>

  <xsd:complexType name="NRunStats">
    <xsd:sequence>
      <xsd:element name="finished" type="NFinished"/>
      <xsd:element name="hosts" type="NHosts"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="NHosts">
    <xsd:attribute name="up" type="xsd:int"/>
    <xsd:attribute name="down" type="xsd:int"/>
    <xsd:attribute name="total" type="xsd:int"/>
  </xsd:complexType>

  <xsd:complexType name="NFinished">
    <xsd:attribute name="time" type="xsd:int"/>
  </xsd:complexType>

  <xsd:complexType name="NScanInfo">
    <xsd:attribute name="type" type="xsd:string"/>
    <xsd:attribute name="protocol" type="xsd:string"/>
    <xsd:attribute name="numservices" type="xsd:int"/>
    <xsd:attribute name="services" type="xsd:string"/>
  </xsd:complexType>

  <xsd:complexType name="NVerbose">
    <xsd:attribute name="level" type="xsd:int"/>
  </xsd:complexType>

  <xsd:complexType name="NDebug">
    <xsd:attribute name="level" type="xsd:int"/>
  </xsd:complexType>

  <xsd:complexType name="NHost">
    <xsd:sequence>
      <xsd:element name="status" type="NStatus"/>
      <xsd:element name="address" type="NAddr"/>
      <xsd:element name="hostnames" type="NNames"/>
      <xsd:element name="ports" type="NPorts"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="NPorts">
    <xsd:sequence>
      <xsd:element name="extraports" type="NExPorts"/>
      <xsd:element name="port" type="NPort" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="NPort">
    <xsd:sequence>
      <xsd:element name="state" type="NState"/>
      <xsd:element name="service" type="NService"/>
    </xsd:sequence>
    <xsd:attribute name="protocol" type="xsd:string"/>
    <xsd:attribute name="portid" type="xsd:int"/>
  </xsd:complexType>

  <xsd:complexType name="NState">
    <xsd:attribute name="state" type="xsd:string"/>
  </xsd:complexType>

  <xsd:complexType name="NService">
    <xsd:attribute name="name" type="xsd:string"/>
    <xsd:attribute name="method" type="xsd:string"/>
    <xsd:attribute name="conf" type="xsd:int"/>
  </xsd:complexType>

  <xsd:complexType name="NExPorts">
    <xsd:attribute name="state" type="xsd:string"/>
    <xsd:attribute name="count" type="xsd:int"/>
  </xsd:complexType>

  <xsd:complexType name="NNames">
    <xsd:sequence>
      <xsd:element name="hostname" type="NName"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="NName">
    <xsd:attribute name="name" type="xsd:string"/>
    <xsd:attribute name="type" type="xsd:string"/>
  </xsd:complexType>

  <xsd:complexType name="NStatus">
    <xsd:attribute name="state" type="xsd:string"/>
  </xsd:complexType>

  <xsd:complexType name="NAddr">
    <xsd:attribute name="addr" type="xsd:string"/>
    <xsd:attribute name="addrtype" type="xsd:string"/>
  </xsd:complexType>

</xsd:schema>
