Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / span / span.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/core/span.api.json
6
7 // Package span contains generated bindings for API file span.api.
8 //
9 // Contents:
10 //   4 messages
11 //
12 package span
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         codec "git.fd.io/govpp.git/codec"
17 )
18
19 // This is a compile-time assertion to ensure that this generated file
20 // is compatible with the GoVPP api package it is being compiled against.
21 // A compilation error at this line likely means your copy of the
22 // GoVPP api package needs to be updated.
23 const _ = api.GoVppAPIPackageIsVersion2
24
25 const (
26         APIFile    = "span"
27         APIVersion = "1.0.0"
28         VersionCrc = 0x10769b5
29 )
30
31 // SwInterfaceSpanDetails defines message 'sw_interface_span_details'.
32 type SwInterfaceSpanDetails struct {
33         SwIfIndexFrom uint32 `binapi:"u32,name=sw_if_index_from" json:"sw_if_index_from,omitempty"`
34         SwIfIndexTo   uint32 `binapi:"u32,name=sw_if_index_to" json:"sw_if_index_to,omitempty"`
35         State         uint8  `binapi:"u8,name=state" json:"state,omitempty"`
36         IsL2          uint8  `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
37 }
38
39 func (m *SwInterfaceSpanDetails) Reset()               { *m = SwInterfaceSpanDetails{} }
40 func (*SwInterfaceSpanDetails) GetMessageName() string { return "sw_interface_span_details" }
41 func (*SwInterfaceSpanDetails) GetCrcString() string   { return "23966371" }
42 func (*SwInterfaceSpanDetails) GetMessageType() api.MessageType {
43         return api.ReplyMessage
44 }
45
46 func (m *SwInterfaceSpanDetails) Size() (size int) {
47         if m == nil {
48                 return 0
49         }
50         size += 4 // m.SwIfIndexFrom
51         size += 4 // m.SwIfIndexTo
52         size += 1 // m.State
53         size += 1 // m.IsL2
54         return size
55 }
56 func (m *SwInterfaceSpanDetails) Marshal(b []byte) ([]byte, error) {
57         if b == nil {
58                 b = make([]byte, m.Size())
59         }
60         buf := codec.NewBuffer(b)
61         buf.EncodeUint32(m.SwIfIndexFrom)
62         buf.EncodeUint32(m.SwIfIndexTo)
63         buf.EncodeUint8(m.State)
64         buf.EncodeUint8(m.IsL2)
65         return buf.Bytes(), nil
66 }
67 func (m *SwInterfaceSpanDetails) Unmarshal(b []byte) error {
68         buf := codec.NewBuffer(b)
69         m.SwIfIndexFrom = buf.DecodeUint32()
70         m.SwIfIndexTo = buf.DecodeUint32()
71         m.State = buf.DecodeUint8()
72         m.IsL2 = buf.DecodeUint8()
73         return nil
74 }
75
76 // SwInterfaceSpanDump defines message 'sw_interface_span_dump'.
77 type SwInterfaceSpanDump struct {
78         IsL2 uint8 `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
79 }
80
81 func (m *SwInterfaceSpanDump) Reset()               { *m = SwInterfaceSpanDump{} }
82 func (*SwInterfaceSpanDump) GetMessageName() string { return "sw_interface_span_dump" }
83 func (*SwInterfaceSpanDump) GetCrcString() string   { return "67c54650" }
84 func (*SwInterfaceSpanDump) GetMessageType() api.MessageType {
85         return api.RequestMessage
86 }
87
88 func (m *SwInterfaceSpanDump) Size() (size int) {
89         if m == nil {
90                 return 0
91         }
92         size += 1 // m.IsL2
93         return size
94 }
95 func (m *SwInterfaceSpanDump) Marshal(b []byte) ([]byte, error) {
96         if b == nil {
97                 b = make([]byte, m.Size())
98         }
99         buf := codec.NewBuffer(b)
100         buf.EncodeUint8(m.IsL2)
101         return buf.Bytes(), nil
102 }
103 func (m *SwInterfaceSpanDump) Unmarshal(b []byte) error {
104         buf := codec.NewBuffer(b)
105         m.IsL2 = buf.DecodeUint8()
106         return nil
107 }
108
109 // SwInterfaceSpanEnableDisable defines message 'sw_interface_span_enable_disable'.
110 type SwInterfaceSpanEnableDisable struct {
111         SwIfIndexFrom uint32 `binapi:"u32,name=sw_if_index_from" json:"sw_if_index_from,omitempty"`
112         SwIfIndexTo   uint32 `binapi:"u32,name=sw_if_index_to" json:"sw_if_index_to,omitempty"`
113         State         uint8  `binapi:"u8,name=state" json:"state,omitempty"`
114         IsL2          uint8  `binapi:"u8,name=is_l2" json:"is_l2,omitempty"`
115 }
116
117 func (m *SwInterfaceSpanEnableDisable) Reset() { *m = SwInterfaceSpanEnableDisable{} }
118 func (*SwInterfaceSpanEnableDisable) GetMessageName() string {
119         return "sw_interface_span_enable_disable"
120 }
121 func (*SwInterfaceSpanEnableDisable) GetCrcString() string { return "7216258d" }
122 func (*SwInterfaceSpanEnableDisable) GetMessageType() api.MessageType {
123         return api.RequestMessage
124 }
125
126 func (m *SwInterfaceSpanEnableDisable) Size() (size int) {
127         if m == nil {
128                 return 0
129         }
130         size += 4 // m.SwIfIndexFrom
131         size += 4 // m.SwIfIndexTo
132         size += 1 // m.State
133         size += 1 // m.IsL2
134         return size
135 }
136 func (m *SwInterfaceSpanEnableDisable) Marshal(b []byte) ([]byte, error) {
137         if b == nil {
138                 b = make([]byte, m.Size())
139         }
140         buf := codec.NewBuffer(b)
141         buf.EncodeUint32(m.SwIfIndexFrom)
142         buf.EncodeUint32(m.SwIfIndexTo)
143         buf.EncodeUint8(m.State)
144         buf.EncodeUint8(m.IsL2)
145         return buf.Bytes(), nil
146 }
147 func (m *SwInterfaceSpanEnableDisable) Unmarshal(b []byte) error {
148         buf := codec.NewBuffer(b)
149         m.SwIfIndexFrom = buf.DecodeUint32()
150         m.SwIfIndexTo = buf.DecodeUint32()
151         m.State = buf.DecodeUint8()
152         m.IsL2 = buf.DecodeUint8()
153         return nil
154 }
155
156 // SwInterfaceSpanEnableDisableReply defines message 'sw_interface_span_enable_disable_reply'.
157 type SwInterfaceSpanEnableDisableReply struct {
158         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
159 }
160
161 func (m *SwInterfaceSpanEnableDisableReply) Reset() { *m = SwInterfaceSpanEnableDisableReply{} }
162 func (*SwInterfaceSpanEnableDisableReply) GetMessageName() string {
163         return "sw_interface_span_enable_disable_reply"
164 }
165 func (*SwInterfaceSpanEnableDisableReply) GetCrcString() string { return "e8d4e804" }
166 func (*SwInterfaceSpanEnableDisableReply) GetMessageType() api.MessageType {
167         return api.ReplyMessage
168 }
169
170 func (m *SwInterfaceSpanEnableDisableReply) Size() (size int) {
171         if m == nil {
172                 return 0
173         }
174         size += 4 // m.Retval
175         return size
176 }
177 func (m *SwInterfaceSpanEnableDisableReply) Marshal(b []byte) ([]byte, error) {
178         if b == nil {
179                 b = make([]byte, m.Size())
180         }
181         buf := codec.NewBuffer(b)
182         buf.EncodeInt32(m.Retval)
183         return buf.Bytes(), nil
184 }
185 func (m *SwInterfaceSpanEnableDisableReply) Unmarshal(b []byte) error {
186         buf := codec.NewBuffer(b)
187         m.Retval = buf.DecodeInt32()
188         return nil
189 }
190
191 func init() { file_span_binapi_init() }
192 func file_span_binapi_init() {
193         api.RegisterMessage((*SwInterfaceSpanDetails)(nil), "sw_interface_span_details_23966371")
194         api.RegisterMessage((*SwInterfaceSpanDump)(nil), "sw_interface_span_dump_67c54650")
195         api.RegisterMessage((*SwInterfaceSpanEnableDisable)(nil), "sw_interface_span_enable_disable_7216258d")
196         api.RegisterMessage((*SwInterfaceSpanEnableDisableReply)(nil), "sw_interface_span_enable_disable_reply_e8d4e804")
197 }
198
199 // Messages returns list of all messages in this module.
200 func AllMessages() []api.Message {
201         return []api.Message{
202                 (*SwInterfaceSpanDetails)(nil),
203                 (*SwInterfaceSpanDump)(nil),
204                 (*SwInterfaceSpanEnableDisable)(nil),
205                 (*SwInterfaceSpanEnableDisableReply)(nil),
206         }
207 }