6f264125825334e214bfcb347e2cb5fc6b4015f7
[govpp.git] / binapi / tunnel_types / tunnel_types.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              22.02-release
5 // source: /usr/share/vpp/api/core/tunnel_types.api.json
6
7 // Package tunnel_types contains generated bindings for API file tunnel_types.api.
8 //
9 // Contents:
10 //   3 enums
11 //   1 struct
12 //
13 package tunnel_types
14
15 import (
16         "strconv"
17
18         api "git.fd.io/govpp.git/api"
19         interface_types "git.fd.io/govpp.git/binapi/interface_types"
20         ip_types "git.fd.io/govpp.git/binapi/ip_types"
21 )
22
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
28
29 const (
30         APIFile    = "tunnel_types"
31         APIVersion = "1.0.1"
32         VersionCrc = 0x882f6758
33 )
34
35 // TunnelEncapDecapFlags defines enum 'tunnel_encap_decap_flags'.
36 type TunnelEncapDecapFlags uint8
37
38 const (
39         TUNNEL_API_ENCAP_DECAP_FLAG_NONE                  TunnelEncapDecapFlags = 0
40         TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DF         TunnelEncapDecapFlags = 1
41         TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_SET_DF          TunnelEncapDecapFlags = 2
42         TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP       TunnelEncapDecapFlags = 4
43         TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_ECN        TunnelEncapDecapFlags = 8
44         TUNNEL_API_ENCAP_DECAP_FLAG_DECAP_COPY_ECN        TunnelEncapDecapFlags = 16
45         TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH      TunnelEncapDecapFlags = 32
46         TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_HOP_LIMIT  TunnelEncapDecapFlags = 64
47         TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_FLOW_LABEL TunnelEncapDecapFlags = 128
48 )
49
50 var (
51         TunnelEncapDecapFlags_name = map[uint8]string{
52                 0:   "TUNNEL_API_ENCAP_DECAP_FLAG_NONE",
53                 1:   "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DF",
54                 2:   "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_SET_DF",
55                 4:   "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP",
56                 8:   "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_ECN",
57                 16:  "TUNNEL_API_ENCAP_DECAP_FLAG_DECAP_COPY_ECN",
58                 32:  "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH",
59                 64:  "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_HOP_LIMIT",
60                 128: "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_FLOW_LABEL",
61         }
62         TunnelEncapDecapFlags_value = map[string]uint8{
63                 "TUNNEL_API_ENCAP_DECAP_FLAG_NONE":                  0,
64                 "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DF":         1,
65                 "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_SET_DF":          2,
66                 "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP":       4,
67                 "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_ECN":        8,
68                 "TUNNEL_API_ENCAP_DECAP_FLAG_DECAP_COPY_ECN":        16,
69                 "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH":      32,
70                 "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_HOP_LIMIT":  64,
71                 "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_FLOW_LABEL": 128,
72         }
73 )
74
75 func (x TunnelEncapDecapFlags) String() string {
76         s, ok := TunnelEncapDecapFlags_name[uint8(x)]
77         if ok {
78                 return s
79         }
80         str := func(n uint8) string {
81                 s, ok := TunnelEncapDecapFlags_name[uint8(n)]
82                 if ok {
83                         return s
84                 }
85                 return "TunnelEncapDecapFlags(" + strconv.Itoa(int(n)) + ")"
86         }
87         for i := uint8(0); i <= 8; i++ {
88                 val := uint8(x)
89                 if val&(1<<i) != 0 {
90                         if s != "" {
91                                 s += "|"
92                         }
93                         s += str(1 << i)
94                 }
95         }
96         if s == "" {
97                 return str(uint8(x))
98         }
99         return s
100 }
101
102 // TunnelMode defines enum 'tunnel_mode'.
103 type TunnelMode uint8
104
105 const (
106         TUNNEL_API_MODE_P2P TunnelMode = 0
107         TUNNEL_API_MODE_MP  TunnelMode = 1
108 )
109
110 var (
111         TunnelMode_name = map[uint8]string{
112                 0: "TUNNEL_API_MODE_P2P",
113                 1: "TUNNEL_API_MODE_MP",
114         }
115         TunnelMode_value = map[string]uint8{
116                 "TUNNEL_API_MODE_P2P": 0,
117                 "TUNNEL_API_MODE_MP":  1,
118         }
119 )
120
121 func (x TunnelMode) String() string {
122         s, ok := TunnelMode_name[uint8(x)]
123         if ok {
124                 return s
125         }
126         return "TunnelMode(" + strconv.Itoa(int(x)) + ")"
127 }
128
129 // TunnelFlags defines enum 'tunnel_flags'.
130 type TunnelFlags uint8
131
132 const (
133         TUNNEL_API_FLAG_TRACK_MTU TunnelFlags = 1
134 )
135
136 var (
137         TunnelFlags_name = map[uint8]string{
138                 1: "TUNNEL_API_FLAG_TRACK_MTU",
139         }
140         TunnelFlags_value = map[string]uint8{
141                 "TUNNEL_API_FLAG_TRACK_MTU": 1,
142         }
143 )
144
145 func (x TunnelFlags) String() string {
146         s, ok := TunnelFlags_name[uint8(x)]
147         if ok {
148                 return s
149         }
150         str := func(n uint8) string {
151                 s, ok := TunnelFlags_name[uint8(n)]
152                 if ok {
153                         return s
154                 }
155                 return "TunnelFlags(" + strconv.Itoa(int(n)) + ")"
156         }
157         for i := uint8(0); i <= 8; i++ {
158                 val := uint8(x)
159                 if val&(1<<i) != 0 {
160                         if s != "" {
161                                 s += "|"
162                         }
163                         s += str(1 << i)
164                 }
165         }
166         if s == "" {
167                 return str(uint8(x))
168         }
169         return s
170 }
171
172 // Tunnel defines type 'tunnel'.
173 type Tunnel struct {
174         Instance        uint32                         `binapi:"u32,name=instance" json:"instance,omitempty"`
175         Src             ip_types.Address               `binapi:"address,name=src" json:"src,omitempty"`
176         Dst             ip_types.Address               `binapi:"address,name=dst" json:"dst,omitempty"`
177         SwIfIndex       interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
178         TableID         uint32                         `binapi:"u32,name=table_id" json:"table_id,omitempty"`
179         EncapDecapFlags TunnelEncapDecapFlags          `binapi:"tunnel_encap_decap_flags,name=encap_decap_flags" json:"encap_decap_flags,omitempty"`
180         Mode            TunnelMode                     `binapi:"tunnel_mode,name=mode" json:"mode,omitempty"`
181         Flags           TunnelFlags                    `binapi:"tunnel_flags,name=flags" json:"flags,omitempty"`
182         Dscp            ip_types.IPDscp                `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
183         HopLimit        uint8                          `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
184 }