1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package p2p_ethernet contains generated bindings for API file p2p_ethernet.api.
14 api "git.fd.io/govpp.git/api"
15 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
16 interface_types "git.fd.io/govpp.git/binapi/interface_types"
17 codec "git.fd.io/govpp.git/codec"
20 // This is a compile-time assertion to ensure that this generated file
21 // is compatible with the GoVPP api package it is being compiled against.
22 // A compilation error at this line likely means your copy of the
23 // GoVPP api package needs to be updated.
24 const _ = api.GoVppAPIPackageIsVersion2
27 APIFile = "p2p_ethernet"
29 VersionCrc = 0xe34f63cd
32 // P2pEthernetAdd defines message 'p2p_ethernet_add'.
33 type P2pEthernetAdd struct {
34 ParentIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=parent_if_index" json:"parent_if_index,omitempty"`
35 SubifID uint32 `binapi:"u32,name=subif_id" json:"subif_id,omitempty"`
36 RemoteMac ethernet_types.MacAddress `binapi:"mac_address,name=remote_mac" json:"remote_mac,omitempty"`
39 func (m *P2pEthernetAdd) Reset() { *m = P2pEthernetAdd{} }
40 func (*P2pEthernetAdd) GetMessageName() string { return "p2p_ethernet_add" }
41 func (*P2pEthernetAdd) GetCrcString() string { return "eeb8e717" }
42 func (*P2pEthernetAdd) GetMessageType() api.MessageType {
43 return api.RequestMessage
46 func (m *P2pEthernetAdd) Size() (size int) {
50 size += 4 // m.ParentIfIndex
51 size += 4 // m.SubifID
52 size += 1 * 6 // m.RemoteMac
55 func (m *P2pEthernetAdd) Marshal(b []byte) ([]byte, error) {
57 b = make([]byte, m.Size())
59 buf := codec.NewBuffer(b)
60 buf.EncodeUint32(uint32(m.ParentIfIndex))
61 buf.EncodeUint32(m.SubifID)
62 buf.EncodeBytes(m.RemoteMac[:], 6)
63 return buf.Bytes(), nil
65 func (m *P2pEthernetAdd) Unmarshal(b []byte) error {
66 buf := codec.NewBuffer(b)
67 m.ParentIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
68 m.SubifID = buf.DecodeUint32()
69 copy(m.RemoteMac[:], buf.DecodeBytes(6))
73 // P2pEthernetAddReply defines message 'p2p_ethernet_add_reply'.
74 type P2pEthernetAddReply struct {
75 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
76 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
79 func (m *P2pEthernetAddReply) Reset() { *m = P2pEthernetAddReply{} }
80 func (*P2pEthernetAddReply) GetMessageName() string { return "p2p_ethernet_add_reply" }
81 func (*P2pEthernetAddReply) GetCrcString() string { return "5383d31f" }
82 func (*P2pEthernetAddReply) GetMessageType() api.MessageType {
83 return api.ReplyMessage
86 func (m *P2pEthernetAddReply) Size() (size int) {
91 size += 4 // m.SwIfIndex
94 func (m *P2pEthernetAddReply) Marshal(b []byte) ([]byte, error) {
96 b = make([]byte, m.Size())
98 buf := codec.NewBuffer(b)
99 buf.EncodeInt32(m.Retval)
100 buf.EncodeUint32(uint32(m.SwIfIndex))
101 return buf.Bytes(), nil
103 func (m *P2pEthernetAddReply) Unmarshal(b []byte) error {
104 buf := codec.NewBuffer(b)
105 m.Retval = buf.DecodeInt32()
106 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
110 // P2pEthernetDel defines message 'p2p_ethernet_del'.
111 type P2pEthernetDel struct {
112 ParentIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=parent_if_index" json:"parent_if_index,omitempty"`
113 RemoteMac ethernet_types.MacAddress `binapi:"mac_address,name=remote_mac" json:"remote_mac,omitempty"`
116 func (m *P2pEthernetDel) Reset() { *m = P2pEthernetDel{} }
117 func (*P2pEthernetDel) GetMessageName() string { return "p2p_ethernet_del" }
118 func (*P2pEthernetDel) GetCrcString() string { return "0b62c386" }
119 func (*P2pEthernetDel) GetMessageType() api.MessageType {
120 return api.RequestMessage
123 func (m *P2pEthernetDel) Size() (size int) {
127 size += 4 // m.ParentIfIndex
128 size += 1 * 6 // m.RemoteMac
131 func (m *P2pEthernetDel) Marshal(b []byte) ([]byte, error) {
133 b = make([]byte, m.Size())
135 buf := codec.NewBuffer(b)
136 buf.EncodeUint32(uint32(m.ParentIfIndex))
137 buf.EncodeBytes(m.RemoteMac[:], 6)
138 return buf.Bytes(), nil
140 func (m *P2pEthernetDel) Unmarshal(b []byte) error {
141 buf := codec.NewBuffer(b)
142 m.ParentIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
143 copy(m.RemoteMac[:], buf.DecodeBytes(6))
147 // P2pEthernetDelReply defines message 'p2p_ethernet_del_reply'.
148 type P2pEthernetDelReply struct {
149 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
152 func (m *P2pEthernetDelReply) Reset() { *m = P2pEthernetDelReply{} }
153 func (*P2pEthernetDelReply) GetMessageName() string { return "p2p_ethernet_del_reply" }
154 func (*P2pEthernetDelReply) GetCrcString() string { return "e8d4e804" }
155 func (*P2pEthernetDelReply) GetMessageType() api.MessageType {
156 return api.ReplyMessage
159 func (m *P2pEthernetDelReply) Size() (size int) {
163 size += 4 // m.Retval
166 func (m *P2pEthernetDelReply) Marshal(b []byte) ([]byte, error) {
168 b = make([]byte, m.Size())
170 buf := codec.NewBuffer(b)
171 buf.EncodeInt32(m.Retval)
172 return buf.Bytes(), nil
174 func (m *P2pEthernetDelReply) Unmarshal(b []byte) error {
175 buf := codec.NewBuffer(b)
176 m.Retval = buf.DecodeInt32()
180 func init() { file_p2p_ethernet_binapi_init() }
181 func file_p2p_ethernet_binapi_init() {
182 api.RegisterMessage((*P2pEthernetAdd)(nil), "p2p_ethernet_add_eeb8e717")
183 api.RegisterMessage((*P2pEthernetAddReply)(nil), "p2p_ethernet_add_reply_5383d31f")
184 api.RegisterMessage((*P2pEthernetDel)(nil), "p2p_ethernet_del_0b62c386")
185 api.RegisterMessage((*P2pEthernetDelReply)(nil), "p2p_ethernet_del_reply_e8d4e804")
188 // Messages returns list of all messages in this module.
189 func AllMessages() []api.Message {
190 return []api.Message{
191 (*P2pEthernetAdd)(nil),
192 (*P2pEthernetAddReply)(nil),
193 (*P2pEthernetDel)(nil),
194 (*P2pEthernetDelReply)(nil),