aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/mfib_types/mfib_types.ba.go
blob: 4e90440762351ae97b2366eb2f7bdc562ae58db7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.4.0-dev
//  VPP:              20.05-release

// Package mfib_types contains generated bindings for API file mfib_types.api.
//
// Contents:
//   1 enum
//   1 struct
//
package mfib_types

import (
	"strconv"

	api "git.fd.io/govpp.git/api"
	fib_types "git.fd.io/govpp.git/binapi/fib_types"
	_ "git.fd.io/govpp.git/binapi/ip_types"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the GoVPP api package it is being compiled against.
// A compilation error at this line likely means your copy of the
// GoVPP api package needs to be updated.
const _ = api.GoVppAPIPackageIsVersion2

// MfibItfFlags defines enum 'mfib_itf_flags'.
type MfibItfFlags uint32

const (
	MFIB_API_ITF_FLAG_NONE           MfibItfFlags = 0
	MFIB_API_ITF_FLAG_NEGATE_SIGNAL  MfibItfFlags = 1
	MFIB_API_ITF_FLAG_ACCEPT         MfibItfFlags = 2
	MFIB_API_ITF_FLAG_FORWARD        MfibItfFlags = 4
	MFIB_API_ITF_FLAG_SIGNAL_PRESENT MfibItfFlags = 8
	MFIB_API_ITF_FLAG_DONT_PRESERVE  MfibItfFlags = 16
)

var (
	MfibItfFlags_name = map[uint32]string{
		0:  "MFIB_API_ITF_FLAG_NONE",
		1:  "MFIB_API_ITF_FLAG_NEGATE_SIGNAL",
		2:  "MFIB_API_ITF_FLAG_ACCEPT",
		4:  "MFIB_API_ITF_FLAG_FORWARD",
		8:  "MFIB_API_ITF_FLAG_SIGNAL_PRESENT",
		16: "MFIB_API_ITF_FLAG_DONT_PRESERVE",
	}
	MfibItfFlags_value = map[string]uint32{
		"MFIB_API_ITF_FLAG_NONE":           0,
		"MFIB_API_ITF_FLAG_NEGATE_SIGNAL":  1,
		"MFIB_API_ITF_FLAG_ACCEPT":         2,
		"MFIB_API_ITF_FLAG_FORWARD":        4,
		"MFIB_API_ITF_FLAG_SIGNAL_PRESENT": 8,
		"MFIB_API_ITF_FLAG_DONT_PRESERVE":  16,
	}
)

func (x MfibItfFlags) String() string {
	s, ok := MfibItfFlags_name[uint32(x)]
	if ok {
		return s
	}
	str := func(n uint32) string {
		s, ok := MfibItfFlags_name[uint32(n)]
		if ok {
			return s
		}
		return "MfibItfFlags(" + strconv.Itoa(int(n)) + ")"
	}
	for i := uint32(0); i <= 32; i++ {
		val := uint32(x)
		if val&(1<<i) != 0 {
			if s != "" {
				s += "|"
			}
			s += str(1 << i)
		}
	}
	if s == "" {
		return str(uint32(x))
	}
	return s
}

// MfibPath defines type 'mfib_path'.
type MfibPath struct {
	ItfFlags MfibItfFlags      `binapi:"mfib_itf_flags,name=itf_flags" json:"itf_flags,omitempty"`
	Path     fib_types.FibPath `binapi:"fib_path,name=path" json:"path,omitempty"`
}