1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/span.api.json
7 // Package span contains generated bindings for API file span.api.
16 api "git.fd.io/govpp.git/api"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 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() int {
87 size += 4 // m.SwIfIndexFrom
88 size += 4 // m.SwIfIndexTo
93 func (m *SwInterfaceSpanDetails) Marshal(b []byte) ([]byte, error) {
96 buf = codec.NewBuffer(make([]byte, m.Size()))
98 buf = codec.NewBuffer(b)
100 buf.EncodeUint32(uint32(m.SwIfIndexFrom))
101 buf.EncodeUint32(uint32(m.SwIfIndexTo))
102 buf.EncodeUint32(uint32(m.State))
103 buf.EncodeBool(m.IsL2)
104 return buf.Bytes(), nil
106 func (m *SwInterfaceSpanDetails) Unmarshal(b []byte) error {
107 buf := codec.NewBuffer(b)
108 m.SwIfIndexFrom = interface_types.InterfaceIndex(buf.DecodeUint32())
109 m.SwIfIndexTo = interface_types.InterfaceIndex(buf.DecodeUint32())
110 m.State = SpanState(buf.DecodeUint32())
111 m.IsL2 = buf.DecodeBool()
115 // SwInterfaceSpanDump defines message 'sw_interface_span_dump'.
116 type SwInterfaceSpanDump struct {
117 IsL2 bool `binapi:"bool,name=is_l2" json:"is_l2,omitempty"`
120 func (m *SwInterfaceSpanDump) Reset() { *m = SwInterfaceSpanDump{} }
121 func (*SwInterfaceSpanDump) GetMessageName() string { return "sw_interface_span_dump" }
122 func (*SwInterfaceSpanDump) GetCrcString() string { return "d6cf0c3d" }
123 func (*SwInterfaceSpanDump) GetMessageType() api.MessageType {
124 return api.RequestMessage
127 func (m *SwInterfaceSpanDump) Size() int {
135 func (m *SwInterfaceSpanDump) Marshal(b []byte) ([]byte, error) {
136 var buf *codec.Buffer
138 buf = codec.NewBuffer(make([]byte, m.Size()))
140 buf = codec.NewBuffer(b)
142 buf.EncodeBool(m.IsL2)
143 return buf.Bytes(), nil
145 func (m *SwInterfaceSpanDump) Unmarshal(b []byte) error {
146 buf := codec.NewBuffer(b)
147 m.IsL2 = buf.DecodeBool()
151 // SwInterfaceSpanEnableDisable defines message 'sw_interface_span_enable_disable'.
152 type SwInterfaceSpanEnableDisable struct {
153 SwIfIndexFrom interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_from" json:"sw_if_index_from,omitempty"`
154 SwIfIndexTo interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index_to" json:"sw_if_index_to,omitempty"`
155 State SpanState `binapi:"span_state,name=state" json:"state,omitempty"`
156 IsL2 bool `binapi:"bool,name=is_l2" json:"is_l2,omitempty"`
159 func (m *SwInterfaceSpanEnableDisable) Reset() { *m = SwInterfaceSpanEnableDisable{} }
160 func (*SwInterfaceSpanEnableDisable) GetMessageName() string {
161 return "sw_interface_span_enable_disable"
163 func (*SwInterfaceSpanEnableDisable) GetCrcString() string { return "acc8fea1" }
164 func (*SwInterfaceSpanEnableDisable) GetMessageType() api.MessageType {
165 return api.RequestMessage
168 func (m *SwInterfaceSpanEnableDisable) Size() int {
173 size += 4 // m.SwIfIndexFrom
174 size += 4 // m.SwIfIndexTo
179 func (m *SwInterfaceSpanEnableDisable) Marshal(b []byte) ([]byte, error) {
180 var buf *codec.Buffer
182 buf = codec.NewBuffer(make([]byte, m.Size()))
184 buf = codec.NewBuffer(b)
186 buf.EncodeUint32(uint32(m.SwIfIndexFrom))
187 buf.EncodeUint32(uint32(m.SwIfIndexTo))
188 buf.EncodeUint32(uint32(m.State))
189 buf.EncodeBool(m.IsL2)
190 return buf.Bytes(), nil
192 func (m *SwInterfaceSpanEnableDisable) Unmarshal(b []byte) error {
193 buf := codec.NewBuffer(b)
194 m.SwIfIndexFrom = interface_types.InterfaceIndex(buf.DecodeUint32())
195 m.SwIfIndexTo = interface_types.InterfaceIndex(buf.DecodeUint32())
196 m.State = SpanState(buf.DecodeUint32())
197 m.IsL2 = buf.DecodeBool()
201 // SwInterfaceSpanEnableDisableReply defines message 'sw_interface_span_enable_disable_reply'.
202 type SwInterfaceSpanEnableDisableReply struct {
203 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
206 func (m *SwInterfaceSpanEnableDisableReply) Reset() { *m = SwInterfaceSpanEnableDisableReply{} }
207 func (*SwInterfaceSpanEnableDisableReply) GetMessageName() string {
208 return "sw_interface_span_enable_disable_reply"
210 func (*SwInterfaceSpanEnableDisableReply) GetCrcString() string { return "e8d4e804" }
211 func (*SwInterfaceSpanEnableDisableReply) GetMessageType() api.MessageType {
212 return api.ReplyMessage
215 func (m *SwInterfaceSpanEnableDisableReply) Size() int {
220 size += 4 // m.Retval
223 func (m *SwInterfaceSpanEnableDisableReply) Marshal(b []byte) ([]byte, error) {
224 var buf *codec.Buffer
226 buf = codec.NewBuffer(make([]byte, m.Size()))
228 buf = codec.NewBuffer(b)
230 buf.EncodeUint32(uint32(m.Retval))
231 return buf.Bytes(), nil
233 func (m *SwInterfaceSpanEnableDisableReply) Unmarshal(b []byte) error {
234 buf := codec.NewBuffer(b)
235 m.Retval = int32(buf.DecodeUint32())
239 func init() { file_span_binapi_init() }
240 func file_span_binapi_init() {
241 api.RegisterMessage((*SwInterfaceSpanDetails)(nil), "sw_interface_span_details_055643fc")
242 api.RegisterMessage((*SwInterfaceSpanDump)(nil), "sw_interface_span_dump_d6cf0c3d")
243 api.RegisterMessage((*SwInterfaceSpanEnableDisable)(nil), "sw_interface_span_enable_disable_acc8fea1")
244 api.RegisterMessage((*SwInterfaceSpanEnableDisableReply)(nil), "sw_interface_span_enable_disable_reply_e8d4e804")
247 // Messages returns list of all messages in this module.
248 func AllMessages() []api.Message {
249 return []api.Message{
250 (*SwInterfaceSpanDetails)(nil),
251 (*SwInterfaceSpanDump)(nil),
252 (*SwInterfaceSpanEnableDisable)(nil),
253 (*SwInterfaceSpanEnableDisableReply)(nil),