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