-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from nagarwal03/oc-intf-common-code-Jan30
Adding support for OC YANG interfaces.
- Loading branch information
Showing
14 changed files
with
3,200 additions
and
1,652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
models/yang/annotations/openconfig-interfaces-annot.yang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
module openconfig-interfaces-annot { | ||
|
||
yang-version "1"; | ||
|
||
namespace "http://openconfig.net/yang/annotation/openconfig-interfaces-annot"; | ||
prefix "oc-interfaces-annot"; | ||
|
||
import sonic-extensions { prefix sonic-ext; } | ||
import openconfig-interfaces { prefix oc-intf; } | ||
import openconfig-if-ip {prefix oc-ip; } | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface { | ||
deviate add { | ||
sonic-ext:key-transformer "intf_tbl_key_xfmr"; | ||
sonic-ext:table-transformer "intf_table_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:config { | ||
deviate add { | ||
sonic-ext:subtree-transformer "intf_eth_port_config_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state { | ||
deviate add { | ||
sonic-ext:db-name "APPL_DB"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:auto-negotiate { | ||
deviate add { | ||
sonic-ext:field-transformer "intf_eth_auto_neg_xfmr"; | ||
sonic-ext:field-name "autoneg"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-eth:ethernet/oc-eth:state/oc-eth:port-speed { | ||
deviate add { | ||
sonic-ext:field-transformer "intf_eth_port_speed_xfmr"; | ||
sonic-ext:field-name "speed"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state { | ||
deviate add { | ||
sonic-ext:db-name "APPL_DB"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:config/oc-intf:mtu { | ||
deviate add { | ||
sonic-ext:field-transformer "intf_mtu_xfmr"; | ||
} | ||
} | ||
|
||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:admin-status { | ||
deviate add { | ||
sonic-ext:field-transformer "intf_admin_status_xfmr"; | ||
sonic-ext:field-name "admin_status"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:config/oc-intf:enabled { | ||
deviate add { | ||
sonic-ext:field-transformer "intf_enabled_xfmr"; | ||
sonic-ext:field-name "admin_status"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:state/oc-intf:enabled { | ||
deviate add { | ||
sonic-ext:field-transformer "intf_enabled_xfmr"; | ||
sonic-ext:field-name "admin_status"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces { | ||
deviate add { | ||
sonic-ext:pre-transformer "intf_pre_xfmr"; | ||
sonic-ext:post-transformer "intf_post_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces { | ||
deviate add { | ||
sonic-ext:table-name "NONE"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface { | ||
deviate add { | ||
sonic-ext:table-transformer "intf_subintfs_table_xfmr"; | ||
sonic-ext:virtual-table "true"; | ||
sonic-ext:key-transformer "intf_subintfs_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-intf:config/oc-intf:index { | ||
deviate add { | ||
sonic-ext:field-transformer "subif_index_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-intf:state/oc-intf:index { | ||
deviate add { | ||
sonic-ext:field-transformer "subif_index_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-ip:ipv4/oc-ip:addresses { | ||
deviate add { | ||
sonic-ext:table-name "NONE"; | ||
sonic-ext:subtree-transformer "intf_ip_addr_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-ip:ipv6/oc-ip:addresses { | ||
deviate add { | ||
sonic-ext:table-name "NONE"; | ||
sonic-ext:subtree-transformer "intf_ip_addr_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-ip:ipv4/oc-ip:addresses/oc-ip:address { | ||
deviate add { | ||
sonic-ext:key-transformer "subintf_ip_addr_key_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address { | ||
deviate add { | ||
sonic-ext:key-transformer "subintf_ip_addr_key_xfmr"; | ||
} | ||
} | ||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-ip:ipv4 { | ||
deviate add { | ||
sonic-ext:table-transformer "intf_table_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-ip:ipv6 { | ||
deviate add { | ||
sonic-ext:key-transformer "subintf_ipv6_tbl_key_xfmr"; | ||
sonic-ext:table-transformer "intf_table_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-ip:ipv6/oc-ip:config/oc-ip:enabled { | ||
deviate add { | ||
sonic-ext:field-transformer "ipv6_enabled_xfmr"; | ||
} | ||
} | ||
|
||
deviation /oc-intf:interfaces/oc-intf:interface/oc-intf:subinterfaces/oc-intf:subinterface/oc-ip:ipv6/oc-ip:state/oc-ip:enabled { | ||
deviate add { | ||
sonic-ext:field-transformer "ipv6_enabled_xfmr"; | ||
} | ||
} | ||
} |
Oops, something went wrong.