go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2106/teib/teib.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 3 // Package teib contains generated bindings for API file teib.api. 4 // 5 // Contents: 6 // - 1 struct 7 // - 4 messages 8 package teib 9 10 import ( 11 api "go.fd.io/govpp/api" 12 codec "go.fd.io/govpp/codec" 13 interface_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/interface_types" 14 ip_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/ip_types" 15 ) 16 17 // This is a compile-time assertion to ensure that this generated file 18 // is compatible with the GoVPP api package it is being compiled against. 19 // A compilation error at this line likely means your copy of the 20 // GoVPP api package needs to be updated. 21 const _ = api.GoVppAPIPackageIsVersion2 22 23 const ( 24 APIFile = "teib" 25 APIVersion = "1.0.0" 26 VersionCrc = 0x14ded985 27 ) 28 29 // TeibEntry defines type 'teib_entry'. 30 type TeibEntry struct { 31 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 32 Peer ip_types.Address `binapi:"address,name=peer" json:"peer,omitempty"` 33 Nh ip_types.Address `binapi:"address,name=nh" json:"nh,omitempty"` 34 NhTableID uint32 `binapi:"u32,name=nh_table_id" json:"nh_table_id,omitempty"` 35 } 36 37 // TeibDetails defines message 'teib_details'. 38 type TeibDetails struct { 39 Entry TeibEntry `binapi:"teib_entry,name=entry" json:"entry,omitempty"` 40 } 41 42 func (m *TeibDetails) Reset() { *m = TeibDetails{} } 43 func (*TeibDetails) GetMessageName() string { return "teib_details" } 44 func (*TeibDetails) GetCrcString() string { return "981ee1a1" } 45 func (*TeibDetails) GetMessageType() api.MessageType { 46 return api.ReplyMessage 47 } 48 49 func (m *TeibDetails) Size() (size int) { 50 if m == nil { 51 return 0 52 } 53 size += 4 // m.Entry.SwIfIndex 54 size += 1 // m.Entry.Peer.Af 55 size += 1 * 16 // m.Entry.Peer.Un 56 size += 1 // m.Entry.Nh.Af 57 size += 1 * 16 // m.Entry.Nh.Un 58 size += 4 // m.Entry.NhTableID 59 return size 60 } 61 func (m *TeibDetails) Marshal(b []byte) ([]byte, error) { 62 if b == nil { 63 b = make([]byte, m.Size()) 64 } 65 buf := codec.NewBuffer(b) 66 buf.EncodeUint32(uint32(m.Entry.SwIfIndex)) 67 buf.EncodeUint8(uint8(m.Entry.Peer.Af)) 68 buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16) 69 buf.EncodeUint8(uint8(m.Entry.Nh.Af)) 70 buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16) 71 buf.EncodeUint32(m.Entry.NhTableID) 72 return buf.Bytes(), nil 73 } 74 func (m *TeibDetails) Unmarshal(b []byte) error { 75 buf := codec.NewBuffer(b) 76 m.Entry.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 77 m.Entry.Peer.Af = ip_types.AddressFamily(buf.DecodeUint8()) 78 copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 79 m.Entry.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8()) 80 copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 81 m.Entry.NhTableID = buf.DecodeUint32() 82 return nil 83 } 84 85 // TeibDump defines message 'teib_dump'. 86 type TeibDump struct{} 87 88 func (m *TeibDump) Reset() { *m = TeibDump{} } 89 func (*TeibDump) GetMessageName() string { return "teib_dump" } 90 func (*TeibDump) GetCrcString() string { return "51077d14" } 91 func (*TeibDump) GetMessageType() api.MessageType { 92 return api.RequestMessage 93 } 94 95 func (m *TeibDump) Size() (size int) { 96 if m == nil { 97 return 0 98 } 99 return size 100 } 101 func (m *TeibDump) Marshal(b []byte) ([]byte, error) { 102 if b == nil { 103 b = make([]byte, m.Size()) 104 } 105 buf := codec.NewBuffer(b) 106 return buf.Bytes(), nil 107 } 108 func (m *TeibDump) Unmarshal(b []byte) error { 109 return nil 110 } 111 112 // TeibEntryAddDel defines message 'teib_entry_add_del'. 113 type TeibEntryAddDel struct { 114 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"` 115 Entry TeibEntry `binapi:"teib_entry,name=entry" json:"entry,omitempty"` 116 } 117 118 func (m *TeibEntryAddDel) Reset() { *m = TeibEntryAddDel{} } 119 func (*TeibEntryAddDel) GetMessageName() string { return "teib_entry_add_del" } 120 func (*TeibEntryAddDel) GetCrcString() string { return "8016cfd2" } 121 func (*TeibEntryAddDel) GetMessageType() api.MessageType { 122 return api.RequestMessage 123 } 124 125 func (m *TeibEntryAddDel) Size() (size int) { 126 if m == nil { 127 return 0 128 } 129 size += 1 // m.IsAdd 130 size += 4 // m.Entry.SwIfIndex 131 size += 1 // m.Entry.Peer.Af 132 size += 1 * 16 // m.Entry.Peer.Un 133 size += 1 // m.Entry.Nh.Af 134 size += 1 * 16 // m.Entry.Nh.Un 135 size += 4 // m.Entry.NhTableID 136 return size 137 } 138 func (m *TeibEntryAddDel) Marshal(b []byte) ([]byte, error) { 139 if b == nil { 140 b = make([]byte, m.Size()) 141 } 142 buf := codec.NewBuffer(b) 143 buf.EncodeUint8(m.IsAdd) 144 buf.EncodeUint32(uint32(m.Entry.SwIfIndex)) 145 buf.EncodeUint8(uint8(m.Entry.Peer.Af)) 146 buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16) 147 buf.EncodeUint8(uint8(m.Entry.Nh.Af)) 148 buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16) 149 buf.EncodeUint32(m.Entry.NhTableID) 150 return buf.Bytes(), nil 151 } 152 func (m *TeibEntryAddDel) Unmarshal(b []byte) error { 153 buf := codec.NewBuffer(b) 154 m.IsAdd = buf.DecodeUint8() 155 m.Entry.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 156 m.Entry.Peer.Af = ip_types.AddressFamily(buf.DecodeUint8()) 157 copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 158 m.Entry.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8()) 159 copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 160 m.Entry.NhTableID = buf.DecodeUint32() 161 return nil 162 } 163 164 // TeibEntryAddDelReply defines message 'teib_entry_add_del_reply'. 165 type TeibEntryAddDelReply struct { 166 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 167 } 168 169 func (m *TeibEntryAddDelReply) Reset() { *m = TeibEntryAddDelReply{} } 170 func (*TeibEntryAddDelReply) GetMessageName() string { return "teib_entry_add_del_reply" } 171 func (*TeibEntryAddDelReply) GetCrcString() string { return "e8d4e804" } 172 func (*TeibEntryAddDelReply) GetMessageType() api.MessageType { 173 return api.ReplyMessage 174 } 175 176 func (m *TeibEntryAddDelReply) Size() (size int) { 177 if m == nil { 178 return 0 179 } 180 size += 4 // m.Retval 181 return size 182 } 183 func (m *TeibEntryAddDelReply) Marshal(b []byte) ([]byte, error) { 184 if b == nil { 185 b = make([]byte, m.Size()) 186 } 187 buf := codec.NewBuffer(b) 188 buf.EncodeInt32(m.Retval) 189 return buf.Bytes(), nil 190 } 191 func (m *TeibEntryAddDelReply) Unmarshal(b []byte) error { 192 buf := codec.NewBuffer(b) 193 m.Retval = buf.DecodeInt32() 194 return nil 195 } 196 197 func init() { file_teib_binapi_init() } 198 func file_teib_binapi_init() { 199 api.RegisterMessage((*TeibDetails)(nil), "teib_details_981ee1a1") 200 api.RegisterMessage((*TeibDump)(nil), "teib_dump_51077d14") 201 api.RegisterMessage((*TeibEntryAddDel)(nil), "teib_entry_add_del_8016cfd2") 202 api.RegisterMessage((*TeibEntryAddDelReply)(nil), "teib_entry_add_del_reply_e8d4e804") 203 } 204 205 // Messages returns list of all messages in this module. 206 func AllMessages() []api.Message { 207 return []api.Message{ 208 (*TeibDetails)(nil), 209 (*TeibDump)(nil), 210 (*TeibEntryAddDel)(nil), 211 (*TeibEntryAddDelReply)(nil), 212 } 213 }