<?xml version="1.0" encoding="UTF-8"?>
<!-- NMWG Request subject -->
<!-- TODO: Make it possible to have just a named to identify a node -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.ggf.org/namespaces/2004/08/gridNetworkMonitoring" xmlns:g="http://www.ggf.org/namespaces/2004/08/gridNetworkMonitoring">
  <xs:complexType name="Address">
    <xs:sequence>
      <xs:element ref="g:host"/>
      <xs:element minOccurs="0" ref="g:port"/>
    </xs:sequence>
    <xs:attribute name="version" use="required" type="xs:token">
      <xs:annotation>
        <xs:documentation>IP version</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
  <xs:element name="host" type="xs:token">
    <xs:annotation>
      <xs:documentation>Host address</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="port" type="xs:short">
    <xs:annotation>
      <xs:documentation>Port</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Node">
    <xs:annotation>
      <xs:documentation>A node</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element ref="g:address"/>
      <xs:element minOccurs="0" name="name" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="address" type="g:Address"/>
  <!--
    Apparently these are broken, too
    InternalNode = Node
    Router = InternalNode
  -->
  <xs:complexType name="Path">
    <xs:annotation>
      <xs:documentation>A path between two nodes</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" ref="g:source"/>
      <xs:element minOccurs="0" ref="g:destination"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="source" type="g:Node"/>
  <xs:element name="destination" type="g:Node"/>
  <!--
      Hop = Path
      Host =
         element operatingSystem { OperatingSystem },
         element interface { NetworkInterface }*
      OperatingSystem = SoftwareDescription
      NetworkInterface =
         element address { Address },
         element card { NIC }
      NIC = 
         ## The logical name of the card as seen
         ## by the OS. E.g. eth0 hme0:1
         element logicalInterfaceName { string },
         element card { HardwareDescription }?,
         element firmware { SoftwareDescription }?,
         element driver  { SoftwareDescription }?,
         element txqueuelen { IntValue }?,
         element mtu { IntValue }?,
         element iobus { string }?,
         element cpu { CPU },
         element maxTCPReadBuffer { IntValue }?,
         element maxTCPWriteBuffer { IntValue }?,
         element timer { TimerDevice }?,
         ## The protocol stack on this host, highest to lowest layer
         element protocolStack { element protocol { ProtocolLayer }+ }?
      CPU =
         element type { string },
         element speed { DoubleValue }
      ProtocolLayer = Extensibility
      ## Piece of software
      SoftwareDescription =
         element name { string },
         element major { xsd:int }?,
         element minor { xsd:int }?,
         element release { xsd:int }?,
         element buildDate { xsd:int }?,
         element vendor { string }?,
         element versionString { string }*
      ## Piece of hardware
      HardwareDescription =
         element componentType { token },
         element manufacturere { string },
         element version { string }
  -->
</xs:schema>

