1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package l2tp contains generated bindings for API file l2tp.api.
17 api "git.fd.io/govpp.git/api"
18 _ "git.fd.io/govpp.git/binapi/ethernet_types"
19 interface_types "git.fd.io/govpp.git/binapi/interface_types"
20 ip_types "git.fd.io/govpp.git/binapi/ip_types"
21 codec "git.fd.io/govpp.git/codec"
24 // This is a compile-time assertion to ensure that this generated file
25 // is compatible with the GoVPP api package it is being compiled against.
26 // A compilation error at this line likely means your copy of the
27 // GoVPP api package needs to be updated.
28 const _ = api.GoVppAPIPackageIsVersion2
33 VersionCrc = 0xb018cef7
36 // L2tLookupKey defines enum 'l2t_lookup_key'.
37 type L2tLookupKey uint8
40 L2T_LOOKUP_KEY_API_SRC_ADDR L2tLookupKey = 0
41 L2T_LOOKUP_KEY_API_DST_ADDR L2tLookupKey = 1
42 L2T_LOOKUP_KEY_API_SESSION_ID L2tLookupKey = 2
46 L2tLookupKey_name = map[uint8]string{
47 0: "L2T_LOOKUP_KEY_API_SRC_ADDR",
48 1: "L2T_LOOKUP_KEY_API_DST_ADDR",
49 2: "L2T_LOOKUP_KEY_API_SESSION_ID",
51 L2tLookupKey_value = map[string]uint8{
52 "L2T_LOOKUP_KEY_API_SRC_ADDR": 0,
53 "L2T_LOOKUP_KEY_API_DST_ADDR": 1,
54 "L2T_LOOKUP_KEY_API_SESSION_ID": 2,
58 func (x L2tLookupKey) String() string {
59 s, ok := L2tLookupKey_name[uint8(x)]
63 return "L2tLookupKey(" + strconv.Itoa(int(x)) + ")"
66 // L2tpv3CreateTunnel defines message 'l2tpv3_create_tunnel'.
67 type L2tpv3CreateTunnel struct {
68 ClientAddress ip_types.Address `binapi:"address,name=client_address" json:"client_address,omitempty"`
69 OurAddress ip_types.Address `binapi:"address,name=our_address" json:"our_address,omitempty"`
70 LocalSessionID uint32 `binapi:"u32,name=local_session_id" json:"local_session_id,omitempty"`
71 RemoteSessionID uint32 `binapi:"u32,name=remote_session_id" json:"remote_session_id,omitempty"`
72 LocalCookie uint64 `binapi:"u64,name=local_cookie" json:"local_cookie,omitempty"`
73 RemoteCookie uint64 `binapi:"u64,name=remote_cookie" json:"remote_cookie,omitempty"`
74 L2SublayerPresent bool `binapi:"bool,name=l2_sublayer_present" json:"l2_sublayer_present,omitempty"`
75 EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
78 func (m *L2tpv3CreateTunnel) Reset() { *m = L2tpv3CreateTunnel{} }
79 func (*L2tpv3CreateTunnel) GetMessageName() string { return "l2tpv3_create_tunnel" }
80 func (*L2tpv3CreateTunnel) GetCrcString() string { return "596892cb" }
81 func (*L2tpv3CreateTunnel) GetMessageType() api.MessageType {
82 return api.RequestMessage
85 func (m *L2tpv3CreateTunnel) Size() (size int) {
89 size += 1 // m.ClientAddress.Af
90 size += 1 * 16 // m.ClientAddress.Un
91 size += 1 // m.OurAddress.Af
92 size += 1 * 16 // m.OurAddress.Un
93 size += 4 // m.LocalSessionID
94 size += 4 // m.RemoteSessionID
95 size += 8 // m.LocalCookie
96 size += 8 // m.RemoteCookie
97 size += 1 // m.L2SublayerPresent
98 size += 4 // m.EncapVrfID
101 func (m *L2tpv3CreateTunnel) Marshal(b []byte) ([]byte, error) {
103 b = make([]byte, m.Size())
105 buf := codec.NewBuffer(b)
106 buf.EncodeUint8(uint8(m.ClientAddress.Af))
107 buf.EncodeBytes(m.ClientAddress.Un.XXX_UnionData[:], 16)
108 buf.EncodeUint8(uint8(m.OurAddress.Af))
109 buf.EncodeBytes(m.OurAddress.Un.XXX_UnionData[:], 16)
110 buf.EncodeUint32(m.LocalSessionID)
111 buf.EncodeUint32(m.RemoteSessionID)
112 buf.EncodeUint64(m.LocalCookie)
113 buf.EncodeUint64(m.RemoteCookie)
114 buf.EncodeBool(m.L2SublayerPresent)
115 buf.EncodeUint32(m.EncapVrfID)
116 return buf.Bytes(), nil
118 func (m *L2tpv3CreateTunnel) Unmarshal(b []byte) error {
119 buf := codec.NewBuffer(b)
120 m.ClientAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
121 copy(m.ClientAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
122 m.OurAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
123 copy(m.OurAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
124 m.LocalSessionID = buf.DecodeUint32()
125 m.RemoteSessionID = buf.DecodeUint32()
126 m.LocalCookie = buf.DecodeUint64()
127 m.RemoteCookie = buf.DecodeUint64()
128 m.L2SublayerPresent = buf.DecodeBool()
129 m.EncapVrfID = buf.DecodeUint32()
133 // L2tpv3CreateTunnelReply defines message 'l2tpv3_create_tunnel_reply'.
134 type L2tpv3CreateTunnelReply struct {
135 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
136 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
139 func (m *L2tpv3CreateTunnelReply) Reset() { *m = L2tpv3CreateTunnelReply{} }
140 func (*L2tpv3CreateTunnelReply) GetMessageName() string { return "l2tpv3_create_tunnel_reply" }
141 func (*L2tpv3CreateTunnelReply) GetCrcString() string { return "5383d31f" }
142 func (*L2tpv3CreateTunnelReply) GetMessageType() api.MessageType {
143 return api.ReplyMessage
146 func (m *L2tpv3CreateTunnelReply) Size() (size int) {
150 size += 4 // m.Retval
151 size += 4 // m.SwIfIndex
154 func (m *L2tpv3CreateTunnelReply) Marshal(b []byte) ([]byte, error) {
156 b = make([]byte, m.Size())
158 buf := codec.NewBuffer(b)
159 buf.EncodeInt32(m.Retval)
160 buf.EncodeUint32(uint32(m.SwIfIndex))
161 return buf.Bytes(), nil
163 func (m *L2tpv3CreateTunnelReply) Unmarshal(b []byte) error {
164 buf := codec.NewBuffer(b)
165 m.Retval = buf.DecodeInt32()
166 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
170 // L2tpv3InterfaceEnableDisable defines message 'l2tpv3_interface_enable_disable'.
171 type L2tpv3InterfaceEnableDisable struct {
172 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
173 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
176 func (m *L2tpv3InterfaceEnableDisable) Reset() { *m = L2tpv3InterfaceEnableDisable{} }
177 func (*L2tpv3InterfaceEnableDisable) GetMessageName() string {
178 return "l2tpv3_interface_enable_disable"
180 func (*L2tpv3InterfaceEnableDisable) GetCrcString() string { return "3865946c" }
181 func (*L2tpv3InterfaceEnableDisable) GetMessageType() api.MessageType {
182 return api.RequestMessage
185 func (m *L2tpv3InterfaceEnableDisable) Size() (size int) {
189 size += 1 // m.EnableDisable
190 size += 4 // m.SwIfIndex
193 func (m *L2tpv3InterfaceEnableDisable) Marshal(b []byte) ([]byte, error) {
195 b = make([]byte, m.Size())
197 buf := codec.NewBuffer(b)
198 buf.EncodeBool(m.EnableDisable)
199 buf.EncodeUint32(uint32(m.SwIfIndex))
200 return buf.Bytes(), nil
202 func (m *L2tpv3InterfaceEnableDisable) Unmarshal(b []byte) error {
203 buf := codec.NewBuffer(b)
204 m.EnableDisable = buf.DecodeBool()
205 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
209 // L2tpv3InterfaceEnableDisableReply defines message 'l2tpv3_interface_enable_disable_reply'.
210 type L2tpv3InterfaceEnableDisableReply struct {
211 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
214 func (m *L2tpv3InterfaceEnableDisableReply) Reset() { *m = L2tpv3InterfaceEnableDisableReply{} }
215 func (*L2tpv3InterfaceEnableDisableReply) GetMessageName() string {
216 return "l2tpv3_interface_enable_disable_reply"
218 func (*L2tpv3InterfaceEnableDisableReply) GetCrcString() string { return "e8d4e804" }
219 func (*L2tpv3InterfaceEnableDisableReply) GetMessageType() api.MessageType {
220 return api.ReplyMessage
223 func (m *L2tpv3InterfaceEnableDisableReply) Size() (size int) {
227 size += 4 // m.Retval
230 func (m *L2tpv3InterfaceEnableDisableReply) Marshal(b []byte) ([]byte, error) {
232 b = make([]byte, m.Size())
234 buf := codec.NewBuffer(b)
235 buf.EncodeInt32(m.Retval)
236 return buf.Bytes(), nil
238 func (m *L2tpv3InterfaceEnableDisableReply) Unmarshal(b []byte) error {
239 buf := codec.NewBuffer(b)
240 m.Retval = buf.DecodeInt32()
244 // L2tpv3SetLookupKey defines message 'l2tpv3_set_lookup_key'.
245 type L2tpv3SetLookupKey struct {
246 Key L2tLookupKey `binapi:"l2t_lookup_key,name=key" json:"key,omitempty"`
249 func (m *L2tpv3SetLookupKey) Reset() { *m = L2tpv3SetLookupKey{} }
250 func (*L2tpv3SetLookupKey) GetMessageName() string { return "l2tpv3_set_lookup_key" }
251 func (*L2tpv3SetLookupKey) GetCrcString() string { return "c9892c86" }
252 func (*L2tpv3SetLookupKey) GetMessageType() api.MessageType {
253 return api.RequestMessage
256 func (m *L2tpv3SetLookupKey) Size() (size int) {
263 func (m *L2tpv3SetLookupKey) Marshal(b []byte) ([]byte, error) {
265 b = make([]byte, m.Size())
267 buf := codec.NewBuffer(b)
268 buf.EncodeUint8(uint8(m.Key))
269 return buf.Bytes(), nil
271 func (m *L2tpv3SetLookupKey) Unmarshal(b []byte) error {
272 buf := codec.NewBuffer(b)
273 m.Key = L2tLookupKey(buf.DecodeUint8())
277 // L2tpv3SetLookupKeyReply defines message 'l2tpv3_set_lookup_key_reply'.
278 type L2tpv3SetLookupKeyReply struct {
279 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
282 func (m *L2tpv3SetLookupKeyReply) Reset() { *m = L2tpv3SetLookupKeyReply{} }
283 func (*L2tpv3SetLookupKeyReply) GetMessageName() string { return "l2tpv3_set_lookup_key_reply" }
284 func (*L2tpv3SetLookupKeyReply) GetCrcString() string { return "e8d4e804" }
285 func (*L2tpv3SetLookupKeyReply) GetMessageType() api.MessageType {
286 return api.ReplyMessage
289 func (m *L2tpv3SetLookupKeyReply) Size() (size int) {
293 size += 4 // m.Retval
296 func (m *L2tpv3SetLookupKeyReply) Marshal(b []byte) ([]byte, error) {
298 b = make([]byte, m.Size())
300 buf := codec.NewBuffer(b)
301 buf.EncodeInt32(m.Retval)
302 return buf.Bytes(), nil
304 func (m *L2tpv3SetLookupKeyReply) Unmarshal(b []byte) error {
305 buf := codec.NewBuffer(b)
306 m.Retval = buf.DecodeInt32()
310 // L2tpv3SetTunnelCookies defines message 'l2tpv3_set_tunnel_cookies'.
311 type L2tpv3SetTunnelCookies struct {
312 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
313 NewLocalCookie uint64 `binapi:"u64,name=new_local_cookie" json:"new_local_cookie,omitempty"`
314 NewRemoteCookie uint64 `binapi:"u64,name=new_remote_cookie" json:"new_remote_cookie,omitempty"`
317 func (m *L2tpv3SetTunnelCookies) Reset() { *m = L2tpv3SetTunnelCookies{} }
318 func (*L2tpv3SetTunnelCookies) GetMessageName() string { return "l2tpv3_set_tunnel_cookies" }
319 func (*L2tpv3SetTunnelCookies) GetCrcString() string { return "b3f4faf7" }
320 func (*L2tpv3SetTunnelCookies) GetMessageType() api.MessageType {
321 return api.RequestMessage
324 func (m *L2tpv3SetTunnelCookies) Size() (size int) {
328 size += 4 // m.SwIfIndex
329 size += 8 // m.NewLocalCookie
330 size += 8 // m.NewRemoteCookie
333 func (m *L2tpv3SetTunnelCookies) Marshal(b []byte) ([]byte, error) {
335 b = make([]byte, m.Size())
337 buf := codec.NewBuffer(b)
338 buf.EncodeUint32(uint32(m.SwIfIndex))
339 buf.EncodeUint64(m.NewLocalCookie)
340 buf.EncodeUint64(m.NewRemoteCookie)
341 return buf.Bytes(), nil
343 func (m *L2tpv3SetTunnelCookies) Unmarshal(b []byte) error {
344 buf := codec.NewBuffer(b)
345 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
346 m.NewLocalCookie = buf.DecodeUint64()
347 m.NewRemoteCookie = buf.DecodeUint64()
351 // L2tpv3SetTunnelCookiesReply defines message 'l2tpv3_set_tunnel_cookies_reply'.
352 type L2tpv3SetTunnelCookiesReply struct {
353 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
356 func (m *L2tpv3SetTunnelCookiesReply) Reset() { *m = L2tpv3SetTunnelCookiesReply{} }
357 func (*L2tpv3SetTunnelCookiesReply) GetMessageName() string { return "l2tpv3_set_tunnel_cookies_reply" }
358 func (*L2tpv3SetTunnelCookiesReply) GetCrcString() string { return "e8d4e804" }
359 func (*L2tpv3SetTunnelCookiesReply) GetMessageType() api.MessageType {
360 return api.ReplyMessage
363 func (m *L2tpv3SetTunnelCookiesReply) Size() (size int) {
367 size += 4 // m.Retval
370 func (m *L2tpv3SetTunnelCookiesReply) Marshal(b []byte) ([]byte, error) {
372 b = make([]byte, m.Size())
374 buf := codec.NewBuffer(b)
375 buf.EncodeInt32(m.Retval)
376 return buf.Bytes(), nil
378 func (m *L2tpv3SetTunnelCookiesReply) Unmarshal(b []byte) error {
379 buf := codec.NewBuffer(b)
380 m.Retval = buf.DecodeInt32()
384 // SwIfL2tpv3TunnelDetails defines message 'sw_if_l2tpv3_tunnel_details'.
385 type SwIfL2tpv3TunnelDetails struct {
386 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
387 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
388 ClientAddress ip_types.Address `binapi:"address,name=client_address" json:"client_address,omitempty"`
389 OurAddress ip_types.Address `binapi:"address,name=our_address" json:"our_address,omitempty"`
390 LocalSessionID uint32 `binapi:"u32,name=local_session_id" json:"local_session_id,omitempty"`
391 RemoteSessionID uint32 `binapi:"u32,name=remote_session_id" json:"remote_session_id,omitempty"`
392 LocalCookie []uint64 `binapi:"u64[2],name=local_cookie" json:"local_cookie,omitempty"`
393 RemoteCookie uint64 `binapi:"u64,name=remote_cookie" json:"remote_cookie,omitempty"`
394 L2SublayerPresent bool `binapi:"bool,name=l2_sublayer_present" json:"l2_sublayer_present,omitempty"`
397 func (m *SwIfL2tpv3TunnelDetails) Reset() { *m = SwIfL2tpv3TunnelDetails{} }
398 func (*SwIfL2tpv3TunnelDetails) GetMessageName() string { return "sw_if_l2tpv3_tunnel_details" }
399 func (*SwIfL2tpv3TunnelDetails) GetCrcString() string { return "1dab5c7e" }
400 func (*SwIfL2tpv3TunnelDetails) GetMessageType() api.MessageType {
401 return api.ReplyMessage
404 func (m *SwIfL2tpv3TunnelDetails) Size() (size int) {
408 size += 4 // m.SwIfIndex
409 size += 64 // m.InterfaceName
410 size += 1 // m.ClientAddress.Af
411 size += 1 * 16 // m.ClientAddress.Un
412 size += 1 // m.OurAddress.Af
413 size += 1 * 16 // m.OurAddress.Un
414 size += 4 // m.LocalSessionID
415 size += 4 // m.RemoteSessionID
416 size += 8 * 2 // m.LocalCookie
417 size += 8 // m.RemoteCookie
418 size += 1 // m.L2SublayerPresent
421 func (m *SwIfL2tpv3TunnelDetails) Marshal(b []byte) ([]byte, error) {
423 b = make([]byte, m.Size())
425 buf := codec.NewBuffer(b)
426 buf.EncodeUint32(uint32(m.SwIfIndex))
427 buf.EncodeString(m.InterfaceName, 64)
428 buf.EncodeUint8(uint8(m.ClientAddress.Af))
429 buf.EncodeBytes(m.ClientAddress.Un.XXX_UnionData[:], 16)
430 buf.EncodeUint8(uint8(m.OurAddress.Af))
431 buf.EncodeBytes(m.OurAddress.Un.XXX_UnionData[:], 16)
432 buf.EncodeUint32(m.LocalSessionID)
433 buf.EncodeUint32(m.RemoteSessionID)
434 for i := 0; i < 2; i++ {
436 if i < len(m.LocalCookie) {
437 x = uint64(m.LocalCookie[i])
441 buf.EncodeUint64(m.RemoteCookie)
442 buf.EncodeBool(m.L2SublayerPresent)
443 return buf.Bytes(), nil
445 func (m *SwIfL2tpv3TunnelDetails) Unmarshal(b []byte) error {
446 buf := codec.NewBuffer(b)
447 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
448 m.InterfaceName = buf.DecodeString(64)
449 m.ClientAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
450 copy(m.ClientAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
451 m.OurAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
452 copy(m.OurAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
453 m.LocalSessionID = buf.DecodeUint32()
454 m.RemoteSessionID = buf.DecodeUint32()
455 m.LocalCookie = make([]uint64, 2)
456 for i := 0; i < len(m.LocalCookie); i++ {
457 m.LocalCookie[i] = buf.DecodeUint64()
459 m.RemoteCookie = buf.DecodeUint64()
460 m.L2SublayerPresent = buf.DecodeBool()
464 // SwIfL2tpv3TunnelDump defines message 'sw_if_l2tpv3_tunnel_dump'.
465 type SwIfL2tpv3TunnelDump struct{}
467 func (m *SwIfL2tpv3TunnelDump) Reset() { *m = SwIfL2tpv3TunnelDump{} }
468 func (*SwIfL2tpv3TunnelDump) GetMessageName() string { return "sw_if_l2tpv3_tunnel_dump" }
469 func (*SwIfL2tpv3TunnelDump) GetCrcString() string { return "51077d14" }
470 func (*SwIfL2tpv3TunnelDump) GetMessageType() api.MessageType {
471 return api.RequestMessage
474 func (m *SwIfL2tpv3TunnelDump) Size() (size int) {
480 func (m *SwIfL2tpv3TunnelDump) Marshal(b []byte) ([]byte, error) {
482 b = make([]byte, m.Size())
484 buf := codec.NewBuffer(b)
485 return buf.Bytes(), nil
487 func (m *SwIfL2tpv3TunnelDump) Unmarshal(b []byte) error {
491 func init() { file_l2tp_binapi_init() }
492 func file_l2tp_binapi_init() {
493 api.RegisterMessage((*L2tpv3CreateTunnel)(nil), "l2tpv3_create_tunnel_596892cb")
494 api.RegisterMessage((*L2tpv3CreateTunnelReply)(nil), "l2tpv3_create_tunnel_reply_5383d31f")
495 api.RegisterMessage((*L2tpv3InterfaceEnableDisable)(nil), "l2tpv3_interface_enable_disable_3865946c")
496 api.RegisterMessage((*L2tpv3InterfaceEnableDisableReply)(nil), "l2tpv3_interface_enable_disable_reply_e8d4e804")
497 api.RegisterMessage((*L2tpv3SetLookupKey)(nil), "l2tpv3_set_lookup_key_c9892c86")
498 api.RegisterMessage((*L2tpv3SetLookupKeyReply)(nil), "l2tpv3_set_lookup_key_reply_e8d4e804")
499 api.RegisterMessage((*L2tpv3SetTunnelCookies)(nil), "l2tpv3_set_tunnel_cookies_b3f4faf7")
500 api.RegisterMessage((*L2tpv3SetTunnelCookiesReply)(nil), "l2tpv3_set_tunnel_cookies_reply_e8d4e804")
501 api.RegisterMessage((*SwIfL2tpv3TunnelDetails)(nil), "sw_if_l2tpv3_tunnel_details_1dab5c7e")
502 api.RegisterMessage((*SwIfL2tpv3TunnelDump)(nil), "sw_if_l2tpv3_tunnel_dump_51077d14")
505 // Messages returns list of all messages in this module.
506 func AllMessages() []api.Message {
507 return []api.Message{
508 (*L2tpv3CreateTunnel)(nil),
509 (*L2tpv3CreateTunnelReply)(nil),
510 (*L2tpv3InterfaceEnableDisable)(nil),
511 (*L2tpv3InterfaceEnableDisableReply)(nil),
512 (*L2tpv3SetLookupKey)(nil),
513 (*L2tpv3SetLookupKeyReply)(nil),
514 (*L2tpv3SetTunnelCookies)(nil),
515 (*L2tpv3SetTunnelCookiesReply)(nil),
516 (*SwIfL2tpv3TunnelDetails)(nil),
517 (*SwIfL2tpv3TunnelDump)(nil),