1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.5.0-dev
// VPP: 22.02-release
// source: /usr/share/vpp/api/core/fib.api.json
// Package fib contains generated bindings for API file fib.api.
//
// Contents:
// 1 struct
// 4 messages
//
package fib
import (
api "git.fd.io/govpp.git/api"
_ "git.fd.io/govpp.git/binapi/fib_types"
_ "git.fd.io/govpp.git/binapi/ip_types"
codec "git.fd.io/govpp.git/codec"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the GoVPP api package it is being compiled against.
// A compilation error at this line likely means your copy of the
// GoVPP api package needs to be updated.
const _ = api.GoVppAPIPackageIsVersion2
const (
APIFile = "fib"
APIVersion = "1.0.0"
VersionCrc = 0x4ef4abc1
)
// FibSource defines type 'fib_source'.
type FibSource struct {
Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
ID uint8 `binapi:"u8,name=id" json:"id,omitempty"`
Name string `binapi:"string[64],name=name" json:"name,omitempty"`
}
// FibSourceAdd defines message 'fib_source_add'.
type FibSourceAdd struct {
Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"`
}
func (m *FibSourceAdd) Reset() { *m = FibSourceAdd{} }
func (*FibSourceAdd) GetMessageName() string { return "fib_source_add" }
func (*FibSourceAdd) GetCrcString() string { return "b3ac2aec" }
func (*FibSourceAdd) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *FibSourceAdd) Size() (size int) {
if m == nil {
return 0
}
size += 1 // m.Src.Priority
size += 1 // m.Src.ID
size += 64 // m.Src.Name
return size
}
func (m *FibSourceAdd) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint8(m.Src.Priority)
buf.EncodeUint8(m.Src.ID)
buf.EncodeString(m.Src.Name, 64)
return buf.Bytes(), nil
}
func (m *FibSourceAdd) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Src.Priority = buf.DecodeUint8()
m.Src.ID = buf.DecodeUint8()
m.Src.Name = buf.DecodeString(64)
return nil
}
// FibSourceAddReply defines message 'fib_source_add_reply'.
type FibSourceAddReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
ID uint8 `binapi:"u8,name=id" json:"id,omitempty"`
}
func (m *FibSourceAddReply) Reset() { *m = FibSourceAddReply{} }
func (*FibSourceAddReply) GetMessageName() string { return "fib_source_add_reply" }
func (*FibSourceAddReply) GetCrcString() string { return "604fd6f1" }
func (*FibSourceAddReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *FibSourceAddReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
size += 1 // m.ID
return size
}
func (m *FibSourceAddReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
buf.EncodeUint8(m.ID)
return buf.Bytes(), nil
}
func (m *FibSourceAddReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
m.ID = buf.DecodeUint8()
return nil
}
// FibSourceDetails defines message 'fib_source_details'.
type FibSourceDetails struct {
Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"`
}
func (m *FibSourceDetails) Reset() { *m = FibSourceDetails{} }
func (*FibSourceDetails) GetMessageName() string { return "fib_source_details" }
func (*FibSourceDetails) GetCrcString() string { return "8668acdb" }
func (*FibSourceDetails) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *FibSourceDetails) Size() (size int) {
if m == nil {
return 0
}
size += 1 // m.Src.Priority
size += 1 // m.Src.ID
size += 64 // m.Src.Name
return size
}
func (m *FibSourceDetails) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint8(m.Src.Priority)
buf.EncodeUint8(m.Src.ID)
buf.EncodeString(m.Src.Name, 64)
return buf.Bytes(), nil
}
func (m *FibSourceDetails) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Src.Priority = buf.DecodeUint8()
m.Src.ID = buf.DecodeUint8()
m.Src.Name = buf.DecodeString(64)
return nil
}
// FibSourceDump defines message 'fib_source_dump'.
type FibSourceDump struct{}
func (m *FibSourceDump) Reset() { *m = FibSourceDump{} }
func (*FibSourceDump) GetMessageName() string { return "fib_source_dump" }
func (*FibSourceDump) GetCrcString() string { return "51077d14" }
func (*FibSourceDump) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *FibSourceDump) Size() (size int) {
if m == nil {
return 0
}
return size
}
func (m *FibSourceDump) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
return buf.Bytes(), nil
}
func (m *FibSourceDump) Unmarshal(b []byte) error {
return nil
}
func init() { file_fib_binapi_init() }
func file_fib_binapi_init() {
api.RegisterMessage((*FibSourceAdd)(nil), "fib_source_add_b3ac2aec")
api.RegisterMessage((*FibSourceAddReply)(nil), "fib_source_add_reply_604fd6f1")
api.RegisterMessage((*FibSourceDetails)(nil), "fib_source_details_8668acdb")
api.RegisterMessage((*FibSourceDump)(nil), "fib_source_dump_51077d14")
}
// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
return []api.Message{
(*FibSourceAdd)(nil),
(*FibSourceAddReply)(nil),
(*FibSourceDetails)(nil),
(*FibSourceDump)(nil),
}
}
|