github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/fib/fib.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: core/fib.api.json 6 7 // Package fib contains generated bindings for API file fib.api. 8 // 9 // Contents: 10 // - 1 struct 11 // - 4 messages 12 package fib 13 14 import ( 15 _ "github.com/networkservicemesh/govpp/binapi/fib_types" 16 _ "github.com/networkservicemesh/govpp/binapi/ip_types" 17 api "go.fd.io/govpp/api" 18 codec "go.fd.io/govpp/codec" 19 ) 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the GoVPP api package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // GoVPP api package needs to be updated. 25 const _ = api.GoVppAPIPackageIsVersion2 26 27 const ( 28 APIFile = "fib" 29 APIVersion = "1.0.0" 30 VersionCrc = 0x4ef4abc1 31 ) 32 33 // FibSource defines type 'fib_source'. 34 type FibSource struct { 35 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"` 36 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` 37 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 38 } 39 40 // /* 41 // - Copyright (c) 2018 Cisco and/or its affiliates. 42 // - Licensed under the Apache License, Version 2.0 (the "License"); 43 // - you may not use this file except in compliance with the License. 44 // - You may obtain a copy of the License at: 45 // * 46 // - http://www.apache.org/licenses/LICENSE-2.0 47 // * 48 // - Unless required by applicable law or agreed to in writing, software 49 // - distributed under the License is distributed on an "AS IS" BASIS, 50 // - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 51 // - See the License for the specific language governing permissions and 52 // - limitations under the License. 53 // 54 // FibSourceAdd defines message 'fib_source_add'. 55 type FibSourceAdd struct { 56 Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"` 57 } 58 59 func (m *FibSourceAdd) Reset() { *m = FibSourceAdd{} } 60 func (*FibSourceAdd) GetMessageName() string { return "fib_source_add" } 61 func (*FibSourceAdd) GetCrcString() string { return "b3ac2aec" } 62 func (*FibSourceAdd) GetMessageType() api.MessageType { 63 return api.RequestMessage 64 } 65 66 func (m *FibSourceAdd) Size() (size int) { 67 if m == nil { 68 return 0 69 } 70 size += 1 // m.Src.Priority 71 size += 1 // m.Src.ID 72 size += 64 // m.Src.Name 73 return size 74 } 75 func (m *FibSourceAdd) Marshal(b []byte) ([]byte, error) { 76 if b == nil { 77 b = make([]byte, m.Size()) 78 } 79 buf := codec.NewBuffer(b) 80 buf.EncodeUint8(m.Src.Priority) 81 buf.EncodeUint8(m.Src.ID) 82 buf.EncodeString(m.Src.Name, 64) 83 return buf.Bytes(), nil 84 } 85 func (m *FibSourceAdd) Unmarshal(b []byte) error { 86 buf := codec.NewBuffer(b) 87 m.Src.Priority = buf.DecodeUint8() 88 m.Src.ID = buf.DecodeUint8() 89 m.Src.Name = buf.DecodeString(64) 90 return nil 91 } 92 93 // FibSourceAddReply defines message 'fib_source_add_reply'. 94 type FibSourceAddReply struct { 95 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 96 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` 97 } 98 99 func (m *FibSourceAddReply) Reset() { *m = FibSourceAddReply{} } 100 func (*FibSourceAddReply) GetMessageName() string { return "fib_source_add_reply" } 101 func (*FibSourceAddReply) GetCrcString() string { return "604fd6f1" } 102 func (*FibSourceAddReply) GetMessageType() api.MessageType { 103 return api.ReplyMessage 104 } 105 106 func (m *FibSourceAddReply) Size() (size int) { 107 if m == nil { 108 return 0 109 } 110 size += 4 // m.Retval 111 size += 1 // m.ID 112 return size 113 } 114 func (m *FibSourceAddReply) Marshal(b []byte) ([]byte, error) { 115 if b == nil { 116 b = make([]byte, m.Size()) 117 } 118 buf := codec.NewBuffer(b) 119 buf.EncodeInt32(m.Retval) 120 buf.EncodeUint8(m.ID) 121 return buf.Bytes(), nil 122 } 123 func (m *FibSourceAddReply) Unmarshal(b []byte) error { 124 buf := codec.NewBuffer(b) 125 m.Retval = buf.DecodeInt32() 126 m.ID = buf.DecodeUint8() 127 return nil 128 } 129 130 // FibSourceDetails defines message 'fib_source_details'. 131 type FibSourceDetails struct { 132 Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"` 133 } 134 135 func (m *FibSourceDetails) Reset() { *m = FibSourceDetails{} } 136 func (*FibSourceDetails) GetMessageName() string { return "fib_source_details" } 137 func (*FibSourceDetails) GetCrcString() string { return "8668acdb" } 138 func (*FibSourceDetails) GetMessageType() api.MessageType { 139 return api.ReplyMessage 140 } 141 142 func (m *FibSourceDetails) Size() (size int) { 143 if m == nil { 144 return 0 145 } 146 size += 1 // m.Src.Priority 147 size += 1 // m.Src.ID 148 size += 64 // m.Src.Name 149 return size 150 } 151 func (m *FibSourceDetails) Marshal(b []byte) ([]byte, error) { 152 if b == nil { 153 b = make([]byte, m.Size()) 154 } 155 buf := codec.NewBuffer(b) 156 buf.EncodeUint8(m.Src.Priority) 157 buf.EncodeUint8(m.Src.ID) 158 buf.EncodeString(m.Src.Name, 64) 159 return buf.Bytes(), nil 160 } 161 func (m *FibSourceDetails) Unmarshal(b []byte) error { 162 buf := codec.NewBuffer(b) 163 m.Src.Priority = buf.DecodeUint8() 164 m.Src.ID = buf.DecodeUint8() 165 m.Src.Name = buf.DecodeString(64) 166 return nil 167 } 168 169 // FibSourceDump defines message 'fib_source_dump'. 170 type FibSourceDump struct{} 171 172 func (m *FibSourceDump) Reset() { *m = FibSourceDump{} } 173 func (*FibSourceDump) GetMessageName() string { return "fib_source_dump" } 174 func (*FibSourceDump) GetCrcString() string { return "51077d14" } 175 func (*FibSourceDump) GetMessageType() api.MessageType { 176 return api.RequestMessage 177 } 178 179 func (m *FibSourceDump) Size() (size int) { 180 if m == nil { 181 return 0 182 } 183 return size 184 } 185 func (m *FibSourceDump) Marshal(b []byte) ([]byte, error) { 186 if b == nil { 187 b = make([]byte, m.Size()) 188 } 189 buf := codec.NewBuffer(b) 190 return buf.Bytes(), nil 191 } 192 func (m *FibSourceDump) Unmarshal(b []byte) error { 193 return nil 194 } 195 196 func init() { file_fib_binapi_init() } 197 func file_fib_binapi_init() { 198 api.RegisterMessage((*FibSourceAdd)(nil), "fib_source_add_b3ac2aec") 199 api.RegisterMessage((*FibSourceAddReply)(nil), "fib_source_add_reply_604fd6f1") 200 api.RegisterMessage((*FibSourceDetails)(nil), "fib_source_details_8668acdb") 201 api.RegisterMessage((*FibSourceDump)(nil), "fib_source_dump_51077d14") 202 } 203 204 // Messages returns list of all messages in this module. 205 func AllMessages() []api.Message { 206 return []api.Message{ 207 (*FibSourceAdd)(nil), 208 (*FibSourceAddReply)(nil), 209 (*FibSourceDetails)(nil), 210 (*FibSourceDump)(nil), 211 } 212 }