# ##############################################################
#
# File: ping.rnc - Specialized schema for the ping
# tool
# Version: $Id: ping.rnc,v 1.10 2006/02/09 05:32:51 zurawski Exp $
# Purpose: Describes specific elements to be used in the
# representation and handling of ping
# measurements.
# Reference: http://books.xmlschemata.org/relaxng/page2.html
#
# ##############################################################
# ##############################################################
# Namespace definitions
# ##############################################################
namespace nmwg = "http://ggf.org/ns/nmwg/base/2.0/"
namespace ping = "http://ggf.org/ns/nmwg/tools/ping/2.0/"
# ##############################################################
# Include additional functionality from other files
# ##############################################################
include
"nmtopo.rnc"
include
"nmbase.rnc" {
Metadata |= PingMetadata
Data |= PingData
}
# ##############################################################
# Metadata is the 'data' that describes physical measurements.
# Metadata can be something such as a physical address, or
# a geographical location; any form of static, re-usable
# designation. It is important to note that the subject
# namespace and parameters namespace MUST match (or the parameters
# can be a generic NMWG) or bad things will occur.
#
# Example:
#
#
# metadataIdRef="OPTIONAL_REFERENCE_ID"
# xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
#
# <!-- TBD OPTIONAL SUBJECT -->
#
# <!-- TBD OPTIONAL PARAMETERS -->
#
# <!-- TBD OPTIONAL EVENTTYPE -->
#
# <!-- TBD OPTIONAL KEY -->
#
# <!-- ANY OPTIONAL (MULTIPLE) ELEMENT IN ANY NAMESPACE -->
#
#
#
# ##############################################################
PingMetadata =
element
nmwg:metadata
{
Identifier &
MetadataIdentifierRef? &
PingMetadataContent
}
PingMetadataBlock =
PingSubject? &
(
PingParameters |
Parameters
)?
PingMetadataContent =
(
PingMetadataBlock |
FilterMetadataBlock
) &
EventType? &
Key?
# ##############################################################
# Redefined ping subject allows only an endPointPair, and the
# two id attributes.
#
# Example:
#
#
# metadataIdRef="OPTIONAL_REFERENCE_ID"
# xmlns:nmwg="http://ggf.org/ns/nmwg/tools/ping/2.0/">
#
#
#
#
# port="OPTIONAL_PORT"/>
#
#
# port="OPTIONAL_PORT"/>
#
#
#
#
#
# ##############################################################
PingSubject =
element
ping:subject
{
Identifier &
MetadataIdentifierRef? &
EndpointPair
}
# ##############################################################
# This is simply the regular method of doing parameters with an
# enumeration to limit what 'names' are accepted and an outer
# ping: namespace for the parameters.
#
# Example:
#
#
# xmlns:nmwg="http://ggf.org/ns/nmwg/tools/ping/2.0/">
#
#
# xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
#
# <!-- ANY TEXT, (IF YOU DID NOT USE THE VALUE ATTRIBUTE) -->
#
#
#
# <!-- MORE PARAMETERS -->
#
#
#
# ##############################################################
PingParameters =
element
ping:parameters
{
Identifier &
PingParameter+
}
PingParameter =
element
nmwg:parameter
{
attribute name { "count" | "interval" | "deadline" |
"packetSize" | "ttl" | "arguments" |
"valueUnits" | "numBytes" |
"numBytesUnits" } &
(
attribute value { text } |
text
)
}
# ##############################################################
# The data block is complex, and has the potential to contain
# many things. The data block can be used to return a metadata
# block from a request, commonTime or datum elements, keys,
# or something that we have perhaps not defined as of yet.
#
# Example:
#
#
# metadataIdRef="OPTIONAL_REFERENCE_ID"
# xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
#
# <!-- OPTIONAL (MULTIPLE) METADATA -->
#
# <!-- OR -->
#
# <!-- TBD OPTIONAL (MULTIPLE) COMMON TIME ELEMENTS AND
# OPTIONAL (MULTIPLE) DATUM ELEMENTS-->
#
# <!-- OR -->
#
# <!-- TBD OPTIONAL (MULTIPLE) DATUM ELEMENTS -->
#
# <!-- OR -->
#
# <!-- OPTIONAL (MULTIPLE) KEY ELEMENTS -->
#
# <!-- OR -->
#
# <!-- ANY OPTIONAL (MULTIPLE) ELEMENT IN ANY NAMESPACE -->
#
#
#
# ##############################################################
PingData =
element
nmwg:data
{
Identifier &
MetadataIdentifierRef? &
(
(
Metadata* |
PingMetadata*
) |
(
PingCommonTime+ &
PingDatum*
) |
PingDatum* |
Key*
)
}
# ##############################################################
# CommonTime is used a a shortcut able to 'factor out' a frequently
# occurring time range that a bunch of datum (or other) elements
# might share, thus reducing complexity of XML representation.
# CommonTime is similar to the other NMWG time stamps (from
# nmtime.rnc) in its potential time representations.
#
# Example:
#
#
# duration="OPTIONAL_DURATION"
# inclusive="OPTIONAL_INCLUSIVE_FLAG"
# xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
#
# <!-- TBD OPTIONAL START TIME ELEMENT (USE END TIME OR DURATION) -->
#
# <!-- TBD OPTIONAL END TIME ELEMENT (ONLY WITH START TIME) -->
#
# <!-- TBD OPTIONAL TIME VALUE ELEMENT (USE IF NO VALUE ATTRIBUTE) -->
#
# <!-- TBD OPTIONAL (MULTIPLE) DATUM ELEMENTS -->
#
# <!-- ANY OPTIONAL (MULTIPLE) ELEMENT IN ANY NAMESPACE -->
#
#
# ##############################################################
PingCommonTime =
element
nmwg:commonTime
{
Type &
(
TimeStamp |
(
StartTime &
(
EndTime |
Duration
)
)
) &
PingDatum*
}
# ##############################################################
# These are the basic elements we would expect to see in the
# specific ping datum.
#
# Example:
#
#
# valueUnits="OPTIONAL_VALUE_UNITS"
# numBytes="OPTIONAL_NUM_BYTES"
# numBytesUnits="OPTIONAL_NUM_BYTES_UNITS"
# seqNum="OPTIONAL_SEQ_NUM"
# ttl="OPTIONAL_TTL"
# timeType="OPTIONAL_TIME_TYPE"
# timeValue="OPTIONAL_TIME_VALUE"
# xmlns:nmwg="http://ggf.org/ns/nmwg/tools/ping/2.0/">
#
# <!-- TIME ELEMENT (IF ATTRIBUTES NOT USED) -->
#
#
#
# ##############################################################
PingDatum =
element
ping:datum
{
attribute value { xsd:float } &
attribute valueUnits { xsd:string }? &
attribute numBytes { xsd:int }? &
attribute numBytesUnits { xsd:string }? &
attribute seqNum { xsd:int }? &
attribute ttl { xsd:int }? &
(
(
attribute timeType { xsd:string } &
attribute timeValue { xsd:string }
) |
Time
)?
}