Skip to content

Commit

Permalink
PACs must be lists not containers
Browse files Browse the repository at this point in the history
  • Loading branch information
demx8as6 committed Feb 13, 2017
1 parent 9a3d9d8 commit f7446d1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 47 deletions.
15 changes: 3 additions & 12 deletions models/tools/build-yang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,12 @@ function post-processing {
sed -i -e "s/grouping fc-port {/list forwarding-construct {\n key 'uuid';\n uses forwarding-construct;\n description \"none\";\n }\n grouping fc-port {/g" $1;
sed -i -e "s/grouping holder {/list equipment {\n key 'uuid';\n uses equipment;\n description \"none\";\n}\n grouping holder {/g" $1;
# spelling

#2017-02-09T06:14:17.078Z | spelling | INFO | adminisatratve better administrative,administrate,administratrix,administration,administrator,administrable
#2017-02-09T06:14:17.149Z | spelling | INFO | conector better connector,convector,corrector,connection,reconnect,collector,Concorde,connected
#2017-02-09T06:14:17.230Z | spelling | INFO | quantised better quantized,quantified,quarantined,antiquated,quantile,quantizer,quantize
#2017-02-09T06:14:17.271Z | spelling | INFO | characeristics better characteristics,characteristic,characterizes,characterizations,charismatics,characterized,Eucharistic
#2017-02-09T06:14:19.552Z | spelling | INFO | permenantly better permanently,permanent,temperamentally,experimentally,permanency,predominant,developmental
#2017-02-09T06:14:19.884Z | spelling | INFO | mechanicall better mechanical,mechanically,mechanicals,mechanic all,mechanic-all,mechanical l,mechanistically,mechanochemically,mechanic,mechanistic,technicality,nontechnical
sed -i -e 's/adminisatratve/administrative/g' $1;
sed -i -e 's/conector/connector/g' $1;
sed -i -e 's/quantised/quantized/g' $1;
sed -i -e 's/characeristics/characteristics/g' $1;
sed -i -e 's/mechanicall/mechanical/g' $1;




# g.874.1
sed -i -e "s/prefix g.874.1-model;/prefix g.874.1-model;\n\n import core-model {\n prefix core-model;\n }\n\n/g" $1;

Expand All @@ -62,9 +52,9 @@ function post-processing {
sed -i -e "s/type integer/type int32/g" $1; # MEGA hack - check with Thorsten....

# turn mandatory top level microwave containers into presence containers
names="(mw-air-interface-pac|mw-air-interface-diversity-pac|mw-ethernet-container-pac|mw-tdm-container-pac)"
# names="(mw-air-interface-pac|mw-air-interface-diversity-pac|mw-ethernet-container-pac|mw-tdm-container-pac)"
# taking into account that optional if-feature statement must stay first
perl -0777 -i -pe "s/(container\s+${names}\s+{\s*\n(\s+if-feature\s.*;\s*\n)?)(\s+)/\1\4presence \"\";\n\4/g" $1
# perl -0777 -i -pe "s/(list\s+${names}\s+{\s*\n(\s+if-feature\s.*;\s*\n)?)(\s+)/\1\4presence \"\";\n\4/g" $1

log " Post processed: $1";
}
Expand Down Expand Up @@ -146,3 +136,4 @@ log "Tree view generated!";

# End
log "End";

3 changes: 2 additions & 1 deletion models/tools/xmi2yang/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,8 @@ function obj2yang(ele){
}
}
if (ele[i].name === 'NetworkElement') obj.nodeType = "container";
/*if(ele[i].key.length != 0){
if (ele[i].name.startsWith('MW_') && ele[i].name.endsWith('_Pac')) obj.nodeType = "list";
/*if(ele[i].key.length != 0){
obj.nodeType = "list";
}*/
if(k == association.length){
Expand Down
4 changes: 0 additions & 4 deletions models/tools/xmi2yang/model/global-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ if (!String.prototype.featureDescription) {
};
}





module.exports = {
version: '2.0'
};
32 changes: 16 additions & 16 deletions models/tools/xmi2yang/project/MicrowaveModel.tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ module: core-model
+--ro administrative-state? administrative-state
+--rw lifecycle-state? lifecycle-state
module: microwave-model
+--rw mw-air-interface-pac!
| +--rw layer-protocol? -> /core-model:network-element/ltp/lp/uuid
+--rw mw-air-interface-pac* [layer-protocol]
| +--rw layer-protocol -> /core-model:network-element/ltp/lp/uuid
| +--ro air-interface-capability
| | +--ro type-of-equipment? string
| | +--ro tx-frequency-min? int32
Expand Down Expand Up @@ -769,17 +769,17 @@ module: microwave-model
| +--rw air-interface-list* -> /core-model:network-element/ltp/uuid
| +--rw sort-of-co-channel-group? string
| +--rw logicalterminationpoint* -> /core-model:network-element/ltp/uuid
+--rw mw-air-interface-hsb-end-point-pac
+--rw mw-air-interface-hsb-end-point-pac* [endpoint]
| +--rw role? role-type
| +--rw endpoint? -> /core-model:forwarding-construct/fc-port/uuid
+--rw mw-air-interface-hsb-fc-switch-pac
| +--rw endpoint -> /core-model:forwarding-construct/fc-port/uuid
+--rw mw-air-interface-hsb-fc-switch-pac* [fcswitch]
| +--rw prot-type? protection-type
| +--rw air-interface-hsb-configuration-is-faulty-severity? severity-type
| +--rw air-interface-hsb-is-partly-down-severity? severity-type
| +--rw air-interface-hsb-is-down-severity? severity-type
| +--rw fcswitch? -> /core-model:forwarding-construct/fc-switch/uuid
+--rw mw-air-interface-diversity-pac!
| +--rw layer-protocol? -> /core-model:network-element/ltp/lp/uuid
| +--rw fcswitch -> /core-model:forwarding-construct/fc-switch/uuid
+--rw mw-air-interface-diversity-pac* [layer-protocol]
| +--rw layer-protocol -> /core-model:network-element/ltp/lp/uuid
| +--ro air-interface-diversity-capability
| | +--ro available-kinds-of-diversity* [diversity-name]
| | | +--ro diversity-name string
Expand Down Expand Up @@ -829,8 +829,8 @@ module: microwave-model
| +--ro granularity-period? granularity-period-type
| +--ro object-class? object-identifier
| +--ro name-binding? object-identifier
+--rw mw-pure-ethernet-structure-pac {pure-ethernet}?
| +--rw layer-protocol? -> /core-model:network-element/ltp/lp/uuid
+--rw mw-pure-ethernet-structure-pac* [layer-protocol] {pure-ethernet}?
| +--rw layer-protocol -> /core-model:network-element/ltp/lp/uuid
| +--ro pure-ethernet-structure-capability
| | +--ro structure-id? core-model:universal-id
| | +--ro supported-alarms? string
Expand Down Expand Up @@ -872,8 +872,8 @@ module: microwave-model
| +--ro granularity-period? granularity-period-type
| +--ro object-class? object-identifier
| +--ro name-binding? object-identifier
+--rw mw-hybrid-mw-structure-pac {hybrid-microwave}?
| +--rw layer-protocol? -> /core-model:network-element/ltp/lp/uuid
+--rw mw-hybrid-mw-structure-pac* [layer-protocol] {hybrid-microwave}?
| +--rw layer-protocol -> /core-model:network-element/ltp/lp/uuid
| +--ro hybrid-mw-structure-capability
| | +--ro structure-id? core-model:universal-id
| | +--ro supported-tdm-structure-types-list* [tdm-structure-name]
Expand Down Expand Up @@ -924,8 +924,8 @@ module: microwave-model
| +--ro granularity-period? granularity-period-type
| +--ro object-class? object-identifier
| +--ro name-binding? object-identifier
+--rw mw-ethernet-container-pac!
| +--rw layer-protocol? -> /core-model:network-element/ltp/lp/uuid
+--rw mw-ethernet-container-pac* [layer-protocol]
| +--rw layer-protocol -> /core-model:network-element/ltp/lp/uuid
| +--ro ethernet-container-capability
| | +--ro bundling-is-avail? boolean
| | +--ro packet-compression-is-avail? boolean
Expand Down Expand Up @@ -992,8 +992,8 @@ module: microwave-model
| +--ro granularity-period? granularity-period-type
| +--ro object-class? object-identifier
| +--ro name-binding? object-identifier
+--rw mw-tdm-container-pac! {hybrid-microwave}?
+--rw layer-protocol? -> /core-model:network-element/ltp/lp/uuid
+--rw mw-tdm-container-pac* [layer-protocol] {hybrid-microwave}?
+--rw layer-protocol -> /core-model:network-element/ltp/lp/uuid
+--ro tdm-container-capability
| +--ro supported-tdm-container-types-list* [tdm-container-name]
| | +--ro tdm-container-name string
Expand Down
31 changes: 17 additions & 14 deletions models/tools/xmi2yang/project/microwave-model.yang
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ module microwave-model {
Martin Skorupski
<mailto:[email protected]>";
description "This module contains a collection of YANG definitions for managing wireless networks.";
revision 2017-02-10 {
revision 2017-02-13 {
description "Initial version";
reference "ONF TR 532: A YANG Data Model for Wireless Networks.";
}

/***********************
* package type-definitions
**********************/
Expand Down Expand Up @@ -855,8 +854,8 @@ module microwave-model {
/***********************
* package air-interface
**********************/
container mw-air-interface-pac {
presence "";
list mw-air-interface-pac {
key 'layer-protocol';
leaf layer-protocol {
type leafref {
path '/core-model:network-element/core-model:ltp/core-model:lp/core-model:uuid';
Expand Down Expand Up @@ -1323,7 +1322,8 @@ module microwave-model {
/***********************
* package air-interface-hsb
**********************/
container mw-air-interface-hsb-end-point-pac {
list mw-air-interface-hsb-end-point-pac {
key 'endpoint';
leaf role {
type role-type;
description "none";
Expand All @@ -1336,7 +1336,8 @@ module microwave-model {
}
description "The EndPoint (EP) object class models the access to the FC function. Each EndPoint instance has a role (e.g., working, protection, protected, hub, spoke, leaf, root, etc.) with respect to the FC function. The association of the FC to LTPs is made via EndPoints (essentially the ports of the FC) where each EndPoint (EP) of the FC has a role in the context of the FC. The traffic forwarding between the associated End PointsEPs of the FC depends upon the type of FC and may be associated with FCSwitch object instances. In cases where there is protection conveys the protecting role of the access to the FC. The EP replaces the Protection Unit of a traditional protection model. It represents a protected (resilient/reliable) point or a protecting (unreliable working or protection) point.";
}
container mw-air-interface-hsb-fc-switch-pac {
list mw-air-interface-hsb-fc-switch-pac {
key 'fcswitch';
leaf prot-type {
type protection-type;
description "Indicates the protection scheme that is used for the ProtectionGroup.";
Expand Down Expand Up @@ -1365,8 +1366,8 @@ module microwave-model {
/***********************
* package air-interface-diversity
**********************/
container mw-air-interface-diversity-pac {
presence "";
list mw-air-interface-diversity-pac {
key 'layer-protocol';
leaf layer-protocol {
type leafref {
path '/core-model:network-element/core-model:ltp/core-model:lp/core-model:uuid';
Expand Down Expand Up @@ -1493,8 +1494,9 @@ module microwave-model {
/***********************
* package pure-ethernet-structure
**********************/
container mw-pure-ethernet-structure-pac {
list mw-pure-ethernet-structure-pac {
if-feature pure-ethernet;
key 'layer-protocol';
leaf layer-protocol {
type leafref {
path '/core-model:network-element/core-model:ltp/core-model:lp/core-model:uuid';
Expand Down Expand Up @@ -1604,8 +1606,9 @@ module microwave-model {
/***********************
* package hybrid-mw-structure
**********************/
container mw-hybrid-mw-structure-pac {
list mw-hybrid-mw-structure-pac {
if-feature hybrid-microwave;
key 'layer-protocol';
leaf layer-protocol {
type leafref {
path '/core-model:network-element/core-model:ltp/core-model:lp/core-model:uuid';
Expand Down Expand Up @@ -1732,8 +1735,8 @@ module microwave-model {
/***********************
* package ethernet-container
**********************/
container mw-ethernet-container-pac {
presence "";
list mw-ethernet-container-pac {
key 'layer-protocol';
leaf layer-protocol {
type leafref {
path '/core-model:network-element/core-model:ltp/core-model:lp/core-model:uuid';
Expand Down Expand Up @@ -1933,9 +1936,9 @@ module microwave-model {
/***********************
* package tdm-container
**********************/
container mw-tdm-container-pac {
list mw-tdm-container-pac {
if-feature hybrid-microwave;
presence "";
key 'layer-protocol';
leaf layer-protocol {
type leafref {
path '/core-model:network-element/core-model:ltp/core-model:lp/core-model:uuid';
Expand Down

0 comments on commit f7446d1

Please sign in to comment.