Improve binapi generator
[govpp.git] / binapi / feature / feature.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 // source: /usr/share/vpp/api/core/feature.api.json
6
7 // Package feature contains generated bindings for API file feature.api.
8 //
9 // Contents:
10 //   2 messages
11 //
12 package feature
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         interface_types "git.fd.io/govpp.git/binapi/interface_types"
17         codec "git.fd.io/govpp.git/codec"
18 )
19
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
25
26 const (
27         APIFile    = "feature"
28         APIVersion = "1.0.2"
29         VersionCrc = 0x8dd9f8ab
30 )
31
32 // FeatureEnableDisable defines message 'feature_enable_disable'.
33 type FeatureEnableDisable struct {
34         SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
35         Enable      bool                           `binapi:"bool,name=enable" json:"enable,omitempty"`
36         ArcName     string                         `binapi:"string[64],name=arc_name" json:"arc_name,omitempty"`
37         FeatureName string                         `binapi:"string[64],name=feature_name" json:"feature_name,omitempty"`
38 }
39
40 func (m *FeatureEnableDisable) Reset()               { *m = FeatureEnableDisable{} }
41 func (*FeatureEnableDisable) GetMessageName() string { return "feature_enable_disable" }
42 func (*FeatureEnableDisable) GetCrcString() string   { return "7531c862" }
43 func (*FeatureEnableDisable) GetMessageType() api.MessageType {
44         return api.RequestMessage
45 }
46
47 func (m *FeatureEnableDisable) Size() int {
48         if m == nil {
49                 return 0
50         }
51         var size int
52         size += 4  // m.SwIfIndex
53         size += 1  // m.Enable
54         size += 64 // m.ArcName
55         size += 64 // m.FeatureName
56         return size
57 }
58 func (m *FeatureEnableDisable) Marshal(b []byte) ([]byte, error) {
59         var buf *codec.Buffer
60         if b == nil {
61                 buf = codec.NewBuffer(make([]byte, m.Size()))
62         } else {
63                 buf = codec.NewBuffer(b)
64         }
65         buf.EncodeUint32(uint32(m.SwIfIndex))
66         buf.EncodeBool(m.Enable)
67         buf.EncodeString(m.ArcName, 64)
68         buf.EncodeString(m.FeatureName, 64)
69         return buf.Bytes(), nil
70 }
71 func (m *FeatureEnableDisable) Unmarshal(b []byte) error {
72         buf := codec.NewBuffer(b)
73         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
74         m.Enable = buf.DecodeBool()
75         m.ArcName = buf.DecodeString(64)
76         m.FeatureName = buf.DecodeString(64)
77         return nil
78 }
79
80 // FeatureEnableDisableReply defines message 'feature_enable_disable_reply'.
81 type FeatureEnableDisableReply struct {
82         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
83 }
84
85 func (m *FeatureEnableDisableReply) Reset()               { *m = FeatureEnableDisableReply{} }
86 func (*FeatureEnableDisableReply) GetMessageName() string { return "feature_enable_disable_reply" }
87 func (*FeatureEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
88 func (*FeatureEnableDisableReply) GetMessageType() api.MessageType {
89         return api.ReplyMessage
90 }
91
92 func (m *FeatureEnableDisableReply) Size() int {
93         if m == nil {
94                 return 0
95         }
96         var size int
97         size += 4 // m.Retval
98         return size
99 }
100 func (m *FeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) {
101         var buf *codec.Buffer
102         if b == nil {
103                 buf = codec.NewBuffer(make([]byte, m.Size()))
104         } else {
105                 buf = codec.NewBuffer(b)
106         }
107         buf.EncodeUint32(uint32(m.Retval))
108         return buf.Bytes(), nil
109 }
110 func (m *FeatureEnableDisableReply) Unmarshal(b []byte) error {
111         buf := codec.NewBuffer(b)
112         m.Retval = int32(buf.DecodeUint32())
113         return nil
114 }
115
116 func init() { file_feature_binapi_init() }
117 func file_feature_binapi_init() {
118         api.RegisterMessage((*FeatureEnableDisable)(nil), "feature_enable_disable_7531c862")
119         api.RegisterMessage((*FeatureEnableDisableReply)(nil), "feature_enable_disable_reply_e8d4e804")
120 }
121
122 // Messages returns list of all messages in this module.
123 func AllMessages() []api.Message {
124         return []api.Message{
125                 (*FeatureEnableDisable)(nil),
126                 (*FeatureEnableDisableReply)(nil),
127         }
128 }