1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
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 = 0x9cfaef64
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 "224c6edd" }
43 func (*StnAddDelRule) GetMessageType() api.MessageType {
44 return api.RequestMessage
47 func (m *StnAddDelRule) Size() (size int) {
51 size += 1 // m.IPAddress.Af
52 size += 1 * 16 // m.IPAddress.Un
53 size += 4 // m.SwIfIndex
57 func (m *StnAddDelRule) Marshal(b []byte) ([]byte, error) {
59 b = make([]byte, m.Size())
61 buf := codec.NewBuffer(b)
62 buf.EncodeUint8(uint8(m.IPAddress.Af))
63 buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16)
64 buf.EncodeUint32(uint32(m.SwIfIndex))
65 buf.EncodeBool(m.IsAdd)
66 return buf.Bytes(), nil
68 func (m *StnAddDelRule) Unmarshal(b []byte) error {
69 buf := codec.NewBuffer(b)
70 m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
71 copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
72 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
73 m.IsAdd = buf.DecodeBool()
77 // StnAddDelRuleReply defines message 'stn_add_del_rule_reply'.
78 type StnAddDelRuleReply struct {
79 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
82 func (m *StnAddDelRuleReply) Reset() { *m = StnAddDelRuleReply{} }
83 func (*StnAddDelRuleReply) GetMessageName() string { return "stn_add_del_rule_reply" }
84 func (*StnAddDelRuleReply) GetCrcString() string { return "e8d4e804" }
85 func (*StnAddDelRuleReply) GetMessageType() api.MessageType {
86 return api.ReplyMessage
89 func (m *StnAddDelRuleReply) Size() (size int) {
96 func (m *StnAddDelRuleReply) Marshal(b []byte) ([]byte, error) {
98 b = make([]byte, m.Size())
100 buf := codec.NewBuffer(b)
101 buf.EncodeInt32(m.Retval)
102 return buf.Bytes(), nil
104 func (m *StnAddDelRuleReply) Unmarshal(b []byte) error {
105 buf := codec.NewBuffer(b)
106 m.Retval = buf.DecodeInt32()
110 // StnRulesDetails defines message 'stn_rules_details'.
111 type StnRulesDetails struct {
112 IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
113 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
116 func (m *StnRulesDetails) Reset() { *m = StnRulesDetails{} }
117 func (*StnRulesDetails) GetMessageName() string { return "stn_rules_details" }
118 func (*StnRulesDetails) GetCrcString() string { return "a51935a6" }
119 func (*StnRulesDetails) GetMessageType() api.MessageType {
120 return api.ReplyMessage
123 func (m *StnRulesDetails) Size() (size int) {
127 size += 1 // m.IPAddress.Af
128 size += 1 * 16 // m.IPAddress.Un
129 size += 4 // m.SwIfIndex
132 func (m *StnRulesDetails) Marshal(b []byte) ([]byte, error) {
134 b = make([]byte, m.Size())
136 buf := codec.NewBuffer(b)
137 buf.EncodeUint8(uint8(m.IPAddress.Af))
138 buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16)
139 buf.EncodeUint32(uint32(m.SwIfIndex))
140 return buf.Bytes(), nil
142 func (m *StnRulesDetails) Unmarshal(b []byte) error {
143 buf := codec.NewBuffer(b)
144 m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
145 copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
146 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
150 // StnRulesDump defines message 'stn_rules_dump'.
151 type StnRulesDump struct{}
153 func (m *StnRulesDump) Reset() { *m = StnRulesDump{} }
154 func (*StnRulesDump) GetMessageName() string { return "stn_rules_dump" }
155 func (*StnRulesDump) GetCrcString() string { return "51077d14" }
156 func (*StnRulesDump) GetMessageType() api.MessageType {
157 return api.RequestMessage
160 func (m *StnRulesDump) Size() (size int) {
166 func (m *StnRulesDump) Marshal(b []byte) ([]byte, error) {
168 b = make([]byte, m.Size())
170 buf := codec.NewBuffer(b)
171 return buf.Bytes(), nil
173 func (m *StnRulesDump) Unmarshal(b []byte) error {
177 func init() { file_stn_binapi_init() }
178 func file_stn_binapi_init() {
179 api.RegisterMessage((*StnAddDelRule)(nil), "stn_add_del_rule_224c6edd")
180 api.RegisterMessage((*StnAddDelRuleReply)(nil), "stn_add_del_rule_reply_e8d4e804")
181 api.RegisterMessage((*StnRulesDetails)(nil), "stn_rules_details_a51935a6")
182 api.RegisterMessage((*StnRulesDump)(nil), "stn_rules_dump_51077d14")
185 // Messages returns list of all messages in this module.
186 func AllMessages() []api.Message {
187 return []api.Message{
188 (*StnAddDelRule)(nil),
189 (*StnAddDelRuleReply)(nil),
190 (*StnRulesDetails)(nil),
191 (*StnRulesDump)(nil),