1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/lldp.api.json
7 // Package lldp contains generated bindings for API file lldp.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 = 0x44347d6
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() int {
53 size += 4 // m.TxInterval
54 size += 4 + len(m.SystemName) // m.SystemName
57 func (m *LldpConfig) Marshal(b []byte) ([]byte, error) {
60 buf = codec.NewBuffer(make([]byte, m.Size()))
62 buf = codec.NewBuffer(b)
64 buf.EncodeUint32(uint32(m.TxHold))
65 buf.EncodeUint32(uint32(m.TxInterval))
66 buf.EncodeString(m.SystemName, 0)
67 return buf.Bytes(), nil
69 func (m *LldpConfig) Unmarshal(b []byte) error {
70 buf := codec.NewBuffer(b)
71 m.TxHold = buf.DecodeUint32()
72 m.TxInterval = buf.DecodeUint32()
73 m.SystemName = buf.DecodeString(0)
77 // LldpConfigReply defines message 'lldp_config_reply'.
78 type LldpConfigReply struct {
79 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
82 func (m *LldpConfigReply) Reset() { *m = LldpConfigReply{} }
83 func (*LldpConfigReply) GetMessageName() string { return "lldp_config_reply" }
84 func (*LldpConfigReply) GetCrcString() string { return "e8d4e804" }
85 func (*LldpConfigReply) GetMessageType() api.MessageType {
86 return api.ReplyMessage
89 func (m *LldpConfigReply) Size() int {
97 func (m *LldpConfigReply) Marshal(b []byte) ([]byte, error) {
100 buf = codec.NewBuffer(make([]byte, m.Size()))
102 buf = codec.NewBuffer(b)
104 buf.EncodeUint32(uint32(m.Retval))
105 return buf.Bytes(), nil
107 func (m *LldpConfigReply) Unmarshal(b []byte) error {
108 buf := codec.NewBuffer(b)
109 m.Retval = int32(buf.DecodeUint32())
113 // SwInterfaceSetLldp defines message 'sw_interface_set_lldp'.
114 type SwInterfaceSetLldp struct {
115 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
116 MgmtIP4 ip_types.IP4Address `binapi:"ip4_address,name=mgmt_ip4" json:"mgmt_ip4,omitempty"`
117 MgmtIP6 ip_types.IP6Address `binapi:"ip6_address,name=mgmt_ip6" json:"mgmt_ip6,omitempty"`
118 MgmtOid []byte `binapi:"u8[128],name=mgmt_oid" json:"mgmt_oid,omitempty"`
119 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
120 PortDesc string `binapi:"string[],name=port_desc" json:"port_desc,omitempty"`
123 func (m *SwInterfaceSetLldp) Reset() { *m = SwInterfaceSetLldp{} }
124 func (*SwInterfaceSetLldp) GetMessageName() string { return "sw_interface_set_lldp" }
125 func (*SwInterfaceSetLldp) GetCrcString() string { return "d646ae0f" }
126 func (*SwInterfaceSetLldp) GetMessageType() api.MessageType {
127 return api.RequestMessage
130 func (m *SwInterfaceSetLldp) Size() int {
135 size += 4 // m.SwIfIndex
136 size += 1 * 4 // m.MgmtIP4
137 size += 1 * 16 // m.MgmtIP6
138 size += 1 * 128 // m.MgmtOid
139 size += 1 // m.Enable
140 size += 4 + len(m.PortDesc) // m.PortDesc
143 func (m *SwInterfaceSetLldp) Marshal(b []byte) ([]byte, error) {
144 var buf *codec.Buffer
146 buf = codec.NewBuffer(make([]byte, m.Size()))
148 buf = codec.NewBuffer(b)
150 buf.EncodeUint32(uint32(m.SwIfIndex))
151 buf.EncodeBytes(m.MgmtIP4[:], 4)
152 buf.EncodeBytes(m.MgmtIP6[:], 16)
153 buf.EncodeBytes(m.MgmtOid[:], 128)
154 buf.EncodeBool(m.Enable)
155 buf.EncodeString(m.PortDesc, 0)
156 return buf.Bytes(), nil
158 func (m *SwInterfaceSetLldp) Unmarshal(b []byte) error {
159 buf := codec.NewBuffer(b)
160 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
161 copy(m.MgmtIP4[:], buf.DecodeBytes(4))
162 copy(m.MgmtIP6[:], buf.DecodeBytes(16))
163 copy(m.MgmtOid[:], buf.DecodeBytes(128))
164 m.Enable = buf.DecodeBool()
165 m.PortDesc = buf.DecodeString(0)
169 // SwInterfaceSetLldpReply defines message 'sw_interface_set_lldp_reply'.
170 type SwInterfaceSetLldpReply struct {
171 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
174 func (m *SwInterfaceSetLldpReply) Reset() { *m = SwInterfaceSetLldpReply{} }
175 func (*SwInterfaceSetLldpReply) GetMessageName() string { return "sw_interface_set_lldp_reply" }
176 func (*SwInterfaceSetLldpReply) GetCrcString() string { return "e8d4e804" }
177 func (*SwInterfaceSetLldpReply) GetMessageType() api.MessageType {
178 return api.ReplyMessage
181 func (m *SwInterfaceSetLldpReply) Size() int {
186 size += 4 // m.Retval
189 func (m *SwInterfaceSetLldpReply) Marshal(b []byte) ([]byte, error) {
190 var buf *codec.Buffer
192 buf = codec.NewBuffer(make([]byte, m.Size()))
194 buf = codec.NewBuffer(b)
196 buf.EncodeUint32(uint32(m.Retval))
197 return buf.Bytes(), nil
199 func (m *SwInterfaceSetLldpReply) Unmarshal(b []byte) error {
200 buf := codec.NewBuffer(b)
201 m.Retval = int32(buf.DecodeUint32())
205 func init() { file_lldp_binapi_init() }
206 func file_lldp_binapi_init() {
207 api.RegisterMessage((*LldpConfig)(nil), "lldp_config_c14445df")
208 api.RegisterMessage((*LldpConfigReply)(nil), "lldp_config_reply_e8d4e804")
209 api.RegisterMessage((*SwInterfaceSetLldp)(nil), "sw_interface_set_lldp_d646ae0f")
210 api.RegisterMessage((*SwInterfaceSetLldpReply)(nil), "sw_interface_set_lldp_reply_e8d4e804")
213 // Messages returns list of all messages in this module.
214 func AllMessages() []api.Message {
215 return []api.Message{
217 (*LldpConfigReply)(nil),
218 (*SwInterfaceSetLldp)(nil),
219 (*SwInterfaceSetLldpReply)(nil),