github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/arp/arp.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/arp.api.json 6 7 // Package arp contains generated bindings for API file arp.api. 8 // 9 // Contents: 10 // - 1 struct 11 // - 8 messages 12 package arp 13 14 import ( 15 _ "github.com/networkservicemesh/govpp/binapi/ethernet_types" 16 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 17 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 18 api "go.fd.io/govpp/api" 19 codec "go.fd.io/govpp/codec" 20 ) 21 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 27 28 const ( 29 APIFile = "arp" 30 APIVersion = "1.0.0" 31 VersionCrc = 0xb57796ae 32 ) 33 34 // ProxyArp defines type 'proxy_arp'. 35 type ProxyArp struct { 36 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` 37 Low ip_types.IP4Address `binapi:"ip4_address,name=low" json:"low,omitempty"` 38 Hi ip_types.IP4Address `binapi:"ip4_address,name=hi" json:"hi,omitempty"` 39 } 40 41 // Proxy ARP add / del request 42 // - is_add - 1 if adding the Proxy ARP range, 0 if deleting 43 // - proxy - Proxy configuration 44 // 45 // ProxyArpAddDel defines message 'proxy_arp_add_del'. 46 type ProxyArpAddDel struct { 47 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 48 Proxy ProxyArp `binapi:"proxy_arp,name=proxy" json:"proxy,omitempty"` 49 } 50 51 func (m *ProxyArpAddDel) Reset() { *m = ProxyArpAddDel{} } 52 func (*ProxyArpAddDel) GetMessageName() string { return "proxy_arp_add_del" } 53 func (*ProxyArpAddDel) GetCrcString() string { return "1823c3e7" } 54 func (*ProxyArpAddDel) GetMessageType() api.MessageType { 55 return api.RequestMessage 56 } 57 58 func (m *ProxyArpAddDel) Size() (size int) { 59 if m == nil { 60 return 0 61 } 62 size += 1 // m.IsAdd 63 size += 4 // m.Proxy.TableID 64 size += 1 * 4 // m.Proxy.Low 65 size += 1 * 4 // m.Proxy.Hi 66 return size 67 } 68 func (m *ProxyArpAddDel) Marshal(b []byte) ([]byte, error) { 69 if b == nil { 70 b = make([]byte, m.Size()) 71 } 72 buf := codec.NewBuffer(b) 73 buf.EncodeBool(m.IsAdd) 74 buf.EncodeUint32(m.Proxy.TableID) 75 buf.EncodeBytes(m.Proxy.Low[:], 4) 76 buf.EncodeBytes(m.Proxy.Hi[:], 4) 77 return buf.Bytes(), nil 78 } 79 func (m *ProxyArpAddDel) Unmarshal(b []byte) error { 80 buf := codec.NewBuffer(b) 81 m.IsAdd = buf.DecodeBool() 82 m.Proxy.TableID = buf.DecodeUint32() 83 copy(m.Proxy.Low[:], buf.DecodeBytes(4)) 84 copy(m.Proxy.Hi[:], buf.DecodeBytes(4)) 85 return nil 86 } 87 88 // ProxyArpAddDelReply defines message 'proxy_arp_add_del_reply'. 89 type ProxyArpAddDelReply struct { 90 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 91 } 92 93 func (m *ProxyArpAddDelReply) Reset() { *m = ProxyArpAddDelReply{} } 94 func (*ProxyArpAddDelReply) GetMessageName() string { return "proxy_arp_add_del_reply" } 95 func (*ProxyArpAddDelReply) GetCrcString() string { return "e8d4e804" } 96 func (*ProxyArpAddDelReply) GetMessageType() api.MessageType { 97 return api.ReplyMessage 98 } 99 100 func (m *ProxyArpAddDelReply) Size() (size int) { 101 if m == nil { 102 return 0 103 } 104 size += 4 // m.Retval 105 return size 106 } 107 func (m *ProxyArpAddDelReply) Marshal(b []byte) ([]byte, error) { 108 if b == nil { 109 b = make([]byte, m.Size()) 110 } 111 buf := codec.NewBuffer(b) 112 buf.EncodeInt32(m.Retval) 113 return buf.Bytes(), nil 114 } 115 func (m *ProxyArpAddDelReply) Unmarshal(b []byte) error { 116 buf := codec.NewBuffer(b) 117 m.Retval = buf.DecodeInt32() 118 return nil 119 } 120 121 // Proxy ARP dump details reply 122 // - - proxy - Same data as used to configure 123 // 124 // ProxyArpDetails defines message 'proxy_arp_details'. 125 type ProxyArpDetails struct { 126 Proxy ProxyArp `binapi:"proxy_arp,name=proxy" json:"proxy,omitempty"` 127 } 128 129 func (m *ProxyArpDetails) Reset() { *m = ProxyArpDetails{} } 130 func (*ProxyArpDetails) GetMessageName() string { return "proxy_arp_details" } 131 func (*ProxyArpDetails) GetCrcString() string { return "5b948673" } 132 func (*ProxyArpDetails) GetMessageType() api.MessageType { 133 return api.ReplyMessage 134 } 135 136 func (m *ProxyArpDetails) Size() (size int) { 137 if m == nil { 138 return 0 139 } 140 size += 4 // m.Proxy.TableID 141 size += 1 * 4 // m.Proxy.Low 142 size += 1 * 4 // m.Proxy.Hi 143 return size 144 } 145 func (m *ProxyArpDetails) Marshal(b []byte) ([]byte, error) { 146 if b == nil { 147 b = make([]byte, m.Size()) 148 } 149 buf := codec.NewBuffer(b) 150 buf.EncodeUint32(m.Proxy.TableID) 151 buf.EncodeBytes(m.Proxy.Low[:], 4) 152 buf.EncodeBytes(m.Proxy.Hi[:], 4) 153 return buf.Bytes(), nil 154 } 155 func (m *ProxyArpDetails) Unmarshal(b []byte) error { 156 buf := codec.NewBuffer(b) 157 m.Proxy.TableID = buf.DecodeUint32() 158 copy(m.Proxy.Low[:], buf.DecodeBytes(4)) 159 copy(m.Proxy.Hi[:], buf.DecodeBytes(4)) 160 return nil 161 } 162 163 // Proxy ARP dump request 164 // ProxyArpDump defines message 'proxy_arp_dump'. 165 type ProxyArpDump struct{} 166 167 func (m *ProxyArpDump) Reset() { *m = ProxyArpDump{} } 168 func (*ProxyArpDump) GetMessageName() string { return "proxy_arp_dump" } 169 func (*ProxyArpDump) GetCrcString() string { return "51077d14" } 170 func (*ProxyArpDump) GetMessageType() api.MessageType { 171 return api.RequestMessage 172 } 173 174 func (m *ProxyArpDump) Size() (size int) { 175 if m == nil { 176 return 0 177 } 178 return size 179 } 180 func (m *ProxyArpDump) Marshal(b []byte) ([]byte, error) { 181 if b == nil { 182 b = make([]byte, m.Size()) 183 } 184 buf := codec.NewBuffer(b) 185 return buf.Bytes(), nil 186 } 187 func (m *ProxyArpDump) Unmarshal(b []byte) error { 188 return nil 189 } 190 191 // Proxy ARP interface dump details reply 192 // - - sw_if_index The interface on which ARP proxy is enabled. 193 // 194 // ProxyArpIntfcDetails defines message 'proxy_arp_intfc_details'. 195 type ProxyArpIntfcDetails struct { 196 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"` 197 } 198 199 func (m *ProxyArpIntfcDetails) Reset() { *m = ProxyArpIntfcDetails{} } 200 func (*ProxyArpIntfcDetails) GetMessageName() string { return "proxy_arp_intfc_details" } 201 func (*ProxyArpIntfcDetails) GetCrcString() string { return "f6458e5f" } 202 func (*ProxyArpIntfcDetails) GetMessageType() api.MessageType { 203 return api.ReplyMessage 204 } 205 206 func (m *ProxyArpIntfcDetails) Size() (size int) { 207 if m == nil { 208 return 0 209 } 210 size += 4 // m.SwIfIndex 211 return size 212 } 213 func (m *ProxyArpIntfcDetails) Marshal(b []byte) ([]byte, error) { 214 if b == nil { 215 b = make([]byte, m.Size()) 216 } 217 buf := codec.NewBuffer(b) 218 buf.EncodeUint32(m.SwIfIndex) 219 return buf.Bytes(), nil 220 } 221 func (m *ProxyArpIntfcDetails) Unmarshal(b []byte) error { 222 buf := codec.NewBuffer(b) 223 m.SwIfIndex = buf.DecodeUint32() 224 return nil 225 } 226 227 // Proxy ARP interface dump request 228 // ProxyArpIntfcDump defines message 'proxy_arp_intfc_dump'. 229 type ProxyArpIntfcDump struct{} 230 231 func (m *ProxyArpIntfcDump) Reset() { *m = ProxyArpIntfcDump{} } 232 func (*ProxyArpIntfcDump) GetMessageName() string { return "proxy_arp_intfc_dump" } 233 func (*ProxyArpIntfcDump) GetCrcString() string { return "51077d14" } 234 func (*ProxyArpIntfcDump) GetMessageType() api.MessageType { 235 return api.RequestMessage 236 } 237 238 func (m *ProxyArpIntfcDump) Size() (size int) { 239 if m == nil { 240 return 0 241 } 242 return size 243 } 244 func (m *ProxyArpIntfcDump) Marshal(b []byte) ([]byte, error) { 245 if b == nil { 246 b = make([]byte, m.Size()) 247 } 248 buf := codec.NewBuffer(b) 249 return buf.Bytes(), nil 250 } 251 func (m *ProxyArpIntfcDump) Unmarshal(b []byte) error { 252 return nil 253 } 254 255 // Proxy ARP add / del interface request 256 // - sw_if_index - Which interface to enable / disable Proxy Arp on 257 // - enable - 1 to enable Proxy ARP on interface, 0 to disable 258 // 259 // ProxyArpIntfcEnableDisable defines message 'proxy_arp_intfc_enable_disable'. 260 type ProxyArpIntfcEnableDisable struct { 261 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 262 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` 263 } 264 265 func (m *ProxyArpIntfcEnableDisable) Reset() { *m = ProxyArpIntfcEnableDisable{} } 266 func (*ProxyArpIntfcEnableDisable) GetMessageName() string { return "proxy_arp_intfc_enable_disable" } 267 func (*ProxyArpIntfcEnableDisable) GetCrcString() string { return "ae6cfcfb" } 268 func (*ProxyArpIntfcEnableDisable) GetMessageType() api.MessageType { 269 return api.RequestMessage 270 } 271 272 func (m *ProxyArpIntfcEnableDisable) Size() (size int) { 273 if m == nil { 274 return 0 275 } 276 size += 4 // m.SwIfIndex 277 size += 1 // m.Enable 278 return size 279 } 280 func (m *ProxyArpIntfcEnableDisable) Marshal(b []byte) ([]byte, error) { 281 if b == nil { 282 b = make([]byte, m.Size()) 283 } 284 buf := codec.NewBuffer(b) 285 buf.EncodeUint32(uint32(m.SwIfIndex)) 286 buf.EncodeBool(m.Enable) 287 return buf.Bytes(), nil 288 } 289 func (m *ProxyArpIntfcEnableDisable) Unmarshal(b []byte) error { 290 buf := codec.NewBuffer(b) 291 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 292 m.Enable = buf.DecodeBool() 293 return nil 294 } 295 296 // ProxyArpIntfcEnableDisableReply defines message 'proxy_arp_intfc_enable_disable_reply'. 297 type ProxyArpIntfcEnableDisableReply struct { 298 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 299 } 300 301 func (m *ProxyArpIntfcEnableDisableReply) Reset() { *m = ProxyArpIntfcEnableDisableReply{} } 302 func (*ProxyArpIntfcEnableDisableReply) GetMessageName() string { 303 return "proxy_arp_intfc_enable_disable_reply" 304 } 305 func (*ProxyArpIntfcEnableDisableReply) GetCrcString() string { return "e8d4e804" } 306 func (*ProxyArpIntfcEnableDisableReply) GetMessageType() api.MessageType { 307 return api.ReplyMessage 308 } 309 310 func (m *ProxyArpIntfcEnableDisableReply) Size() (size int) { 311 if m == nil { 312 return 0 313 } 314 size += 4 // m.Retval 315 return size 316 } 317 func (m *ProxyArpIntfcEnableDisableReply) Marshal(b []byte) ([]byte, error) { 318 if b == nil { 319 b = make([]byte, m.Size()) 320 } 321 buf := codec.NewBuffer(b) 322 buf.EncodeInt32(m.Retval) 323 return buf.Bytes(), nil 324 } 325 func (m *ProxyArpIntfcEnableDisableReply) Unmarshal(b []byte) error { 326 buf := codec.NewBuffer(b) 327 m.Retval = buf.DecodeInt32() 328 return nil 329 } 330 331 func init() { file_arp_binapi_init() } 332 func file_arp_binapi_init() { 333 api.RegisterMessage((*ProxyArpAddDel)(nil), "proxy_arp_add_del_1823c3e7") 334 api.RegisterMessage((*ProxyArpAddDelReply)(nil), "proxy_arp_add_del_reply_e8d4e804") 335 api.RegisterMessage((*ProxyArpDetails)(nil), "proxy_arp_details_5b948673") 336 api.RegisterMessage((*ProxyArpDump)(nil), "proxy_arp_dump_51077d14") 337 api.RegisterMessage((*ProxyArpIntfcDetails)(nil), "proxy_arp_intfc_details_f6458e5f") 338 api.RegisterMessage((*ProxyArpIntfcDump)(nil), "proxy_arp_intfc_dump_51077d14") 339 api.RegisterMessage((*ProxyArpIntfcEnableDisable)(nil), "proxy_arp_intfc_enable_disable_ae6cfcfb") 340 api.RegisterMessage((*ProxyArpIntfcEnableDisableReply)(nil), "proxy_arp_intfc_enable_disable_reply_e8d4e804") 341 } 342 343 // Messages returns list of all messages in this module. 344 func AllMessages() []api.Message { 345 return []api.Message{ 346 (*ProxyArpAddDel)(nil), 347 (*ProxyArpAddDelReply)(nil), 348 (*ProxyArpDetails)(nil), 349 (*ProxyArpDump)(nil), 350 (*ProxyArpIntfcDetails)(nil), 351 (*ProxyArpIntfcDump)(nil), 352 (*ProxyArpIntfcEnableDisable)(nil), 353 (*ProxyArpIntfcEnableDisableReply)(nil), 354 } 355 }