diff --git a/rules/functions b/rules/functions index d86d714b4a2..62b3c8a9837 100644 --- a/rules/functions +++ b/rules/functions @@ -198,7 +198,6 @@ define generate_manifest $(eval export config_cli_plugin=$($(1).gz_CLI_CONFIG_PLUGIN)) $(eval export show_cli_plugin=$($(1).gz_CLI_SHOW_PLUGIN)) $(eval export clear_cli_plugin=$($(1).gz_CLI_CLEAR_PLUGIN)) - j2 $($*.gz_PATH)/Dockerfile$(2).j2 > $($(1).gz_PATH)/Dockerfile$(2) j2 --customize scripts/j2cli/json_filter.py files/build_templates/manifest.json.j2 > $($(1).gz_PATH)/manifest.common.json if [ -f $($*.gz_PATH)/manifest.part.json.j2 ]; then j2 --customize scripts/j2cli/json_filter.py $($(1).gz_PATH)/manifest.part.json.j2 > $($(1).gz_PATH)/manifest.part.json diff --git a/src/sonic-platform-common b/src/sonic-platform-common index 21fece56bdb..07e75bc46d5 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 21fece56bdb31a1ff4ed55eae954ea28de9052a5 +Subproject commit 07e75bc46d5231ca50ea9e5e71645c5290e21fb9 diff --git a/src/sonic-swss b/src/sonic-swss index 5f8ebfa10a2..bb0733aa67f 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 5f8ebfa10a27d06062983d3f3bce2b86c6929600 +Subproject commit bb0733aa67ffc4e430e70bcf2db2dc6316172b32 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 52b7a4708c2..95aec723ecc 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 52b7a4708c2032c29db24fcca09485ebb172aa06 +Subproject commit 95aec723ecc5028d107838027dd886480dfdb85c diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json b/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json index 28f2e0b4440..aa53606298a 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json @@ -61,5 +61,25 @@ "key": "sonic-acl:services", "value": ["SNMP"] } + }, + "ACL_TABLE_CUSTOM_TABLE_TYPE": { + "desc": "ACL_TABLE LOAD TABLE TYPE SUCCESSFULLY." + }, + "ACL_TABLE_CUSTOM_TABLE_TYPE_NO_MATCHES": { + "desc": "ACL_TABLE LOAD TABLE TYPE WITH NO MATCHES.", + "eStrKey": "MinElements" + }, + "ACL_TABLE_CUSTOM_TABLE_TYPE_NO_BIND_POINT_TYPES": { + "desc": "ACL_TABLE LOAD TABLE TYPE WITH NO BIND POINT TYPES.", + "eStrKey": "MinElements" + }, + "ACL_TABLE_CUSTOM_TABLE_TYPE_NO_ACTIONS": { + "desc": "ACL_TABLE LOAD TABLE TYPE SUCCESSFULLY WITH NO ACTIONS.", + "eStrKey" : "Verify", + "verify": { + "xpath": "/sonic-acl:sonic-acl/ACL_TABLE_TYPE/ACL_TABLE_TYPE_LIST[ACL_TABLE_TYPE_NAME='CUSTOM_L3']/ACL_TABLE_TYPE_NAME", + "key": "sonic-acl:actions", + "value": [""] + } } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json index 4a1dd088835..d22d372a5ea 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json @@ -471,5 +471,191 @@ ] } } + }, + "ACL_TABLE_CUSTOM_TABLE_TYPE": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "policy_desc": "Filter IPv6", + "ports": [ + "Ethernet0" + ], + "stage": "EGRESS", + "type": "CUSTOM_L3" + } + ] + }, + "sonic-acl:ACL_TABLE_TYPE": { + "ACL_TABLE_TYPE_LIST": [ + { + "ACL_TABLE_TYPE_NAME": "CUSTOM_L3", + "matches": [ + "SRC_IP", + "IN_PORTS" + ], + "actions": [ + "PACKET_ACTION" + ], + "bind_points": [ + "PORT" + ] + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "0,1,2,3", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + } + ] + } + } + }, + "ACL_TABLE_CUSTOM_TABLE_TYPE_NO_MATCHES": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "policy_desc": "Filter IPv6", + "ports": [ + "Ethernet0" + ], + "stage": "EGRESS", + "type": "CUSTOM_L3" + } + ] + }, + "sonic-acl:ACL_TABLE_TYPE": { + "ACL_TABLE_TYPE_LIST": [ + { + "ACL_TABLE_TYPE_NAME": "CUSTOM_L3", + "actions": [ + "PACKET_ACTION" + ], + "bind_points": [ + "PORT" + ] + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "0,1,2,3", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + } + ] + } + } + }, + "ACL_TABLE_CUSTOM_TABLE_TYPE_NO_BIND_POINT_TYPES": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "policy_desc": "Filter IPv6", + "ports": [ + "Ethernet0" + ], + "stage": "EGRESS", + "type": "CUSTOM_L3" + } + ] + }, + "sonic-acl:ACL_TABLE_TYPE": { + "ACL_TABLE_TYPE_LIST": [ + { + "ACL_TABLE_TYPE_NAME": "CUSTOM_L3", + "matches": [ + "SRC_IP", + "IN_PORTS" + ], + "actions": [ + "PACKET_ACTION" + ] + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "0,1,2,3", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + } + ] + } + } + }, + "ACL_TABLE_CUSTOM_TABLE_TYPE_NO_ACTIONS": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "policy_desc": "Filter IPv6", + "ports": [ + "Ethernet0" + ], + "stage": "EGRESS", + "type": "CUSTOM_L3" + } + ] + }, + "sonic-acl:ACL_TABLE_TYPE": { + "ACL_TABLE_TYPE_LIST": [ + { + "ACL_TABLE_TYPE_NAME": "CUSTOM_L3", + "matches": [ + "SRC_IP", + "IN_PORTS" + ], + "bind_points": [ + "PORT" + ] + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "0,1,2,3", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang b/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang index b8ae8efdf31..85c0cf997d4 100644 --- a/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang +++ b/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang @@ -7,7 +7,6 @@ module sonic-breakout_cfg { import sonic-extension { prefix ext; - revision-date 2019-07-01; } description "BREAKOUT_CFG YANG Module for SONiC OS"; diff --git a/src/sonic-yang-models/yang-models/sonic-crm.yang b/src/sonic-yang-models/yang-models/sonic-crm.yang index 48c15b0e48c..d1ac84eec39 100644 --- a/src/sonic-yang-models/yang-models/sonic-crm.yang +++ b/src/sonic-yang-models/yang-models/sonic-crm.yang @@ -7,7 +7,6 @@ module sonic-crm { import sonic-types { prefix stypes; - revision-date 2019-07-01; } description "CRM YANG Module for SONiC OS"; diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 21771585814..f7ef8261d6b 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -15,7 +15,6 @@ module sonic-device_metadata { import sonic-types { prefix stypes; - revision-date 2019-07-01; } description "DEVICE_METADATA YANG Module for SONiC OS"; diff --git a/src/sonic-yang-models/yang-models/sonic-device_neighbor.yang b/src/sonic-yang-models/yang-models/sonic-device_neighbor.yang index e1c745dd9af..a7284ccec50 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_neighbor.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_neighbor.yang @@ -11,7 +11,6 @@ module sonic-device_neighbor { import sonic-extension { prefix ext; - revision-date 2019-07-01; } import sonic-port { diff --git a/src/sonic-yang-models/yang-models/sonic-extension.yang b/src/sonic-yang-models/yang-models/sonic-extension.yang deleted file mode 100644 index 6369b605173..00000000000 --- a/src/sonic-yang-models/yang-models/sonic-extension.yang +++ /dev/null @@ -1,13 +0,0 @@ -module sonic-extension { - - yang-version 1.1; - - namespace "http://github.com/Azure/sonic-extension"; - prefix sonic-extension; - - description "Extension yang Module for SONiC OS"; - - revision 2019-07-01 { - description "First Revision"; - } -} diff --git a/src/sonic-yang-models/yang-models/sonic-interface.yang b/src/sonic-yang-models/yang-models/sonic-interface.yang index f559eb6be1b..746dbba46b7 100644 --- a/src/sonic-yang-models/yang-models/sonic-interface.yang +++ b/src/sonic-yang-models/yang-models/sonic-interface.yang @@ -7,12 +7,10 @@ module sonic-interface { import sonic-types { prefix stypes; - revision-date 2019-07-01; } import sonic-extension { prefix ext; - revision-date 2019-07-01; } import sonic-port { diff --git a/src/sonic-yang-models/yang-models/sonic-loopback-interface.yang b/src/sonic-yang-models/yang-models/sonic-loopback-interface.yang index 0414f3b9434..df59d3961fb 100644 --- a/src/sonic-yang-models/yang-models/sonic-loopback-interface.yang +++ b/src/sonic-yang-models/yang-models/sonic-loopback-interface.yang @@ -7,12 +7,10 @@ module sonic-loopback-interface { import sonic-types { prefix stypes; - revision-date 2019-07-01; } import sonic-extension { prefix ext; - revision-date 2019-07-01; } import sonic-vrf { diff --git a/src/sonic-yang-models/yang-models/sonic-port.yang b/src/sonic-yang-models/yang-models/sonic-port.yang index d2f63e57120..0e1c5db0b8f 100644 --- a/src/sonic-yang-models/yang-models/sonic-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-port.yang @@ -7,12 +7,10 @@ module sonic-port{ import sonic-types { prefix stypes; - revision-date 2019-07-01; } import sonic-extension { prefix ext; - revision-date 2019-07-01; } description "PORT yang Module for SONiC OS"; diff --git a/src/sonic-yang-models/yang-models/sonic-portchannel.yang b/src/sonic-yang-models/yang-models/sonic-portchannel.yang index 587a19e4bec..083a413527e 100644 --- a/src/sonic-yang-models/yang-models/sonic-portchannel.yang +++ b/src/sonic-yang-models/yang-models/sonic-portchannel.yang @@ -7,12 +7,10 @@ module sonic-portchannel { import sonic-types { prefix stypes; - revision-date 2019-07-01; } import sonic-extension { prefix ext; - revision-date 2019-07-01; } import sonic-port { @@ -138,7 +136,7 @@ module sonic-portchannel { path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name"; } } - + leaf port { /* key elements are mandatory by default */ type leafref { diff --git a/src/sonic-yang-models/yang-models/sonic-vlan.yang b/src/sonic-yang-models/yang-models/sonic-vlan.yang index f420b8f7b17..3e407442865 100644 --- a/src/sonic-yang-models/yang-models/sonic-vlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vlan.yang @@ -11,12 +11,10 @@ module sonic-vlan { import sonic-types { prefix stypes; - revision-date 2019-07-01; } import sonic-extension { prefix ext; - revision-date 2019-07-01; } import sonic-port { diff --git a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 index 63f4e54752e..1374b840cbf 100644 --- a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 @@ -225,6 +225,34 @@ module sonic-acl { } /* end of container ACL_RULE */ + container ACL_TABLE_TYPE { + list ACL_TABLE_TYPE_LIST { + key "ACL_TABLE_TYPE_NAME"; + + leaf ACL_TABLE_TYPE_NAME { + type string; + } + + leaf-list matches { + type string; + min-elements 1; + } + + leaf-list actions { + type string; + default ""; + } + + leaf-list bind_points { + type enumeration { + enum PORT; + enum LAG; + } + min-elements 1; + } + } + } + container ACL_TABLE { description "ACL_TABLE part of config_db.json"; @@ -245,7 +273,12 @@ module sonic-acl { leaf type { mandatory true; - type stypes:acl_table_type; + type union { + type leafref { + path "/acl:sonic-acl/acl:ACL_TABLE_TYPE/acl:ACL_TABLE_TYPE_LIST/acl:ACL_TABLE_TYPE_NAME"; + } + type stypes:acl_table_type; + } } leaf stage { diff --git a/src/sonic-yang-models/yang-templates/sonic-extension.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-extension.yang.j2 new file mode 100644 index 00000000000..142ef517b7c --- /dev/null +++ b/src/sonic-yang-models/yang-templates/sonic-extension.yang.j2 @@ -0,0 +1,41 @@ +module sonic-extension { + + yang-version 1.1; + + namespace "http://github.com/Azure/sonic-extension"; + prefix sonic-extension; + + description "Extension yang Module for SONiC OS"; + + revision 2019-07-01 { + description "First Revision"; + } + + /* For complete guide of using these extensions in SONiC yangs, refer + SONiC yang guidelines at + https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md */ + + extension db-name { + description "DB name, e.g. APPL_DB, CONFIG_DB"; + argument "value"; + } + + {% if yang_model_type == "cvl" %} + extension custom-validation-cvl { + description "Extension for registering cvl based custom validation handler."; + argument "handler"; + } + + extension dependent-on { + description + "Extension to define dependency on other table. During CREATE/UPDATE, + the action will be performed first on the Parent table and then on the + Dependent table. In DELETE operation, the Dependent table will be + deleted first and then the Parent table. This extension can be defined + only under List nodes. Table name should always be suffixed with '_LIST' + as modeled in yang. e.g. - dependent-on STP_LIST"; + argument "value"; + } + {% else %} + {% endif %} +} diff --git a/src/sonic-yang-models/yang-models/sonic-types.yang b/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 similarity index 74% rename from src/sonic-yang-models/yang-models/sonic-types.yang rename to src/sonic-yang-models/yang-templates/sonic-types.yang.j2 index 7bc9372536e..c28ea16c00b 100644 --- a/src/sonic-yang-models/yang-models/sonic-types.yang +++ b/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 @@ -155,6 +155,42 @@ module sonic-types { } } + typedef oper-status { + type enumeration { + enum unknown; + enum up; + enum down; + } + description "Operational status of an entity such as Port, MCLAG etc"; + } + + typedef mode-status { + type enumeration { + enum enable; + enum disable; + } + description + "This type can be used where toggle functionality required. + For ex. IPv6-link-local-only, Dhcp-replay-link-select, SNMP traps etc"; + } + + typedef dhcp-relay-policy-action { + type enumeration { + enum discard; + enum append; + enum replace; + } + description "DHCP relay policy action value"; + } + + typedef percentage { + type uint8 { + range "0..100"; + } + description + "Integer indicating a percentage value"; + } + typedef tpid_type { type string { pattern "0x8100|0x9100|0x9200|0x88a8|0x88A8"; @@ -185,4 +221,27 @@ module sonic-types { enum transit; } } + + + + /* Required for CVL */ + {% if yang_model_type == "cvl" %} + container operation { + description + "This definition is used internally by CVL and + is not exposed in NBI. Leaf 'operation' allows + evaluation of must expression for + CREATE/UPDATE/DELETE operation."; + + leaf operation { + type enumeration { + enum NOP; + enum CREATE; + enum UPDATE; + enum DELETE; + } + } + } + {% else %} + {% endif %} }