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/p2p_ethernet.api.json
7 // Package p2p_ethernet contains generated bindings for API file p2p_ethernet.api.
15 api "git.fd.io/govpp.git/api"
16 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 codec "git.fd.io/govpp.git/codec"
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
28 APIFile = "p2p_ethernet"
30 VersionCrc = 0xe34f63cd
33 // P2pEthernetAdd defines message 'p2p_ethernet_add'.
34 type P2pEthernetAdd struct {
35 ParentIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=parent_if_index" json:"parent_if_index,omitempty"`
36 SubifID uint32 `binapi:"u32,name=subif_id" json:"subif_id,omitempty"`
37 RemoteMac ethernet_types.MacAddress `binapi:"mac_address,name=remote_mac" json:"remote_mac,omitempty"`
40 func (m *P2pEthernetAdd) Reset() { *m = P2pEthernetAdd{} }
41 func (*P2pEthernetAdd) GetMessageName() string { return "p2p_ethernet_add" }
42 func (*P2pEthernetAdd) GetCrcString() string { return "eeb8e717" }
43 func (*P2pEthernetAdd) GetMessageType() api.MessageType {
44 return api.RequestMessage
47 func (m *P2pEthernetAdd) Size() int {
52 size += 4 // m.ParentIfIndex
53 size += 4 // m.SubifID
54 size += 1 * 6 // m.RemoteMac
57 func (m *P2pEthernetAdd) Marshal(b []byte) ([]byte, error) {
60 buf = codec.NewBuffer(make([]byte, m.Size()))
62 buf = codec.NewBuffer(b)
64 buf.EncodeUint32(uint32(m.ParentIfIndex))
65 buf.EncodeUint32(uint32(m.SubifID))
66 buf.EncodeBytes(m.RemoteMac[:], 6)
67 return buf.Bytes(), nil
69 func (m *P2pEthernetAdd) Unmarshal(b []byte) error {
70 buf := codec.NewBuffer(b)
71 m.ParentIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
72 m.SubifID = buf.DecodeUint32()
73 copy(m.RemoteMac[:], buf.DecodeBytes(6))
77 // P2pEthernetAddReply defines message 'p2p_ethernet_add_reply'.
78 type P2pEthernetAddReply struct {
79 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
80 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
83 func (m *P2pEthernetAddReply) Reset() { *m = P2pEthernetAddReply{} }
84 func (*P2pEthernetAddReply) GetMessageName() string { return "p2p_ethernet_add_reply" }
85 func (*P2pEthernetAddReply) GetCrcString() string { return "5383d31f" }
86 func (*P2pEthernetAddReply) GetMessageType() api.MessageType {
87 return api.ReplyMessage
90 func (m *P2pEthernetAddReply) Size() int {
96 size += 4 // m.SwIfIndex
99 func (m *P2pEthernetAddReply) Marshal(b []byte) ([]byte, error) {
100 var buf *codec.Buffer
102 buf = codec.NewBuffer(make([]byte, m.Size()))
104 buf = codec.NewBuffer(b)
106 buf.EncodeUint32(uint32(m.Retval))
107 buf.EncodeUint32(uint32(m.SwIfIndex))
108 return buf.Bytes(), nil
110 func (m *P2pEthernetAddReply) Unmarshal(b []byte) error {
111 buf := codec.NewBuffer(b)
112 m.Retval = int32(buf.DecodeUint32())
113 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
117 // P2pEthernetDel defines message 'p2p_ethernet_del'.
118 type P2pEthernetDel struct {
119 ParentIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=parent_if_index" json:"parent_if_index,omitempty"`
120 RemoteMac ethernet_types.MacAddress `binapi:"mac_address,name=remote_mac" json:"remote_mac,omitempty"`
123 func (m *P2pEthernetDel) Reset() { *m = P2pEthernetDel{} }
124 func (*P2pEthernetDel) GetMessageName() string { return "p2p_ethernet_del" }
125 func (*P2pEthernetDel) GetCrcString() string { return "0b62c386" }
126 func (*P2pEthernetDel) GetMessageType() api.MessageType {
127 return api.RequestMessage
130 func (m *P2pEthernetDel) Size() int {
135 size += 4 // m.ParentIfIndex
136 size += 1 * 6 // m.RemoteMac
139 func (m *P2pEthernetDel) Marshal(b []byte) ([]byte, error) {
140 var buf *codec.Buffer
142 buf = codec.NewBuffer(make([]byte, m.Size()))
144 buf = codec.NewBuffer(b)
146 buf.EncodeUint32(uint32(m.ParentIfIndex))
147 buf.EncodeBytes(m.RemoteMac[:], 6)
148 return buf.Bytes(), nil
150 func (m *P2pEthernetDel) Unmarshal(b []byte) error {
151 buf := codec.NewBuffer(b)
152 m.ParentIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
153 copy(m.RemoteMac[:], buf.DecodeBytes(6))
157 // P2pEthernetDelReply defines message 'p2p_ethernet_del_reply'.
158 type P2pEthernetDelReply struct {
159 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
162 func (m *P2pEthernetDelReply) Reset() { *m = P2pEthernetDelReply{} }
163 func (*P2pEthernetDelReply) GetMessageName() string { return "p2p_ethernet_del_reply" }
164 func (*P2pEthernetDelReply) GetCrcString() string { return "e8d4e804" }
165 func (*P2pEthernetDelReply) GetMessageType() api.MessageType {
166 return api.ReplyMessage
169 func (m *P2pEthernetDelReply) Size() int {
174 size += 4 // m.Retval
177 func (m *P2pEthernetDelReply) Marshal(b []byte) ([]byte, error) {
178 var buf *codec.Buffer
180 buf = codec.NewBuffer(make([]byte, m.Size()))
182 buf = codec.NewBuffer(b)
184 buf.EncodeUint32(uint32(m.Retval))
185 return buf.Bytes(), nil
187 func (m *P2pEthernetDelReply) Unmarshal(b []byte) error {
188 buf := codec.NewBuffer(b)
189 m.Retval = int32(buf.DecodeUint32())
193 func init() { file_p2p_ethernet_binapi_init() }
194 func file_p2p_ethernet_binapi_init() {
195 api.RegisterMessage((*P2pEthernetAdd)(nil), "p2p_ethernet_add_eeb8e717")
196 api.RegisterMessage((*P2pEthernetAddReply)(nil), "p2p_ethernet_add_reply_5383d31f")
197 api.RegisterMessage((*P2pEthernetDel)(nil), "p2p_ethernet_del_0b62c386")
198 api.RegisterMessage((*P2pEthernetDelReply)(nil), "p2p_ethernet_del_reply_e8d4e804")
201 // Messages returns list of all messages in this module.
202 func AllMessages() []api.Message {
203 return []api.Message{
204 (*P2pEthernetAdd)(nil),
205 (*P2pEthernetAddReply)(nil),
206 (*P2pEthernetDel)(nil),
207 (*P2pEthernetDelReply)(nil),