<commit_before><!--
 Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
 -->
<xsd:schema 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ifmap="http://www.trustedcomputinggroup.org/2010/IFMAP/2" 
xmlns:meta="http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2" 
targetNamespace="http://www.contrailsystems.com/2012/VNC-CONFIG/0">

<!-- Definition of IFMAP-SEMANTICS-IDL 
     It describes relationship and properties of meta data elements with 
     respect to identifier. It appears in comment after the referenced 
     elements. All statements are "element = some property"

     Start the contains of comment with #IFMAP-SEMANTICS-IDL

     #IFMAP-SEMANTICS-IDL list-of-statements
     list-of-statements := list-of-statements, statement
     statement  := Link('element', 'identifier', 'identifier', [ref-type-list])|
                   Type('element', [type-list])|
                   Property(element-name identifier-name)|
                   Exclude('element', [generator-list])
     element    := metadata element name
     identifier := identifier element name | "any" | "all"
     ref-type-list:= ref-type-list 'has' |
                  := ref-type-list 'ref' |
                  := 
     ref-type-list:= ref-type-list 'string-enum' |
                  := 
     string-enum  := This command will convert string type restriction to 
                   enum type
     generator-list:= generator-list 'backend'|
                   := generator-list 'frontend'|
                   := 
 -->

<!--Common types-->


<xsd:complexType name="MacAddressesType">
    <xsd:element name="mac-address" maxOccurs="unbounded"/>
</xsd:complexType>

<xsd:simpleType name="IpAddressType">
    <xsd:restriction base="xsd:string"/>
</xsd:simpleType>

<xsd:complexType name="IpAddressesType">
    <xsd:all>
        <xsd:element name="ip-address" type="IpAddressType" maxOccurs="unbounded"/>
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="SubnetType">
    <xsd:all>
        <xsd:element name="ip-prefix" type="xsd:string"/>
        <xsd:element name="ip-prefix-len" type="xsd:integer"/>
    </xsd:all>
</xsd:complexType> 

<xsd:complexType name="UuidType">
    <xsd:all>
        <xsd:element name="uuid-mslong" type="xsd:unsignedLong"/>
        <xsd:element name="uuid-lslong" type="xsd:unsignedLong"/>
    </xsd:all>
</xsd:complexType> 

<!-- ACL type definition -->

<xsd:complexType name="SequenceType">
    <xsd:all>
        <xsd:element name="major" type="xsd:integer"/>
        <xsd:element name="minor" type="xsd:integer"/>
    </xsd:all>
</xsd:complexType> 

<xsd:complexType name="TimerType">
    <xsd:all>
        <xsd:element name="start-time" type="xsd:dateTime"/>
        <xsd:element name="on-interval" type="xsd:time"/>
        <xsd:element name="off-interval" type="xsd:time"/>
        <xsd:element name="end-time" type="xsd:dateTime"/>
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="VirtualNetworkPolicyType">
    <xsd:all>
        <xsd:element name="sequence" type="SequenceType"/>
        <xsd:element name="timer" type="TimerType"/>
    </xsd:all>
</xsd:complexType>

<xsd:simpleType name="ProtocolType">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="tcp"/>
        <xsd:enumeration value="udp"/>
        <xsd:enumeration value="icmp"/>
        <xsd:enumeration value="any"/>
    </xsd:restriction>
</xsd:simpleType>
<!--#IFMAP-SEMANTICS-IDL 
     Type('ProtocolType', ['string-enum']) -->

<xsd:complexType name="AddressType">
    <xsd:choice>
        <xsd:element name="subnet" type="SubnetType"/>
        <xsd:element name="virtual-network" type="xsd:string" />
        <xsd:element name="security-group" type="xsd:string" />
    </xsd:choice>
</xsd:complexType>

<xsd:complexType name="PortType">
    <xsd:sequence>
        <xsd:element name="start-port" type="xsd:integer"/>
        <xsd:element name="end-port" type="xsd:integer"/>
    </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="MatchConditionType">
    <xsd:sequence>
        <xsd:element name="protocol"    type="xsd:string"/>
        <xsd:element name="src-address" type="AddressType"/>
        <xsd:element name="src-port"    type="PortType" />
        <xsd:element name="dst-address" type="AddressType"/>
        <xsd:element name="dst-port"    type="PortType" />
    </xsd:sequence>
</xsd:complexType>

<xsd:simpleType name="SimpleActionType">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="alert"/>
        <xsd:enumeration value="drop"/>
        <xsd:enumeration value="deny"/>
        <xsd:enumeration value="log"/>
        <xsd:enumeration value="pass"/>
        <xsd:enumeration value="reject"/>
    </xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="MirrorActionType">
    <xsd:all>
        <xsd:element name="analyzer-name" type="xsd:string"/>
        <xsd:element name="encapsulation" type="xsd:string"/>
        <xsd:element name="analyzer-ip-address" type="smi:IpAddress"/>
        <xsd:element name="routing-instance" type="xsd:string"/>
        <xsd:element name="udp-port" type="xsd:integer"/>
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="ActionListType">
    <xsd:all>
        <xsd:element name="simple-action" type="SimpleActionType"/>
        <xsd:element name="gateway-name" type="xsd:string"/>
        <xsd:element name="apply-service" type="xsd:string" maxOccurs="unbounded"/>
        <xsd:element name="mirror-to" type="MirrorActionType"/>
        <xsd:element name="assign-routing-instance" type="xsd:string"/>
        <!-- More actions can come here. e.g. policer, QOS etc-->
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="AclRuleType">
    <xsd:all>
        <xsd:element name="match-condition" type="MatchConditionType"/>
        <xsd:element name="action-list" type="ActionListType"/>
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="AclEntriesType">
    <xsd:all>
       <xsd:element name="dynamic" type="xsd:boolean"/>
       <xsd:element name="acl-rule" type="AclRuleType" maxOccurs="unbounded"/>
    </xsd:all>
</xsd:complexType>


<xsd:simpleType name="DirectionType"><commit_msg>Add uuid to ACL rule type<commit_after><!--
 Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
 -->
<xsd:schema 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ifmap="http://www.trustedcomputinggroup.org/2010/IFMAP/2" 
xmlns:meta="http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2" 
targetNamespace="http://www.contrailsystems.com/2012/VNC-CONFIG/0">

<!-- Definition of IFMAP-SEMANTICS-IDL 
     It describes relationship and properties of meta data elements with 
     respect to identifier. It appears in comment after the referenced 
     elements. All statements are "element = some property"

     Start the contains of comment with #IFMAP-SEMANTICS-IDL

     #IFMAP-SEMANTICS-IDL list-of-statements
     list-of-statements := list-of-statements, statement
     statement  := Link('element', 'identifier', 'identifier', [ref-type-list])|
                   Type('element', [type-list])|
                   Property(element-name identifier-name)|
                   Exclude('element', [generator-list])
     element    := metadata element name
     identifier := identifier element name | "any" | "all"
     ref-type-list:= ref-type-list 'has' |
                  := ref-type-list 'ref' |
                  := 
     ref-type-list:= ref-type-list 'string-enum' |
                  := 
     string-enum  := This command will convert string type restriction to 
                   enum type
     generator-list:= generator-list 'backend'|
                   := generator-list 'frontend'|
                   := 
 -->

<!--Common types-->


<xsd:complexType name="MacAddressesType">
    <xsd:element name="mac-address" maxOccurs="unbounded"/>
</xsd:complexType>

<xsd:simpleType name="IpAddressType">
    <xsd:restriction base="xsd:string"/>
</xsd:simpleType>

<xsd:complexType name="IpAddressesType">
    <xsd:all>
        <xsd:element name="ip-address" type="IpAddressType" maxOccurs="unbounded"/>
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="SubnetType">
    <xsd:all>
        <xsd:element name="ip-prefix" type="xsd:string"/>
        <xsd:element name="ip-prefix-len" type="xsd:integer"/>
    </xsd:all>
</xsd:complexType> 

<xsd:complexType name="UuidType">
    <xsd:all>
        <xsd:element name="uuid-mslong" type="xsd:unsignedLong"/>
        <xsd:element name="uuid-lslong" type="xsd:unsignedLong"/>
    </xsd:all>
</xsd:complexType> 

<!-- ACL type definition -->

<xsd:complexType name="SequenceType">
    <xsd:all>
        <xsd:element name="major" type="xsd:integer"/>
        <xsd:element name="minor" type="xsd:integer"/>
    </xsd:all>
</xsd:complexType> 

<xsd:complexType name="TimerType">
    <xsd:all>
        <xsd:element name="start-time" type="xsd:dateTime"/>
        <xsd:element name="on-interval" type="xsd:time"/>
        <xsd:element name="off-interval" type="xsd:time"/>
        <xsd:element name="end-time" type="xsd:dateTime"/>
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="VirtualNetworkPolicyType">
    <xsd:all>
        <xsd:element name="sequence" type="SequenceType"/>
        <xsd:element name="timer" type="TimerType"/>
    </xsd:all>
</xsd:complexType>

<xsd:simpleType name="ProtocolType">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="tcp"/>
        <xsd:enumeration value="udp"/>
        <xsd:enumeration value="icmp"/>
        <xsd:enumeration value="any"/>
    </xsd:restriction>
</xsd:simpleType>
<!--#IFMAP-SEMANTICS-IDL 
     Type('ProtocolType', ['string-enum']) -->

<xsd:complexType name="AddressType">
    <xsd:choice>
        <xsd:element name="subnet" type="SubnetType"/>
        <xsd:element name="virtual-network" type="xsd:string" />
        <xsd:element name="security-group" type="xsd:string" />
    </xsd:choice>
</xsd:complexType>

<xsd:complexType name="PortType">
    <xsd:sequence>
        <xsd:element name="start-port" type="xsd:integer"/>
        <xsd:element name="end-port" type="xsd:integer"/>
    </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="MatchConditionType">
    <xsd:sequence>
        <xsd:element name="protocol"    type="xsd:string"/>
        <xsd:element name="src-address" type="AddressType"/>
        <xsd:element name="src-port"    type="PortType" />
        <xsd:element name="dst-address" type="AddressType"/>
        <xsd:element name="dst-port"    type="PortType" />
    </xsd:sequence>
</xsd:complexType>

<xsd:simpleType name="SimpleActionType">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="alert"/>
        <xsd:enumeration value="drop"/>
        <xsd:enumeration value="deny"/>
        <xsd:enumeration value="log"/>
        <xsd:enumeration value="pass"/>
        <xsd:enumeration value="reject"/>
    </xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="MirrorActionType">
    <xsd:all>
        <xsd:element name="analyzer-name" type="xsd:string"/>
        <xsd:element name="encapsulation" type="xsd:string"/>
        <xsd:element name="analyzer-ip-address" type="smi:IpAddress"/>
        <xsd:element name="routing-instance" type="xsd:string"/>
        <xsd:element name="udp-port" type="xsd:integer"/>
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="ActionListType">
    <xsd:all>
        <xsd:element name="simple-action" type="SimpleActionType"/>
        <xsd:element name="gateway-name" type="xsd:string"/>
        <xsd:element name="apply-service" type="xsd:string" maxOccurs="unbounded"/>
        <xsd:element name="mirror-to" type="MirrorActionType"/>
        <xsd:element name="assign-routing-instance" type="xsd:string"/>
        <!-- More actions can come here. e.g. policer, QOS etc-->
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="AclRuleType">
    <xsd:all>
        <xsd:element name="match-condition" type="MatchConditionType"/>
        <xsd:element name="action-list" type="ActionListType"/>
        <xsd:element name="rule-uuid" type="xsd:string"/>
    </xsd:all>
</xsd:complexType>

<xsd:complexType name="AclEntriesType">
    <xsd:all>
       <xsd:element name="dynamic" type="xsd:boolean"/>
       <xsd:element name="acl-rule" type="AclRuleType" maxOccurs="unbounded"/>
    </xsd:all>
</xsd:complexType>


<xsd:simpleType name="DirectionType">
{'fraction_non_alphanumeric': 0.17136835278858625, 'fraction_numerical': 0.0038910505836575876, 'mean_word_length': 3.429802513464991, 'pattern_counts': {'":': 0, '<': 246, '<?xml version=': 0, '>': 246, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7113070', 'n_tokens_mistral': 4250, 'n_tokens_neox': 3813, 'n_words': 693}