Skip to content

Commit

Permalink
Routing Policy schema
Browse files Browse the repository at this point in the history
Refer to https://bugs.launchpad.net/juniperopenstack/+bug/1500698

1. Trim routing_policy.xsd to meet requirements in above bug
    a. Prefix match and community match
    b. Action to update community and local_pref
2. Link routing instance and routing policy

Change-Id: I3c7df32732f09ae603998bfffee4d2aba8ea10fa
Related-bug:#1500698
  • Loading branch information
bailkeri committed Nov 12, 2015
1 parent 4cf884e commit 14b8f30
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 39 deletions.
20 changes: 20 additions & 0 deletions src/schema/bgp_schema.xsd
Expand Up @@ -8,6 +8,7 @@

<xsd:include schemaLocation='ietf-l3vpn-schema.xsd'/>
<xsd:include schemaLocation='smi-base.xsd'/>
<xsd:include schemaLocation='routing_policy.xsd'/>

<!-- routing-instance: group of customer attachment points with the same
connectivity policies -->
Expand All @@ -19,6 +20,25 @@
Link('connection', 'routing-instance', 'routing-instance', ['ref']) -->
<!--#IFMAP-SEMANTICS-IDL
Link('instance-target', 'routing-instance', 'route-target', ['ref']) -->

<xsd:complexType name="RoutingPolicyType">
<xsd:annotation>
<xsd:documentation>
Sequence defines the position where the routing policy is inserted
into the existing list of policies in the routing-instance
It is string representation of floating number.
e.g. "1.01" or "0.1"
In this above case policy with "0.1" is inserted before "1.01"
</xsd:documentation>
</xsd:annotation>
<xsd:element name="sequence" type="xsd:string"/>
</xsd:complexType>

<xsd:element name="routing-instance-routing-policy" type="RoutingPolicyType"/>
<!--#IFMAP-SEMANTICS-IDL
Link('routing-instance-routing-policy',
'routing-instance', 'routing-policy', ['ref']) -->

<!--#IFMAP-SEMANTICS-IDL
Property('default-ce-protocol', 'routing-instance') -->
<!--#IFMAP-SEMANTICS-IDL
Expand Down
62 changes: 28 additions & 34 deletions src/schema/routing_policy.xsd
Expand Up @@ -5,71 +5,65 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:smi="urn:ietf:params:xml:ns:opsawg:smi:base:1.0">

<xsd:include schemaLocation='smi-base.xsd'/>
<xsd:element name='routing-policy' type='ifmap::IdentityType'/>
<xsd:element name='routing-policy-entries' type='PolicyStatement'/>
<!--#IFMAP-SEMANTICS-IDL
Property('routing-policy-entries', 'routing-policy') -->

<xsd:complexType name='PolicyStatement'>
<xsd:sequence>
<xsd:element name='term' type='PolicyTerm' maxOccurs='unbounded'/>
</xsd:sequence>
<xsd:element name='term' type='PolicyTerm' maxOccurs='unbounded'/>
</xsd:complexType>

<xsd:simpleType name='ActionType'>
<xsd:simpleType name='ActionType'>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="reject"/>
<xsd:enumeration value="accept"/>
<xsd:enumeration value="next"/>
</xsd:restriction>
</xsd:simpleType>

<xsd:complexType name='CommunityListType'>
<xsd:element name='community' type='xsd:string' maxOccurs='unbounded'/>
</xsd:complexType>

<xsd:complexType name="ActionCommunity">
<xsd:sequence>
<xsd:element name='add' type='xsd:string'/>
<xsd:element name='remove' type='xsd:string'/>
<xsd:element name='set' type='xsd:string'/>
</xsd:sequence>
<xsd:element name='add' type='CommunityListType'/>
<xsd:element name='remove' type='CommunityListType'/>
<xsd:element name='set' type='CommunityListType'/>
</xsd:complexType>

<xsd:complexType name="ActionUpdate">
<xsd:sequence>
<xsd:element name="community" type="ActionCommunity"/>
<xsd:element name="local-pref" type="xsd:integer"/>
</xsd:sequence>
<xsd:element name="community" type="ActionCommunity"/>
<xsd:element name="local-pref" type="xsd:integer"/>
</xsd:complexType>

<xsd:complexType name='PolicyAction'>
<xsd:all>
<xsd:element name='update' type='ActionUpdate'/>
<xsd:element name='action' type='ActionType'/>
<xsd:element name='update' type='ActionUpdate'/>
<xsd:element name='action' type='ActionType'/>
</xsd:all>
</xsd:complexType>

<xsd:simpleType name="ProtocolType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="bgp"/>
<xsd:enumeration value="direct"/>
<xsd:simpleType name='PrefixMatchType'>
<xsd:restriction base="xsd:string" default="exact">
<xsd:enumeration value="exact"/>
<xsd:enumeration value="longer"/>
<xsd:enumeration value="orlonger"/>
</xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="PrefixMatch">
<xsd:element name="prefix" type="xsd:string"/>
<xsd:element name="type" type="PrefixMatchType"/>
</xsd:complexType>

<xsd:complexType name="PolicyMatch">
<xsd:sequence>
<xsd:element name="as-path" type="xsd:string"/>
<xsd:element name="community" type="xsd:string"/>
<xsd:element name="local-pref" type="xsd:integer"/>
<xsd:element name="neighbor" type="smi:IpAddress"/>
<xsd:element name="prefix" type="xsd:string"/>
<xsd:element name="next-hop" type="smi:IpAddress"/>
<xsd:element name="protocol" type="ProtocolType"/>
</xsd:sequence>
<xsd:element name="community" type="xsd:string"/>
<xsd:element name="prefix" type="PrefixMatch"/>
</xsd:complexType>

<xsd:complexType name='PolicyTerm'>
<xsd:sequence>
<xsd:element name='from' type='PolicyMatch'/>
<xsd:element name='then' type='PolicyAction'/>
</xsd:sequence>
<xsd:complexType name='PolicyTerm'>
<xsd:element name='from' type='PolicyMatch'/>
<xsd:element name='then' type='PolicyAction'/>
</xsd:complexType>
</xsd:schema>
8 changes: 3 additions & 5 deletions src/schema/vnc_cfg.xsd
Expand Up @@ -96,11 +96,9 @@ targetNamespace="http://www.contrailsystems.com/2012/VNC-CONFIG/0">
<!-- 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:element name="major" type="xsd:integer"/>
<xsd:element name="minor" type="xsd:integer"/>
</xsd:complexType>

<xsd:complexType name="TimerType">
<xsd:all>
Expand Down

0 comments on commit 14b8f30

Please sign in to comment.