Skip to content

Commit

Permalink
Revert changes in openconfig-hashing.yang
Browse files Browse the repository at this point in the history
  • Loading branch information
atmanmehta committed Aug 31, 2023
1 parent 1389b90 commit 1274017
Showing 1 changed file with 123 additions and 91 deletions.
214 changes: 123 additions & 91 deletions release/models/hashing/openconfig-hashing.yang
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module openconfig-hashing {

yang-version "1";

// namespace
Expand Down Expand Up @@ -30,101 +29,116 @@ module openconfig-hashing {
}

// OpenConfig specific extensions for module metadata.
oc-ext:regexp-posix;
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";

typedef hash-field-type-ipv4 {
type enumeration {
enum NONE {
description "Do not use any IPv4 fields in the
calculation of the hash.";
}
enum SRC_ADDRESS {
description "Use only the IPv4 source address in the
calculation of the hash.";
}
enum DST_ADDRESS {
description "Use only the IPv4 destination address in the
calculation of the hash.";
}
enum BOTH {
description "Use both the IPv4 source and
destination addresses in the calculation of the
hash.";
}
enum TARGET_DEFINED {
description "Use the default fields that are used by
the device for calculating the hash.";
}
}
description "The IPv4 fields that should be used to
compute the hash.";
}

typedef hash-field-type-ipv6 {
type enumeration {
enum NONE {
description "Do not use any IPv6 fields in the
calculation of the hash.";
}
enum SRC_ADDRESS {
description "Use only the IPv6 source address in the
calculation of the hash.";
}
enum DST_ADDRESS {
description "Use only the IPv6 destination address in the
calculation of the hash.";
}
enum BOTH {
description "Use both the IPv6 source and
destination addresses in the calculation of the
hash.";
}
enum TARGET_DEFINED {
description "Use the default fields that are used by
the device for calculating the hash.";
}
enum FLOW_LABEL {
description "Use the flow label in the IPv6 header
to calculate the hash.";
}
}
description "The IPv6 fields that should be used to
compute the hash.";
}

typedef hash-field-type-transport {
type enumeration {
enum NONE {
description "Do not use any transport fields in the
calculation of the hash.";
}
enum SRC_PORT {
description "Use only the source port from the
transport header in the calculation of the hash.";
}
enum DST_PORT {
description "Use only the destination port from the
transport header in the calculation of the hash.";
}
enum BOTH {
description "Use both the source and
destination ports from the transport header in
the calculation of the hash.";
}
enum TARGET_DEFINED {
description "Use the default fields that are used by
the device for calculating the hash.";
}
}
description "The trasport layer fields that should be used to
compute the hash.";
}

grouping hashing-inputs {
description
"Top level container for inputs to be used for hashing policies.";
"Top level container for inputs to be used for hashing policies.";

container hash-field-modes {
description
"Fields to be used when calculating the hash.";
leaf ipv4 {
type enumeration {
enum NONE {
description "Do not use any IPv4 fields in the
calculation of the hash.";
}
enum SRC_ADDRESS {
description "Use only the IPv4 source address in the
calculation of the hash.";
}
enum DST_ADDRESS {
description "Use only the IPv4 destination address in the
calculation of the hash.";
}
enum BOTH {
description "Use both the IPv4 source and
destination addresses in the calculation of the
hash.";
}
enum TARGET_DEFINED {
description "Use the default fields that are used by
the device for calculating the hash.";
}
}
description "The IPv4 fields that should be used to
compute the hash.";
}
leaf ipv6 {
type enumeration {
enum NONE {
description "Do not use any IPv6 fields in the
calculation of the hash.";
}
enum SRC_ADDRESS {
description "Use only the IPv6 source address in the
calculation of the hash.";
}
enum DST_ADDRESS {
description "Use only the IPv6 destination address in the
calculation of the hash.";
}
enum BOTH {
description "Use both the IPv6 source and
destination addresses in the calculation of the
hash.";
}
enum TARGET_DEFINED {
description "Use the default fields that are used by
the device for calculating the hash.";
}
enum FLOW_LABEL {
description "Use the flow label in the IPv6 header
to calculate the hash.";
}
}
description "The IPv6 fields that should be used to
compute the hash.";
}
leaf transport-ports {
type enumeration {
enum NONE {
description "Do not use any transport fields in the
calculation of the hash.";
}
enum SRC_PORT {
description "Use only the source port from the
transport header in the calculation of the hash.";
}
enum DST_PORT {
description "Use only the destination port from the
transport header in the calculation of the hash.";
}
enum BOTH {
description "Use both the source and
destination ports from the transport header in
the calculation of the hash.";
}
enum TARGET_DEFINED {
description "Use the default fields that are used by
the device for calculating the hash.";
}
}
description "The trasport layer fields that should be used to
compute the hash.";
}
leaf ipv4 {
type hash-field-type-ipv4;
description "The IPv4 fields that should be used to
compute the hash.";
}
leaf ipv6 {
type hash-field-type-ipv6;
description "The IPv6 fields that should be used to
compute the hash.";
}
leaf transport-ports {
type hash-field-type-transport;
description "The transport layer fields that should be used to
compute the hash.";
}
}

Expand Down Expand Up @@ -161,7 +175,6 @@ module openconfig-hashing {
"The seed used to initialize the hash algorithm";
}

uses hashing-inputs;
}

grouping hashing-top {
Expand Down Expand Up @@ -190,6 +203,7 @@ module openconfig-hashing {
container config {
description
"Configurable items at the global hash policy level.";

uses hashing-policy-config;
}
container state {
Expand All @@ -200,7 +214,25 @@ module openconfig-hashing {

uses hashing-policy-config;
}
container hash-field-modes {
description
"Container for specifying inputs to be used when
calculating the hash.";
container config {
description
"Configurable items at the hashing inputs level.";
uses hashing-inputs;
}
container state {
config false;
description "Operational state data at the hashing
inputs level.";
uses hashing-inputs;
}
}
}
}
}

uses hashing-top;
}

0 comments on commit 1274017

Please sign in to comment.