How to use Precedence method of types Package

Best Ginkgo code snippet using types.Precedence

Run Ginkgo automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

expr.go

Source: expr.go Github

copy
1package sql
2
3import (
4	"bytes"
5	"fmt"
6	"math"
7	"strconv"
8
9	"github.com/johncgriffin/overflow"
10
11	p "github.com/jrhy/sandbox/parse"
12	"github.com/jrhy/sandbox/sql/colval"
13	"github.com/jrhy/sandbox/sql/types"
14)
15
16func Expression(res **types.Evaluator) p.Func {
17	return binaryExpr(res)
18}
19
20func toInt(cv colval.ColumnValue) *int64 {
21	// TODO: sqlite equivalence: for arithmetic, parse strings to numbers
22	switch v := (cv).(type) {
23	case colval.Int:
24		i := int64(v)
25		return &i
26	case colval.Real:
27		i := int64(float64(v))
28		return &i
29	case colval.Text:
30		i, _ := strconv.ParseInt(string(v), 0, 64)
31		return &i
32	}
33	return nil
34}
35
36func toReal(cv colval.ColumnValue) *float64 {
37	switch v := (cv).(type) {
38	case colval.Int:
39		f := float64(v)
40		return &f
41	case colval.Real:
42		f := float64(v)
43		return &f
44	case colval.Text:
45		matches := RealValueRE.FindStringSubmatch(string(v))
46		var f float64
47		if len(matches) > 0 {
48			var err error
49			f, err = strconv.ParseFloat(matches[1], 64)
50			if err != nil {
51				fmt.Printf("ERRRRRRRRR %v\n", err)
52			}
53		}
54		return &f
55	}
56	return nil
57}
58
59func toBool(cv colval.ColumnValue) *bool {
60	switch v := (cv).(type) {
61	case colval.Int:
62		b := v != 0
63		return &b
64	case colval.Real:
65		b := v != 0.0
66		return &b
67	case colval.Null:
68		return nil
69	}
70	b := false
71	return &b
72}
73
74func precedence(op string) int {
75	switch op {
76	case "or":
77		return 1
78	case "and":
79		return 2
80	case "not":
81		return 3
82	case "=", "!=", "==", "<>":
83		return 4
84	case "<", "<=", ">", ">=":
85		return 5
86	case "+", "-":
87		return 6
88	case "*", "/", "%":
89		return 7
90	default:
91		panic(op)
92	}
93}
94
95func binaryExpr(res **types.Evaluator) p.Func {
96	var cv colval.ColumnValue
97	var name string
98	cvParser := ColumnValueParser(&cv)
99	colRefParser := SQLName(&name)
100	return func(e *p.Parser) bool {
101		var valStack []types.Evaluator
102		var opStack []string
103		var precStack []int
104		var minPrecedence = 1
105		for {
106			name = ""
107			e.SkipWS()
108			unaryMinus := 0
109			for {
110				if e.Exact("-") {
111					unaryMinus++
112				} else if e.Exact("+") {
113
114				} else {
115					break
116				}
117				e.SkipWS()
118			}
119			if unaryMinus%2 == 1 {
120				valStack = append(valStack, types.Evaluator{Func: func(_ map[string]colval.ColumnValue) colval.ColumnValue { return colval.Int(0) }})
121				opStack = append(opStack, "-")
122				precStack = append(precStack, minPrecedence)
123			}
124			if e.Exact("(") {
125				var ev *types.Evaluator
126				subExpressionParser := binaryExpr(&ev)
127				if e.Match(subExpressionParser) && e.SkipWS() && e.Exact(")") {
128					valStack = append(valStack, *ev)
129				} else {
130					return false
131				}
132			} else if e.Match(cvParser) {
133				fmt.Printf("got cv: %v\n", cv)
134				cv := cv
135				valStack = append(valStack, types.Evaluator{Func: func(_ map[string]colval.ColumnValue) colval.ColumnValue { return cv }})
136			} else if e.Match(colRefParser) {
137				name := name
138				valStack = append(valStack, types.Evaluator{
139					Func: func(inputs map[string]colval.ColumnValue) colval.ColumnValue {
140						fmt.Printf("deref! %s -> %v\n", name, inputs[name])
141						res, ok := inputs[name]
142						if !ok {
143							panic(fmt.Errorf("column reference missing in inputs: %s", name))
144						}
145						return res
146					},
147					Inputs: map[string]struct{}{name: {}},
148				})
149			} else {
150				fmt.Printf("NO EXPR MATCH\n")
151				return false
152			}
153			e.SkipWS()
154			for {
155				fmt.Printf("input: %s\n", e.Remaining)
156				/*
157					fmt.Printf("valStack: ")
158					for i := range valStack {
159						fmt.Printf("%d ", valStack[i])
160					}*/
161				fmt.Printf("\nopStack: ")
162				for i := range opStack {
163					fmt.Printf("%s ", opStack[i])
164				}
165				fmt.Printf("\nprecStack: ")
166				for i := range precStack {
167					fmt.Printf("%d ", precStack[i])
168				}
169				fmt.Printf("\n")
170
171				matchWithPrecedence := func(op string) bool {
172					opPrecedence := precedence(op)
173					if minPrecedence > opPrecedence {
174						return false
175					}
176					if !e.Exact(op) {
177						return false
178					}
179					fmt.Printf("pushing %s\n", op)
180					opStack = append(opStack, op)
181					precStack = append(precStack, minPrecedence)
182					if opPrecedence > minPrecedence {
183						fmt.Printf("upshift!\n")
184					}
185					minPrecedence = opPrecedence
186					return true
187				}
188				if matchWithPrecedence("not") ||
189					matchWithPrecedence("and") ||
190					matchWithPrecedence("or") ||
191					matchWithPrecedence("==") ||
192					matchWithPrecedence("=") ||
193					matchWithPrecedence("!=") ||
194					matchWithPrecedence("<>") ||
195					matchWithPrecedence("<=") ||
196					matchWithPrecedence("<") ||
197					matchWithPrecedence(">=") ||
198					matchWithPrecedence(">") ||
199					matchWithPrecedence("+") ||
200					matchWithPrecedence("-") ||
201					matchWithPrecedence("*") ||
202					matchWithPrecedence("%") ||
203					matchWithPrecedence("/") {
204					break
205				} else if len(valStack) >= 2 {
206					fmt.Printf("downshift!\n")
207					op := opStack[len(opStack)-1]
208					vals := valStack[len(valStack)-2:]
209					minPrecedence = precStack[len(precStack)-1]
210					precStack = precStack[:len(precStack)-1]
211					valStack = valStack[:len(valStack)-2]
212					opStack = opStack[:len(opStack)-1]
213					fmt.Printf("vals: %v, op %s\n", vals, op)
214					switch op {
215					case "or":
216						valStack = append(valStack, or(vals))
217					case "and":
218						valStack = append(valStack, and(vals))
219					case "-":
220						valStack = append(valStack,
221							binaryArithmetic(vals,
222								overflow.Sub64, func(a, b float64) float64 { return a - b }))
223					case "+":
224						valStack = append(valStack,
225							binaryArithmetic(vals,
226								overflow.Add64, func(a, b float64) float64 { return a + b }))
227					case "*":
228						valStack = append(valStack,
229							binaryArithmetic(vals,
230								overflow.Mul64, func(a, b float64) float64 { return a * b }))
231					case "/":
232						valStack = append(valStack,
233							binaryArithmetic(vals,
234								overflow.Div64, func(a, b float64) float64 { return a / b }))
235					case "%":
236						valStack = append(valStack,
237							binaryArithmetic(vals,
238								func(a, b int64) (int64, bool) { return a % b, true },
239								func(a, b float64) float64 { return math.Remainder(a, b) + b }))
240					case "!=", "<>":
241						valStack = append(valStack,
242							binaryComparison(vals,
243								func(a, b int64) bool { return a != b },
244								func(a, b float64) bool { return a != b }))
245					case "<":
246						valStack = append(valStack,
247							binaryComparison(vals,
248								func(a, b int64) bool { return a < b },
249								func(a, b float64) bool { return a < b }))
250					case "<=":
251						valStack = append(valStack,
252							binaryComparison(vals,
253								func(a, b int64) bool { return a <= b },
254								func(a, b float64) bool { return a <= b }))
255					case ">":
256						valStack = append(valStack,
257							binaryComparison(vals,
258								func(a, b int64) bool { return a > b },
259								func(a, b float64) bool { return a > b }))
260					case ">=":
261						valStack = append(valStack,
262							binaryComparison(vals,
263								func(a, b int64) bool { return a >= b },
264								func(a, b float64) bool { return a >= b }))
265					case "=":
266						valStack = append(valStack, equal(vals))
267					default:
268						panic(op)
269					}
270					continue
271				} else if len(valStack) == 1 {
272					fmt.Printf("DONE\n")
273					v := valStack[0]
274					*res = &v
275					return true
276				}
277				break
278			}
279		}
280	}
281}
282
283func requireDimensions(x, y int, cv [][]colval.ColumnValue) error {
284	if len(cv) != y || y > 0 && len(cv[0]) != x {
285		return fmt.Errorf("require %dx%d dimensions", x, y)
286	}
287	return nil
288}
289
290func requireSingle(cv [][]colval.ColumnValue) error { return requireDimensions(1, 1, cv) }
291
292func combineInputs(evaluators []types.Evaluator) map[string]struct{} {
293	combined := make(map[string]struct{}, len(evaluators)*2)
294	for i := range evaluators {
295		for k := range evaluators[i].Inputs {
296			combined[k] = struct{}{}
297		}
298	}
299	return combined
300}
301
302func equal(inputs []types.Evaluator) types.Evaluator {
303	capture := []types.Evaluator{inputs[0], inputs[1]}
304	return types.Evaluator{
305		Inputs: combineInputs(capture),
306		Func: func(inputs map[string]colval.ColumnValue) colval.ColumnValue {
307			col := []colval.ColumnValue{capture[0].Func(inputs), capture[1].Func(inputs)}
308			if isNull(col[0]) || isNull(col[1]) {
309				return colval.Null{}
310			}
311			if isText(col[0]) && isText(col[1]) {
312				return boolCV(col[0].(colval.Text) == col[1].(colval.Text))
313			}
314			if isBlob(col[0]) && isBlob(col[1]) {
315				return boolCV(bytes.Equal(col[0].(colval.Blob), col[1].(colval.Blob)))
316			}
317			if isInt(col[0]) {
318				if isInt(col[1]) {
319					return boolCV(col[0].(colval.Int) == col[1].(colval.Int))
320				}
321				if isReal(col[1]) {
322					return boolCV(float64(col[0].(colval.Int)) == float64(col[1].(colval.Real)))
323				}
324			}
325			if isReal(col[0]) {
326				if isInt(col[1]) {
327					return boolCV(float64(col[0].(colval.Real)) == float64(col[1].(colval.Int)))
328				}
329				if isReal(col[1]) {
330					return boolCV(col[0].(colval.Real) == col[1].(colval.Real))
331				}
332			}
333			return boolCV(false)
334		}}
335}
336func boolCV(b bool) colval.ColumnValue {
337	if b {
338		return colval.Int(1)
339	} else {
340		return colval.Int(0)
341	}
342}
343
344func isNull(cv colval.ColumnValue) bool {
345	_, isNull := cv.(colval.Null)
346	return isNull
347}
348func isInt(cv colval.ColumnValue) bool {
349	_, isInt := cv.(colval.Int)
350	return isInt
351}
352func isIntText(cv colval.ColumnValue) bool {
353	s, isText := cv.(colval.Text)
354	return isText && IntValueRE.MatchString(string(s))
355}
356func intTextValue(cv colval.ColumnValue, res *int64) bool {
357	s, isText := cv.(colval.Text)
358	if !isText {
359		return false
360	}
361	i, err := strconv.ParseInt(string(s), 0, 64)
362	if err != nil {
363		return false
364	}
365	*res = i
366	return true
367}
368func isReal(cv colval.ColumnValue) bool {
369	_, isReal := cv.(colval.Real)
370	return isReal
371}
372func isRealText(cv colval.ColumnValue) bool {
373	s, isText := cv.(colval.Text)
374	return isText && RealValueRE.MatchString(string(s))
375}
376func realTextValue(cv colval.ColumnValue, res *float64) bool {
377	s, isText := cv.(colval.Text)
378	if !isText {
379		return false
380	}
381	f, err := strconv.ParseFloat(string(s), 64)
382	if err != nil {
383		return false
384	}
385	*res = f
386	return true
387}
388func isText(cv colval.ColumnValue) bool {
389	_, isText := cv.(colval.Text)
390	return isText
391}
392func isBlob(cv colval.ColumnValue) bool {
393	_, isBlob := cv.(colval.Blob)
394	return isBlob
395}
396
397func or(inputs []types.Evaluator) types.Evaluator {
398	capture := []types.Evaluator{inputs[0], inputs[1]}
399	return types.Evaluator{
400		Inputs: combineInputs(capture),
401		Func: func(inputs map[string]colval.ColumnValue) colval.ColumnValue {
402			col := []colval.ColumnValue{capture[0].Func(inputs), capture[1].Func(inputs)}
403			left := toBool(col[0])
404			if left != nil && *left {
405				return colval.Int(1)
406			}
407			right := toBool(col[1])
408			if right != nil && *right {
409				return colval.Int(1)
410			}
411			if left == nil || right == nil {
412				return colval.Null{}
413			}
414			return colval.Int(0)
415		}}
416}
417
418func and(inputs []types.Evaluator) types.Evaluator {
419	capture := []types.Evaluator{inputs[0], inputs[1]}
420	return types.Evaluator{
421		Inputs: combineInputs(capture),
422		Func: func(inputs map[string]colval.ColumnValue) colval.ColumnValue {
423			col := []colval.ColumnValue{capture[0].Func(inputs), capture[1].Func(inputs)}
424			left := toBool(col[0])
425			right := toBool(col[1])
426			if left != nil && right != nil {
427				return boolCV(*left && *right)
428			}
429			if left != nil && !*left || right != nil && !*right {
430				return colval.Int(0)
431			}
432			return colval.Null{}
433		}}
434}
435
436func binaryArithmetic(
437	inputs []types.Evaluator,
438	intFunc func(int64, int64) (int64, bool),
439	realFunc func(float64, float64) float64,
440) types.Evaluator {
441	capture := []types.Evaluator{inputs[0], inputs[1]}
442	return types.Evaluator{
443		Inputs: combineInputs(capture),
444		Func: func(inputs map[string]colval.ColumnValue) colval.ColumnValue {
445			col := []colval.ColumnValue{capture[0].Func(inputs), capture[1].Func(inputs)}
446			if isNull(col[0]) || isNull(col[1]) {
447				return colval.Null{}
448			}
449			if isReal(col[0]) || isRealText(col[0]) || isReal(col[1]) || isRealText(col[1]) {
450				return colval.Real(realFunc(*toReal(col[0]), *toReal(col[1])))
451			}
452			left := *toInt(col[0])
453			right := *toInt(col[1])
454			res, ok := intFunc(left, right)
455			if !ok {
456				return colval.Real(realFunc(*toReal(col[0]), *toReal(col[1])))
457			}
458			return colval.Int(res)
459		}}
460}
461
462/*
463func binaryComparison(
464	inputs []types.Evaluator,
465	intFunc func(int64, int64) (bool, bool),
466	realFunc func(float64, float64) bool,
467) types.Evaluator {
468	arithmeticEvaluator := binaryArithmetic(inputs,
469		func(a, b int64) (int64, bool) {
470		if res, _ := intFunc(a,b); res { return 1, true }
471		return 0, true
472	}, func(a, b float64) float64 {
473		if realFunc(a,b) { return 1.0 }
474		return 0.0
475	})
476	inner := arithmeticEvaluator.Func
477	arithmeticEvaluator.Func =
478		func(inputs map[string]colval.ColumnValue) colval.ColumnValue {
479			cv :=  inner(inputs)
480			if r, isReal := cv.(colval.Real) {
481				return colval.Int(int64(r))
482			}
483		}
484
485	return arithmeticEvaluator
486}*/
487func binaryComparison(
488	inputs []types.Evaluator,
489	intFunc func(int64, int64) bool,
490	realFunc func(float64, float64) bool,
491) types.Evaluator {
492	capture := []types.Evaluator{inputs[0], inputs[1]}
493	return types.Evaluator{
494		Inputs: combineInputs(capture),
495		Func: func(inputs map[string]colval.ColumnValue) colval.ColumnValue {
496			col := []colval.ColumnValue{capture[0].Func(inputs), capture[1].Func(inputs)}
497			if isNull(col[0]) || isNull(col[1]) {
498				return colval.Null{}
499			}
500			if isReal(col[0]) || isRealText(col[0]) || isReal(col[1]) || isRealText(col[1]) {
501				return boolCV(realFunc(*toReal(col[0]), *toReal(col[1])))
502			}
503			return boolCV(intFunc(*toInt(col[0]), *toInt(col[1])))
504		}}
505}
506
Full Screen

gate.go

Source: gate.go Github

copy
1package model
2
3import (
4	"sort"
5
6	"github.com/Sirupsen/logrus"
7)
8
9// BooleanGateType is a binary gate.
10//
11// ActorsGateType will enable if the given actor(s) are in a known, approved
12// list of actors.
13//
14// GroupsGateType will enable if the given group(s) are in the known, approved
15// list of actors.
16//
17// PercentOfActorsGateType will first validate that the actor is allowed, then
18// hash the actor to see if they are within a percentage of enabled users in
19// that list.
20//
21// PercentOfTimeGateType will enable the gate a percentage of the time.
22const (
23	BooleanGateType         = "boolean"
24	ActorsGateType          = "actors"
25	GroupsGateType          = "groups"
26	PercentOfActorsGateType = "percentOfActors"
27	PercentOfTimeGateType   = "percentOfTime"
28)
29
30// Gate NODOC
31type Gate struct {
32	Value         string   `json:"value,omitempty"`
33	Groups        []string `json:"groups,omitempty"`
34	Actors        []string `json:"actors,omitempty"`
35	ActorPercent  int      `json:"actorPercent,omitempty"`
36	PercentOfTime int      `json:"percentOfTime,omitempty"`
37}
38
39// Types returns a slice of all types of the gate, in order of evaluation
40// precedence.
41func (g *Gate) Types() (types []string) {
42	if g.Value == "true" || g.Value == "false" {
43		types = append(types, BooleanGateType)
44	}
45	if len(g.Actors) > 0 {
46		if g.ActorPercent > 0 {
47			types = append(types, PercentOfActorsGateType)
48		} else {
49			types = append(types, ActorsGateType)
50		}
51	}
52	if len(g.Groups) > 0 {
53		types = append(types, GroupsGateType)
54	}
55	if g.PercentOfTime > 0 {
56		types = append(types, PercentOfTimeGateType)
57	}
58	sort.Sort(byPrecedence(types))
59	return
60}
61
62// From highest precedence to lowest.
63var gatePrecedence = []string{
64	BooleanGateType,
65	GroupsGateType,
66	ActorsGateType,
67	PercentOfActorsGateType,
68	PercentOfTimeGateType,
69}
70
71type byPrecedence []string
72
73func (s byPrecedence) Len() int {
74	return len(s)
75}
76
77func (s byPrecedence) Swap(i, j int) {
78	s[i], s[j] = s[j], s[i]
79}
80
81func (s byPrecedence) Less(i, j int) bool {
82	return s.pos(s[i]) < s.pos(s[j])
83}
84
85func (s byPrecedence) pos(val string) int {
86	for i, g := range gatePrecedence {
87		if g == val {
88			return i
89		}
90	}
91	logrus.WithField("val", val).Error("Unknown value for byPrecedence sorter")
92	return 0
93}
94
Full Screen

asr9k_prm_cfg.go

Source: asr9k_prm_cfg.go Github

copy
1// This module contains a collection of YANG definitions
2// for Cisco IOS-XR asr9k-prm package configuration.
3// 
4// This module contains definitions
5// for the following management objects:
6//   hardware-module-qos-mode: QoS mode in hardware module port(s)
7//   hardware-module-tcp-mss-adjust: hardware module tcp mss adjust
8//   hardware-module-tcam: hardware module tcam
9//   hardware-module-efd: hardware module efd
10//   hardware-module-all-qos-mode: hardware module all qos mode
11// 
12// Copyright (c) 2013-2018 by Cisco Systems, Inc.
13// All rights reserved.
14package asr9k_prm_cfg
15
16import (
17    "fmt"
18    "github.com/CiscoDevNet/ydk-go/ydk"
19    "github.com/CiscoDevNet/ydk-go/ydk/types"
20    "github.com/CiscoDevNet/ydk-go/ydk/types/yfilter"
21    "github.com/CiscoDevNet/ydk-go/ydk/models/cisco_ios_xr"
22    "reflect"
23)
24
25func init() {
26    ydk.YLogDebug(fmt.Sprintf("Registering top level entities for package asr9k_prm_cfg"))
27    ydk.RegisterEntity("{http://cisco.com/ns/yang/Cisco-IOS-XR-asr9k-prm-cfg hardware-module-qos-mode}", reflect.TypeOf(HardwareModuleQosMode{}))
28    ydk.RegisterEntity("Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-qos-mode", reflect.TypeOf(HardwareModuleQosMode{}))
29    ydk.RegisterEntity("{http://cisco.com/ns/yang/Cisco-IOS-XR-asr9k-prm-cfg hardware-module-tcp-mss-adjust}", reflect.TypeOf(HardwareModuleTcpMssAdjust{}))
30    ydk.RegisterEntity("Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcp-mss-adjust", reflect.TypeOf(HardwareModuleTcpMssAdjust{}))
31    ydk.RegisterEntity("{http://cisco.com/ns/yang/Cisco-IOS-XR-asr9k-prm-cfg hardware-module-tcam}", reflect.TypeOf(HardwareModuleTcam{}))
32    ydk.RegisterEntity("Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcam", reflect.TypeOf(HardwareModuleTcam{}))
33    ydk.RegisterEntity("{http://cisco.com/ns/yang/Cisco-IOS-XR-asr9k-prm-cfg hardware-module-efd}", reflect.TypeOf(HardwareModuleEfd{}))
34    ydk.RegisterEntity("Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd", reflect.TypeOf(HardwareModuleEfd{}))
35    ydk.RegisterEntity("{http://cisco.com/ns/yang/Cisco-IOS-XR-asr9k-prm-cfg hardware-module-all-qos-mode}", reflect.TypeOf(HardwareModuleAllQosMode{}))
36    ydk.RegisterEntity("Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-all-qos-mode", reflect.TypeOf(HardwareModuleAllQosMode{}))
37}
38
39// Asr9kEfdMode represents Asr9k efd mode
40type Asr9kEfdMode string
41
42const (
43    // Only check outer encap
44    Asr9kEfdMode_only_outer_encap Asr9kEfdMode = "only-outer-encap"
45
46    // Check outer and inner encap
47    Asr9kEfdMode_include_inner_encap Asr9kEfdMode = "include-inner-encap"
48)
49
50// Asr9kEfdOperation represents Asr9k efd operation
51type Asr9kEfdOperation string
52
53const (
54    // Less than
55    Asr9kEfdOperation_less_than Asr9kEfdOperation = "less-than"
56
57    // Greater than or equal
58    Asr9kEfdOperation_greater_than_or_equal Asr9kEfdOperation = "greater-than-or-equal"
59)
60
61// PrmTcamProfile represents Prm tcam profile
62type PrmTcamProfile string
63
64const (
65    // Profile 0
66    PrmTcamProfile_profile0 PrmTcamProfile = "profile0"
67
68    // Profile 1
69    PrmTcamProfile_profile1 PrmTcamProfile = "profile1"
70
71    // Profile 2
72    PrmTcamProfile_profile2 PrmTcamProfile = "profile2"
73)
74
75// HardwareModuleQosMode
76// QoS mode in hardware module port(s)
77type HardwareModuleQosMode struct {
78    EntityData types.CommonEntityData
79    YFilter yfilter.YFilter
80
81    // QoS applicable nodes.
82    Nodes HardwareModuleQosMode_Nodes
83}
84
85func (hardwareModuleQosMode *HardwareModuleQosMode) GetEntityData() *types.CommonEntityData {
86    hardwareModuleQosMode.EntityData.YFilter = hardwareModuleQosMode.YFilter
87    hardwareModuleQosMode.EntityData.YangName = "hardware-module-qos-mode"
88    hardwareModuleQosMode.EntityData.BundleName = "cisco_ios_xr"
89    hardwareModuleQosMode.EntityData.ParentYangName = "Cisco-IOS-XR-asr9k-prm-cfg"
90    hardwareModuleQosMode.EntityData.SegmentPath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-qos-mode"
91    hardwareModuleQosMode.EntityData.AbsolutePath = hardwareModuleQosMode.EntityData.SegmentPath
92    hardwareModuleQosMode.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
93    hardwareModuleQosMode.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
94    hardwareModuleQosMode.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
95
96    hardwareModuleQosMode.EntityData.Children = types.NewOrderedMap()
97    hardwareModuleQosMode.EntityData.Children.Append("nodes", types.YChild{"Nodes", &hardwareModuleQosMode.Nodes})
98    hardwareModuleQosMode.EntityData.Leafs = types.NewOrderedMap()
99
100    hardwareModuleQosMode.EntityData.YListKeys = []string {}
101
102    return &(hardwareModuleQosMode.EntityData)
103}
104
105// HardwareModuleQosMode_Nodes
106// QoS applicable nodes
107type HardwareModuleQosMode_Nodes struct {
108    EntityData types.CommonEntityData
109    YFilter yfilter.YFilter
110
111    // A node. The type is slice of HardwareModuleQosMode_Nodes_Node.
112    Node []*HardwareModuleQosMode_Nodes_Node
113}
114
115func (nodes *HardwareModuleQosMode_Nodes) GetEntityData() *types.CommonEntityData {
116    nodes.EntityData.YFilter = nodes.YFilter
117    nodes.EntityData.YangName = "nodes"
118    nodes.EntityData.BundleName = "cisco_ios_xr"
119    nodes.EntityData.ParentYangName = "hardware-module-qos-mode"
120    nodes.EntityData.SegmentPath = "nodes"
121    nodes.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-qos-mode/" + nodes.EntityData.SegmentPath
122    nodes.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
123    nodes.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
124    nodes.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
125
126    nodes.EntityData.Children = types.NewOrderedMap()
127    nodes.EntityData.Children.Append("node", types.YChild{"Node", nil})
128    for i := range nodes.Node {
129        nodes.EntityData.Children.Append(types.GetSegmentPath(nodes.Node[i]), types.YChild{"Node", nodes.Node[i]})
130    }
131    nodes.EntityData.Leafs = types.NewOrderedMap()
132
133    nodes.EntityData.YListKeys = []string {}
134
135    return &(nodes.EntityData)
136}
137
138// HardwareModuleQosMode_Nodes_Node
139// A node
140type HardwareModuleQosMode_Nodes_Node struct {
141    EntityData types.CommonEntityData
142    YFilter yfilter.YFilter
143    YListKey string
144
145    // This attribute is a key. Node ID. The type is string with pattern:
146    // ([a-zA-Z0-9_]*\d+/){1,2}([a-zA-Z0-9_]*\d+).
147    NodeName interface{}
148
149    // Disable child level/flat policy shaping. The type is interface{}.
150    ChildShapingDisable interface{}
151
152    // Enable low burst mode for TM entity. The type is interface{}.
153    LowburstEnable interface{}
154}
155
156func (node *HardwareModuleQosMode_Nodes_Node) GetEntityData() *types.CommonEntityData {
157    node.EntityData.YFilter = node.YFilter
158    node.EntityData.YangName = "node"
159    node.EntityData.BundleName = "cisco_ios_xr"
160    node.EntityData.ParentYangName = "nodes"
161    node.EntityData.SegmentPath = "node" + types.AddKeyToken(node.NodeName, "node-name")
162    node.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-qos-mode/nodes/" + node.EntityData.SegmentPath
163    node.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
164    node.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
165    node.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
166
167    node.EntityData.Children = types.NewOrderedMap()
168    node.EntityData.Leafs = types.NewOrderedMap()
169    node.EntityData.Leafs.Append("node-name", types.YLeaf{"NodeName", node.NodeName})
170    node.EntityData.Leafs.Append("child-shaping-disable", types.YLeaf{"ChildShapingDisable", node.ChildShapingDisable})
171    node.EntityData.Leafs.Append("lowburst-enable", types.YLeaf{"LowburstEnable", node.LowburstEnable})
172
173    node.EntityData.YListKeys = []string {"NodeName"}
174
175    return &(node.EntityData)
176}
177
178// HardwareModuleTcpMssAdjust
179// hardware module tcp mss adjust
180type HardwareModuleTcpMssAdjust struct {
181    EntityData types.CommonEntityData
182    YFilter yfilter.YFilter
183
184    // TCP MSS Adjust applicable nodes.
185    Nodes HardwareModuleTcpMssAdjust_Nodes
186}
187
188func (hardwareModuleTcpMssAdjust *HardwareModuleTcpMssAdjust) GetEntityData() *types.CommonEntityData {
189    hardwareModuleTcpMssAdjust.EntityData.YFilter = hardwareModuleTcpMssAdjust.YFilter
190    hardwareModuleTcpMssAdjust.EntityData.YangName = "hardware-module-tcp-mss-adjust"
191    hardwareModuleTcpMssAdjust.EntityData.BundleName = "cisco_ios_xr"
192    hardwareModuleTcpMssAdjust.EntityData.ParentYangName = "Cisco-IOS-XR-asr9k-prm-cfg"
193    hardwareModuleTcpMssAdjust.EntityData.SegmentPath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcp-mss-adjust"
194    hardwareModuleTcpMssAdjust.EntityData.AbsolutePath = hardwareModuleTcpMssAdjust.EntityData.SegmentPath
195    hardwareModuleTcpMssAdjust.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
196    hardwareModuleTcpMssAdjust.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
197    hardwareModuleTcpMssAdjust.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
198
199    hardwareModuleTcpMssAdjust.EntityData.Children = types.NewOrderedMap()
200    hardwareModuleTcpMssAdjust.EntityData.Children.Append("nodes", types.YChild{"Nodes", &hardwareModuleTcpMssAdjust.Nodes})
201    hardwareModuleTcpMssAdjust.EntityData.Leafs = types.NewOrderedMap()
202
203    hardwareModuleTcpMssAdjust.EntityData.YListKeys = []string {}
204
205    return &(hardwareModuleTcpMssAdjust.EntityData)
206}
207
208// HardwareModuleTcpMssAdjust_Nodes
209// TCP MSS Adjust applicable nodes
210type HardwareModuleTcpMssAdjust_Nodes struct {
211    EntityData types.CommonEntityData
212    YFilter yfilter.YFilter
213
214    // A node. The type is slice of HardwareModuleTcpMssAdjust_Nodes_Node.
215    Node []*HardwareModuleTcpMssAdjust_Nodes_Node
216}
217
218func (nodes *HardwareModuleTcpMssAdjust_Nodes) GetEntityData() *types.CommonEntityData {
219    nodes.EntityData.YFilter = nodes.YFilter
220    nodes.EntityData.YangName = "nodes"
221    nodes.EntityData.BundleName = "cisco_ios_xr"
222    nodes.EntityData.ParentYangName = "hardware-module-tcp-mss-adjust"
223    nodes.EntityData.SegmentPath = "nodes"
224    nodes.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcp-mss-adjust/" + nodes.EntityData.SegmentPath
225    nodes.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
226    nodes.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
227    nodes.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
228
229    nodes.EntityData.Children = types.NewOrderedMap()
230    nodes.EntityData.Children.Append("node", types.YChild{"Node", nil})
231    for i := range nodes.Node {
232        nodes.EntityData.Children.Append(types.GetSegmentPath(nodes.Node[i]), types.YChild{"Node", nodes.Node[i]})
233    }
234    nodes.EntityData.Leafs = types.NewOrderedMap()
235
236    nodes.EntityData.YListKeys = []string {}
237
238    return &(nodes.EntityData)
239}
240
241// HardwareModuleTcpMssAdjust_Nodes_Node
242// A node
243type HardwareModuleTcpMssAdjust_Nodes_Node struct {
244    EntityData types.CommonEntityData
245    YFilter yfilter.YFilter
246    YListKey string
247
248    // This attribute is a key. Node ID. The type is string with pattern:
249    // ([a-zA-Z0-9_]*\d+/){1,2}([a-zA-Z0-9_]*\d+).
250    NodeName interface{}
251
252    // TCP MSS Adjust NPs.
253    Nps HardwareModuleTcpMssAdjust_Nodes_Node_Nps
254}
255
256func (node *HardwareModuleTcpMssAdjust_Nodes_Node) GetEntityData() *types.CommonEntityData {
257    node.EntityData.YFilter = node.YFilter
258    node.EntityData.YangName = "node"
259    node.EntityData.BundleName = "cisco_ios_xr"
260    node.EntityData.ParentYangName = "nodes"
261    node.EntityData.SegmentPath = "node" + types.AddKeyToken(node.NodeName, "node-name")
262    node.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcp-mss-adjust/nodes/" + node.EntityData.SegmentPath
263    node.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
264    node.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
265    node.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
266
267    node.EntityData.Children = types.NewOrderedMap()
268    node.EntityData.Children.Append("nps", types.YChild{"Nps", &node.Nps})
269    node.EntityData.Leafs = types.NewOrderedMap()
270    node.EntityData.Leafs.Append("node-name", types.YLeaf{"NodeName", node.NodeName})
271
272    node.EntityData.YListKeys = []string {"NodeName"}
273
274    return &(node.EntityData)
275}
276
277// HardwareModuleTcpMssAdjust_Nodes_Node_Nps
278// TCP MSS Adjust NPs
279type HardwareModuleTcpMssAdjust_Nodes_Node_Nps struct {
280    EntityData types.CommonEntityData
281    YFilter yfilter.YFilter
282
283    // NP number. The type is slice of
284    // HardwareModuleTcpMssAdjust_Nodes_Node_Nps_Np.
285    Np []*HardwareModuleTcpMssAdjust_Nodes_Node_Nps_Np
286}
287
288func (nps *HardwareModuleTcpMssAdjust_Nodes_Node_Nps) GetEntityData() *types.CommonEntityData {
289    nps.EntityData.YFilter = nps.YFilter
290    nps.EntityData.YangName = "nps"
291    nps.EntityData.BundleName = "cisco_ios_xr"
292    nps.EntityData.ParentYangName = "node"
293    nps.EntityData.SegmentPath = "nps"
294    nps.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcp-mss-adjust/nodes/node/" + nps.EntityData.SegmentPath
295    nps.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
296    nps.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
297    nps.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
298
299    nps.EntityData.Children = types.NewOrderedMap()
300    nps.EntityData.Children.Append("np", types.YChild{"Np", nil})
301    for i := range nps.Np {
302        nps.EntityData.Children.Append(types.GetSegmentPath(nps.Np[i]), types.YChild{"Np", nps.Np[i]})
303    }
304    nps.EntityData.Leafs = types.NewOrderedMap()
305
306    nps.EntityData.YListKeys = []string {}
307
308    return &(nps.EntityData)
309}
310
311// HardwareModuleTcpMssAdjust_Nodes_Node_Nps_Np
312// NP number
313type HardwareModuleTcpMssAdjust_Nodes_Node_Nps_Np struct {
314    EntityData types.CommonEntityData
315    YFilter yfilter.YFilter
316    YListKey string
317
318    // This attribute is a key. Number between 0-7. The type is interface{} with
319    // range: 0..7.
320    NpId interface{}
321
322    // TCP MSS Adjust value. The type is interface{} with range: 1280..1535. Units
323    // are byte.
324    AdjustValue interface{}
325}
326
327func (np *HardwareModuleTcpMssAdjust_Nodes_Node_Nps_Np) GetEntityData() *types.CommonEntityData {
328    np.EntityData.YFilter = np.YFilter
329    np.EntityData.YangName = "np"
330    np.EntityData.BundleName = "cisco_ios_xr"
331    np.EntityData.ParentYangName = "nps"
332    np.EntityData.SegmentPath = "np" + types.AddKeyToken(np.NpId, "np-id")
333    np.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcp-mss-adjust/nodes/node/nps/" + np.EntityData.SegmentPath
334    np.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
335    np.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
336    np.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
337
338    np.EntityData.Children = types.NewOrderedMap()
339    np.EntityData.Leafs = types.NewOrderedMap()
340    np.EntityData.Leafs.Append("np-id", types.YLeaf{"NpId", np.NpId})
341    np.EntityData.Leafs.Append("adjust-value", types.YLeaf{"AdjustValue", np.AdjustValue})
342
343    np.EntityData.YListKeys = []string {"NpId"}
344
345    return &(np.EntityData)
346}
347
348// HardwareModuleTcam
349// hardware module tcam
350type HardwareModuleTcam struct {
351    EntityData types.CommonEntityData
352    YFilter yfilter.YFilter
353
354    // Global TCAM partition profile for all TCAM applicable nodes. The type is
355    // PrmTcamProfile. The default value is profile0.
356    GlobalProfile interface{}
357
358    // TCAM applicable nodes.
359    Nodes HardwareModuleTcam_Nodes
360}
361
362func (hardwareModuleTcam *HardwareModuleTcam) GetEntityData() *types.CommonEntityData {
363    hardwareModuleTcam.EntityData.YFilter = hardwareModuleTcam.YFilter
364    hardwareModuleTcam.EntityData.YangName = "hardware-module-tcam"
365    hardwareModuleTcam.EntityData.BundleName = "cisco_ios_xr"
366    hardwareModuleTcam.EntityData.ParentYangName = "Cisco-IOS-XR-asr9k-prm-cfg"
367    hardwareModuleTcam.EntityData.SegmentPath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcam"
368    hardwareModuleTcam.EntityData.AbsolutePath = hardwareModuleTcam.EntityData.SegmentPath
369    hardwareModuleTcam.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
370    hardwareModuleTcam.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
371    hardwareModuleTcam.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
372
373    hardwareModuleTcam.EntityData.Children = types.NewOrderedMap()
374    hardwareModuleTcam.EntityData.Children.Append("nodes", types.YChild{"Nodes", &hardwareModuleTcam.Nodes})
375    hardwareModuleTcam.EntityData.Leafs = types.NewOrderedMap()
376    hardwareModuleTcam.EntityData.Leafs.Append("global-profile", types.YLeaf{"GlobalProfile", hardwareModuleTcam.GlobalProfile})
377
378    hardwareModuleTcam.EntityData.YListKeys = []string {}
379
380    return &(hardwareModuleTcam.EntityData)
381}
382
383// HardwareModuleTcam_Nodes
384// TCAM applicable nodes
385type HardwareModuleTcam_Nodes struct {
386    EntityData types.CommonEntityData
387    YFilter yfilter.YFilter
388
389    // A TCAM applicable node. The type is slice of HardwareModuleTcam_Nodes_Node.
390    Node []*HardwareModuleTcam_Nodes_Node
391}
392
393func (nodes *HardwareModuleTcam_Nodes) GetEntityData() *types.CommonEntityData {
394    nodes.EntityData.YFilter = nodes.YFilter
395    nodes.EntityData.YangName = "nodes"
396    nodes.EntityData.BundleName = "cisco_ios_xr"
397    nodes.EntityData.ParentYangName = "hardware-module-tcam"
398    nodes.EntityData.SegmentPath = "nodes"
399    nodes.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcam/" + nodes.EntityData.SegmentPath
400    nodes.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
401    nodes.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
402    nodes.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
403
404    nodes.EntityData.Children = types.NewOrderedMap()
405    nodes.EntityData.Children.Append("node", types.YChild{"Node", nil})
406    for i := range nodes.Node {
407        nodes.EntityData.Children.Append(types.GetSegmentPath(nodes.Node[i]), types.YChild{"Node", nodes.Node[i]})
408    }
409    nodes.EntityData.Leafs = types.NewOrderedMap()
410
411    nodes.EntityData.YListKeys = []string {}
412
413    return &(nodes.EntityData)
414}
415
416// HardwareModuleTcam_Nodes_Node
417// A TCAM applicable node
418type HardwareModuleTcam_Nodes_Node struct {
419    EntityData types.CommonEntityData
420    YFilter yfilter.YFilter
421    YListKey string
422
423    // This attribute is a key. Node ID. The type is string with pattern:
424    // ([a-zA-Z0-9_]*\d+/){1,2}([a-zA-Z0-9_]*\d+).
425    NodeName interface{}
426
427    // A TCAM partition profile. The type is PrmTcamProfile. The default value is
428    // profile0.
429    Profile interface{}
430}
431
432func (node *HardwareModuleTcam_Nodes_Node) GetEntityData() *types.CommonEntityData {
433    node.EntityData.YFilter = node.YFilter
434    node.EntityData.YangName = "node"
435    node.EntityData.BundleName = "cisco_ios_xr"
436    node.EntityData.ParentYangName = "nodes"
437    node.EntityData.SegmentPath = "node" + types.AddKeyToken(node.NodeName, "node-name")
438    node.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-tcam/nodes/" + node.EntityData.SegmentPath
439    node.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
440    node.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
441    node.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
442
443    node.EntityData.Children = types.NewOrderedMap()
444    node.EntityData.Leafs = types.NewOrderedMap()
445    node.EntityData.Leafs.Append("node-name", types.YLeaf{"NodeName", node.NodeName})
446    node.EntityData.Leafs.Append("profile", types.YLeaf{"Profile", node.Profile})
447
448    node.EntityData.YListKeys = []string {"NodeName"}
449
450    return &(node.EntityData)
451}
452
453// HardwareModuleEfd
454// hardware module efd
455type HardwareModuleEfd struct {
456    EntityData types.CommonEntityData
457    YFilter yfilter.YFilter
458
459    // All nodes.
460    NodeAll HardwareModuleEfd_NodeAll
461
462    // EFD applicable nodes.
463    Nodes HardwareModuleEfd_Nodes
464}
465
466func (hardwareModuleEfd *HardwareModuleEfd) GetEntityData() *types.CommonEntityData {
467    hardwareModuleEfd.EntityData.YFilter = hardwareModuleEfd.YFilter
468    hardwareModuleEfd.EntityData.YangName = "hardware-module-efd"
469    hardwareModuleEfd.EntityData.BundleName = "cisco_ios_xr"
470    hardwareModuleEfd.EntityData.ParentYangName = "Cisco-IOS-XR-asr9k-prm-cfg"
471    hardwareModuleEfd.EntityData.SegmentPath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd"
472    hardwareModuleEfd.EntityData.AbsolutePath = hardwareModuleEfd.EntityData.SegmentPath
473    hardwareModuleEfd.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
474    hardwareModuleEfd.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
475    hardwareModuleEfd.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
476
477    hardwareModuleEfd.EntityData.Children = types.NewOrderedMap()
478    hardwareModuleEfd.EntityData.Children.Append("node-all", types.YChild{"NodeAll", &hardwareModuleEfd.NodeAll})
479    hardwareModuleEfd.EntityData.Children.Append("nodes", types.YChild{"Nodes", &hardwareModuleEfd.Nodes})
480    hardwareModuleEfd.EntityData.Leafs = types.NewOrderedMap()
481
482    hardwareModuleEfd.EntityData.YListKeys = []string {}
483
484    return &(hardwareModuleEfd.EntityData)
485}
486
487// HardwareModuleEfd_NodeAll
488// All nodes
489type HardwareModuleEfd_NodeAll struct {
490    EntityData types.CommonEntityData
491    YFilter yfilter.YFilter
492
493    // Enable EFD for this node. The type is interface{}.
494    Enable interface{}
495
496    // EFD mode parameter. The type is Asr9kEfdMode.
497    Mode interface{}
498
499    // VLAN Priority Mask.
500    VlanPriorityMask HardwareModuleEfd_NodeAll_VlanPriorityMask
501
502    // EFD IP parameters.
503    IpPrecedence HardwareModuleEfd_NodeAll_IpPrecedence
504
505    // EFD VLAN parameters.
506    VlanCos HardwareModuleEfd_NodeAll_VlanCos
507
508    // IP Priority Mask.
509    IpPriorityMask HardwareModuleEfd_NodeAll_IpPriorityMask
510
511    // MPLS Priority Mask.
512    MplsPriorityMask HardwareModuleEfd_NodeAll_MplsPriorityMask
513
514    // EFD MPLS parameters.
515    MplsExp HardwareModuleEfd_NodeAll_MplsExp
516}
517
518func (nodeAll *HardwareModuleEfd_NodeAll) GetEntityData() *types.CommonEntityData {
519    nodeAll.EntityData.YFilter = nodeAll.YFilter
520    nodeAll.EntityData.YangName = "node-all"
521    nodeAll.EntityData.BundleName = "cisco_ios_xr"
522    nodeAll.EntityData.ParentYangName = "hardware-module-efd"
523    nodeAll.EntityData.SegmentPath = "node-all"
524    nodeAll.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/" + nodeAll.EntityData.SegmentPath
525    nodeAll.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
526    nodeAll.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
527    nodeAll.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
528
529    nodeAll.EntityData.Children = types.NewOrderedMap()
530    nodeAll.EntityData.Children.Append("vlan-priority-mask", types.YChild{"VlanPriorityMask", &nodeAll.VlanPriorityMask})
531    nodeAll.EntityData.Children.Append("ip-precedence", types.YChild{"IpPrecedence", &nodeAll.IpPrecedence})
532    nodeAll.EntityData.Children.Append("vlan-cos", types.YChild{"VlanCos", &nodeAll.VlanCos})
533    nodeAll.EntityData.Children.Append("ip-priority-mask", types.YChild{"IpPriorityMask", &nodeAll.IpPriorityMask})
534    nodeAll.EntityData.Children.Append("mpls-priority-mask", types.YChild{"MplsPriorityMask", &nodeAll.MplsPriorityMask})
535    nodeAll.EntityData.Children.Append("mpls-exp", types.YChild{"MplsExp", &nodeAll.MplsExp})
536    nodeAll.EntityData.Leafs = types.NewOrderedMap()
537    nodeAll.EntityData.Leafs.Append("enable", types.YLeaf{"Enable", nodeAll.Enable})
538    nodeAll.EntityData.Leafs.Append("mode", types.YLeaf{"Mode", nodeAll.Mode})
539
540    nodeAll.EntityData.YListKeys = []string {}
541
542    return &(nodeAll.EntityData)
543}
544
545// HardwareModuleEfd_NodeAll_VlanPriorityMask
546// VLAN Priority Mask
547// This type is a presence type.
548type HardwareModuleEfd_NodeAll_VlanPriorityMask struct {
549    EntityData types.CommonEntityData
550    YFilter yfilter.YFilter
551    YPresence bool
552
553    // Prec. The type is interface{} with range: 0..1. The default value is 0.
554    Prec0 interface{}
555
556    // Prec. The type is interface{} with range: 0..1. The default value is 0.
557    Prec1 interface{}
558
559    // Prec. The type is interface{} with range: 0..1. The default value is 0.
560    Prec2 interface{}
561
562    // Prec. The type is interface{} with range: 0..1. The default value is 0.
563    Prec3 interface{}
564
565    // Prec. The type is interface{} with range: 0..1. The default value is 0.
566    Prec4 interface{}
567
568    // Prec. The type is interface{} with range: 0..1. The default value is 0.
569    Prec5 interface{}
570
571    // Prec. The type is interface{} with range: 0..1. The default value is 0.
572    Prec6 interface{}
573
574    // Prec. The type is interface{} with range: 0..1. The default value is 0.
575    Prec7 interface{}
576}
577
578func (vlanPriorityMask *HardwareModuleEfd_NodeAll_VlanPriorityMask) GetEntityData() *types.CommonEntityData {
579    vlanPriorityMask.EntityData.YFilter = vlanPriorityMask.YFilter
580    vlanPriorityMask.EntityData.YangName = "vlan-priority-mask"
581    vlanPriorityMask.EntityData.BundleName = "cisco_ios_xr"
582    vlanPriorityMask.EntityData.ParentYangName = "node-all"
583    vlanPriorityMask.EntityData.SegmentPath = "vlan-priority-mask"
584    vlanPriorityMask.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/node-all/" + vlanPriorityMask.EntityData.SegmentPath
585    vlanPriorityMask.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
586    vlanPriorityMask.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
587    vlanPriorityMask.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
588
589    vlanPriorityMask.EntityData.Children = types.NewOrderedMap()
590    vlanPriorityMask.EntityData.Leafs = types.NewOrderedMap()
591    vlanPriorityMask.EntityData.Leafs.Append("prec0", types.YLeaf{"Prec0", vlanPriorityMask.Prec0})
592    vlanPriorityMask.EntityData.Leafs.Append("prec1", types.YLeaf{"Prec1", vlanPriorityMask.Prec1})
593    vlanPriorityMask.EntityData.Leafs.Append("prec2", types.YLeaf{"Prec2", vlanPriorityMask.Prec2})
594    vlanPriorityMask.EntityData.Leafs.Append("prec3", types.YLeaf{"Prec3", vlanPriorityMask.Prec3})
595    vlanPriorityMask.EntityData.Leafs.Append("prec4", types.YLeaf{"Prec4", vlanPriorityMask.Prec4})
596    vlanPriorityMask.EntityData.Leafs.Append("prec5", types.YLeaf{"Prec5", vlanPriorityMask.Prec5})
597    vlanPriorityMask.EntityData.Leafs.Append("prec6", types.YLeaf{"Prec6", vlanPriorityMask.Prec6})
598    vlanPriorityMask.EntityData.Leafs.Append("prec7", types.YLeaf{"Prec7", vlanPriorityMask.Prec7})
599
600    vlanPriorityMask.EntityData.YListKeys = []string {}
601
602    return &(vlanPriorityMask.EntityData)
603}
604
605// HardwareModuleEfd_NodeAll_IpPrecedence
606// EFD IP parameters
607// This type is a presence type.
608type HardwareModuleEfd_NodeAll_IpPrecedence struct {
609    EntityData types.CommonEntityData
610    YFilter yfilter.YFilter
611    YPresence bool
612
613    // IP TOS precedence threshold. The type is interface{} with range: 0..7. This
614    // attribute is mandatory.
615    Precedence interface{}
616
617    // IP operation. The type is Asr9kEfdOperation. The default value is
618    // greater-than-or-equal.
619    Operation interface{}
620}
621
622func (ipPrecedence *HardwareModuleEfd_NodeAll_IpPrecedence) GetEntityData() *types.CommonEntityData {
623    ipPrecedence.EntityData.YFilter = ipPrecedence.YFilter
624    ipPrecedence.EntityData.YangName = "ip-precedence"
625    ipPrecedence.EntityData.BundleName = "cisco_ios_xr"
626    ipPrecedence.EntityData.ParentYangName = "node-all"
627    ipPrecedence.EntityData.SegmentPath = "ip-precedence"
628    ipPrecedence.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/node-all/" + ipPrecedence.EntityData.SegmentPath
629    ipPrecedence.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
630    ipPrecedence.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
631    ipPrecedence.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
632
633    ipPrecedence.EntityData.Children = types.NewOrderedMap()
634    ipPrecedence.EntityData.Leafs = types.NewOrderedMap()
635    ipPrecedence.EntityData.Leafs.Append("precedence", types.YLeaf{"Precedence", ipPrecedence.Precedence})
636    ipPrecedence.EntityData.Leafs.Append("operation", types.YLeaf{"Operation", ipPrecedence.Operation})
637
638    ipPrecedence.EntityData.YListKeys = []string {}
639
640    return &(ipPrecedence.EntityData)
641}
642
643// HardwareModuleEfd_NodeAll_VlanCos
644// EFD VLAN parameters
645// This type is a presence type.
646type HardwareModuleEfd_NodeAll_VlanCos struct {
647    EntityData types.CommonEntityData
648    YFilter yfilter.YFilter
649    YPresence bool
650
651    // VLAN COS threshold. The type is interface{} with range: 0..7. This
652    // attribute is mandatory.
653    Cos interface{}
654
655    // VLAN operation. The type is Asr9kEfdOperation. The default value is
656    // greater-than-or-equal.
657    Operation interface{}
658}
659
660func (vlanCos *HardwareModuleEfd_NodeAll_VlanCos) GetEntityData() *types.CommonEntityData {
661    vlanCos.EntityData.YFilter = vlanCos.YFilter
662    vlanCos.EntityData.YangName = "vlan-cos"
663    vlanCos.EntityData.BundleName = "cisco_ios_xr"
664    vlanCos.EntityData.ParentYangName = "node-all"
665    vlanCos.EntityData.SegmentPath = "vlan-cos"
666    vlanCos.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/node-all/" + vlanCos.EntityData.SegmentPath
667    vlanCos.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
668    vlanCos.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
669    vlanCos.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
670
671    vlanCos.EntityData.Children = types.NewOrderedMap()
672    vlanCos.EntityData.Leafs = types.NewOrderedMap()
673    vlanCos.EntityData.Leafs.Append("cos", types.YLeaf{"Cos", vlanCos.Cos})
674    vlanCos.EntityData.Leafs.Append("operation", types.YLeaf{"Operation", vlanCos.Operation})
675
676    vlanCos.EntityData.YListKeys = []string {}
677
678    return &(vlanCos.EntityData)
679}
680
681// HardwareModuleEfd_NodeAll_IpPriorityMask
682// IP Priority Mask
683// This type is a presence type.
684type HardwareModuleEfd_NodeAll_IpPriorityMask struct {
685    EntityData types.CommonEntityData
686    YFilter yfilter.YFilter
687    YPresence bool
688
689    // Prec. The type is interface{} with range: 0..1. The default value is 0.
690    Prec0 interface{}
691
692    // Prec. The type is interface{} with range: 0..1. The default value is 0.
693    Prec1 interface{}
694
695    // Prec. The type is interface{} with range: 0..1. The default value is 0.
696    Prec2 interface{}
697
698    // Prec. The type is interface{} with range: 0..1. The default value is 0.
699    Prec3 interface{}
700
701    // Prec. The type is interface{} with range: 0..1. The default value is 0.
702    Prec4 interface{}
703
704    // Prec. The type is interface{} with range: 0..1. The default value is 0.
705    Prec5 interface{}
706
707    // Prec. The type is interface{} with range: 0..1. The default value is 0.
708    Prec6 interface{}
709
710    // Prec. The type is interface{} with range: 0..1. The default value is 0.
711    Prec7 interface{}
712}
713
714func (ipPriorityMask *HardwareModuleEfd_NodeAll_IpPriorityMask) GetEntityData() *types.CommonEntityData {
715    ipPriorityMask.EntityData.YFilter = ipPriorityMask.YFilter
716    ipPriorityMask.EntityData.YangName = "ip-priority-mask"
717    ipPriorityMask.EntityData.BundleName = "cisco_ios_xr"
718    ipPriorityMask.EntityData.ParentYangName = "node-all"
719    ipPriorityMask.EntityData.SegmentPath = "ip-priority-mask"
720    ipPriorityMask.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/node-all/" + ipPriorityMask.EntityData.SegmentPath
721    ipPriorityMask.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
722    ipPriorityMask.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
723    ipPriorityMask.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
724
725    ipPriorityMask.EntityData.Children = types.NewOrderedMap()
726    ipPriorityMask.EntityData.Leafs = types.NewOrderedMap()
727    ipPriorityMask.EntityData.Leafs.Append("prec0", types.YLeaf{"Prec0", ipPriorityMask.Prec0})
728    ipPriorityMask.EntityData.Leafs.Append("prec1", types.YLeaf{"Prec1", ipPriorityMask.Prec1})
729    ipPriorityMask.EntityData.Leafs.Append("prec2", types.YLeaf{"Prec2", ipPriorityMask.Prec2})
730    ipPriorityMask.EntityData.Leafs.Append("prec3", types.YLeaf{"Prec3", ipPriorityMask.Prec3})
731    ipPriorityMask.EntityData.Leafs.Append("prec4", types.YLeaf{"Prec4", ipPriorityMask.Prec4})
732    ipPriorityMask.EntityData.Leafs.Append("prec5", types.YLeaf{"Prec5", ipPriorityMask.Prec5})
733    ipPriorityMask.EntityData.Leafs.Append("prec6", types.YLeaf{"Prec6", ipPriorityMask.Prec6})
734    ipPriorityMask.EntityData.Leafs.Append("prec7", types.YLeaf{"Prec7", ipPriorityMask.Prec7})
735
736    ipPriorityMask.EntityData.YListKeys = []string {}
737
738    return &(ipPriorityMask.EntityData)
739}
740
741// HardwareModuleEfd_NodeAll_MplsPriorityMask
742// MPLS Priority Mask
743// This type is a presence type.
744type HardwareModuleEfd_NodeAll_MplsPriorityMask struct {
745    EntityData types.CommonEntityData
746    YFilter yfilter.YFilter
747    YPresence bool
748
749    // Prec. The type is interface{} with range: 0..1. The default value is 0.
750    Prec0 interface{}
751
752    // Prec. The type is interface{} with range: 0..1. The default value is 0.
753    Prec1 interface{}
754
755    // Prec. The type is interface{} with range: 0..1. The default value is 0.
756    Prec2 interface{}
757
758    // Prec. The type is interface{} with range: 0..1. The default value is 0.
759    Prec3 interface{}
760
761    // Prec. The type is interface{} with range: 0..1. The default value is 0.
762    Prec4 interface{}
763
764    // Prec. The type is interface{} with range: 0..1. The default value is 0.
765    Prec5 interface{}
766
767    // Prec. The type is interface{} with range: 0..1. The default value is 0.
768    Prec6 interface{}
769
770    // Prec. The type is interface{} with range: 0..1. The default value is 0.
771    Prec7 interface{}
772}
773
774func (mplsPriorityMask *HardwareModuleEfd_NodeAll_MplsPriorityMask) GetEntityData() *types.CommonEntityData {
775    mplsPriorityMask.EntityData.YFilter = mplsPriorityMask.YFilter
776    mplsPriorityMask.EntityData.YangName = "mpls-priority-mask"
777    mplsPriorityMask.EntityData.BundleName = "cisco_ios_xr"
778    mplsPriorityMask.EntityData.ParentYangName = "node-all"
779    mplsPriorityMask.EntityData.SegmentPath = "mpls-priority-mask"
780    mplsPriorityMask.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/node-all/" + mplsPriorityMask.EntityData.SegmentPath
781    mplsPriorityMask.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
782    mplsPriorityMask.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
783    mplsPriorityMask.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
784
785    mplsPriorityMask.EntityData.Children = types.NewOrderedMap()
786    mplsPriorityMask.EntityData.Leafs = types.NewOrderedMap()
787    mplsPriorityMask.EntityData.Leafs.Append("prec0", types.YLeaf{"Prec0", mplsPriorityMask.Prec0})
788    mplsPriorityMask.EntityData.Leafs.Append("prec1", types.YLeaf{"Prec1", mplsPriorityMask.Prec1})
789    mplsPriorityMask.EntityData.Leafs.Append("prec2", types.YLeaf{"Prec2", mplsPriorityMask.Prec2})
790    mplsPriorityMask.EntityData.Leafs.Append("prec3", types.YLeaf{"Prec3", mplsPriorityMask.Prec3})
791    mplsPriorityMask.EntityData.Leafs.Append("prec4", types.YLeaf{"Prec4", mplsPriorityMask.Prec4})
792    mplsPriorityMask.EntityData.Leafs.Append("prec5", types.YLeaf{"Prec5", mplsPriorityMask.Prec5})
793    mplsPriorityMask.EntityData.Leafs.Append("prec6", types.YLeaf{"Prec6", mplsPriorityMask.Prec6})
794    mplsPriorityMask.EntityData.Leafs.Append("prec7", types.YLeaf{"Prec7", mplsPriorityMask.Prec7})
795
796    mplsPriorityMask.EntityData.YListKeys = []string {}
797
798    return &(mplsPriorityMask.EntityData)
799}
800
801// HardwareModuleEfd_NodeAll_MplsExp
802// EFD MPLS parameters
803// This type is a presence type.
804type HardwareModuleEfd_NodeAll_MplsExp struct {
805    EntityData types.CommonEntityData
806    YFilter yfilter.YFilter
807    YPresence bool
808
809    // MPLS EXP threshold. The type is interface{} with range: 0..7. This
810    // attribute is mandatory.
811    Exp interface{}
812
813    // MPLS operation. The type is Asr9kEfdOperation. The default value is
814    // greater-than-or-equal.
815    Operation interface{}
816}
817
818func (mplsExp *HardwareModuleEfd_NodeAll_MplsExp) GetEntityData() *types.CommonEntityData {
819    mplsExp.EntityData.YFilter = mplsExp.YFilter
820    mplsExp.EntityData.YangName = "mpls-exp"
821    mplsExp.EntityData.BundleName = "cisco_ios_xr"
822    mplsExp.EntityData.ParentYangName = "node-all"
823    mplsExp.EntityData.SegmentPath = "mpls-exp"
824    mplsExp.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/node-all/" + mplsExp.EntityData.SegmentPath
825    mplsExp.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
826    mplsExp.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
827    mplsExp.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
828
829    mplsExp.EntityData.Children = types.NewOrderedMap()
830    mplsExp.EntityData.Leafs = types.NewOrderedMap()
831    mplsExp.EntityData.Leafs.Append("exp", types.YLeaf{"Exp", mplsExp.Exp})
832    mplsExp.EntityData.Leafs.Append("operation", types.YLeaf{"Operation", mplsExp.Operation})
833
834    mplsExp.EntityData.YListKeys = []string {}
835
836    return &(mplsExp.EntityData)
837}
838
839// HardwareModuleEfd_Nodes
840// EFD applicable nodes
841type HardwareModuleEfd_Nodes struct {
842    EntityData types.CommonEntityData
843    YFilter yfilter.YFilter
844
845    // A node. The type is slice of HardwareModuleEfd_Nodes_Node.
846    Node []*HardwareModuleEfd_Nodes_Node
847}
848
849func (nodes *HardwareModuleEfd_Nodes) GetEntityData() *types.CommonEntityData {
850    nodes.EntityData.YFilter = nodes.YFilter
851    nodes.EntityData.YangName = "nodes"
852    nodes.EntityData.BundleName = "cisco_ios_xr"
853    nodes.EntityData.ParentYangName = "hardware-module-efd"
854    nodes.EntityData.SegmentPath = "nodes"
855    nodes.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/" + nodes.EntityData.SegmentPath
856    nodes.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
857    nodes.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
858    nodes.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
859
860    nodes.EntityData.Children = types.NewOrderedMap()
861    nodes.EntityData.Children.Append("node", types.YChild{"Node", nil})
862    for i := range nodes.Node {
863        nodes.EntityData.Children.Append(types.GetSegmentPath(nodes.Node[i]), types.YChild{"Node", nodes.Node[i]})
864    }
865    nodes.EntityData.Leafs = types.NewOrderedMap()
866
867    nodes.EntityData.YListKeys = []string {}
868
869    return &(nodes.EntityData)
870}
871
872// HardwareModuleEfd_Nodes_Node
873// A node
874type HardwareModuleEfd_Nodes_Node struct {
875    EntityData types.CommonEntityData
876    YFilter yfilter.YFilter
877    YListKey string
878
879    // This attribute is a key. Node Name. The type is string with pattern:
880    // ([a-zA-Z0-9_]*\d+/){1,2}([a-zA-Z0-9_]*\d+).
881    NodeName interface{}
882
883    // Enable EFD for this node. The type is interface{}.
884    Enable interface{}
885
886    // EFD mode parameter. The type is Asr9kEfdMode.
887    Mode interface{}
888
889    // VLAN Priority Mask.
890    VlanPriorityMask HardwareModuleEfd_Nodes_Node_VlanPriorityMask
891
892    // EFD IP parameters.
893    IpPrecedence HardwareModuleEfd_Nodes_Node_IpPrecedence
894
895    // EFD VLAN parameters.
896    VlanCos HardwareModuleEfd_Nodes_Node_VlanCos
897
898    // IP Priority Mask.
899    IpPriorityMask HardwareModuleEfd_Nodes_Node_IpPriorityMask
900
901    // MPLS Priority Mask.
902    MplsPriorityMask HardwareModuleEfd_Nodes_Node_MplsPriorityMask
903
904    // EFD MPLS parameters.
905    MplsExp HardwareModuleEfd_Nodes_Node_MplsExp
906}
907
908func (node *HardwareModuleEfd_Nodes_Node) GetEntityData() *types.CommonEntityData {
909    node.EntityData.YFilter = node.YFilter
910    node.EntityData.YangName = "node"
911    node.EntityData.BundleName = "cisco_ios_xr"
912    node.EntityData.ParentYangName = "nodes"
913    node.EntityData.SegmentPath = "node" + types.AddKeyToken(node.NodeName, "node-name")
914    node.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/nodes/" + node.EntityData.SegmentPath
915    node.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
916    node.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
917    node.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
918
919    node.EntityData.Children = types.NewOrderedMap()
920    node.EntityData.Children.Append("vlan-priority-mask", types.YChild{"VlanPriorityMask", &node.VlanPriorityMask})
921    node.EntityData.Children.Append("ip-precedence", types.YChild{"IpPrecedence", &node.IpPrecedence})
922    node.EntityData.Children.Append("vlan-cos", types.YChild{"VlanCos", &node.VlanCos})
923    node.EntityData.Children.Append("ip-priority-mask", types.YChild{"IpPriorityMask", &node.IpPriorityMask})
924    node.EntityData.Children.Append("mpls-priority-mask", types.YChild{"MplsPriorityMask", &node.MplsPriorityMask})
925    node.EntityData.Children.Append("mpls-exp", types.YChild{"MplsExp", &node.MplsExp})
926    node.EntityData.Leafs = types.NewOrderedMap()
927    node.EntityData.Leafs.Append("node-name", types.YLeaf{"NodeName", node.NodeName})
928    node.EntityData.Leafs.Append("enable", types.YLeaf{"Enable", node.Enable})
929    node.EntityData.Leafs.Append("mode", types.YLeaf{"Mode", node.Mode})
930
931    node.EntityData.YListKeys = []string {"NodeName"}
932
933    return &(node.EntityData)
934}
935
936// HardwareModuleEfd_Nodes_Node_VlanPriorityMask
937// VLAN Priority Mask
938// This type is a presence type.
939type HardwareModuleEfd_Nodes_Node_VlanPriorityMask struct {
940    EntityData types.CommonEntityData
941    YFilter yfilter.YFilter
942    YPresence bool
943
944    // Prec. The type is interface{} with range: 0..1. The default value is 0.
945    Prec0 interface{}
946
947    // Prec. The type is interface{} with range: 0..1. The default value is 0.
948    Prec1 interface{}
949
950    // Prec. The type is interface{} with range: 0..1. The default value is 0.
951    Prec2 interface{}
952
953    // Prec. The type is interface{} with range: 0..1. The default value is 0.
954    Prec3 interface{}
955
956    // Prec. The type is interface{} with range: 0..1. The default value is 0.
957    Prec4 interface{}
958
959    // Prec. The type is interface{} with range: 0..1. The default value is 0.
960    Prec5 interface{}
961
962    // Prec. The type is interface{} with range: 0..1. The default value is 0.
963    Prec6 interface{}
964
965    // Prec. The type is interface{} with range: 0..1. The default value is 0.
966    Prec7 interface{}
967}
968
969func (vlanPriorityMask *HardwareModuleEfd_Nodes_Node_VlanPriorityMask) GetEntityData() *types.CommonEntityData {
970    vlanPriorityMask.EntityData.YFilter = vlanPriorityMask.YFilter
971    vlanPriorityMask.EntityData.YangName = "vlan-priority-mask"
972    vlanPriorityMask.EntityData.BundleName = "cisco_ios_xr"
973    vlanPriorityMask.EntityData.ParentYangName = "node"
974    vlanPriorityMask.EntityData.SegmentPath = "vlan-priority-mask"
975    vlanPriorityMask.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/nodes/node/" + vlanPriorityMask.EntityData.SegmentPath
976    vlanPriorityMask.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
977    vlanPriorityMask.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
978    vlanPriorityMask.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
979
980    vlanPriorityMask.EntityData.Children = types.NewOrderedMap()
981    vlanPriorityMask.EntityData.Leafs = types.NewOrderedMap()
982    vlanPriorityMask.EntityData.Leafs.Append("prec0", types.YLeaf{"Prec0", vlanPriorityMask.Prec0})
983    vlanPriorityMask.EntityData.Leafs.Append("prec1", types.YLeaf{"Prec1", vlanPriorityMask.Prec1})
984    vlanPriorityMask.EntityData.Leafs.Append("prec2", types.YLeaf{"Prec2", vlanPriorityMask.Prec2})
985    vlanPriorityMask.EntityData.Leafs.Append("prec3", types.YLeaf{"Prec3", vlanPriorityMask.Prec3})
986    vlanPriorityMask.EntityData.Leafs.Append("prec4", types.YLeaf{"Prec4", vlanPriorityMask.Prec4})
987    vlanPriorityMask.EntityData.Leafs.Append("prec5", types.YLeaf{"Prec5", vlanPriorityMask.Prec5})
988    vlanPriorityMask.EntityData.Leafs.Append("prec6", types.YLeaf{"Prec6", vlanPriorityMask.Prec6})
989    vlanPriorityMask.EntityData.Leafs.Append("prec7", types.YLeaf{"Prec7", vlanPriorityMask.Prec7})
990
991    vlanPriorityMask.EntityData.YListKeys = []string {}
992
993    return &(vlanPriorityMask.EntityData)
994}
995
996// HardwareModuleEfd_Nodes_Node_IpPrecedence
997// EFD IP parameters
998// This type is a presence type.
999type HardwareModuleEfd_Nodes_Node_IpPrecedence struct {
1000    EntityData types.CommonEntityData
1001    YFilter yfilter.YFilter
1002    YPresence bool
1003
1004    // IP TOS precedence threshold. The type is interface{} with range: 0..7. This
1005    // attribute is mandatory.
1006    Precedence interface{}
1007
1008    // IP operation. The type is Asr9kEfdOperation. The default value is
1009    // greater-than-or-equal.
1010    Operation interface{}
1011}
1012
1013func (ipPrecedence *HardwareModuleEfd_Nodes_Node_IpPrecedence) GetEntityData() *types.CommonEntityData {
1014    ipPrecedence.EntityData.YFilter = ipPrecedence.YFilter
1015    ipPrecedence.EntityData.YangName = "ip-precedence"
1016    ipPrecedence.EntityData.BundleName = "cisco_ios_xr"
1017    ipPrecedence.EntityData.ParentYangName = "node"
1018    ipPrecedence.EntityData.SegmentPath = "ip-precedence"
1019    ipPrecedence.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/nodes/node/" + ipPrecedence.EntityData.SegmentPath
1020    ipPrecedence.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
1021    ipPrecedence.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
1022    ipPrecedence.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
1023
1024    ipPrecedence.EntityData.Children = types.NewOrderedMap()
1025    ipPrecedence.EntityData.Leafs = types.NewOrderedMap()
1026    ipPrecedence.EntityData.Leafs.Append("precedence", types.YLeaf{"Precedence", ipPrecedence.Precedence})
1027    ipPrecedence.EntityData.Leafs.Append("operation", types.YLeaf{"Operation", ipPrecedence.Operation})
1028
1029    ipPrecedence.EntityData.YListKeys = []string {}
1030
1031    return &(ipPrecedence.EntityData)
1032}
1033
1034// HardwareModuleEfd_Nodes_Node_VlanCos
1035// EFD VLAN parameters
1036// This type is a presence type.
1037type HardwareModuleEfd_Nodes_Node_VlanCos struct {
1038    EntityData types.CommonEntityData
1039    YFilter yfilter.YFilter
1040    YPresence bool
1041
1042    // VLAN COS threshold. The type is interface{} with range: 0..7. This
1043    // attribute is mandatory.
1044    Cos interface{}
1045
1046    // VLAN operation. The type is Asr9kEfdOperation. The default value is
1047    // greater-than-or-equal.
1048    Operation interface{}
1049}
1050
1051func (vlanCos *HardwareModuleEfd_Nodes_Node_VlanCos) GetEntityData() *types.CommonEntityData {
1052    vlanCos.EntityData.YFilter = vlanCos.YFilter
1053    vlanCos.EntityData.YangName = "vlan-cos"
1054    vlanCos.EntityData.BundleName = "cisco_ios_xr"
1055    vlanCos.EntityData.ParentYangName = "node"
1056    vlanCos.EntityData.SegmentPath = "vlan-cos"
1057    vlanCos.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/nodes/node/" + vlanCos.EntityData.SegmentPath
1058    vlanCos.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
1059    vlanCos.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
1060    vlanCos.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
1061
1062    vlanCos.EntityData.Children = types.NewOrderedMap()
1063    vlanCos.EntityData.Leafs = types.NewOrderedMap()
1064    vlanCos.EntityData.Leafs.Append("cos", types.YLeaf{"Cos", vlanCos.Cos})
1065    vlanCos.EntityData.Leafs.Append("operation", types.YLeaf{"Operation", vlanCos.Operation})
1066
1067    vlanCos.EntityData.YListKeys = []string {}
1068
1069    return &(vlanCos.EntityData)
1070}
1071
1072// HardwareModuleEfd_Nodes_Node_IpPriorityMask
1073// IP Priority Mask
1074// This type is a presence type.
1075type HardwareModuleEfd_Nodes_Node_IpPriorityMask struct {
1076    EntityData types.CommonEntityData
1077    YFilter yfilter.YFilter
1078    YPresence bool
1079
1080    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1081    Prec0 interface{}
1082
1083    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1084    Prec1 interface{}
1085
1086    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1087    Prec2 interface{}
1088
1089    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1090    Prec3 interface{}
1091
1092    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1093    Prec4 interface{}
1094
1095    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1096    Prec5 interface{}
1097
1098    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1099    Prec6 interface{}
1100
1101    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1102    Prec7 interface{}
1103}
1104
1105func (ipPriorityMask *HardwareModuleEfd_Nodes_Node_IpPriorityMask) GetEntityData() *types.CommonEntityData {
1106    ipPriorityMask.EntityData.YFilter = ipPriorityMask.YFilter
1107    ipPriorityMask.EntityData.YangName = "ip-priority-mask"
1108    ipPriorityMask.EntityData.BundleName = "cisco_ios_xr"
1109    ipPriorityMask.EntityData.ParentYangName = "node"
1110    ipPriorityMask.EntityData.SegmentPath = "ip-priority-mask"
1111    ipPriorityMask.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/nodes/node/" + ipPriorityMask.EntityData.SegmentPath
1112    ipPriorityMask.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
1113    ipPriorityMask.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
1114    ipPriorityMask.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
1115
1116    ipPriorityMask.EntityData.Children = types.NewOrderedMap()
1117    ipPriorityMask.EntityData.Leafs = types.NewOrderedMap()
1118    ipPriorityMask.EntityData.Leafs.Append("prec0", types.YLeaf{"Prec0", ipPriorityMask.Prec0})
1119    ipPriorityMask.EntityData.Leafs.Append("prec1", types.YLeaf{"Prec1", ipPriorityMask.Prec1})
1120    ipPriorityMask.EntityData.Leafs.Append("prec2", types.YLeaf{"Prec2", ipPriorityMask.Prec2})
1121    ipPriorityMask.EntityData.Leafs.Append("prec3", types.YLeaf{"Prec3", ipPriorityMask.Prec3})
1122    ipPriorityMask.EntityData.Leafs.Append("prec4", types.YLeaf{"Prec4", ipPriorityMask.Prec4})
1123    ipPriorityMask.EntityData.Leafs.Append("prec5", types.YLeaf{"Prec5", ipPriorityMask.Prec5})
1124    ipPriorityMask.EntityData.Leafs.Append("prec6", types.YLeaf{"Prec6", ipPriorityMask.Prec6})
1125    ipPriorityMask.EntityData.Leafs.Append("prec7", types.YLeaf{"Prec7", ipPriorityMask.Prec7})
1126
1127    ipPriorityMask.EntityData.YListKeys = []string {}
1128
1129    return &(ipPriorityMask.EntityData)
1130}
1131
1132// HardwareModuleEfd_Nodes_Node_MplsPriorityMask
1133// MPLS Priority Mask
1134// This type is a presence type.
1135type HardwareModuleEfd_Nodes_Node_MplsPriorityMask struct {
1136    EntityData types.CommonEntityData
1137    YFilter yfilter.YFilter
1138    YPresence bool
1139
1140    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1141    Prec0 interface{}
1142
1143    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1144    Prec1 interface{}
1145
1146    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1147    Prec2 interface{}
1148
1149    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1150    Prec3 interface{}
1151
1152    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1153    Prec4 interface{}
1154
1155    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1156    Prec5 interface{}
1157
1158    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1159    Prec6 interface{}
1160
1161    // Prec. The type is interface{} with range: 0..1. The default value is 0.
1162    Prec7 interface{}
1163}
1164
1165func (mplsPriorityMask *HardwareModuleEfd_Nodes_Node_MplsPriorityMask) GetEntityData() *types.CommonEntityData {
1166    mplsPriorityMask.EntityData.YFilter = mplsPriorityMask.YFilter
1167    mplsPriorityMask.EntityData.YangName = "mpls-priority-mask"
1168    mplsPriorityMask.EntityData.BundleName = "cisco_ios_xr"
1169    mplsPriorityMask.EntityData.ParentYangName = "node"
1170    mplsPriorityMask.EntityData.SegmentPath = "mpls-priority-mask"
1171    mplsPriorityMask.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/nodes/node/" + mplsPriorityMask.EntityData.SegmentPath
1172    mplsPriorityMask.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
1173    mplsPriorityMask.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
1174    mplsPriorityMask.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
1175
1176    mplsPriorityMask.EntityData.Children = types.NewOrderedMap()
1177    mplsPriorityMask.EntityData.Leafs = types.NewOrderedMap()
1178    mplsPriorityMask.EntityData.Leafs.Append("prec0", types.YLeaf{"Prec0", mplsPriorityMask.Prec0})
1179    mplsPriorityMask.EntityData.Leafs.Append("prec1", types.YLeaf{"Prec1", mplsPriorityMask.Prec1})
1180    mplsPriorityMask.EntityData.Leafs.Append("prec2", types.YLeaf{"Prec2", mplsPriorityMask.Prec2})
1181    mplsPriorityMask.EntityData.Leafs.Append("prec3", types.YLeaf{"Prec3", mplsPriorityMask.Prec3})
1182    mplsPriorityMask.EntityData.Leafs.Append("prec4", types.YLeaf{"Prec4", mplsPriorityMask.Prec4})
1183    mplsPriorityMask.EntityData.Leafs.Append("prec5", types.YLeaf{"Prec5", mplsPriorityMask.Prec5})
1184    mplsPriorityMask.EntityData.Leafs.Append("prec6", types.YLeaf{"Prec6", mplsPriorityMask.Prec6})
1185    mplsPriorityMask.EntityData.Leafs.Append("prec7", types.YLeaf{"Prec7", mplsPriorityMask.Prec7})
1186
1187    mplsPriorityMask.EntityData.YListKeys = []string {}
1188
1189    return &(mplsPriorityMask.EntityData)
1190}
1191
1192// HardwareModuleEfd_Nodes_Node_MplsExp
1193// EFD MPLS parameters
1194// This type is a presence type.
1195type HardwareModuleEfd_Nodes_Node_MplsExp struct {
1196    EntityData types.CommonEntityData
1197    YFilter yfilter.YFilter
1198    YPresence bool
1199
1200    // MPLS EXP threshold. The type is interface{} with range: 0..7. This
1201    // attribute is mandatory.
1202    Exp interface{}
1203
1204    // MPLS operation. The type is Asr9kEfdOperation. The default value is
1205    // greater-than-or-equal.
1206    Operation interface{}
1207}
1208
1209func (mplsExp *HardwareModuleEfd_Nodes_Node_MplsExp) GetEntityData() *types.CommonEntityData {
1210    mplsExp.EntityData.YFilter = mplsExp.YFilter
1211    mplsExp.EntityData.YangName = "mpls-exp"
1212    mplsExp.EntityData.BundleName = "cisco_ios_xr"
1213    mplsExp.EntityData.ParentYangName = "node"
1214    mplsExp.EntityData.SegmentPath = "mpls-exp"
1215    mplsExp.EntityData.AbsolutePath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-efd/nodes/node/" + mplsExp.EntityData.SegmentPath
1216    mplsExp.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
1217    mplsExp.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
1218    mplsExp.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
1219
1220    mplsExp.EntityData.Children = types.NewOrderedMap()
1221    mplsExp.EntityData.Leafs = types.NewOrderedMap()
1222    mplsExp.EntityData.Leafs.Append("exp", types.YLeaf{"Exp", mplsExp.Exp})
1223    mplsExp.EntityData.Leafs.Append("operation", types.YLeaf{"Operation", mplsExp.Operation})
1224
1225    mplsExp.EntityData.YListKeys = []string {}
1226
1227    return &(mplsExp.EntityData)
1228}
1229
1230// HardwareModuleAllQosMode
1231// hardware module all qos mode
1232type HardwareModuleAllQosMode struct {
1233    EntityData types.CommonEntityData
1234    YFilter yfilter.YFilter
1235
1236    // enable per-priority-buffer-limit. The type is interface{}.
1237    PerPriorityBufferLimit interface{}
1238
1239    // Enable ingress queue for MOD-80 4X10G MPA or MOD-400 20X10G MPA. The type
1240    // is interface{}.
1241    IngressQueue interface{}
1242
1243    // Enable aggregate bundle mode . The type is interface{}.
1244    AggregateBundleMode interface{}
1245
1246    // Enable bundle aggregate policer mode . The type is interface{}.
1247    BundleAggregatePolicerMode interface{}
1248
1249    // Enable L4 wred accounting buffer mode. The type is interface{}.
1250    WredBufferMode interface{}
1251}
1252
1253func (hardwareModuleAllQosMode *HardwareModuleAllQosMode) GetEntityData() *types.CommonEntityData {
1254    hardwareModuleAllQosMode.EntityData.YFilter = hardwareModuleAllQosMode.YFilter
1255    hardwareModuleAllQosMode.EntityData.YangName = "hardware-module-all-qos-mode"
1256    hardwareModuleAllQosMode.EntityData.BundleName = "cisco_ios_xr"
1257    hardwareModuleAllQosMode.EntityData.ParentYangName = "Cisco-IOS-XR-asr9k-prm-cfg"
1258    hardwareModuleAllQosMode.EntityData.SegmentPath = "Cisco-IOS-XR-asr9k-prm-cfg:hardware-module-all-qos-mode"
1259    hardwareModuleAllQosMode.EntityData.AbsolutePath = hardwareModuleAllQosMode.EntityData.SegmentPath
1260    hardwareModuleAllQosMode.EntityData.CapabilitiesTable = cisco_ios_xr.GetCapabilities()
1261    hardwareModuleAllQosMode.EntityData.NamespaceTable = cisco_ios_xr.GetNamespaces()
1262    hardwareModuleAllQosMode.EntityData.BundleYangModelsLocation = cisco_ios_xr.GetModelsPath()
1263
1264    hardwareModuleAllQosMode.EntityData.Children = types.NewOrderedMap()
1265    hardwareModuleAllQosMode.EntityData.Leafs = types.NewOrderedMap()
1266    hardwareModuleAllQosMode.EntityData.Leafs.Append("per-priority-buffer-limit", types.YLeaf{"PerPriorityBufferLimit", hardwareModuleAllQosMode.PerPriorityBufferLimit})
1267    hardwareModuleAllQosMode.EntityData.Leafs.Append("ingress-queue", types.YLeaf{"IngressQueue", hardwareModuleAllQosMode.IngressQueue})
1268    hardwareModuleAllQosMode.EntityData.Leafs.Append("aggregate-bundle-mode", types.YLeaf{"AggregateBundleMode", hardwareModuleAllQosMode.AggregateBundleMode})
1269    hardwareModuleAllQosMode.EntityData.Leafs.Append("bundle-aggregate-policer-mode", types.YLeaf{"BundleAggregatePolicerMode", hardwareModuleAllQosMode.BundleAggregatePolicerMode})
1270    hardwareModuleAllQosMode.EntityData.Leafs.Append("wred-buffer-mode", types.YLeaf{"WredBufferMode", hardwareModuleAllQosMode.WredBufferMode})
1271
1272    hardwareModuleAllQosMode.EntityData.YListKeys = []string {}
1273
1274    return &(hardwareModuleAllQosMode.EntityData)
1275}
1276
1277
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Most used method in

Trigger Precedence code on LambdaTest Cloud Grid

Execute automation tests with Precedence on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)