diff options
Diffstat (limited to 'binapi/interface')
-rw-r--r-- | binapi/interface/interface.ba.go | 441 | ||||
-rw-r--r-- | binapi/interface/interface_rest.ba.go | 594 | ||||
-rw-r--r-- | binapi/interface/interface_rpc.ba.go | 146 |
3 files changed, 526 insertions, 655 deletions
diff --git a/binapi/interface/interface.ba.go b/binapi/interface/interface.ba.go index 822c325..9561eff 100644 --- a/binapi/interface/interface.ba.go +++ b/binapi/interface/interface.ba.go @@ -1,22 +1,22 @@ // Code generated by GoVPP's binapi-generator. DO NOT EDIT. // versions: -// binapi-generator: v0.4.0-dev -// VPP: 20.05-release +// binapi-generator: v0.6.0-dev +// VPP: 22.02-release // source: /usr/share/vpp/api/core/interface.api.json // Package interfaces contains generated bindings for API file interface.api. // // Contents: -// 57 messages +// 66 messages // package interfaces import ( - api "git.fd.io/govpp.git/api" - ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types" - interface_types "git.fd.io/govpp.git/binapi/interface_types" - ip_types "git.fd.io/govpp.git/binapi/ip_types" - codec "git.fd.io/govpp.git/codec" + api "go.fd.io/govpp/api" + ethernet_types "go.fd.io/govpp/binapi/ethernet_types" + interface_types "go.fd.io/govpp/binapi/interface_types" + ip_types "go.fd.io/govpp/binapi/ip_types" + codec "go.fd.io/govpp/codec" ) // This is a compile-time assertion to ensure that this generated file @@ -27,8 +27,8 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "interface" - APIVersion = "3.2.2" - VersionCrc = 0x58d4cf5a + APIVersion = "3.2.3" + VersionCrc = 0x13ab947a ) // CollectDetailedInterfaceStats defines message 'collect_detailed_interface_stats'. @@ -264,7 +264,7 @@ type CreateSubif struct { func (m *CreateSubif) Reset() { *m = CreateSubif{} } func (*CreateSubif) GetMessageName() string { return "create_subif" } -func (*CreateSubif) GetCrcString() string { return "cb371063" } +func (*CreateSubif) GetCrcString() string { return "790ca755" } func (*CreateSubif) GetMessageType() api.MessageType { return api.RequestMessage } @@ -695,7 +695,7 @@ type SwInterfaceAddDelAddress struct { func (m *SwInterfaceAddDelAddress) Reset() { *m = SwInterfaceAddDelAddress{} } func (*SwInterfaceAddDelAddress) GetMessageName() string { return "sw_interface_add_del_address" } -func (*SwInterfaceAddDelAddress) GetCrcString() string { return "5803d5c4" } +func (*SwInterfaceAddDelAddress) GetCrcString() string { return "5463d73b" } func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType { return api.RequestMessage } @@ -1075,7 +1075,7 @@ type SwInterfaceDetails struct { func (m *SwInterfaceDetails) Reset() { *m = SwInterfaceDetails{} } func (*SwInterfaceDetails) GetMessageName() string { return "sw_interface_details" } -func (*SwInterfaceDetails) GetCrcString() string { return "17b69fa2" } +func (*SwInterfaceDetails) GetCrcString() string { return "6c221fc7" } func (*SwInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } @@ -1236,7 +1236,7 @@ type SwInterfaceEvent struct { func (m *SwInterfaceEvent) Reset() { *m = SwInterfaceEvent{} } func (*SwInterfaceEvent) GetMessageName() string { return "sw_interface_event" } -func (*SwInterfaceEvent) GetCrcString() string { return "f709f78d" } +func (*SwInterfaceEvent) GetCrcString() string { return "2d3d95a7" } func (*SwInterfaceEvent) GetMessageType() api.MessageType { return api.EventMessage } @@ -1429,7 +1429,7 @@ func (m *SwInterfaceRxPlacementDetails) Reset() { *m = SwInterfaceRxPlacementDet func (*SwInterfaceRxPlacementDetails) GetMessageName() string { return "sw_interface_rx_placement_details" } -func (*SwInterfaceRxPlacementDetails) GetCrcString() string { return "f6d7d024" } +func (*SwInterfaceRxPlacementDetails) GetCrcString() string { return "9e44a7ce" } func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType { return api.RequestMessage } @@ -1505,7 +1505,7 @@ type SwInterfaceSetFlags struct { func (m *SwInterfaceSetFlags) Reset() { *m = SwInterfaceSetFlags{} } func (*SwInterfaceSetFlags) GetMessageName() string { return "sw_interface_set_flags" } -func (*SwInterfaceSetFlags) GetCrcString() string { return "6a2b491a" } +func (*SwInterfaceSetFlags) GetCrcString() string { return "f5aec1b8" } func (*SwInterfaceSetFlags) GetMessageType() api.MessageType { return api.RequestMessage } @@ -1567,6 +1567,78 @@ func (m *SwInterfaceSetFlagsReply) Unmarshal(b []byte) error { return nil } +// SwInterfaceSetInterfaceName defines message 'sw_interface_set_interface_name'. +type SwInterfaceSetInterfaceName struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + Name string `binapi:"string[64],name=name" json:"name,omitempty"` +} + +func (m *SwInterfaceSetInterfaceName) Reset() { *m = SwInterfaceSetInterfaceName{} } +func (*SwInterfaceSetInterfaceName) GetMessageName() string { return "sw_interface_set_interface_name" } +func (*SwInterfaceSetInterfaceName) GetCrcString() string { return "45a1d548" } +func (*SwInterfaceSetInterfaceName) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceSetInterfaceName) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 64 // m.Name + return size +} +func (m *SwInterfaceSetInterfaceName) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeString(m.Name, 64) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetInterfaceName) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Name = buf.DecodeString(64) + return nil +} + +// SwInterfaceSetInterfaceNameReply defines message 'sw_interface_set_interface_name_reply'. +type SwInterfaceSetInterfaceNameReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SwInterfaceSetInterfaceNameReply) Reset() { *m = SwInterfaceSetInterfaceNameReply{} } +func (*SwInterfaceSetInterfaceNameReply) GetMessageName() string { + return "sw_interface_set_interface_name_reply" +} +func (*SwInterfaceSetInterfaceNameReply) GetCrcString() string { return "e8d4e804" } +func (*SwInterfaceSetInterfaceNameReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SwInterfaceSetInterfaceNameReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *SwInterfaceSetInterfaceNameReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetInterfaceNameReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // SwInterfaceSetIPDirectedBroadcast defines message 'sw_interface_set_ip_directed_broadcast'. type SwInterfaceSetIPDirectedBroadcast struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -1651,7 +1723,7 @@ type SwInterfaceSetMacAddress struct { func (m *SwInterfaceSetMacAddress) Reset() { *m = SwInterfaceSetMacAddress{} } func (*SwInterfaceSetMacAddress) GetMessageName() string { return "sw_interface_set_mac_address" } -func (*SwInterfaceSetMacAddress) GetCrcString() string { return "6aca746a" } +func (*SwInterfaceSetMacAddress) GetCrcString() string { return "c536e7eb" } func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage } @@ -1794,6 +1866,76 @@ func (m *SwInterfaceSetMtuReply) Unmarshal(b []byte) error { return nil } +// SwInterfaceSetPromisc defines message 'sw_interface_set_promisc'. +type SwInterfaceSetPromisc struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + PromiscOn bool `binapi:"bool,name=promisc_on" json:"promisc_on,omitempty"` +} + +func (m *SwInterfaceSetPromisc) Reset() { *m = SwInterfaceSetPromisc{} } +func (*SwInterfaceSetPromisc) GetMessageName() string { return "sw_interface_set_promisc" } +func (*SwInterfaceSetPromisc) GetCrcString() string { return "d40860d4" } +func (*SwInterfaceSetPromisc) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceSetPromisc) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 1 // m.PromiscOn + return size +} +func (m *SwInterfaceSetPromisc) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.PromiscOn) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetPromisc) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.PromiscOn = buf.DecodeBool() + return nil +} + +// SwInterfaceSetPromiscReply defines message 'sw_interface_set_promisc_reply'. +type SwInterfaceSetPromiscReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SwInterfaceSetPromiscReply) Reset() { *m = SwInterfaceSetPromiscReply{} } +func (*SwInterfaceSetPromiscReply) GetMessageName() string { return "sw_interface_set_promisc_reply" } +func (*SwInterfaceSetPromiscReply) GetCrcString() string { return "e8d4e804" } +func (*SwInterfaceSetPromiscReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SwInterfaceSetPromiscReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *SwInterfaceSetPromiscReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetPromiscReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // SwInterfaceSetRxMode defines message 'sw_interface_set_rx_mode'. type SwInterfaceSetRxMode struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -1804,7 +1946,7 @@ type SwInterfaceSetRxMode struct { func (m *SwInterfaceSetRxMode) Reset() { *m = SwInterfaceSetRxMode{} } func (*SwInterfaceSetRxMode) GetMessageName() string { return "sw_interface_set_rx_mode" } -func (*SwInterfaceSetRxMode) GetCrcString() string { return "780f5cee" } +func (*SwInterfaceSetRxMode) GetCrcString() string { return "b04d1cfe" } func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType { return api.RequestMessage } @@ -2026,6 +2168,95 @@ func (m *SwInterfaceSetTableReply) Unmarshal(b []byte) error { return nil } +// SwInterfaceSetTxPlacement defines message 'sw_interface_set_tx_placement'. +type SwInterfaceSetTxPlacement struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"` + ArraySize uint32 `binapi:"u32,name=array_size" json:"-"` + Threads []uint32 `binapi:"u32[array_size],name=threads" json:"threads,omitempty"` +} + +func (m *SwInterfaceSetTxPlacement) Reset() { *m = SwInterfaceSetTxPlacement{} } +func (*SwInterfaceSetTxPlacement) GetMessageName() string { return "sw_interface_set_tx_placement" } +func (*SwInterfaceSetTxPlacement) GetCrcString() string { return "4e0cd5ff" } +func (*SwInterfaceSetTxPlacement) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceSetTxPlacement) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.QueueID + size += 4 // m.ArraySize + size += 4 * len(m.Threads) // m.Threads + return size +} +func (m *SwInterfaceSetTxPlacement) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.QueueID) + buf.EncodeUint32(uint32(len(m.Threads))) + for i := 0; i < len(m.Threads); i++ { + var x uint32 + if i < len(m.Threads) { + x = uint32(m.Threads[i]) + } + buf.EncodeUint32(x) + } + return buf.Bytes(), nil +} +func (m *SwInterfaceSetTxPlacement) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.QueueID = buf.DecodeUint32() + m.ArraySize = buf.DecodeUint32() + m.Threads = make([]uint32, m.ArraySize) + for i := 0; i < len(m.Threads); i++ { + m.Threads[i] = buf.DecodeUint32() + } + return nil +} + +// SwInterfaceSetTxPlacementReply defines message 'sw_interface_set_tx_placement_reply'. +type SwInterfaceSetTxPlacementReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SwInterfaceSetTxPlacementReply) Reset() { *m = SwInterfaceSetTxPlacementReply{} } +func (*SwInterfaceSetTxPlacementReply) GetMessageName() string { + return "sw_interface_set_tx_placement_reply" +} +func (*SwInterfaceSetTxPlacementReply) GetCrcString() string { return "e8d4e804" } +func (*SwInterfaceSetTxPlacementReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SwInterfaceSetTxPlacementReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *SwInterfaceSetTxPlacementReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetTxPlacementReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // SwInterfaceSetUnnumbered defines message 'sw_interface_set_unnumbered'. type SwInterfaceSetUnnumbered struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -2035,7 +2266,7 @@ type SwInterfaceSetUnnumbered struct { func (m *SwInterfaceSetUnnumbered) Reset() { *m = SwInterfaceSetUnnumbered{} } func (*SwInterfaceSetUnnumbered) GetMessageName() string { return "sw_interface_set_unnumbered" } -func (*SwInterfaceSetUnnumbered) GetCrcString() string { return "938ef33b" } +func (*SwInterfaceSetUnnumbered) GetCrcString() string { return "154a6439" } func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType { return api.RequestMessage } @@ -2176,6 +2407,142 @@ func (m *SwInterfaceTagAddDelReply) Unmarshal(b []byte) error { return nil } +// SwInterfaceTxPlacementDetails defines message 'sw_interface_tx_placement_details'. +type SwInterfaceTxPlacementDetails struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"` + Shared uint8 `binapi:"u8,name=shared" json:"shared,omitempty"` + ArraySize uint32 `binapi:"u32,name=array_size" json:"-"` + Threads []uint32 `binapi:"u32[array_size],name=threads" json:"threads,omitempty"` +} + +func (m *SwInterfaceTxPlacementDetails) Reset() { *m = SwInterfaceTxPlacementDetails{} } +func (*SwInterfaceTxPlacementDetails) GetMessageName() string { + return "sw_interface_tx_placement_details" +} +func (*SwInterfaceTxPlacementDetails) GetCrcString() string { return "00381a2e" } +func (*SwInterfaceTxPlacementDetails) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceTxPlacementDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.QueueID + size += 1 // m.Shared + size += 4 // m.ArraySize + size += 4 * len(m.Threads) // m.Threads + return size +} +func (m *SwInterfaceTxPlacementDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.QueueID) + buf.EncodeUint8(m.Shared) + buf.EncodeUint32(uint32(len(m.Threads))) + for i := 0; i < len(m.Threads); i++ { + var x uint32 + if i < len(m.Threads) { + x = uint32(m.Threads[i]) + } + buf.EncodeUint32(x) + } + return buf.Bytes(), nil +} +func (m *SwInterfaceTxPlacementDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.QueueID = buf.DecodeUint32() + m.Shared = buf.DecodeUint8() + m.ArraySize = buf.DecodeUint32() + m.Threads = make([]uint32, m.ArraySize) + for i := 0; i < len(m.Threads); i++ { + m.Threads[i] = buf.DecodeUint32() + } + return nil +} + +// SwInterfaceTxPlacementGet defines message 'sw_interface_tx_placement_get'. +type SwInterfaceTxPlacementGet struct { + Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *SwInterfaceTxPlacementGet) Reset() { *m = SwInterfaceTxPlacementGet{} } +func (*SwInterfaceTxPlacementGet) GetMessageName() string { return "sw_interface_tx_placement_get" } +func (*SwInterfaceTxPlacementGet) GetCrcString() string { return "47250981" } +func (*SwInterfaceTxPlacementGet) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceTxPlacementGet) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Cursor + size += 4 // m.SwIfIndex + return size +} +func (m *SwInterfaceTxPlacementGet) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Cursor) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *SwInterfaceTxPlacementGet) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Cursor = buf.DecodeUint32() + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// SwInterfaceTxPlacementGetReply defines message 'sw_interface_tx_placement_get_reply'. +type SwInterfaceTxPlacementGetReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` +} + +func (m *SwInterfaceTxPlacementGetReply) Reset() { *m = SwInterfaceTxPlacementGetReply{} } +func (*SwInterfaceTxPlacementGetReply) GetMessageName() string { + return "sw_interface_tx_placement_get_reply" +} +func (*SwInterfaceTxPlacementGetReply) GetCrcString() string { return "53b48f5d" } +func (*SwInterfaceTxPlacementGetReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SwInterfaceTxPlacementGetReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.Cursor + return size +} +func (m *SwInterfaceTxPlacementGetReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.Cursor) + return buf.Bytes(), nil +} +func (m *SwInterfaceTxPlacementGetReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.Cursor = buf.DecodeUint32() + return nil +} + // WantInterfaceEvents defines message 'want_interface_events'. type WantInterfaceEvents struct { EnableDisable uint32 `binapi:"u32,name=enable_disable" json:"enable_disable,omitempty"` @@ -2254,7 +2621,7 @@ func file_interfaces_binapi_init() { api.RegisterMessage((*CreateLoopbackInstance)(nil), "create_loopback_instance_d36a3ee2") api.RegisterMessage((*CreateLoopbackInstanceReply)(nil), "create_loopback_instance_reply_5383d31f") api.RegisterMessage((*CreateLoopbackReply)(nil), "create_loopback_reply_5383d31f") - api.RegisterMessage((*CreateSubif)(nil), "create_subif_cb371063") + api.RegisterMessage((*CreateSubif)(nil), "create_subif_790ca755") api.RegisterMessage((*CreateSubifReply)(nil), "create_subif_reply_5383d31f") api.RegisterMessage((*CreateVlanSubif)(nil), "create_vlan_subif_af34ac8b") api.RegisterMessage((*CreateVlanSubifReply)(nil), "create_vlan_subif_reply_5383d31f") @@ -2266,7 +2633,7 @@ func file_interfaces_binapi_init() { api.RegisterMessage((*HwInterfaceSetMtuReply)(nil), "hw_interface_set_mtu_reply_e8d4e804") api.RegisterMessage((*InterfaceNameRenumber)(nil), "interface_name_renumber_2b8858b8") api.RegisterMessage((*InterfaceNameRenumberReply)(nil), "interface_name_renumber_reply_e8d4e804") - api.RegisterMessage((*SwInterfaceAddDelAddress)(nil), "sw_interface_add_del_address_5803d5c4") + api.RegisterMessage((*SwInterfaceAddDelAddress)(nil), "sw_interface_add_del_address_5463d73b") api.RegisterMessage((*SwInterfaceAddDelAddressReply)(nil), "sw_interface_add_del_address_reply_e8d4e804") api.RegisterMessage((*SwInterfaceAddDelMacAddress)(nil), "sw_interface_add_del_mac_address_638bb9f4") api.RegisterMessage((*SwInterfaceAddDelMacAddressReply)(nil), "sw_interface_add_del_mac_address_reply_e8d4e804") @@ -2276,33 +2643,42 @@ func file_interfaces_binapi_init() { api.RegisterMessage((*SwInterfaceAddressReplaceEndReply)(nil), "sw_interface_address_replace_end_reply_e8d4e804") api.RegisterMessage((*SwInterfaceClearStats)(nil), "sw_interface_clear_stats_f9e6675e") api.RegisterMessage((*SwInterfaceClearStatsReply)(nil), "sw_interface_clear_stats_reply_e8d4e804") - api.RegisterMessage((*SwInterfaceDetails)(nil), "sw_interface_details_17b69fa2") + api.RegisterMessage((*SwInterfaceDetails)(nil), "sw_interface_details_6c221fc7") api.RegisterMessage((*SwInterfaceDump)(nil), "sw_interface_dump_aa610c27") - api.RegisterMessage((*SwInterfaceEvent)(nil), "sw_interface_event_f709f78d") + api.RegisterMessage((*SwInterfaceEvent)(nil), "sw_interface_event_2d3d95a7") api.RegisterMessage((*SwInterfaceGetMacAddress)(nil), "sw_interface_get_mac_address_f9e6675e") api.RegisterMessage((*SwInterfaceGetMacAddressReply)(nil), "sw_interface_get_mac_address_reply_40ef2c08") api.RegisterMessage((*SwInterfaceGetTable)(nil), "sw_interface_get_table_2d033de4") api.RegisterMessage((*SwInterfaceGetTableReply)(nil), "sw_interface_get_table_reply_a6eb0109") - api.RegisterMessage((*SwInterfaceRxPlacementDetails)(nil), "sw_interface_rx_placement_details_f6d7d024") + api.RegisterMessage((*SwInterfaceRxPlacementDetails)(nil), "sw_interface_rx_placement_details_9e44a7ce") api.RegisterMessage((*SwInterfaceRxPlacementDump)(nil), "sw_interface_rx_placement_dump_f9e6675e") - api.RegisterMessage((*SwInterfaceSetFlags)(nil), "sw_interface_set_flags_6a2b491a") + api.RegisterMessage((*SwInterfaceSetFlags)(nil), "sw_interface_set_flags_f5aec1b8") api.RegisterMessage((*SwInterfaceSetFlagsReply)(nil), "sw_interface_set_flags_reply_e8d4e804") + api.RegisterMessage((*SwInterfaceSetInterfaceName)(nil), "sw_interface_set_interface_name_45a1d548") + api.RegisterMessage((*SwInterfaceSetInterfaceNameReply)(nil), "sw_interface_set_interface_name_reply_e8d4e804") api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcast)(nil), "sw_interface_set_ip_directed_broadcast_ae6cfcfb") api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcastReply)(nil), "sw_interface_set_ip_directed_broadcast_reply_e8d4e804") - api.RegisterMessage((*SwInterfaceSetMacAddress)(nil), "sw_interface_set_mac_address_6aca746a") + api.RegisterMessage((*SwInterfaceSetMacAddress)(nil), "sw_interface_set_mac_address_c536e7eb") api.RegisterMessage((*SwInterfaceSetMacAddressReply)(nil), "sw_interface_set_mac_address_reply_e8d4e804") api.RegisterMessage((*SwInterfaceSetMtu)(nil), "sw_interface_set_mtu_5cbe85e5") api.RegisterMessage((*SwInterfaceSetMtuReply)(nil), "sw_interface_set_mtu_reply_e8d4e804") - api.RegisterMessage((*SwInterfaceSetRxMode)(nil), "sw_interface_set_rx_mode_780f5cee") + api.RegisterMessage((*SwInterfaceSetPromisc)(nil), "sw_interface_set_promisc_d40860d4") + api.RegisterMessage((*SwInterfaceSetPromiscReply)(nil), "sw_interface_set_promisc_reply_e8d4e804") + api.RegisterMessage((*SwInterfaceSetRxMode)(nil), "sw_interface_set_rx_mode_b04d1cfe") api.RegisterMessage((*SwInterfaceSetRxModeReply)(nil), "sw_interface_set_rx_mode_reply_e8d4e804") api.RegisterMessage((*SwInterfaceSetRxPlacement)(nil), "sw_interface_set_rx_placement_db65f3c9") api.RegisterMessage((*SwInterfaceSetRxPlacementReply)(nil), "sw_interface_set_rx_placement_reply_e8d4e804") api.RegisterMessage((*SwInterfaceSetTable)(nil), "sw_interface_set_table_df42a577") api.RegisterMessage((*SwInterfaceSetTableReply)(nil), "sw_interface_set_table_reply_e8d4e804") - api.RegisterMessage((*SwInterfaceSetUnnumbered)(nil), "sw_interface_set_unnumbered_938ef33b") + api.RegisterMessage((*SwInterfaceSetTxPlacement)(nil), "sw_interface_set_tx_placement_4e0cd5ff") + api.RegisterMessage((*SwInterfaceSetTxPlacementReply)(nil), "sw_interface_set_tx_placement_reply_e8d4e804") + api.RegisterMessage((*SwInterfaceSetUnnumbered)(nil), "sw_interface_set_unnumbered_154a6439") api.RegisterMessage((*SwInterfaceSetUnnumberedReply)(nil), "sw_interface_set_unnumbered_reply_e8d4e804") api.RegisterMessage((*SwInterfaceTagAddDel)(nil), "sw_interface_tag_add_del_426f8bc1") api.RegisterMessage((*SwInterfaceTagAddDelReply)(nil), "sw_interface_tag_add_del_reply_e8d4e804") + api.RegisterMessage((*SwInterfaceTxPlacementDetails)(nil), "sw_interface_tx_placement_details_00381a2e") + api.RegisterMessage((*SwInterfaceTxPlacementGet)(nil), "sw_interface_tx_placement_get_47250981") + api.RegisterMessage((*SwInterfaceTxPlacementGetReply)(nil), "sw_interface_tx_placement_get_reply_53b48f5d") api.RegisterMessage((*WantInterfaceEvents)(nil), "want_interface_events_476f5a08") api.RegisterMessage((*WantInterfaceEventsReply)(nil), "want_interface_events_reply_e8d4e804") } @@ -2349,22 +2725,31 @@ func AllMessages() []api.Message { (*SwInterfaceRxPlacementDump)(nil), (*SwInterfaceSetFlags)(nil), (*SwInterfaceSetFlagsReply)(nil), + (*SwInterfaceSetInterfaceName)(nil), + (*SwInterfaceSetInterfaceNameReply)(nil), (*SwInterfaceSetIPDirectedBroadcast)(nil), (*SwInterfaceSetIPDirectedBroadcastReply)(nil), (*SwInterfaceSetMacAddress)(nil), (*SwInterfaceSetMacAddressReply)(nil), (*SwInterfaceSetMtu)(nil), (*SwInterfaceSetMtuReply)(nil), + (*SwInterfaceSetPromisc)(nil), + (*SwInterfaceSetPromiscReply)(nil), (*SwInterfaceSetRxMode)(nil), (*SwInterfaceSetRxModeReply)(nil), (*SwInterfaceSetRxPlacement)(nil), (*SwInterfaceSetRxPlacementReply)(nil), (*SwInterfaceSetTable)(nil), (*SwInterfaceSetTableReply)(nil), + (*SwInterfaceSetTxPlacement)(nil), + (*SwInterfaceSetTxPlacementReply)(nil), (*SwInterfaceSetUnnumbered)(nil), (*SwInterfaceSetUnnumberedReply)(nil), (*SwInterfaceTagAddDel)(nil), (*SwInterfaceTagAddDelReply)(nil), + (*SwInterfaceTxPlacementDetails)(nil), + (*SwInterfaceTxPlacementGet)(nil), + (*SwInterfaceTxPlacementGetReply)(nil), (*WantInterfaceEvents)(nil), (*WantInterfaceEventsReply)(nil), } diff --git a/binapi/interface/interface_rest.ba.go b/binapi/interface/interface_rest.ba.go deleted file mode 100644 index da5b899..0000000 --- a/binapi/interface/interface_rest.ba.go +++ /dev/null @@ -1,594 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package interfaces - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/collect_detailed_interface_stats", func(w http.ResponseWriter, req *http.Request) { - var request = new(CollectDetailedInterfaceStats) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.CollectDetailedInterfaceStats(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/create_loopback", func(w http.ResponseWriter, req *http.Request) { - var request = new(CreateLoopback) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.CreateLoopback(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/create_loopback_instance", func(w http.ResponseWriter, req *http.Request) { - var request = new(CreateLoopbackInstance) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.CreateLoopbackInstance(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/create_subif", func(w http.ResponseWriter, req *http.Request) { - var request = new(CreateSubif) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.CreateSubif(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/create_vlan_subif", func(w http.ResponseWriter, req *http.Request) { - var request = new(CreateVlanSubif) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.CreateVlanSubif(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/delete_loopback", func(w http.ResponseWriter, req *http.Request) { - var request = new(DeleteLoopback) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.DeleteLoopback(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/delete_subif", func(w http.ResponseWriter, req *http.Request) { - var request = new(DeleteSubif) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.DeleteSubif(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/hw_interface_set_mtu", func(w http.ResponseWriter, req *http.Request) { - var request = new(HwInterfaceSetMtu) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.HwInterfaceSetMtu(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/interface_name_renumber", func(w http.ResponseWriter, req *http.Request) { - var request = new(InterfaceNameRenumber) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.InterfaceNameRenumber(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_add_del_address", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceAddDelAddress) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceAddDelAddress(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_add_del_mac_address", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceAddDelMacAddress) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceAddDelMacAddress(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_address_replace_begin", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceAddressReplaceBegin) - reply, err := rpc.SwInterfaceAddressReplaceBegin(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_address_replace_end", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceAddressReplaceEnd) - reply, err := rpc.SwInterfaceAddressReplaceEnd(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_clear_stats", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceClearStats) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceClearStats(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_get_mac_address", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceGetMacAddress) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceGetMacAddress(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_get_table", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceGetTable) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceGetTable(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_set_flags", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSetFlags) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceSetFlags(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_set_ip_directed_broadcast", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSetIPDirectedBroadcast) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceSetIPDirectedBroadcast(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_set_mac_address", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSetMacAddress) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceSetMacAddress(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_set_mtu", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSetMtu) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceSetMtu(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_set_rx_mode", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSetRxMode) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceSetRxMode(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_set_rx_placement", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSetRxPlacement) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceSetRxPlacement(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_set_table", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSetTable) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceSetTable(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_set_unnumbered", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSetUnnumbered) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceSetUnnumbered(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/sw_interface_tag_add_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceTagAddDel) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.SwInterfaceTagAddDel(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - mux.HandleFunc("/want_interface_events", func(w http.ResponseWriter, req *http.Request) { - var request = new(WantInterfaceEvents) - b, err := ioutil.ReadAll(req.Body) - if err != nil { - http.Error(w, "read body failed", http.StatusBadRequest) - return - } - if err := json.Unmarshal(b, request); err != nil { - http.Error(w, "unmarshal data failed", http.StatusBadRequest) - return - } - reply, err := rpc.WantInterfaceEvents(req.Context(), request) - if err != nil { - http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) - return - } - rep, err := json.MarshalIndent(reply, "", " ") - if err != nil { - http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) - return - } - w.Write(rep) - }) - return http.HandlerFunc(mux.ServeHTTP) -} diff --git a/binapi/interface/interface_rpc.ba.go b/binapi/interface/interface_rpc.ba.go index 6dc6a43..a175403 100644 --- a/binapi/interface/interface_rpc.ba.go +++ b/binapi/interface/interface_rpc.ba.go @@ -5,12 +5,13 @@ package interfaces import ( "context" "fmt" - api "git.fd.io/govpp.git/api" - vpe "git.fd.io/govpp.git/binapi/vpe" "io" + + api "go.fd.io/govpp/api" + memclnt "go.fd.io/govpp/binapi/memclnt" ) -// RPCService defines RPC service interface. +// RPCService defines RPC service interface. type RPCService interface { CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error) CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error) @@ -31,14 +32,18 @@ type RPCService interface { SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error) SwInterfaceRxPlacementDump(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_SwInterfaceRxPlacementDumpClient, error) SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error) + SwInterfaceSetInterfaceName(ctx context.Context, in *SwInterfaceSetInterfaceName) (*SwInterfaceSetInterfaceNameReply, error) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error) SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error) + SwInterfaceSetPromisc(ctx context.Context, in *SwInterfaceSetPromisc) (*SwInterfaceSetPromiscReply, error) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error) SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error) + SwInterfaceSetTxPlacement(ctx context.Context, in *SwInterfaceSetTxPlacement) (*SwInterfaceSetTxPlacementReply, error) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error) + SwInterfaceTxPlacementGet(ctx context.Context, in *SwInterfaceTxPlacementGet) (RPCService_SwInterfaceTxPlacementGetClient, error) WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error) } @@ -56,7 +61,7 @@ func (c *serviceClient) CollectDetailedInterfaceStats(ctx context.Context, in *C if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error) { @@ -65,7 +70,7 @@ func (c *serviceClient) CreateLoopback(ctx context.Context, in *CreateLoopback) if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error) { @@ -74,7 +79,7 @@ func (c *serviceClient) CreateLoopbackInstance(ctx context.Context, in *CreateLo if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubifReply, error) { @@ -83,7 +88,7 @@ func (c *serviceClient) CreateSubif(ctx context.Context, in *CreateSubif) (*Crea if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*CreateVlanSubifReply, error) { @@ -92,7 +97,7 @@ func (c *serviceClient) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*DeleteLoopbackReply, error) { @@ -101,7 +106,7 @@ func (c *serviceClient) DeleteLoopback(ctx context.Context, in *DeleteLoopback) if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubifReply, error) { @@ -110,7 +115,7 @@ func (c *serviceClient) DeleteSubif(ctx context.Context, in *DeleteSubif) (*Dele if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error) { @@ -119,7 +124,7 @@ func (c *serviceClient) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSe if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error) { @@ -128,7 +133,7 @@ func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *Interface if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error) { @@ -137,7 +142,7 @@ func (c *serviceClient) SwInterfaceAddDelAddress(ctx context.Context, in *SwInte if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceAddDelMacAddress(ctx context.Context, in *SwInterfaceAddDelMacAddress) (*SwInterfaceAddDelMacAddressReply, error) { @@ -146,7 +151,7 @@ func (c *serviceClient) SwInterfaceAddDelMacAddress(ctx context.Context, in *SwI if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceAddressReplaceBegin(ctx context.Context, in *SwInterfaceAddressReplaceBegin) (*SwInterfaceAddressReplaceBeginReply, error) { @@ -155,7 +160,7 @@ func (c *serviceClient) SwInterfaceAddressReplaceBegin(ctx context.Context, in * if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceAddressReplaceEnd(ctx context.Context, in *SwInterfaceAddressReplaceEnd) (*SwInterfaceAddressReplaceEndReply, error) { @@ -164,7 +169,7 @@ func (c *serviceClient) SwInterfaceAddressReplaceEnd(ctx context.Context, in *Sw if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error) { @@ -173,7 +178,7 @@ func (c *serviceClient) SwInterfaceClearStats(ctx context.Context, in *SwInterfa if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceDump(ctx context.Context, in *SwInterfaceDump) (RPCService_SwInterfaceDumpClient, error) { @@ -185,7 +190,7 @@ func (c *serviceClient) SwInterfaceDump(ctx context.Context, in *SwInterfaceDump if err := x.Stream.SendMsg(in); err != nil { return nil, err } - if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil { + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { return nil, err } return x, nil @@ -208,7 +213,11 @@ func (c *serviceClient_SwInterfaceDumpClient) Recv() (*SwInterfaceDetails, error switch m := msg.(type) { case *SwInterfaceDetails: return m, nil - case *vpe.ControlPingReply: + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -221,7 +230,7 @@ func (c *serviceClient) SwInterfaceGetMacAddress(ctx context.Context, in *SwInte if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error) { @@ -230,7 +239,7 @@ func (c *serviceClient) SwInterfaceGetTable(ctx context.Context, in *SwInterface if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceRxPlacementDump(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_SwInterfaceRxPlacementDumpClient, error) { @@ -242,7 +251,7 @@ func (c *serviceClient) SwInterfaceRxPlacementDump(ctx context.Context, in *SwIn if err := x.Stream.SendMsg(in); err != nil { return nil, err } - if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil { + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { return nil, err } return x, nil @@ -265,7 +274,11 @@ func (c *serviceClient_SwInterfaceRxPlacementDumpClient) Recv() (*SwInterfaceRxP switch m := msg.(type) { case *SwInterfaceRxPlacementDetails: return m, nil - case *vpe.ControlPingReply: + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -278,7 +291,16 @@ func (c *serviceClient) SwInterfaceSetFlags(ctx context.Context, in *SwInterface if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) SwInterfaceSetInterfaceName(ctx context.Context, in *SwInterfaceSetInterfaceName) (*SwInterfaceSetInterfaceNameReply, error) { + out := new(SwInterfaceSetInterfaceNameReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error) { @@ -287,7 +309,7 @@ func (c *serviceClient) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, i if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error) { @@ -296,7 +318,7 @@ func (c *serviceClient) SwInterfaceSetMacAddress(ctx context.Context, in *SwInte if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error) { @@ -305,7 +327,16 @@ func (c *serviceClient) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSe if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) SwInterfaceSetPromisc(ctx context.Context, in *SwInterfaceSetPromisc) (*SwInterfaceSetPromiscReply, error) { + out := new(SwInterfaceSetPromiscReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error) { @@ -314,7 +345,7 @@ func (c *serviceClient) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfac if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error) { @@ -323,7 +354,7 @@ func (c *serviceClient) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInt if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error) { @@ -332,7 +363,16 @@ func (c *serviceClient) SwInterfaceSetTable(ctx context.Context, in *SwInterface if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) SwInterfaceSetTxPlacement(ctx context.Context, in *SwInterfaceSetTxPlacement) (*SwInterfaceSetTxPlacementReply, error) { + out := new(SwInterfaceSetTxPlacementReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error) { @@ -341,7 +381,7 @@ func (c *serviceClient) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInte if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error) { @@ -350,7 +390,47 @@ func (c *serviceClient) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfac if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) SwInterfaceTxPlacementGet(ctx context.Context, in *SwInterfaceTxPlacementGet) (RPCService_SwInterfaceTxPlacementGetClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_SwInterfaceTxPlacementGetClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_SwInterfaceTxPlacementGetClient interface { + Recv() (*SwInterfaceTxPlacementDetails, error) + api.Stream +} + +type serviceClient_SwInterfaceTxPlacementGetClient struct { + api.Stream +} + +func (c *serviceClient_SwInterfaceTxPlacementGetClient) Recv() (*SwInterfaceTxPlacementDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *SwInterfaceTxPlacementDetails: + return m, nil + case *SwInterfaceTxPlacementGetReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } } func (c *serviceClient) WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error) { @@ -359,5 +439,5 @@ func (c *serviceClient) WantInterfaceEvents(ctx context.Context, in *WantInterfa if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } |