1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package span contains generated bindings for API file span.api.
17 api "git.fd.io/govpp.git/api"
18 interface_types "git.fd.io/govpp.git/binapi/interface_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0x9f4dec7c
34 // SpanState defines enum 'span_state'.
38 SPAN_STATE_API_DISABLED SpanState = 0
39 SPAN_STATE_API_RX SpanState = 1
40 SPAN_STATE_API_TX SpanState = 2
41 SPAN_STATE_API_RX_TX SpanState = 3
45 SpanState_name = map[uint32]string{
46 0: "SPAN_STATE_API_DISABLED",
47 1: "SPAN_STATE_API_RX",
48 2: "SPAN_STATE_API_TX",
49 3: "SPAN_STATE_API_RX_TX",
51 SpanState_value = map[string]uint32{
52 "SPAN_STATE_API_DISABLED": 0,
53 "SPAN_STATE_API_RX": 1,
54 "SPAN_STATE_API_TX": 2,
55 "SPAN_STATE_API_RX_TX": 3,
59 func (x SpanState) String() string {
60 s, ok := SpanState_name[uint32(x)]
64 return "SpanState(" + strconv.Itoa(int(x)) + ")"
67 // SwInterfaceSpanDetails defines message 'sw_interface_span_details'.
68 type SwInterfaceSpanDetails struct {
69 SwIfIndexFrom interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_from" json:"sw_if_index_from,omitempty"`
70 SwIfIndexTo interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_to" json:"sw_if_index_to,omitempty"`
71 State SpanState `binapi:"span_state,name=state" json:"state,omitempty"`
72 IsL2 bool `binapi:"bool,name=is_l2" json:"is_l2,omitempty"`
75 func (m *SwInterfaceSpanDetails) Reset() { *m = SwInterfaceSpanDetails{} }
76 func (*SwInterfaceSpanDetails) GetMessageName() string { return "sw_interface_span_details" }
77 func (*SwInterfaceSpanDetails) GetCrcString() string { return "055643fc" }
78 func (*SwInterfaceSpanDetails) GetMessageType() api.MessageType {
79 return api.ReplyMessage
82 func (m *SwInterfaceSpanDetails) Size() (size int) {
86 size += 4 // m.SwIfIndexFrom
87 size += 4 // m.SwIfIndexTo
92 func (m *SwInterfaceSpanDetails) Marshal(b []byte) ([]byte, error) {
94 b = make([]byte, m.Size())
96 buf := codec.NewBuffer(b)
97 buf.EncodeUint32(uint32(m.SwIfIndexFrom))
98 buf.EncodeUint32(uint32(m.SwIfIndexTo))
99 buf.EncodeUint32(uint32(m.State))
100 buf.EncodeBool(m.IsL2)
101 return buf.Bytes(), nil
103 func (m *SwInterfaceSpanDetails) Unmarshal(b []byte) error {
104 buf := codec.NewBuffer(b)
105 m.SwIfIndexFrom = interface_types.InterfaceIndex(buf.DecodeUint32())
106 m.SwIfIndexTo = interface_types.InterfaceIndex(buf.DecodeUint32())
107 m.State = SpanState(buf.DecodeUint32())
108 m.IsL2 = buf.DecodeBool()
112 // SwInterfaceSpanDump defines message 'sw_interface_span_dump'.
113 type SwInterfaceSpanDump struct {
114 IsL2 bool `binapi:"bool,name=is_l2" json:"is_l2,omitempty"`
117 func (m *SwInterfaceSpanDump) Reset() { *m = SwInterfaceSpanDump{} }
118 func (*SwInterfaceSpanDump) GetMessageName() string { return "sw_interface_span_dump" }
119 func (*SwInterfaceSpanDump) GetCrcString() string { return "d6cf0c3d" }
120 func (*SwInterfaceSpanDump) GetMessageType() api.MessageType {
121 return api.RequestMessage
124 func (m *SwInterfaceSpanDump) Size() (size int) {
131 func (m *SwInterfaceSpanDump) Marshal(b []byte) ([]byte, error) {
133 b = make([]byte, m.Size())
135 buf := codec.NewBuffer(b)
136 buf.EncodeBool(m.IsL2)
137 return buf.Bytes(), nil
139 func (m *SwInterfaceSpanDump) Unmarshal(b []byte) error {
140 buf := codec.NewBuffer(b)
141 m.IsL2 = buf.DecodeBool()
145 // SwInterfaceSpanEnableDisable defines message 'sw_interface_span_enable_disable'.
146 type SwInterfaceSpanEnableDisable struct {
147 SwIfIndexFrom interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_from" json:"sw_if_index_from,omitempty"`
148 SwIfIndexTo interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_to" json:"sw_if_index_to,omitempty"`
149 State SpanState `binapi:"span_state,name=state" json:"state,omitempty"`
150 IsL2 bool `binapi:"bool,name=is_l2" json:"is_l2,omitempty"`
153 func (m *SwInterfaceSpanEnableDisable) Reset() { *m = SwInterfaceSpanEnableDisable{} }
154 func (*SwInterfaceSpanEnableDisable) GetMessageName() string {
155 return "sw_interface_span_enable_disable"
157 func (*SwInterfaceSpanEnableDisable) GetCrcString() string { return "acc8fea1" }
158 func (*SwInterfaceSpanEnableDisable) GetMessageType() api.MessageType {
159 return api.RequestMessage
162 func (m *SwInterfaceSpanEnableDisable) Size() (size int) {
166 size += 4 // m.SwIfIndexFrom
167 size += 4 // m.SwIfIndexTo
172 func (m *SwInterfaceSpanEnableDisable) Marshal(b []byte) ([]byte, error) {
174 b = make([]byte, m.Size())
176 buf := codec.NewBuffer(b)
177 buf.EncodeUint32(uint32(m.SwIfIndexFrom))
178 buf.EncodeUint32(uint32(m.SwIfIndexTo))
179 buf.EncodeUint32(uint32(m.State))
180 buf.EncodeBool(m.IsL2)
181 return buf.Bytes(), nil
183 func (m *SwInterfaceSpanEnableDisable) Unmarshal(b []byte) error {
184 buf := codec.NewBuffer(b)
185 m.SwIfIndexFrom = interface_types.InterfaceIndex(buf.DecodeUint32())
186 m.SwIfIndexTo = interface_types.InterfaceIndex(buf.DecodeUint32())
187 m.State = SpanState(buf.DecodeUint32())
188 m.IsL2 = buf.DecodeBool()
192 // SwInterfaceSpanEnableDisableReply defines message 'sw_interface_span_enable_disable_reply'.
193 type SwInterfaceSpanEnableDisableReply struct {
194 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
197 func (m *SwInterfaceSpanEnableDisableReply) Reset() { *m = SwInterfaceSpanEnableDisableReply{} }
198 func (*SwInterfaceSpanEnableDisableReply) GetMessageName() string {
199 return "sw_interface_span_enable_disable_reply"
201 func (*SwInterfaceSpanEnableDisableReply) GetCrcString() string { return "e8d4e804" }
202 func (*SwInterfaceSpanEnableDisableReply) GetMessageType() api.MessageType {
203 return api.ReplyMessage
206 func (m *SwInterfaceSpanEnableDisableReply) Size() (size int) {
210 size += 4 // m.Retval
213 func (m *SwInterfaceSpanEnableDisableReply) Marshal(b []byte) ([]byte, error) {
215 b = make([]byte, m.Size())
217 buf := codec.NewBuffer(b)
218 buf.EncodeInt32(m.Retval)
219 return buf.Bytes(), nil
221 func (m *SwInterfaceSpanEnableDisableReply) Unmarshal(b []byte) error {
222 buf := codec.NewBuffer(b)
223 m.Retval = buf.DecodeInt32()
227 func init() { file_span_binapi_init() }
228 func file_span_binapi_init() {
229 api.RegisterMessage((*SwInterfaceSpanDetails)(nil), "sw_interface_span_details_055643fc")
230 api.RegisterMessage((*SwInterfaceSpanDump)(nil), "sw_interface_span_dump_d6cf0c3d")
231 api.RegisterMessage((*SwInterfaceSpanEnableDisable)(nil), "sw_interface_span_enable_disable_acc8fea1")
232 api.RegisterMessage((*SwInterfaceSpanEnableDisableReply)(nil), "sw_interface_span_enable_disable_reply_e8d4e804")
235 // Messages returns list of all messages in this module.
236 func AllMessages() []api.Message {
237 return []api.Message{
238 (*SwInterfaceSpanDetails)(nil),
239 (*SwInterfaceSpanDump)(nil),
240 (*SwInterfaceSpanEnableDisable)(nil),
241 (*SwInterfaceSpanEnableDisableReply)(nil),