1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/netmap.api.json
7 // Package netmap contains generated bindings for API file netmap.api.
15 api "git.fd.io/govpp.git/api"
16 codec "git.fd.io/govpp.git/codec"
19 // This is a compile-time assertion to ensure that this generated file
20 // is compatible with the GoVPP api package it is being compiled against.
21 // A compilation error at this line likely means your copy of the
22 // GoVPP api package needs to be updated.
23 const _ = api.GoVppAPIPackageIsVersion2
28 VersionCrc = 0x40e7a84f
31 // NetmapCreate defines message 'netmap_create'.
32 type NetmapCreate struct {
33 NetmapIfName []byte `binapi:"u8[64],name=netmap_if_name" json:"netmap_if_name,omitempty"`
34 HwAddr []byte `binapi:"u8[6],name=hw_addr" json:"hw_addr,omitempty"`
35 UseRandomHwAddr uint8 `binapi:"u8,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"`
36 IsPipe uint8 `binapi:"u8,name=is_pipe" json:"is_pipe,omitempty"`
37 IsMaster uint8 `binapi:"u8,name=is_master" json:"is_master,omitempty"`
40 func (m *NetmapCreate) Reset() { *m = NetmapCreate{} }
41 func (*NetmapCreate) GetMessageName() string { return "netmap_create" }
42 func (*NetmapCreate) GetCrcString() string { return "5299044e" }
43 func (*NetmapCreate) GetMessageType() api.MessageType {
44 return api.RequestMessage
47 func (m *NetmapCreate) Size() (size int) {
51 size += 1 * 64 // m.NetmapIfName
52 size += 1 * 6 // m.HwAddr
53 size += 1 // m.UseRandomHwAddr
55 size += 1 // m.IsMaster
58 func (m *NetmapCreate) Marshal(b []byte) ([]byte, error) {
60 b = make([]byte, m.Size())
62 buf := codec.NewBuffer(b)
63 buf.EncodeBytes(m.NetmapIfName, 64)
64 buf.EncodeBytes(m.HwAddr, 6)
65 buf.EncodeUint8(m.UseRandomHwAddr)
66 buf.EncodeUint8(m.IsPipe)
67 buf.EncodeUint8(m.IsMaster)
68 return buf.Bytes(), nil
70 func (m *NetmapCreate) Unmarshal(b []byte) error {
71 buf := codec.NewBuffer(b)
72 m.NetmapIfName = make([]byte, 64)
73 copy(m.NetmapIfName, buf.DecodeBytes(len(m.NetmapIfName)))
74 m.HwAddr = make([]byte, 6)
75 copy(m.HwAddr, buf.DecodeBytes(len(m.HwAddr)))
76 m.UseRandomHwAddr = buf.DecodeUint8()
77 m.IsPipe = buf.DecodeUint8()
78 m.IsMaster = buf.DecodeUint8()
82 // NetmapCreateReply defines message 'netmap_create_reply'.
83 type NetmapCreateReply struct {
84 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
87 func (m *NetmapCreateReply) Reset() { *m = NetmapCreateReply{} }
88 func (*NetmapCreateReply) GetMessageName() string { return "netmap_create_reply" }
89 func (*NetmapCreateReply) GetCrcString() string { return "e8d4e804" }
90 func (*NetmapCreateReply) GetMessageType() api.MessageType {
91 return api.ReplyMessage
94 func (m *NetmapCreateReply) Size() (size int) {
101 func (m *NetmapCreateReply) Marshal(b []byte) ([]byte, error) {
103 b = make([]byte, m.Size())
105 buf := codec.NewBuffer(b)
106 buf.EncodeInt32(m.Retval)
107 return buf.Bytes(), nil
109 func (m *NetmapCreateReply) Unmarshal(b []byte) error {
110 buf := codec.NewBuffer(b)
111 m.Retval = buf.DecodeInt32()
115 // NetmapDelete defines message 'netmap_delete'.
116 type NetmapDelete struct {
117 NetmapIfName []byte `binapi:"u8[64],name=netmap_if_name" json:"netmap_if_name,omitempty"`
120 func (m *NetmapDelete) Reset() { *m = NetmapDelete{} }
121 func (*NetmapDelete) GetMessageName() string { return "netmap_delete" }
122 func (*NetmapDelete) GetCrcString() string { return "a8b6c201" }
123 func (*NetmapDelete) GetMessageType() api.MessageType {
124 return api.RequestMessage
127 func (m *NetmapDelete) Size() (size int) {
131 size += 1 * 64 // m.NetmapIfName
134 func (m *NetmapDelete) Marshal(b []byte) ([]byte, error) {
136 b = make([]byte, m.Size())
138 buf := codec.NewBuffer(b)
139 buf.EncodeBytes(m.NetmapIfName, 64)
140 return buf.Bytes(), nil
142 func (m *NetmapDelete) Unmarshal(b []byte) error {
143 buf := codec.NewBuffer(b)
144 m.NetmapIfName = make([]byte, 64)
145 copy(m.NetmapIfName, buf.DecodeBytes(len(m.NetmapIfName)))
149 // NetmapDeleteReply defines message 'netmap_delete_reply'.
150 type NetmapDeleteReply struct {
151 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
154 func (m *NetmapDeleteReply) Reset() { *m = NetmapDeleteReply{} }
155 func (*NetmapDeleteReply) GetMessageName() string { return "netmap_delete_reply" }
156 func (*NetmapDeleteReply) GetCrcString() string { return "e8d4e804" }
157 func (*NetmapDeleteReply) GetMessageType() api.MessageType {
158 return api.ReplyMessage
161 func (m *NetmapDeleteReply) Size() (size int) {
165 size += 4 // m.Retval
168 func (m *NetmapDeleteReply) Marshal(b []byte) ([]byte, error) {
170 b = make([]byte, m.Size())
172 buf := codec.NewBuffer(b)
173 buf.EncodeInt32(m.Retval)
174 return buf.Bytes(), nil
176 func (m *NetmapDeleteReply) Unmarshal(b []byte) error {
177 buf := codec.NewBuffer(b)
178 m.Retval = buf.DecodeInt32()
182 func init() { file_netmap_binapi_init() }
183 func file_netmap_binapi_init() {
184 api.RegisterMessage((*NetmapCreate)(nil), "netmap_create_5299044e")
185 api.RegisterMessage((*NetmapCreateReply)(nil), "netmap_create_reply_e8d4e804")
186 api.RegisterMessage((*NetmapDelete)(nil), "netmap_delete_a8b6c201")
187 api.RegisterMessage((*NetmapDeleteReply)(nil), "netmap_delete_reply_e8d4e804")
190 // Messages returns list of all messages in this module.
191 func AllMessages() []api.Message {
192 return []api.Message{
193 (*NetmapCreate)(nil),
194 (*NetmapCreateReply)(nil),
195 (*NetmapDelete)(nil),
196 (*NetmapDeleteReply)(nil),