binapigen: fix union size
[govpp.git] / binapi / ioam_export / ioam_export.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/plugins/ioam_export.api.json
6
7 // Package ioam_export contains generated bindings for API file ioam_export.api.
8 //
9 // Contents:
10 //   2 messages
11 //
12 package ioam_export
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         ip_types "git.fd.io/govpp.git/binapi/ip_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    = "ioam_export"
28         APIVersion = "1.0.0"
29         VersionCrc = 0x56bd3b73
30 )
31
32 // IoamExportIP6EnableDisable defines message 'ioam_export_ip6_enable_disable'.
33 type IoamExportIP6EnableDisable struct {
34         IsDisable        bool                `binapi:"bool,name=is_disable" json:"is_disable,omitempty"`
35         CollectorAddress ip_types.IP4Address `binapi:"ip4_address,name=collector_address" json:"collector_address,omitempty"`
36         SrcAddress       ip_types.IP4Address `binapi:"ip4_address,name=src_address" json:"src_address,omitempty"`
37 }
38
39 func (m *IoamExportIP6EnableDisable) Reset()               { *m = IoamExportIP6EnableDisable{} }
40 func (*IoamExportIP6EnableDisable) GetMessageName() string { return "ioam_export_ip6_enable_disable" }
41 func (*IoamExportIP6EnableDisable) GetCrcString() string   { return "e4d4ebfa" }
42 func (*IoamExportIP6EnableDisable) GetMessageType() api.MessageType {
43         return api.RequestMessage
44 }
45
46 func (m *IoamExportIP6EnableDisable) Size() (size int) {
47         if m == nil {
48                 return 0
49         }
50         size += 1     // m.IsDisable
51         size += 1 * 4 // m.CollectorAddress
52         size += 1 * 4 // m.SrcAddress
53         return size
54 }
55 func (m *IoamExportIP6EnableDisable) Marshal(b []byte) ([]byte, error) {
56         if b == nil {
57                 b = make([]byte, m.Size())
58         }
59         buf := codec.NewBuffer(b)
60         buf.EncodeBool(m.IsDisable)
61         buf.EncodeBytes(m.CollectorAddress[:], 4)
62         buf.EncodeBytes(m.SrcAddress[:], 4)
63         return buf.Bytes(), nil
64 }
65 func (m *IoamExportIP6EnableDisable) Unmarshal(b []byte) error {
66         buf := codec.NewBuffer(b)
67         m.IsDisable = buf.DecodeBool()
68         copy(m.CollectorAddress[:], buf.DecodeBytes(4))
69         copy(m.SrcAddress[:], buf.DecodeBytes(4))
70         return nil
71 }
72
73 // IoamExportIP6EnableDisableReply defines message 'ioam_export_ip6_enable_disable_reply'.
74 type IoamExportIP6EnableDisableReply struct {
75         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
76 }
77
78 func (m *IoamExportIP6EnableDisableReply) Reset() { *m = IoamExportIP6EnableDisableReply{} }
79 func (*IoamExportIP6EnableDisableReply) GetMessageName() string {
80         return "ioam_export_ip6_enable_disable_reply"
81 }
82 func (*IoamExportIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
83 func (*IoamExportIP6EnableDisableReply) GetMessageType() api.MessageType {
84         return api.ReplyMessage
85 }
86
87 func (m *IoamExportIP6EnableDisableReply) Size() (size int) {
88         if m == nil {
89                 return 0
90         }
91         size += 4 // m.Retval
92         return size
93 }
94 func (m *IoamExportIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
95         if b == nil {
96                 b = make([]byte, m.Size())
97         }
98         buf := codec.NewBuffer(b)
99         buf.EncodeInt32(m.Retval)
100         return buf.Bytes(), nil
101 }
102 func (m *IoamExportIP6EnableDisableReply) Unmarshal(b []byte) error {
103         buf := codec.NewBuffer(b)
104         m.Retval = buf.DecodeInt32()
105         return nil
106 }
107
108 func init() { file_ioam_export_binapi_init() }
109 func file_ioam_export_binapi_init() {
110         api.RegisterMessage((*IoamExportIP6EnableDisable)(nil), "ioam_export_ip6_enable_disable_e4d4ebfa")
111         api.RegisterMessage((*IoamExportIP6EnableDisableReply)(nil), "ioam_export_ip6_enable_disable_reply_e8d4e804")
112 }
113
114 // Messages returns list of all messages in this module.
115 func AllMessages() []api.Message {
116         return []api.Message{
117                 (*IoamExportIP6EnableDisable)(nil),
118                 (*IoamExportIP6EnableDisableReply)(nil),
119         }
120 }