edca66350722f66ab5bd0e7e1a3990891cba49df
[govpp.git] / binapi / l2e / l2e.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5
6 // Package l2e contains generated bindings for API file l2e.api.
7 //
8 // Contents:
9 //   2 messages
10 //
11 package l2e
12
13 import (
14         api "git.fd.io/govpp.git/api"
15         interface_types "git.fd.io/govpp.git/binapi/interface_types"
16         codec "git.fd.io/govpp.git/codec"
17 )
18
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
24
25 const (
26         APIFile    = "l2e"
27         APIVersion = "1.0.0"
28         VersionCrc = 0x7c918b8
29 )
30
31 // L2Emulation defines message 'l2_emulation'.
32 type L2Emulation struct {
33         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
34         Enable    bool                           `binapi:"bool,name=enable" json:"enable,omitempty"`
35 }
36
37 func (m *L2Emulation) Reset()               { *m = L2Emulation{} }
38 func (*L2Emulation) GetMessageName() string { return "l2_emulation" }
39 func (*L2Emulation) GetCrcString() string   { return "ae6cfcfb" }
40 func (*L2Emulation) GetMessageType() api.MessageType {
41         return api.RequestMessage
42 }
43
44 func (m *L2Emulation) Size() (size int) {
45         if m == nil {
46                 return 0
47         }
48         size += 4 // m.SwIfIndex
49         size += 1 // m.Enable
50         return size
51 }
52 func (m *L2Emulation) Marshal(b []byte) ([]byte, error) {
53         if b == nil {
54                 b = make([]byte, m.Size())
55         }
56         buf := codec.NewBuffer(b)
57         buf.EncodeUint32(uint32(m.SwIfIndex))
58         buf.EncodeBool(m.Enable)
59         return buf.Bytes(), nil
60 }
61 func (m *L2Emulation) Unmarshal(b []byte) error {
62         buf := codec.NewBuffer(b)
63         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
64         m.Enable = buf.DecodeBool()
65         return nil
66 }
67
68 // L2EmulationReply defines message 'l2_emulation_reply'.
69 type L2EmulationReply struct {
70         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
71 }
72
73 func (m *L2EmulationReply) Reset()               { *m = L2EmulationReply{} }
74 func (*L2EmulationReply) GetMessageName() string { return "l2_emulation_reply" }
75 func (*L2EmulationReply) GetCrcString() string   { return "e8d4e804" }
76 func (*L2EmulationReply) GetMessageType() api.MessageType {
77         return api.ReplyMessage
78 }
79
80 func (m *L2EmulationReply) Size() (size int) {
81         if m == nil {
82                 return 0
83         }
84         size += 4 // m.Retval
85         return size
86 }
87 func (m *L2EmulationReply) Marshal(b []byte) ([]byte, error) {
88         if b == nil {
89                 b = make([]byte, m.Size())
90         }
91         buf := codec.NewBuffer(b)
92         buf.EncodeInt32(m.Retval)
93         return buf.Bytes(), nil
94 }
95 func (m *L2EmulationReply) Unmarshal(b []byte) error {
96         buf := codec.NewBuffer(b)
97         m.Retval = buf.DecodeInt32()
98         return nil
99 }
100
101 func init() { file_l2e_binapi_init() }
102 func file_l2e_binapi_init() {
103         api.RegisterMessage((*L2Emulation)(nil), "l2_emulation_ae6cfcfb")
104         api.RegisterMessage((*L2EmulationReply)(nil), "l2_emulation_reply_e8d4e804")
105 }
106
107 // Messages returns list of all messages in this module.
108 func AllMessages() []api.Message {
109         return []api.Message{
110                 (*L2Emulation)(nil),
111                 (*L2EmulationReply)(nil),
112         }
113 }