1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.3.5-56-gc0da1f2-dirty
5 // source: /usr/share/vpp/api/core/span.api.json
7 // Package span contains generated bindings for API file span.api.
18 api "git.fd.io/govpp.git/api"
19 interface_types "git.fd.io/govpp.git/binapi/interface_types"
20 codec "git.fd.io/govpp.git/codec"
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
32 VersionCrc = 0x34ee02b
35 // SpanState defines enum 'span_state'.
39 SPAN_STATE_API_DISABLED SpanState = 0
40 SPAN_STATE_API_RX SpanState = 1
41 SPAN_STATE_API_TX SpanState = 2
42 SPAN_STATE_API_RX_TX SpanState = 3
46 SpanState_name = map[uint32]string{
47 0: "SPAN_STATE_API_DISABLED",
48 1: "SPAN_STATE_API_RX",
49 2: "SPAN_STATE_API_TX",
50 3: "SPAN_STATE_API_RX_TX",
52 SpanState_value = map[string]uint32{
53 "SPAN_STATE_API_DISABLED": 0,
54 "SPAN_STATE_API_RX": 1,
55 "SPAN_STATE_API_TX": 2,
56 "SPAN_STATE_API_RX_TX": 3,
60 func (x SpanState) String() string {
61 s, ok := SpanState_name[uint32(x)]
65 return "SpanState(" + strconv.Itoa(int(x)) + ")"
68 // SwInterfaceSpanDetails defines message 'sw_interface_span_details'.
69 type SwInterfaceSpanDetails struct {
70 SwIfIndexFrom interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_from" json:"sw_if_index_from,omitempty"`
71 SwIfIndexTo interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_to" json:"sw_if_index_to,omitempty"`
72 State SpanState `binapi:"span_state,name=state" json:"state,omitempty"`
73 IsL2 bool `binapi:"bool,name=is_l2" json:"is_l2,omitempty"`
76 func (m *SwInterfaceSpanDetails) Reset() { *m = SwInterfaceSpanDetails{} }
77 func (*SwInterfaceSpanDetails) GetMessageName() string { return "sw_interface_span_details" }
78 func (*SwInterfaceSpanDetails) GetCrcString() string { return "8a20e79f" }
79 func (*SwInterfaceSpanDetails) GetMessageType() api.MessageType {
80 return api.ReplyMessage
83 func (m *SwInterfaceSpanDetails) Size() (size int) {
87 size += 4 // m.SwIfIndexFrom
88 size += 4 // m.SwIfIndexTo
93 func (m *SwInterfaceSpanDetails) Marshal(b []byte) ([]byte, error) {
95 b = make([]byte, m.Size())
97 buf := codec.NewBuffer(b)
98 buf.EncodeUint32(uint32(m.SwIfIndexFrom))
99 buf.EncodeUint32(uint32(m.SwIfIndexTo))
100 buf.EncodeUint32(uint32(m.State))
101 buf.EncodeBool(m.IsL2)
102 return buf.Bytes(), nil
104 func (m *SwInterfaceSpanDetails) Unmarshal(b []byte) error {
105 buf := codec.NewBuffer(b)
106 m.SwIfIndexFrom = interface_types.InterfaceIndex(buf.DecodeUint32())
107 m.SwIfIndexTo = interface_types.InterfaceIndex(buf.DecodeUint32())
108 m.State = SpanState(buf.DecodeUint32())
109 m.IsL2 = buf.DecodeBool()
113 // SwInterfaceSpanDump defines message 'sw_interface_span_dump'.
114 type SwInterfaceSpanDump struct {
115 IsL2 bool `binapi:"bool,name=is_l2" json:"is_l2,omitempty"`
118 func (m *SwInterfaceSpanDump) Reset() { *m = SwInterfaceSpanDump{} }
119 func (*SwInterfaceSpanDump) GetMessageName() string { return "sw_interface_span_dump" }
120 func (*SwInterfaceSpanDump) GetCrcString() string { return "d6cf0c3d" }
121 func (*SwInterfaceSpanDump) GetMessageType() api.MessageType {
122 return api.RequestMessage
125 func (m *SwInterfaceSpanDump) Size() (size int) {
132 func (m *SwInterfaceSpanDump) Marshal(b []byte) ([]byte, error) {
134 b = make([]byte, m.Size())
136 buf := codec.NewBuffer(b)
137 buf.EncodeBool(m.IsL2)
138 return buf.Bytes(), nil
140 func (m *SwInterfaceSpanDump) Unmarshal(b []byte) error {
141 buf := codec.NewBuffer(b)
142 m.IsL2 = buf.DecodeBool()
146 // SwInterfaceSpanEnableDisable defines message 'sw_interface_span_enable_disable'.
147 type SwInterfaceSpanEnableDisable struct {
148 SwIfIndexFrom interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_from" json:"sw_if_index_from,omitempty"`
149 SwIfIndexTo interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_to" json:"sw_if_index_to,omitempty"`
150 State SpanState `binapi:"span_state,name=state" json:"state,omitempty"`
151 IsL2 bool `binapi:"bool,name=is_l2" json:"is_l2,omitempty"`
154 func (m *SwInterfaceSpanEnableDisable) Reset() { *m = SwInterfaceSpanEnableDisable{} }
155 func (*SwInterfaceSpanEnableDisable) GetMessageName() string {
156 return "sw_interface_span_enable_disable"
158 func (*SwInterfaceSpanEnableDisable) GetCrcString() string { return "23ddd96b" }
159 func (*SwInterfaceSpanEnableDisable) GetMessageType() api.MessageType {
160 return api.RequestMessage
163 func (m *SwInterfaceSpanEnableDisable) Size() (size int) {
167 size += 4 // m.SwIfIndexFrom
168 size += 4 // m.SwIfIndexTo
173 func (m *SwInterfaceSpanEnableDisable) Marshal(b []byte) ([]byte, error) {
175 b = make([]byte, m.Size())
177 buf := codec.NewBuffer(b)
178 buf.EncodeUint32(uint32(m.SwIfIndexFrom))
179 buf.EncodeUint32(uint32(m.SwIfIndexTo))
180 buf.EncodeUint32(uint32(m.State))
181 buf.EncodeBool(m.IsL2)
182 return buf.Bytes(), nil
184 func (m *SwInterfaceSpanEnableDisable) Unmarshal(b []byte) error {
185 buf := codec.NewBuffer(b)
186 m.SwIfIndexFrom = interface_types.InterfaceIndex(buf.DecodeUint32())
187 m.SwIfIndexTo = interface_types.InterfaceIndex(buf.DecodeUint32())
188 m.State = SpanState(buf.DecodeUint32())
189 m.IsL2 = buf.DecodeBool()
193 // SwInterfaceSpanEnableDisableReply defines message 'sw_interface_span_enable_disable_reply'.
194 type SwInterfaceSpanEnableDisableReply struct {
195 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
198 func (m *SwInterfaceSpanEnableDisableReply) Reset() { *m = SwInterfaceSpanEnableDisableReply{} }
199 func (*SwInterfaceSpanEnableDisableReply) GetMessageName() string {
200 return "sw_interface_span_enable_disable_reply"
202 func (*SwInterfaceSpanEnableDisableReply) GetCrcString() string { return "e8d4e804" }
203 func (*SwInterfaceSpanEnableDisableReply) GetMessageType() api.MessageType {
204 return api.ReplyMessage
207 func (m *SwInterfaceSpanEnableDisableReply) Size() (size int) {
211 size += 4 // m.Retval
214 func (m *SwInterfaceSpanEnableDisableReply) Marshal(b []byte) ([]byte, error) {
216 b = make([]byte, m.Size())
218 buf := codec.NewBuffer(b)
219 buf.EncodeInt32(m.Retval)
220 return buf.Bytes(), nil
222 func (m *SwInterfaceSpanEnableDisableReply) Unmarshal(b []byte) error {
223 buf := codec.NewBuffer(b)
224 m.Retval = buf.DecodeInt32()
228 func init() { file_span_binapi_init() }
229 func file_span_binapi_init() {
230 api.RegisterMessage((*SwInterfaceSpanDetails)(nil), "sw_interface_span_details_8a20e79f")
231 api.RegisterMessage((*SwInterfaceSpanDump)(nil), "sw_interface_span_dump_d6cf0c3d")
232 api.RegisterMessage((*SwInterfaceSpanEnableDisable)(nil), "sw_interface_span_enable_disable_23ddd96b")
233 api.RegisterMessage((*SwInterfaceSpanEnableDisableReply)(nil), "sw_interface_span_enable_disable_reply_e8d4e804")
236 // Messages returns list of all messages in this module.
237 func AllMessages() []api.Message {
238 return []api.Message{
239 (*SwInterfaceSpanDetails)(nil),
240 (*SwInterfaceSpanDump)(nil),
241 (*SwInterfaceSpanEnableDisable)(nil),
242 (*SwInterfaceSpanEnableDisableReply)(nil),