1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package stn contains generated bindings for API file stn.api.
14 api "git.fd.io/govpp.git/api"
15 interface_types "git.fd.io/govpp.git/binapi/interface_types"
16 ip_types "git.fd.io/govpp.git/binapi/ip_types"
17 codec "git.fd.io/govpp.git/codec"
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
29 VersionCrc = 0x5a5079cd
32 // StnAddDelRule defines message 'stn_add_del_rule'.
33 type StnAddDelRule struct {
34 IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
35 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
36 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
39 func (m *StnAddDelRule) Reset() { *m = StnAddDelRule{} }
40 func (*StnAddDelRule) GetMessageName() string { return "stn_add_del_rule" }
41 func (*StnAddDelRule) GetCrcString() string { return "53f751e6" }
42 func (*StnAddDelRule) GetMessageType() api.MessageType {
43 return api.RequestMessage
46 func (m *StnAddDelRule) Size() (size int) {
50 size += 1 // m.IPAddress.Af
51 size += 1 * 16 // m.IPAddress.Un
52 size += 4 // m.SwIfIndex
56 func (m *StnAddDelRule) Marshal(b []byte) ([]byte, error) {
58 b = make([]byte, m.Size())
60 buf := codec.NewBuffer(b)
61 buf.EncodeUint8(uint8(m.IPAddress.Af))
62 buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16)
63 buf.EncodeUint32(uint32(m.SwIfIndex))
64 buf.EncodeBool(m.IsAdd)
65 return buf.Bytes(), nil
67 func (m *StnAddDelRule) Unmarshal(b []byte) error {
68 buf := codec.NewBuffer(b)
69 m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
70 copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
71 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
72 m.IsAdd = buf.DecodeBool()
76 // StnAddDelRuleReply defines message 'stn_add_del_rule_reply'.
77 type StnAddDelRuleReply struct {
78 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
81 func (m *StnAddDelRuleReply) Reset() { *m = StnAddDelRuleReply{} }
82 func (*StnAddDelRuleReply) GetMessageName() string { return "stn_add_del_rule_reply" }
83 func (*StnAddDelRuleReply) GetCrcString() string { return "e8d4e804" }
84 func (*StnAddDelRuleReply) GetMessageType() api.MessageType {
85 return api.ReplyMessage
88 func (m *StnAddDelRuleReply) Size() (size int) {
95 func (m *StnAddDelRuleReply) Marshal(b []byte) ([]byte, error) {
97 b = make([]byte, m.Size())
99 buf := codec.NewBuffer(b)
100 buf.EncodeInt32(m.Retval)
101 return buf.Bytes(), nil
103 func (m *StnAddDelRuleReply) Unmarshal(b []byte) error {
104 buf := codec.NewBuffer(b)
105 m.Retval = buf.DecodeInt32()
109 // StnRulesDetails defines message 'stn_rules_details'.
110 type StnRulesDetails struct {
111 IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
112 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
115 func (m *StnRulesDetails) Reset() { *m = StnRulesDetails{} }
116 func (*StnRulesDetails) GetMessageName() string { return "stn_rules_details" }
117 func (*StnRulesDetails) GetCrcString() string { return "b0f6606c" }
118 func (*StnRulesDetails) GetMessageType() api.MessageType {
119 return api.ReplyMessage
122 func (m *StnRulesDetails) Size() (size int) {
126 size += 1 // m.IPAddress.Af
127 size += 1 * 16 // m.IPAddress.Un
128 size += 4 // m.SwIfIndex
131 func (m *StnRulesDetails) Marshal(b []byte) ([]byte, error) {
133 b = make([]byte, m.Size())
135 buf := codec.NewBuffer(b)
136 buf.EncodeUint8(uint8(m.IPAddress.Af))
137 buf.EncodeBytes(m.IPAddress.Un.XXX_UnionData[:], 16)
138 buf.EncodeUint32(uint32(m.SwIfIndex))
139 return buf.Bytes(), nil
141 func (m *StnRulesDetails) Unmarshal(b []byte) error {
142 buf := codec.NewBuffer(b)
143 m.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
144 copy(m.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
145 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
149 // StnRulesDump defines message 'stn_rules_dump'.
150 type StnRulesDump struct{}
152 func (m *StnRulesDump) Reset() { *m = StnRulesDump{} }
153 func (*StnRulesDump) GetMessageName() string { return "stn_rules_dump" }
154 func (*StnRulesDump) GetCrcString() string { return "51077d14" }
155 func (*StnRulesDump) GetMessageType() api.MessageType {
156 return api.RequestMessage
159 func (m *StnRulesDump) Size() (size int) {
165 func (m *StnRulesDump) Marshal(b []byte) ([]byte, error) {
167 b = make([]byte, m.Size())
169 buf := codec.NewBuffer(b)
170 return buf.Bytes(), nil
172 func (m *StnRulesDump) Unmarshal(b []byte) error {
176 func init() { file_stn_binapi_init() }
177 func file_stn_binapi_init() {
178 api.RegisterMessage((*StnAddDelRule)(nil), "stn_add_del_rule_53f751e6")
179 api.RegisterMessage((*StnAddDelRuleReply)(nil), "stn_add_del_rule_reply_e8d4e804")
180 api.RegisterMessage((*StnRulesDetails)(nil), "stn_rules_details_b0f6606c")
181 api.RegisterMessage((*StnRulesDump)(nil), "stn_rules_dump_51077d14")
184 // Messages returns list of all messages in this module.
185 func AllMessages() []api.Message {
186 return []api.Message{
187 (*StnAddDelRule)(nil),
188 (*StnAddDelRuleReply)(nil),
189 (*StnRulesDetails)(nil),
190 (*StnRulesDump)(nil),