1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
4 // VPP: 20.05.1-release
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() (size int) {
51 size += 4 // m.ParentIfIndex
52 size += 4 // m.SubifID
53 size += 1 * 6 // m.RemoteMac
56 func (m *P2pEthernetAdd) Marshal(b []byte) ([]byte, error) {
58 b = make([]byte, m.Size())
60 buf := codec.NewBuffer(b)
61 buf.EncodeUint32(uint32(m.ParentIfIndex))
62 buf.EncodeUint32(m.SubifID)
63 buf.EncodeBytes(m.RemoteMac[:], 6)
64 return buf.Bytes(), nil
66 func (m *P2pEthernetAdd) Unmarshal(b []byte) error {
67 buf := codec.NewBuffer(b)
68 m.ParentIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
69 m.SubifID = buf.DecodeUint32()
70 copy(m.RemoteMac[:], buf.DecodeBytes(6))
74 // P2pEthernetAddReply defines message 'p2p_ethernet_add_reply'.
75 type P2pEthernetAddReply struct {
76 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
77 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
80 func (m *P2pEthernetAddReply) Reset() { *m = P2pEthernetAddReply{} }
81 func (*P2pEthernetAddReply) GetMessageName() string { return "p2p_ethernet_add_reply" }
82 func (*P2pEthernetAddReply) GetCrcString() string { return "5383d31f" }
83 func (*P2pEthernetAddReply) GetMessageType() api.MessageType {
84 return api.ReplyMessage
87 func (m *P2pEthernetAddReply) Size() (size int) {
92 size += 4 // m.SwIfIndex
95 func (m *P2pEthernetAddReply) Marshal(b []byte) ([]byte, error) {
97 b = make([]byte, m.Size())
99 buf := codec.NewBuffer(b)
100 buf.EncodeInt32(m.Retval)
101 buf.EncodeUint32(uint32(m.SwIfIndex))
102 return buf.Bytes(), nil
104 func (m *P2pEthernetAddReply) Unmarshal(b []byte) error {
105 buf := codec.NewBuffer(b)
106 m.Retval = buf.DecodeInt32()
107 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
111 // P2pEthernetDel defines message 'p2p_ethernet_del'.
112 type P2pEthernetDel struct {
113 ParentIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=parent_if_index" json:"parent_if_index,omitempty"`
114 RemoteMac ethernet_types.MacAddress `binapi:"mac_address,name=remote_mac" json:"remote_mac,omitempty"`
117 func (m *P2pEthernetDel) Reset() { *m = P2pEthernetDel{} }
118 func (*P2pEthernetDel) GetMessageName() string { return "p2p_ethernet_del" }
119 func (*P2pEthernetDel) GetCrcString() string { return "0b62c386" }
120 func (*P2pEthernetDel) GetMessageType() api.MessageType {
121 return api.RequestMessage
124 func (m *P2pEthernetDel) Size() (size int) {
128 size += 4 // m.ParentIfIndex
129 size += 1 * 6 // m.RemoteMac
132 func (m *P2pEthernetDel) Marshal(b []byte) ([]byte, error) {
134 b = make([]byte, m.Size())
136 buf := codec.NewBuffer(b)
137 buf.EncodeUint32(uint32(m.ParentIfIndex))
138 buf.EncodeBytes(m.RemoteMac[:], 6)
139 return buf.Bytes(), nil
141 func (m *P2pEthernetDel) Unmarshal(b []byte) error {
142 buf := codec.NewBuffer(b)
143 m.ParentIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
144 copy(m.RemoteMac[:], buf.DecodeBytes(6))
148 // P2pEthernetDelReply defines message 'p2p_ethernet_del_reply'.
149 type P2pEthernetDelReply struct {
150 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
153 func (m *P2pEthernetDelReply) Reset() { *m = P2pEthernetDelReply{} }
154 func (*P2pEthernetDelReply) GetMessageName() string { return "p2p_ethernet_del_reply" }
155 func (*P2pEthernetDelReply) GetCrcString() string { return "e8d4e804" }
156 func (*P2pEthernetDelReply) GetMessageType() api.MessageType {
157 return api.ReplyMessage
160 func (m *P2pEthernetDelReply) Size() (size int) {
164 size += 4 // m.Retval
167 func (m *P2pEthernetDelReply) Marshal(b []byte) ([]byte, error) {
169 b = make([]byte, m.Size())
171 buf := codec.NewBuffer(b)
172 buf.EncodeInt32(m.Retval)
173 return buf.Bytes(), nil
175 func (m *P2pEthernetDelReply) Unmarshal(b []byte) error {
176 buf := codec.NewBuffer(b)
177 m.Retval = buf.DecodeInt32()
181 func init() { file_p2p_ethernet_binapi_init() }
182 func file_p2p_ethernet_binapi_init() {
183 api.RegisterMessage((*P2pEthernetAdd)(nil), "p2p_ethernet_add_eeb8e717")
184 api.RegisterMessage((*P2pEthernetAddReply)(nil), "p2p_ethernet_add_reply_5383d31f")
185 api.RegisterMessage((*P2pEthernetDel)(nil), "p2p_ethernet_del_0b62c386")
186 api.RegisterMessage((*P2pEthernetDelReply)(nil), "p2p_ethernet_del_reply_e8d4e804")
189 // Messages returns list of all messages in this module.
190 func AllMessages() []api.Message {
191 return []api.Message{
192 (*P2pEthernetAdd)(nil),
193 (*P2pEthernetAddReply)(nil),
194 (*P2pEthernetDel)(nil),
195 (*P2pEthernetDelReply)(nil),