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/fib.api.json
7 // Package fib contains generated bindings for API file fib.api.
16 api "git.fd.io/govpp.git/api"
17 _ "git.fd.io/govpp.git/binapi/fib_types"
18 _ "git.fd.io/govpp.git/binapi/ip_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 = 0x4ef4abc1
34 // FibSource defines type 'fib_source'.
35 type FibSource struct {
36 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
37 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"`
38 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
41 // FibSourceAdd defines message 'fib_source_add'.
42 type FibSourceAdd struct {
43 Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"`
46 func (m *FibSourceAdd) Reset() { *m = FibSourceAdd{} }
47 func (*FibSourceAdd) GetMessageName() string { return "fib_source_add" }
48 func (*FibSourceAdd) GetCrcString() string { return "b3ac2aec" }
49 func (*FibSourceAdd) GetMessageType() api.MessageType {
50 return api.RequestMessage
53 func (m *FibSourceAdd) Size() (size int) {
57 size += 1 // m.Src.Priority
59 size += 64 // m.Src.Name
62 func (m *FibSourceAdd) Marshal(b []byte) ([]byte, error) {
64 b = make([]byte, m.Size())
66 buf := codec.NewBuffer(b)
67 buf.EncodeUint8(m.Src.Priority)
68 buf.EncodeUint8(m.Src.ID)
69 buf.EncodeString(m.Src.Name, 64)
70 return buf.Bytes(), nil
72 func (m *FibSourceAdd) Unmarshal(b []byte) error {
73 buf := codec.NewBuffer(b)
74 m.Src.Priority = buf.DecodeUint8()
75 m.Src.ID = buf.DecodeUint8()
76 m.Src.Name = buf.DecodeString(64)
80 // FibSourceAddReply defines message 'fib_source_add_reply'.
81 type FibSourceAddReply struct {
82 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
83 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"`
86 func (m *FibSourceAddReply) Reset() { *m = FibSourceAddReply{} }
87 func (*FibSourceAddReply) GetMessageName() string { return "fib_source_add_reply" }
88 func (*FibSourceAddReply) GetCrcString() string { return "604fd6f1" }
89 func (*FibSourceAddReply) GetMessageType() api.MessageType {
90 return api.ReplyMessage
93 func (m *FibSourceAddReply) Size() (size int) {
101 func (m *FibSourceAddReply) Marshal(b []byte) ([]byte, error) {
103 b = make([]byte, m.Size())
105 buf := codec.NewBuffer(b)
106 buf.EncodeInt32(m.Retval)
107 buf.EncodeUint8(m.ID)
108 return buf.Bytes(), nil
110 func (m *FibSourceAddReply) Unmarshal(b []byte) error {
111 buf := codec.NewBuffer(b)
112 m.Retval = buf.DecodeInt32()
113 m.ID = buf.DecodeUint8()
117 // FibSourceDetails defines message 'fib_source_details'.
118 type FibSourceDetails struct {
119 Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"`
122 func (m *FibSourceDetails) Reset() { *m = FibSourceDetails{} }
123 func (*FibSourceDetails) GetMessageName() string { return "fib_source_details" }
124 func (*FibSourceDetails) GetCrcString() string { return "8668acdb" }
125 func (*FibSourceDetails) GetMessageType() api.MessageType {
126 return api.ReplyMessage
129 func (m *FibSourceDetails) Size() (size int) {
133 size += 1 // m.Src.Priority
134 size += 1 // m.Src.ID
135 size += 64 // m.Src.Name
138 func (m *FibSourceDetails) Marshal(b []byte) ([]byte, error) {
140 b = make([]byte, m.Size())
142 buf := codec.NewBuffer(b)
143 buf.EncodeUint8(m.Src.Priority)
144 buf.EncodeUint8(m.Src.ID)
145 buf.EncodeString(m.Src.Name, 64)
146 return buf.Bytes(), nil
148 func (m *FibSourceDetails) Unmarshal(b []byte) error {
149 buf := codec.NewBuffer(b)
150 m.Src.Priority = buf.DecodeUint8()
151 m.Src.ID = buf.DecodeUint8()
152 m.Src.Name = buf.DecodeString(64)
156 // FibSourceDump defines message 'fib_source_dump'.
157 type FibSourceDump struct{}
159 func (m *FibSourceDump) Reset() { *m = FibSourceDump{} }
160 func (*FibSourceDump) GetMessageName() string { return "fib_source_dump" }
161 func (*FibSourceDump) GetCrcString() string { return "51077d14" }
162 func (*FibSourceDump) GetMessageType() api.MessageType {
163 return api.RequestMessage
166 func (m *FibSourceDump) Size() (size int) {
172 func (m *FibSourceDump) Marshal(b []byte) ([]byte, error) {
174 b = make([]byte, m.Size())
176 buf := codec.NewBuffer(b)
177 return buf.Bytes(), nil
179 func (m *FibSourceDump) Unmarshal(b []byte) error {
183 func init() { file_fib_binapi_init() }
184 func file_fib_binapi_init() {
185 api.RegisterMessage((*FibSourceAdd)(nil), "fib_source_add_b3ac2aec")
186 api.RegisterMessage((*FibSourceAddReply)(nil), "fib_source_add_reply_604fd6f1")
187 api.RegisterMessage((*FibSourceDetails)(nil), "fib_source_details_8668acdb")
188 api.RegisterMessage((*FibSourceDump)(nil), "fib_source_dump_51077d14")
191 // Messages returns list of all messages in this module.
192 func AllMessages() []api.Message {
193 return []api.Message{
194 (*FibSourceAdd)(nil),
195 (*FibSourceAddReply)(nil),
196 (*FibSourceDetails)(nil),
197 (*FibSourceDump)(nil),