1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/plugins/stn.api.json
7 // Package stn contains generated bindings for API file stn.api.
15 api "git.fd.io/govpp.git/api"
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"
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
30 VersionCrc = 0x5a5079cd
33 // StnAddDelRule defines message 'stn_add_del_rule'.
34 type StnAddDelRule struct {
35 IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
36 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
37 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
40 func (m *StnAddDelRule) Reset() { *m = StnAddDelRule{} }
41 func (*StnAddDelRule) GetMessageName() string { return "stn_add_del_rule" }
42 func (*StnAddDelRule) GetCrcString() string { return "53f751e6" }
43 func (*StnAddDelRule) GetMessageType() api.MessageType {
44 return api.RequestMessage
47 func (m *StnAddDelRule) Size() int {
52 size += 1 // m.IPAddress.Af
53 size += 1 * 16 // m.IPAddress.Un
54 size += 4 // m.SwIfIndex
58 func (m *StnAddDelRule) Marshal(b []byte) ([]byte, error) {
61 buf = codec.NewBuffer(make([]byte, m.Size()))
63 buf = codec.NewBuffer(b)
65 buf.EncodeUint8(uint8(m.IPAddress.Af))
66 buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0)
67 buf.EncodeUint32(uint32(m.SwIfIndex))
68 buf.EncodeBool(m.IsAdd)
69 return buf.Bytes(), nil
71 func (m *StnAddDelRule) Unmarshal(b []byte) error {
72 buf := codec.NewBuffer(b)
73 m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
74 copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
75 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
76 m.IsAdd = buf.DecodeBool()
80 // StnAddDelRuleReply defines message 'stn_add_del_rule_reply'.
81 type StnAddDelRuleReply struct {
82 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
85 func (m *StnAddDelRuleReply) Reset() { *m = StnAddDelRuleReply{} }
86 func (*StnAddDelRuleReply) GetMessageName() string { return "stn_add_del_rule_reply" }
87 func (*StnAddDelRuleReply) GetCrcString() string { return "e8d4e804" }
88 func (*StnAddDelRuleReply) GetMessageType() api.MessageType {
89 return api.ReplyMessage
92 func (m *StnAddDelRuleReply) Size() int {
100 func (m *StnAddDelRuleReply) Marshal(b []byte) ([]byte, error) {
101 var buf *codec.Buffer
103 buf = codec.NewBuffer(make([]byte, m.Size()))
105 buf = codec.NewBuffer(b)
107 buf.EncodeUint32(uint32(m.Retval))
108 return buf.Bytes(), nil
110 func (m *StnAddDelRuleReply) Unmarshal(b []byte) error {
111 buf := codec.NewBuffer(b)
112 m.Retval = int32(buf.DecodeUint32())
116 // StnRulesDetails defines message 'stn_rules_details'.
117 type StnRulesDetails struct {
118 IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
119 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
122 func (m *StnRulesDetails) Reset() { *m = StnRulesDetails{} }
123 func (*StnRulesDetails) GetMessageName() string { return "stn_rules_details" }
124 func (*StnRulesDetails) GetCrcString() string { return "b0f6606c" }
125 func (*StnRulesDetails) GetMessageType() api.MessageType {
126 return api.ReplyMessage
129 func (m *StnRulesDetails) Size() int {
134 size += 1 // m.IPAddress.Af
135 size += 1 * 16 // m.IPAddress.Un
136 size += 4 // m.SwIfIndex
139 func (m *StnRulesDetails) Marshal(b []byte) ([]byte, error) {
140 var buf *codec.Buffer
142 buf = codec.NewBuffer(make([]byte, m.Size()))
144 buf = codec.NewBuffer(b)
146 buf.EncodeUint8(uint8(m.IPAddress.Af))
147 buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 0)
148 buf.EncodeUint32(uint32(m.SwIfIndex))
149 return buf.Bytes(), nil
151 func (m *StnRulesDetails) Unmarshal(b []byte) error {
152 buf := codec.NewBuffer(b)
153 m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
154 copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
155 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
159 // StnRulesDump defines message 'stn_rules_dump'.
160 type StnRulesDump struct{}
162 func (m *StnRulesDump) Reset() { *m = StnRulesDump{} }
163 func (*StnRulesDump) GetMessageName() string { return "stn_rules_dump" }
164 func (*StnRulesDump) GetCrcString() string { return "51077d14" }
165 func (*StnRulesDump) GetMessageType() api.MessageType {
166 return api.RequestMessage
169 func (m *StnRulesDump) Size() int {
176 func (m *StnRulesDump) Marshal(b []byte) ([]byte, error) {
177 var buf *codec.Buffer
179 buf = codec.NewBuffer(make([]byte, m.Size()))
181 buf = codec.NewBuffer(b)
183 return buf.Bytes(), nil
185 func (m *StnRulesDump) Unmarshal(b []byte) error {
189 func init() { file_stn_binapi_init() }
190 func file_stn_binapi_init() {
191 api.RegisterMessage((*StnAddDelRule)(nil), "stn_add_del_rule_53f751e6")
192 api.RegisterMessage((*StnAddDelRuleReply)(nil), "stn_add_del_rule_reply_e8d4e804")
193 api.RegisterMessage((*StnRulesDetails)(nil), "stn_rules_details_b0f6606c")
194 api.RegisterMessage((*StnRulesDump)(nil), "stn_rules_dump_51077d14")
197 // Messages returns list of all messages in this module.
198 func AllMessages() []api.Message {
199 return []api.Message{
200 (*StnAddDelRule)(nil),
201 (*StnAddDelRuleReply)(nil),
202 (*StnRulesDetails)(nil),
203 (*StnRulesDump)(nil),