1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.6.0-dev
5 // source: /usr/share/vpp/api/plugins/lldp.api.json
7 // Package lldp contains generated bindings for API file lldp.api.
15 api "go.fd.io/govpp/api"
16 interface_types "go.fd.io/govpp/binapi/interface_types"
17 ip_types "go.fd.io/govpp/binapi/ip_types"
18 codec "go.fd.io/govpp/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 = 0x8a7e7049
33 // LldpConfig defines message 'lldp_config'.
34 type LldpConfig struct {
35 TxHold uint32 `binapi:"u32,name=tx_hold" json:"tx_hold,omitempty"`
36 TxInterval uint32 `binapi:"u32,name=tx_interval" json:"tx_interval,omitempty"`
37 SystemName string `binapi:"string[],name=system_name" json:"system_name,omitempty"`
40 func (m *LldpConfig) Reset() { *m = LldpConfig{} }
41 func (*LldpConfig) GetMessageName() string { return "lldp_config" }
42 func (*LldpConfig) GetCrcString() string { return "c14445df" }
43 func (*LldpConfig) GetMessageType() api.MessageType {
44 return api.RequestMessage
47 func (m *LldpConfig) Size() (size int) {
52 size += 4 // m.TxInterval
53 size += 4 + len(m.SystemName) // m.SystemName
56 func (m *LldpConfig) Marshal(b []byte) ([]byte, error) {
58 b = make([]byte, m.Size())
60 buf := codec.NewBuffer(b)
61 buf.EncodeUint32(m.TxHold)
62 buf.EncodeUint32(m.TxInterval)
63 buf.EncodeString(m.SystemName, 0)
64 return buf.Bytes(), nil
66 func (m *LldpConfig) Unmarshal(b []byte) error {
67 buf := codec.NewBuffer(b)
68 m.TxHold = buf.DecodeUint32()
69 m.TxInterval = buf.DecodeUint32()
70 m.SystemName = buf.DecodeString(0)
74 // LldpConfigReply defines message 'lldp_config_reply'.
75 type LldpConfigReply struct {
76 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
79 func (m *LldpConfigReply) Reset() { *m = LldpConfigReply{} }
80 func (*LldpConfigReply) GetMessageName() string { return "lldp_config_reply" }
81 func (*LldpConfigReply) GetCrcString() string { return "e8d4e804" }
82 func (*LldpConfigReply) GetMessageType() api.MessageType {
83 return api.ReplyMessage
86 func (m *LldpConfigReply) Size() (size int) {
93 func (m *LldpConfigReply) Marshal(b []byte) ([]byte, error) {
95 b = make([]byte, m.Size())
97 buf := codec.NewBuffer(b)
98 buf.EncodeInt32(m.Retval)
99 return buf.Bytes(), nil
101 func (m *LldpConfigReply) Unmarshal(b []byte) error {
102 buf := codec.NewBuffer(b)
103 m.Retval = buf.DecodeInt32()
107 // SwInterfaceSetLldp defines message 'sw_interface_set_lldp'.
108 type SwInterfaceSetLldp struct {
109 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
110 MgmtIP4 ip_types.IP4Address `binapi:"ip4_address,name=mgmt_ip4" json:"mgmt_ip4,omitempty"`
111 MgmtIP6 ip_types.IP6Address `binapi:"ip6_address,name=mgmt_ip6" json:"mgmt_ip6,omitempty"`
112 MgmtOid []byte `binapi:"u8[128],name=mgmt_oid" json:"mgmt_oid,omitempty"`
113 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
114 PortDesc string `binapi:"string[],name=port_desc" json:"port_desc,omitempty"`
117 func (m *SwInterfaceSetLldp) Reset() { *m = SwInterfaceSetLldp{} }
118 func (*SwInterfaceSetLldp) GetMessageName() string { return "sw_interface_set_lldp" }
119 func (*SwInterfaceSetLldp) GetCrcString() string { return "57afbcd4" }
120 func (*SwInterfaceSetLldp) GetMessageType() api.MessageType {
121 return api.RequestMessage
124 func (m *SwInterfaceSetLldp) Size() (size int) {
128 size += 4 // m.SwIfIndex
129 size += 1 * 4 // m.MgmtIP4
130 size += 1 * 16 // m.MgmtIP6
131 size += 1 * 128 // m.MgmtOid
132 size += 1 // m.Enable
133 size += 4 + len(m.PortDesc) // m.PortDesc
136 func (m *SwInterfaceSetLldp) Marshal(b []byte) ([]byte, error) {
138 b = make([]byte, m.Size())
140 buf := codec.NewBuffer(b)
141 buf.EncodeUint32(uint32(m.SwIfIndex))
142 buf.EncodeBytes(m.MgmtIP4[:], 4)
143 buf.EncodeBytes(m.MgmtIP6[:], 16)
144 buf.EncodeBytes(m.MgmtOid, 128)
145 buf.EncodeBool(m.Enable)
146 buf.EncodeString(m.PortDesc, 0)
147 return buf.Bytes(), nil
149 func (m *SwInterfaceSetLldp) Unmarshal(b []byte) error {
150 buf := codec.NewBuffer(b)
151 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
152 copy(m.MgmtIP4[:], buf.DecodeBytes(4))
153 copy(m.MgmtIP6[:], buf.DecodeBytes(16))
154 m.MgmtOid = make([]byte, 128)
155 copy(m.MgmtOid, buf.DecodeBytes(len(m.MgmtOid)))
156 m.Enable = buf.DecodeBool()
157 m.PortDesc = buf.DecodeString(0)
161 // SwInterfaceSetLldpReply defines message 'sw_interface_set_lldp_reply'.
162 type SwInterfaceSetLldpReply struct {
163 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
166 func (m *SwInterfaceSetLldpReply) Reset() { *m = SwInterfaceSetLldpReply{} }
167 func (*SwInterfaceSetLldpReply) GetMessageName() string { return "sw_interface_set_lldp_reply" }
168 func (*SwInterfaceSetLldpReply) GetCrcString() string { return "e8d4e804" }
169 func (*SwInterfaceSetLldpReply) GetMessageType() api.MessageType {
170 return api.ReplyMessage
173 func (m *SwInterfaceSetLldpReply) Size() (size int) {
177 size += 4 // m.Retval
180 func (m *SwInterfaceSetLldpReply) Marshal(b []byte) ([]byte, error) {
182 b = make([]byte, m.Size())
184 buf := codec.NewBuffer(b)
185 buf.EncodeInt32(m.Retval)
186 return buf.Bytes(), nil
188 func (m *SwInterfaceSetLldpReply) Unmarshal(b []byte) error {
189 buf := codec.NewBuffer(b)
190 m.Retval = buf.DecodeInt32()
194 func init() { file_lldp_binapi_init() }
195 func file_lldp_binapi_init() {
196 api.RegisterMessage((*LldpConfig)(nil), "lldp_config_c14445df")
197 api.RegisterMessage((*LldpConfigReply)(nil), "lldp_config_reply_e8d4e804")
198 api.RegisterMessage((*SwInterfaceSetLldp)(nil), "sw_interface_set_lldp_57afbcd4")
199 api.RegisterMessage((*SwInterfaceSetLldpReply)(nil), "sw_interface_set_lldp_reply_e8d4e804")
202 // Messages returns list of all messages in this module.
203 func AllMessages() []api.Message {
204 return []api.Message{
206 (*LldpConfigReply)(nil),
207 (*SwInterfaceSetLldp)(nil),
208 (*SwInterfaceSetLldpReply)(nil),