github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/arping/arping.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.4.0-dev 4 // VPP: 23.02-rc0~189-g57127b32a 5 // source: /usr/share/vpp/api/plugins/arping.api.json 6 7 // Package arping contains generated bindings for API file arping.api. 8 // 9 // Contents: 10 // 2 messages 11 // 12 package arping 13 14 import ( 15 api "git.fd.io/govpp.git/api" 16 codec "git.fd.io/govpp.git/codec" 17 interface_types "github.com/edwarnicke/govpp/binapi/interface_types" 18 ip_types "github.com/edwarnicke/govpp/binapi/ip_types" 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 = "arping" 29 APIVersion = "1.0.0" 30 VersionCrc = 0x666f91cc 31 ) 32 33 // Arping defines message 'arping'. 34 type Arping struct { 35 Address ip_types.Address `binapi:"address,name=address" json:"address,omitempty"` 36 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 37 IsGarp bool `binapi:"bool,name=is_garp" json:"is_garp,omitempty"` 38 Repeat uint32 `binapi:"u32,name=repeat,default=1" json:"repeat,omitempty"` 39 Interval float64 `binapi:"f64,name=interval,default=1" json:"interval,omitempty"` 40 } 41 42 func (m *Arping) Reset() { *m = Arping{} } 43 func (*Arping) GetMessageName() string { return "arping" } 44 func (*Arping) GetCrcString() string { return "48817482" } 45 func (*Arping) GetMessageType() api.MessageType { 46 return api.RequestMessage 47 } 48 49 func (m *Arping) Size() (size int) { 50 if m == nil { 51 return 0 52 } 53 size += 1 // m.Address.Af 54 size += 1 * 16 // m.Address.Un 55 size += 4 // m.SwIfIndex 56 size += 1 // m.IsGarp 57 size += 4 // m.Repeat 58 size += 8 // m.Interval 59 return size 60 } 61 func (m *Arping) Marshal(b []byte) ([]byte, error) { 62 if b == nil { 63 b = make([]byte, m.Size()) 64 } 65 buf := codec.NewBuffer(b) 66 buf.EncodeUint8(uint8(m.Address.Af)) 67 buf.EncodeBytes(m.Address.Un.XXX_UnionData[:], 16) 68 buf.EncodeUint32(uint32(m.SwIfIndex)) 69 buf.EncodeBool(m.IsGarp) 70 buf.EncodeUint32(m.Repeat) 71 buf.EncodeFloat64(m.Interval) 72 return buf.Bytes(), nil 73 } 74 func (m *Arping) Unmarshal(b []byte) error { 75 buf := codec.NewBuffer(b) 76 m.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 77 copy(m.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 78 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 79 m.IsGarp = buf.DecodeBool() 80 m.Repeat = buf.DecodeUint32() 81 m.Interval = buf.DecodeFloat64() 82 return nil 83 } 84 85 // ArpingReply defines message 'arping_reply'. 86 type ArpingReply struct { 87 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 88 ReplyCount uint32 `binapi:"u32,name=reply_count" json:"reply_count,omitempty"` 89 } 90 91 func (m *ArpingReply) Reset() { *m = ArpingReply{} } 92 func (*ArpingReply) GetMessageName() string { return "arping_reply" } 93 func (*ArpingReply) GetCrcString() string { return "bb9d1cbd" } 94 func (*ArpingReply) GetMessageType() api.MessageType { 95 return api.ReplyMessage 96 } 97 98 func (m *ArpingReply) Size() (size int) { 99 if m == nil { 100 return 0 101 } 102 size += 4 // m.Retval 103 size += 4 // m.ReplyCount 104 return size 105 } 106 func (m *ArpingReply) Marshal(b []byte) ([]byte, error) { 107 if b == nil { 108 b = make([]byte, m.Size()) 109 } 110 buf := codec.NewBuffer(b) 111 buf.EncodeInt32(m.Retval) 112 buf.EncodeUint32(m.ReplyCount) 113 return buf.Bytes(), nil 114 } 115 func (m *ArpingReply) Unmarshal(b []byte) error { 116 buf := codec.NewBuffer(b) 117 m.Retval = buf.DecodeInt32() 118 m.ReplyCount = buf.DecodeUint32() 119 return nil 120 } 121 122 func init() { file_arping_binapi_init() } 123 func file_arping_binapi_init() { 124 api.RegisterMessage((*Arping)(nil), "arping_48817482") 125 api.RegisterMessage((*ArpingReply)(nil), "arping_reply_bb9d1cbd") 126 } 127 128 // Messages returns list of all messages in this module. 129 func AllMessages() []api.Message { 130 return []api.Message{ 131 (*Arping)(nil), 132 (*ArpingReply)(nil), 133 } 134 }