1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package lldp contains generated bindings for API file lldp.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 = 0x44347d6
32 // LldpConfig defines message 'lldp_config'.
33 type LldpConfig struct {
34 TxHold uint32 `binapi:"u32,name=tx_hold" json:"tx_hold,omitempty"`
35 TxInterval uint32 `binapi:"u32,name=tx_interval" json:"tx_interval,omitempty"`
36 SystemName string `binapi:"string[],name=system_name" json:"system_name,omitempty"`
39 func (m *LldpConfig) Reset() { *m = LldpConfig{} }
40 func (*LldpConfig) GetMessageName() string { return "lldp_config" }
41 func (*LldpConfig) GetCrcString() string { return "c14445df" }
42 func (*LldpConfig) GetMessageType() api.MessageType {
43 return api.RequestMessage
46 func (m *LldpConfig) Size() (size int) {
51 size += 4 // m.TxInterval
52 size += 4 + len(m.SystemName) // m.SystemName
55 func (m *LldpConfig) Marshal(b []byte) ([]byte, error) {
57 b = make([]byte, m.Size())
59 buf := codec.NewBuffer(b)
60 buf.EncodeUint32(m.TxHold)
61 buf.EncodeUint32(m.TxInterval)
62 buf.EncodeString(m.SystemName, 0)
63 return buf.Bytes(), nil
65 func (m *LldpConfig) Unmarshal(b []byte) error {
66 buf := codec.NewBuffer(b)
67 m.TxHold = buf.DecodeUint32()
68 m.TxInterval = buf.DecodeUint32()
69 m.SystemName = buf.DecodeString(0)
73 // LldpConfigReply defines message 'lldp_config_reply'.
74 type LldpConfigReply struct {
75 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
78 func (m *LldpConfigReply) Reset() { *m = LldpConfigReply{} }
79 func (*LldpConfigReply) GetMessageName() string { return "lldp_config_reply" }
80 func (*LldpConfigReply) GetCrcString() string { return "e8d4e804" }
81 func (*LldpConfigReply) GetMessageType() api.MessageType {
82 return api.ReplyMessage
85 func (m *LldpConfigReply) Size() (size int) {
92 func (m *LldpConfigReply) Marshal(b []byte) ([]byte, error) {
94 b = make([]byte, m.Size())
96 buf := codec.NewBuffer(b)
97 buf.EncodeInt32(m.Retval)
98 return buf.Bytes(), nil
100 func (m *LldpConfigReply) Unmarshal(b []byte) error {
101 buf := codec.NewBuffer(b)
102 m.Retval = buf.DecodeInt32()
106 // SwInterfaceSetLldp defines message 'sw_interface_set_lldp'.
107 type SwInterfaceSetLldp struct {
108 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
109 MgmtIP4 ip_types.IP4Address `binapi:"ip4_address,name=mgmt_ip4" json:"mgmt_ip4,omitempty"`
110 MgmtIP6 ip_types.IP6Address `binapi:"ip6_address,name=mgmt_ip6" json:"mgmt_ip6,omitempty"`
111 MgmtOid []byte `binapi:"u8[128],name=mgmt_oid" json:"mgmt_oid,omitempty"`
112 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
113 PortDesc string `binapi:"string[],name=port_desc" json:"port_desc,omitempty"`
116 func (m *SwInterfaceSetLldp) Reset() { *m = SwInterfaceSetLldp{} }
117 func (*SwInterfaceSetLldp) GetMessageName() string { return "sw_interface_set_lldp" }
118 func (*SwInterfaceSetLldp) GetCrcString() string { return "d646ae0f" }
119 func (*SwInterfaceSetLldp) GetMessageType() api.MessageType {
120 return api.RequestMessage
123 func (m *SwInterfaceSetLldp) Size() (size int) {
127 size += 4 // m.SwIfIndex
128 size += 1 * 4 // m.MgmtIP4
129 size += 1 * 16 // m.MgmtIP6
130 size += 1 * 128 // m.MgmtOid
131 size += 1 // m.Enable
132 size += 4 + len(m.PortDesc) // m.PortDesc
135 func (m *SwInterfaceSetLldp) Marshal(b []byte) ([]byte, error) {
137 b = make([]byte, m.Size())
139 buf := codec.NewBuffer(b)
140 buf.EncodeUint32(uint32(m.SwIfIndex))
141 buf.EncodeBytes(m.MgmtIP4[:], 4)
142 buf.EncodeBytes(m.MgmtIP6[:], 16)
143 buf.EncodeBytes(m.MgmtOid, 128)
144 buf.EncodeBool(m.Enable)
145 buf.EncodeString(m.PortDesc, 0)
146 return buf.Bytes(), nil
148 func (m *SwInterfaceSetLldp) Unmarshal(b []byte) error {
149 buf := codec.NewBuffer(b)
150 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
151 copy(m.MgmtIP4[:], buf.DecodeBytes(4))
152 copy(m.MgmtIP6[:], buf.DecodeBytes(16))
153 m.MgmtOid = make([]byte, 128)
154 copy(m.MgmtOid, buf.DecodeBytes(len(m.MgmtOid)))
155 m.Enable = buf.DecodeBool()
156 m.PortDesc = buf.DecodeString(0)
160 // SwInterfaceSetLldpReply defines message 'sw_interface_set_lldp_reply'.
161 type SwInterfaceSetLldpReply struct {
162 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
165 func (m *SwInterfaceSetLldpReply) Reset() { *m = SwInterfaceSetLldpReply{} }
166 func (*SwInterfaceSetLldpReply) GetMessageName() string { return "sw_interface_set_lldp_reply" }
167 func (*SwInterfaceSetLldpReply) GetCrcString() string { return "e8d4e804" }
168 func (*SwInterfaceSetLldpReply) GetMessageType() api.MessageType {
169 return api.ReplyMessage
172 func (m *SwInterfaceSetLldpReply) Size() (size int) {
176 size += 4 // m.Retval
179 func (m *SwInterfaceSetLldpReply) Marshal(b []byte) ([]byte, error) {
181 b = make([]byte, m.Size())
183 buf := codec.NewBuffer(b)
184 buf.EncodeInt32(m.Retval)
185 return buf.Bytes(), nil
187 func (m *SwInterfaceSetLldpReply) Unmarshal(b []byte) error {
188 buf := codec.NewBuffer(b)
189 m.Retval = buf.DecodeInt32()
193 func init() { file_lldp_binapi_init() }
194 func file_lldp_binapi_init() {
195 api.RegisterMessage((*LldpConfig)(nil), "lldp_config_c14445df")
196 api.RegisterMessage((*LldpConfigReply)(nil), "lldp_config_reply_e8d4e804")
197 api.RegisterMessage((*SwInterfaceSetLldp)(nil), "sw_interface_set_lldp_d646ae0f")
198 api.RegisterMessage((*SwInterfaceSetLldpReply)(nil), "sw_interface_set_lldp_reply_e8d4e804")
201 // Messages returns list of all messages in this module.
202 func AllMessages() []api.Message {
203 return []api.Message{
205 (*LldpConfigReply)(nil),
206 (*SwInterfaceSetLldp)(nil),
207 (*SwInterfaceSetLldpReply)(nil),