cb310fb9146e78bbe8724578e34c99137785f5a7
[govpp.git] / binapi / pppoe / pppoe.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 pppoe contains generated bindings for API file pppoe.api.
7 //
8 // Contents:
9 //   4 messages
10 //
11 package pppoe
12
13 import (
14         api "git.fd.io/govpp.git/api"
15         ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
16         interface_types "git.fd.io/govpp.git/binapi/interface_types"
17         ip_types "git.fd.io/govpp.git/binapi/ip_types"
18         codec "git.fd.io/govpp.git/codec"
19 )
20
21 // This is a compile-time assertion to ensure that this generated file
22 // is compatible with the GoVPP api package it is being compiled against.
23 // A compilation error at this line likely means your copy of the
24 // GoVPP api package needs to be updated.
25 const _ = api.GoVppAPIPackageIsVersion2
26
27 const (
28         APIFile    = "pppoe"
29         APIVersion = "2.0.0"
30         VersionCrc = 0x24ebf557
31 )
32
33 // PppoeAddDelSession defines message 'pppoe_add_del_session'.
34 type PppoeAddDelSession struct {
35         IsAdd      bool                      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
36         SessionID  uint16                    `binapi:"u16,name=session_id" json:"session_id,omitempty"`
37         ClientIP   ip_types.Address          `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
38         DecapVrfID uint32                    `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
39         ClientMac  ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
40 }
41
42 func (m *PppoeAddDelSession) Reset()               { *m = PppoeAddDelSession{} }
43 func (*PppoeAddDelSession) GetMessageName() string { return "pppoe_add_del_session" }
44 func (*PppoeAddDelSession) GetCrcString() string   { return "46ace853" }
45 func (*PppoeAddDelSession) GetMessageType() api.MessageType {
46         return api.RequestMessage
47 }
48
49 func (m *PppoeAddDelSession) Size() (size int) {
50         if m == nil {
51                 return 0
52         }
53         size += 1      // m.IsAdd
54         size += 2      // m.SessionID
55         size += 1      // m.ClientIP.Af
56         size += 1 * 16 // m.ClientIP.Un
57         size += 4      // m.DecapVrfID
58         size += 1 * 6  // m.ClientMac
59         return size
60 }
61 func (m *PppoeAddDelSession) Marshal(b []byte) ([]byte, error) {
62         if b == nil {
63                 b = make([]byte, m.Size())
64         }
65         buf := codec.NewBuffer(b)
66         buf.EncodeBool(m.IsAdd)
67         buf.EncodeUint16(m.SessionID)
68         buf.EncodeUint8(uint8(m.ClientIP.Af))
69         buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
70         buf.EncodeUint32(m.DecapVrfID)
71         buf.EncodeBytes(m.ClientMac[:], 6)
72         return buf.Bytes(), nil
73 }
74 func (m *PppoeAddDelSession) Unmarshal(b []byte) error {
75         buf := codec.NewBuffer(b)
76         m.IsAdd = buf.DecodeBool()
77         m.SessionID = buf.DecodeUint16()
78         m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
79         copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
80         m.DecapVrfID = buf.DecodeUint32()
81         copy(m.ClientMac[:], buf.DecodeBytes(6))
82         return nil
83 }
84
85 // PppoeAddDelSessionReply defines message 'pppoe_add_del_session_reply'.
86 type PppoeAddDelSessionReply struct {
87         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
88         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
89 }
90
91 func (m *PppoeAddDelSessionReply) Reset()               { *m = PppoeAddDelSessionReply{} }
92 func (*PppoeAddDelSessionReply) GetMessageName() string { return "pppoe_add_del_session_reply" }
93 func (*PppoeAddDelSessionReply) GetCrcString() string   { return "5383d31f" }
94 func (*PppoeAddDelSessionReply) GetMessageType() api.MessageType {
95         return api.ReplyMessage
96 }
97
98 func (m *PppoeAddDelSessionReply) Size() (size int) {
99         if m == nil {
100                 return 0
101         }
102         size += 4 // m.Retval
103         size += 4 // m.SwIfIndex
104         return size
105 }
106 func (m *PppoeAddDelSessionReply) Marshal(b []byte) ([]byte, error) {
107         if b == nil {
108                 b = make([]byte, m.Size())
109         }
110         buf := codec.NewBuffer(b)
111         buf.EncodeInt32(m.Retval)
112         buf.EncodeUint32(uint32(m.SwIfIndex))
113         return buf.Bytes(), nil
114 }
115 func (m *PppoeAddDelSessionReply) Unmarshal(b []byte) error {
116         buf := codec.NewBuffer(b)
117         m.Retval = buf.DecodeInt32()
118         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
119         return nil
120 }
121
122 // PppoeSessionDetails defines message 'pppoe_session_details'.
123 type PppoeSessionDetails struct {
124         SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
125         SessionID    uint16                         `binapi:"u16,name=session_id" json:"session_id,omitempty"`
126         ClientIP     ip_types.Address               `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
127         EncapIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=encap_if_index" json:"encap_if_index,omitempty"`
128         DecapVrfID   uint32                         `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
129         LocalMac     ethernet_types.MacAddress      `binapi:"mac_address,name=local_mac" json:"local_mac,omitempty"`
130         ClientMac    ethernet_types.MacAddress      `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
131 }
132
133 func (m *PppoeSessionDetails) Reset()               { *m = PppoeSessionDetails{} }
134 func (*PppoeSessionDetails) GetMessageName() string { return "pppoe_session_details" }
135 func (*PppoeSessionDetails) GetCrcString() string   { return "332bc742" }
136 func (*PppoeSessionDetails) GetMessageType() api.MessageType {
137         return api.ReplyMessage
138 }
139
140 func (m *PppoeSessionDetails) Size() (size int) {
141         if m == nil {
142                 return 0
143         }
144         size += 4      // m.SwIfIndex
145         size += 2      // m.SessionID
146         size += 1      // m.ClientIP.Af
147         size += 1 * 16 // m.ClientIP.Un
148         size += 4      // m.EncapIfIndex
149         size += 4      // m.DecapVrfID
150         size += 1 * 6  // m.LocalMac
151         size += 1 * 6  // m.ClientMac
152         return size
153 }
154 func (m *PppoeSessionDetails) Marshal(b []byte) ([]byte, error) {
155         if b == nil {
156                 b = make([]byte, m.Size())
157         }
158         buf := codec.NewBuffer(b)
159         buf.EncodeUint32(uint32(m.SwIfIndex))
160         buf.EncodeUint16(m.SessionID)
161         buf.EncodeUint8(uint8(m.ClientIP.Af))
162         buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
163         buf.EncodeUint32(uint32(m.EncapIfIndex))
164         buf.EncodeUint32(m.DecapVrfID)
165         buf.EncodeBytes(m.LocalMac[:], 6)
166         buf.EncodeBytes(m.ClientMac[:], 6)
167         return buf.Bytes(), nil
168 }
169 func (m *PppoeSessionDetails) Unmarshal(b []byte) error {
170         buf := codec.NewBuffer(b)
171         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
172         m.SessionID = buf.DecodeUint16()
173         m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
174         copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
175         m.EncapIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
176         m.DecapVrfID = buf.DecodeUint32()
177         copy(m.LocalMac[:], buf.DecodeBytes(6))
178         copy(m.ClientMac[:], buf.DecodeBytes(6))
179         return nil
180 }
181
182 // PppoeSessionDump defines message 'pppoe_session_dump'.
183 type PppoeSessionDump struct {
184         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
185 }
186
187 func (m *PppoeSessionDump) Reset()               { *m = PppoeSessionDump{} }
188 func (*PppoeSessionDump) GetMessageName() string { return "pppoe_session_dump" }
189 func (*PppoeSessionDump) GetCrcString() string   { return "f9e6675e" }
190 func (*PppoeSessionDump) GetMessageType() api.MessageType {
191         return api.RequestMessage
192 }
193
194 func (m *PppoeSessionDump) Size() (size int) {
195         if m == nil {
196                 return 0
197         }
198         size += 4 // m.SwIfIndex
199         return size
200 }
201 func (m *PppoeSessionDump) Marshal(b []byte) ([]byte, error) {
202         if b == nil {
203                 b = make([]byte, m.Size())
204         }
205         buf := codec.NewBuffer(b)
206         buf.EncodeUint32(uint32(m.SwIfIndex))
207         return buf.Bytes(), nil
208 }
209 func (m *PppoeSessionDump) Unmarshal(b []byte) error {
210         buf := codec.NewBuffer(b)
211         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
212         return nil
213 }
214
215 func init() { file_pppoe_binapi_init() }
216 func file_pppoe_binapi_init() {
217         api.RegisterMessage((*PppoeAddDelSession)(nil), "pppoe_add_del_session_46ace853")
218         api.RegisterMessage((*PppoeAddDelSessionReply)(nil), "pppoe_add_del_session_reply_5383d31f")
219         api.RegisterMessage((*PppoeSessionDetails)(nil), "pppoe_session_details_332bc742")
220         api.RegisterMessage((*PppoeSessionDump)(nil), "pppoe_session_dump_f9e6675e")
221 }
222
223 // Messages returns list of all messages in this module.
224 func AllMessages() []api.Message {
225         return []api.Message{
226                 (*PppoeAddDelSession)(nil),
227                 (*PppoeAddDelSessionReply)(nil),
228                 (*PppoeSessionDetails)(nil),
229                 (*PppoeSessionDump)(nil),
230         }
231 }