diff --git a/EosSdk.i b/EosSdk.i index a74fdde..7cddcc0 100644 --- a/EosSdk.i +++ b/EosSdk.i @@ -442,3 +442,23 @@ default_iterator(eos::intf_mgr, intf_iter); default_iterator(eos::ip_route_mgr, ip_route_iter); default_iterator(eos::mpls_route_mgr, mpls_route_iter); default_iterator(eos::subintf_mgr, subintf_iter); + + + +%{ + /* + SWIG generates code for Swig::Director, that includes a static field + containing a heap-allocated python lock. If the code using that director + lock is not used here, then the lock is created, but never used, and the + compiler can eliminate the store of the constructed lock to the static + variable that holds it. Make sure there's a public path to use the lock, + so that elision doesn't happen, and we don't see the allocation as a + memory leak. + */ +[[gnu::visibility("default")]] +void _EOSSDK_SWIG_NO_ELIDE_STATICS(PyObject *pyo, void *vptr) { + Swig::Director director(pyo); + director.swig_acquire_ownership_obj(vptr, true); +} + +%} diff --git a/Includes.i b/Includes.i index cc956cb..a5ac034 100644 --- a/Includes.i +++ b/Includes.i @@ -8,41 +8,41 @@ %include "eos/exception.h" %include "eos/hash_mix.h" %include "eos/types/eth.h" -%include "eos/panic.h" -%include "eos/types/ip.h" -%include "eos/types/acl.h" -%include "eos/types/intf.h" -%include "eos/types/bfd.h" %include "eos/types/eth_phy_intf.h" %include "eos/types/hardware_table.h" -%include "eos/types/lldp.h" -%include "eos/types/macsec.h" +%include "eos/panic.h" +%include "eos/types/intf.h" +%include "eos/types/ip.h" %include "eos/types/mpls.h" -%include "eos/types/mpls_vrf_label.h" -%include "eos/types/structured_filter.h" %include "eos/types/vrf.h" %include "eos/types/subintf.h" +%include "eos/eth.h" %include "eos/ip.h" +%include "eos/types/acl.h" %include "eos/types/aresolve.h" +%include "eos/intf.h" +%include "eos/mpls.h" +%include "eos/types/bfd.h" %include "eos/types/bgp.h" %include "eos/types/bgp_path.h" %include "eos/types/decap_group.h" -%include "eos/eth.h" -%include "eos/intf.h" %include "eos/types/directflow.h" %include "eos/types/eth_lag_intf.h" -%include "eos/mpls.h" %include "eos/types/ip_route.h" +%include "eos/types/lldp.h" %include "eos/types/mac_table.h" +%include "eos/types/macsec.h" %include "eos/types/mpls_route.h" +%include "eos/types/mpls_vrf_label.h" %include "eos/types/neighbor_table.h" %include "eos/types/nexthop_group_tunnel.h" +%include "eos/types/structured_filter.h" +%include "eos/ip_route.h" +%include "eos/types/fib.h" %include "eos/bfd.h" %include "eos/types/nexthop_group.h" %include "eos/acl.h" %include "eos/types/policy_map.h" -%include "eos/ip_route.h" -%include "eos/types/fib.h" %include "eos/bgp.h" %include "eos/types/route_map.h" %include "eos/policy_map.h" @@ -68,18 +68,12 @@ %include "eos/timer.h" %include "eos/hardware_table.h" %include "eos/inline/agent.h" -%include "eos/inline/types/acl.h" -%include "eos/inline/types/bfd.h" %include "eos/inline/types/eth.h" %include "eos/inline/types/eth_phy_intf.h" %include "eos/inline/types/hardware_table.h" %include "eos/inline/types/intf.h" %include "eos/inline/types/ip.h" -%include "eos/inline/types/lldp.h" -%include "eos/inline/types/macsec.h" %include "eos/inline/types/mpls.h" -%include "eos/inline/types/mpls_vrf_label.h" -%include "eos/inline/types/structured_filter.h" %include "eos/inline/types/vrf.h" %include "eos/sdk.h" %include "eos/vrf.h" @@ -92,8 +86,6 @@ %include "eos/inline/types/subintf.h" %include "eos/inline/vrf.h" %include "eos/ip_intf.h" -%include "eos/lldp.h" -%include "eos/macsec.h" %include "eos/mlag.h" %include "eos/subintf.h" %include "eos/system.h" @@ -102,49 +94,57 @@ %include "eos/decap_group.h" %include "eos/directflow.h" %include "eos/eth_lag_intf.h" -%include "eos/inline/acl.h" -%include "eos/inline/bfd.h" %include "eos/inline/eth_intf.h" %include "eos/inline/eth_phy_intf.h" %include "eos/inline/ip_intf.h" -%include "eos/inline/lldp.h" -%include "eos/inline/macsec.h" %include "eos/inline/mlag.h" %include "eos/inline/system.h" +%include "eos/inline/types/acl.h" %include "eos/inline/types/aresolve.h" +%include "eos/inline/types/bfd.h" %include "eos/inline/types/bgp.h" %include "eos/inline/types/bgp_path.h" %include "eos/inline/types/decap_group.h" %include "eos/inline/types/directflow.h" %include "eos/inline/types/eth_lag_intf.h" %include "eos/inline/types/ip_route.h" +%include "eos/inline/types/lldp.h" %include "eos/inline/types/mac_table.h" +%include "eos/inline/types/macsec.h" %include "eos/inline/types/mpls_route.h" +%include "eos/inline/types/mpls_vrf_label.h" %include "eos/inline/types/neighbor_table.h" %include "eos/inline/types/nexthop_group_tunnel.h" +%include "eos/inline/types/structured_filter.h" +%include "eos/lldp.h" %include "eos/mac_table.h" +%include "eos/macsec.h" %include "eos/mpls_route.h" %include "eos/mpls_vrf_label.h" %include "eos/neighbor_table.h" %include "eos/nexthop_group_tunnel.h" +%include "eos/inline/acl.h" %include "eos/inline/aresolve.h" +%include "eos/inline/bfd.h" %include "eos/inline/bgp.h" %include "eos/inline/bgp_path.h" %include "eos/inline/directflow.h" %include "eos/inline/eth_lag_intf.h" +%include "eos/inline/lldp.h" %include "eos/inline/mac_table.h" +%include "eos/inline/macsec.h" %include "eos/inline/mpls_route.h" %include "eos/inline/neighbor_table.h" %include "eos/inline/nexthop_group_tunnel.h" +%include "eos/fib.h" +%include "eos/inline/types/fib.h" %include "eos/inline/types/nexthop_group.h" %include "eos/inline/types/policy_map.h" +%include "eos/inline/types/route_map.h" %include "eos/nexthop_group.h" -%include "eos/fib.h" +%include "eos/route_map.h" +%include "eos/inline/fib.h" %include "eos/inline/nexthop_group.h" %include "eos/inline/policy_map.h" -%include "eos/inline/types/fib.h" -%include "eos/inline/types/route_map.h" -%include "eos/route_map.h" %include "eos/class_map.h" -%include "eos/inline/fib.h" %include "eos/inline/types/class_map.h" diff --git a/Makefile.am b/Makefile.am index 0a0cb05..51d2e9e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,10 @@ lib_LTLIBRARIES = libeos.la AM_CXXFLAGS = -fvisibility=hidden -AM_CXXFLAGS += -Wextra -Wall -Wnon-virtual-dtor -Werror -Wno-unused-parameter -Wno-error=unused-value AM_CXXFLAGS += $(EXTRA_CFLAGS) -AM_LDFLAGS = -Wl,--no-undefined - +AM_CXXFLAGS += -Wextra -Wall -Wnon-virtual-dtor -Werror -Wno-unused-parameter -Wno-error=unused-value -fPIC -fPIE -fvisibility-inlines-hidden +AM_CXXFLAGS += -DTRAFFIC_POLICY_ENABLED +AM_LDFLAGS = -Wl,--no-undefined -fPIC -fPIE PUBLISHED_HEADER_FILES := $(wildcard eos/*.h) $(wildcard eos/inline/*.h) $(wildcard eos/types/*.h) $(wildcard eos/inline/types/*.h) nobase_include_HEADERS = $(PUBLISHED_HEADER_FILES) @@ -77,6 +77,35 @@ libeos_la_SOURCES += bgp_path.cpp libeos_la_SOURCES += lldp.cpp libeos_la_SOURCES += xcvr.cpp libeos_la_SOURCES += nexthop_group_tunnel.cpp +# Add in auto generated X_gen.cpp files too. +libeos_la_SOURCES += acl_gen.cpp +libeos_la_SOURCES += bfd_gen.cpp +libeos_la_SOURCES += bgp_path_gen.cpp +libeos_la_SOURCES += bgp_gen.cpp +libeos_la_SOURCES += class_map_gen.cpp +libeos_la_SOURCES += decap_group_gen.cpp +libeos_la_SOURCES += directflow_gen.cpp +libeos_la_SOURCES += eapi_gen.cpp +libeos_la_SOURCES += eth_lag_intf_gen.cpp +libeos_la_SOURCES += eth_phy_intf_gen.cpp +libeos_la_SOURCES += fib_gen.cpp +libeos_la_SOURCES += hardware_table_gen.cpp +libeos_la_SOURCES += intf_gen.cpp +libeos_la_SOURCES += ip_route_gen.cpp +libeos_la_SOURCES += ip_gen.cpp +libeos_la_SOURCES += lldp_gen.cpp +libeos_la_SOURCES += macsec_gen.cpp +libeos_la_SOURCES += mac_table_gen.cpp +libeos_la_SOURCES += mpls_route_gen.cpp +libeos_la_SOURCES += mpls_vrf_label_gen.cpp +libeos_la_SOURCES += neighbor_table_gen.cpp +libeos_la_SOURCES += nexthop_group_tunnel_gen.cpp +libeos_la_SOURCES += nexthop_group_gen.cpp +libeos_la_SOURCES += policy_map_gen.cpp +libeos_la_SOURCES += route_map_gen.cpp +libeos_la_SOURCES += structured_filter_gen.cpp +libeos_la_SOURCES += subintf_gen.cpp +libeos_la_SOURCES += vrf_gen.cpp libeos_la_CPPFLAGS = $(AM_CPPFLAGS) $(SHIPPING_FLAG) -fPIC -fPIE libeos_la_LDFLAGS = -version-info $(SDK_LIBTOOL_VERSION) -lrt diff --git a/SdkImpl.cpp b/SdkImpl.cpp index b0b9946..3719d2f 100644 --- a/SdkImpl.cpp +++ b/SdkImpl.cpp @@ -111,7 +111,6 @@ INIT_STUB_MGR(eth_phy_intf_counter_mgr) INIT_STUB_MGR(eth_lag_intf_mgr) INIT_STUB_MGR(hardware_table_mgr) INIT_STUB_MGR(intf_mgr) -INIT_STUB_MGR(intf_counter_mgr) INIT_STUB_MGR(ip_intf_mgr) INIT_STUB_MGR(ip_route_mgr) INIT_STUB_MGR(lldp_mgr) @@ -141,6 +140,14 @@ void sdk::SdkImpl::init_fib_mgr(mgr_mode_type_t mode) { // TODO: No op impl. } +// Explicit definition for counter manager init with arguments +intf_counter_mgr * new_intf_counter_mgr(); +void sdk::SdkImpl::init_intf_counter_mgr( mgr_mode_type_t ) { + if(!intf_counter_mgr_) { + intf_counter_mgr_ = new_intf_counter_mgr(); + } +} + void sdk::SdkImpl::init_mount_mgr() { // BUG86400 - Not a public function } diff --git a/SdkImpl.h b/SdkImpl.h index 67f63f4..8793d18 100644 --- a/SdkImpl.h +++ b/SdkImpl.h @@ -127,7 +127,7 @@ class EOS_SDK_PUBLIC sdk::SdkImpl { void init_fib_mgr(mgr_mode_type_t mode=MODE_TYPE_READ_ONLY); void init_hardware_table_mgr(); void init_intf_mgr(); - void init_intf_counter_mgr(); + void init_intf_counter_mgr(mgr_mode_type_t mode=MODE_TYPE_READ_ONLY); void init_ip_intf_mgr(); void init_ip_route_mgr(); void init_lldp_mgr(); @@ -166,6 +166,7 @@ class EOS_SDK_PUBLIC sdk::SdkImpl { hardware_table_mgr * get_hardware_table_mgr(); intf_mgr * get_intf_mgr(); intf_counter_mgr * get_intf_counter_mgr(); + intf_counter_mgr * get_intf_counter_mgr(mgr_mode_type_t mode); ip_intf_mgr * get_ip_intf_mgr(); ip_route_mgr * get_ip_route_mgr(); lldp_mgr * get_lldp_mgr(); @@ -235,6 +236,7 @@ class EOS_SDK_PUBLIC sdk::SdkImpl { std::string name_; void * eossdk_context_; + mgr_mode_type_t intf_counter_mgr_init_mode_; friend class mount_mgr; }; @@ -367,9 +369,23 @@ inline intf_mgr * sdk::SdkImpl::get_intf_mgr() { } inline intf_counter_mgr * sdk::SdkImpl::get_intf_counter_mgr() { + if ( !intf_counter_mgr_ ) { + get_intf_counter_mgr( MODE_TYPE_READ_ONLY ) ; + } + return intf_counter_mgr_; +} + +inline intf_counter_mgr * sdk::SdkImpl::get_intf_counter_mgr( + mgr_mode_type_t mode ) { eos::print_profiles::add_profile( "IntfMgrHelper" ); eos::print_profiles::add_profile( "intf" ); - GET_NO_MOUNT_MGR(intf_counter) + if ( !intf_counter_mgr_ ) { + intf_counter_mgr_init_mode_ = mode; + init_intf_counter_mgr( mode ) ; + } else if ( intf_counter_mgr_init_mode_ != mode ) { + panic( "Requested manager mode is different than mode on initialization" ); + } + return intf_counter_mgr_; } inline ip_intf_mgr * sdk::SdkImpl::get_ip_intf_mgr() { diff --git a/acl_gen.cpp b/acl_gen.cpp new file mode 100644 index 0000000..2f469bd --- /dev/null +++ b/acl_gen.cpp @@ -0,0 +1,168 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/acl.h" +#include "eos/types/acl_impl.h" + +namespace eos { + +// Default constructor. +acl_ttl_spec_t::acl_ttl_spec_t() : + pimpl(std::make_shared()) {} +// Constructor for different ttl specs, note if oper is ACL_RANGE_ANY, the ttl +// should be set to 0. +acl_ttl_spec_t::acl_ttl_spec_t(acl_range_operator_t oper, uint8_t ttl) : + pimpl(std::make_shared( + oper, + ttl + )) {} +EOS_SDK_PUBLIC acl_ttl_spec_t::acl_ttl_spec_t( + const acl_ttl_spec_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC acl_ttl_spec_t& +acl_ttl_spec_t::operator=( + acl_ttl_spec_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +acl_ttl_spec_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +acl_ttl_spec_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +acl_port_spec_t::acl_port_spec_t() : + pimpl(std::make_shared()) {} +acl_port_spec_t::acl_port_spec_t(acl_range_operator_t oper, + std::list const & ports) : + pimpl(std::make_shared( + oper, + ports + )) {} +EOS_SDK_PUBLIC acl_port_spec_t::acl_port_spec_t( + const acl_port_spec_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC acl_port_spec_t& +acl_port_spec_t::operator=( + acl_port_spec_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +acl_port_spec_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +acl_port_spec_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +acl_rule_base_t::acl_rule_base_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC acl_rule_base_t::acl_rule_base_t( + const acl_rule_base_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC acl_rule_base_t& +acl_rule_base_t::operator=( + acl_rule_base_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +acl_rule_base_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +acl_rule_base_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Constructor for concrete rule ip type passed to acl_add_rule() variants. +acl_rule_ip_t::acl_rule_ip_t() : acl_rule_base_t(), + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC acl_rule_ip_t::acl_rule_ip_t( + const acl_rule_ip_t& other) : + acl_rule_base_t(other), + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC acl_rule_ip_t& +acl_rule_ip_t::operator=( + acl_rule_ip_t const & other) +{ + if(this != &other) { + acl_rule_base_t::operator=(other); + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +acl_rule_ip_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +acl_rule_ip_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +acl_rule_eth_t::acl_rule_eth_t() : acl_rule_base_t(), + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC acl_rule_eth_t::acl_rule_eth_t( + const acl_rule_eth_t& other) : + acl_rule_base_t(other), + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC acl_rule_eth_t& +acl_rule_eth_t::operator=( + acl_rule_eth_t const & other) +{ + if(this != &other) { + acl_rule_base_t::operator=(other); + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +acl_rule_eth_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +acl_rule_eth_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/aresolve_types.cpp b/aresolve_types.cpp index 24f72f2..4bafdd7 100644 --- a/aresolve_types.cpp +++ b/aresolve_types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #include "eos/aresolve.h" diff --git a/bfd_gen.cpp b/bfd_gen.cpp new file mode 100644 index 0000000..59c80a5 --- /dev/null +++ b/bfd_gen.cpp @@ -0,0 +1,267 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/bfd.h" +#include "eos/types/bfd_impl.h" + +namespace eos { + +// Default constructor. +bfd_session_key_t::bfd_session_key_t() : + pimpl(std::make_shared()) {} +bfd_session_key_t::bfd_session_key_t(ip_addr_t ip_addr, std::string vrf, + bfd_session_type_t type, intf_id_t intf) : + pimpl(std::make_shared( + ip_addr, + vrf, + type, + intf + )) {} +bfd_session_key_t::bfd_session_key_t(ip_addr_t ip_addr, std::string vrf, + bfd_session_type_t type, intf_id_t intf, + ip_addr_t src_ip_addr) : + pimpl(std::make_shared( + ip_addr, + vrf, + type, + intf, + src_ip_addr + )) {} +// Sbfd session constructor. +bfd_session_key_t::bfd_session_key_t(ip_addr_t ip_addr, std::string vrf, + bfd_session_type_t type, uint64_t tunnel_id) : + pimpl(std::make_shared( + ip_addr, + vrf, + type, + tunnel_id + )) {} +// Constructor with complete argument list. +bfd_session_key_t::bfd_session_key_t(ip_addr_t ip_addr, std::string vrf, + bfd_session_type_t type, intf_id_t intf, + ip_addr_t src_ip_addr, uint64_t tunnel_id) : + pimpl(std::make_shared( + ip_addr, + vrf, + type, + intf, + src_ip_addr, + tunnel_id + )) {} +EOS_SDK_PUBLIC bfd_session_key_t::bfd_session_key_t( + const bfd_session_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC bfd_session_key_t& +bfd_session_key_t::operator=( + bfd_session_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +bfd_session_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +bfd_session_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +bfd_interval_t::bfd_interval_t() : + pimpl(std::make_shared()) {} +bfd_interval_t::bfd_interval_t(uint16_t tx, uint16_t rx, uint8_t mult) : + pimpl(std::make_shared( + tx, + rx, + mult + )) {} +EOS_SDK_PUBLIC bfd_interval_t::bfd_interval_t( + const bfd_interval_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC bfd_interval_t& +bfd_interval_t::operator=( + bfd_interval_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +bfd_interval_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +bfd_interval_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +bfd_session_t::bfd_session_t() : + pimpl(std::make_shared()) {} +bfd_session_t::bfd_session_t(bfd_session_key_t peer, bfd_session_status_t status) : + pimpl(std::make_shared( + peer, + status + )) {} +EOS_SDK_PUBLIC bfd_session_t::bfd_session_t( + const bfd_session_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC bfd_session_t& +bfd_session_t::operator=( + bfd_session_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +bfd_session_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +bfd_session_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +sbfd_echo_session_key_t::sbfd_echo_session_key_t() : + pimpl(std::make_shared()) {} +sbfd_echo_session_key_t::sbfd_echo_session_key_t( + ip_addr_t nexthop, intf_id_t nexthop_intf, + std::forward_list const & labels, uint8_t ip_dscp, + uint8_t mpls_exp) : + pimpl(std::make_shared( + nexthop, + nexthop_intf, + labels, + ip_dscp, + mpls_exp + )) {} +sbfd_echo_session_key_t::sbfd_echo_session_key_t( + ip_addr_t nexthop, intf_id_t nexthop_intf, + std::forward_list const & labels) : + pimpl(std::make_shared( + nexthop, + nexthop_intf, + labels + )) {} +EOS_SDK_PUBLIC sbfd_echo_session_key_t::sbfd_echo_session_key_t( + const sbfd_echo_session_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC sbfd_echo_session_key_t& +sbfd_echo_session_key_t::operator=( + sbfd_echo_session_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +sbfd_echo_session_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +sbfd_echo_session_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +sbfd_interval_t::sbfd_interval_t() : + pimpl(std::make_shared()) {} +sbfd_interval_t::sbfd_interval_t(uint16_t tx, uint8_t mult) : + pimpl(std::make_shared( + tx, + mult + )) {} +EOS_SDK_PUBLIC sbfd_interval_t::sbfd_interval_t( + const sbfd_interval_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC sbfd_interval_t& +sbfd_interval_t::operator=( + sbfd_interval_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +sbfd_interval_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +sbfd_interval_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +sbfd_echo_session_rtt_stats_t::sbfd_echo_session_rtt_stats_t( + uint32_t last_rtt, uint32_t min_rtt, uint32_t avg_rtt, uint32_t max_rtt, + uint32_t snapshot_min_rtt, uint32_t snapshot_avg_rtt, + uint32_t snapshot_max_rtt) : + pimpl(std::make_shared( + last_rtt, + min_rtt, + avg_rtt, + max_rtt, + snapshot_min_rtt, + snapshot_avg_rtt, + snapshot_max_rtt + )) {} +EOS_SDK_PUBLIC sbfd_echo_session_rtt_stats_t::sbfd_echo_session_rtt_stats_t( + const sbfd_echo_session_rtt_stats_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC sbfd_echo_session_rtt_stats_t& +sbfd_echo_session_rtt_stats_t::operator=( + sbfd_echo_session_rtt_stats_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +sbfd_echo_session_rtt_stats_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +sbfd_echo_session_rtt_stats_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/bgp_gen.cpp b/bgp_gen.cpp new file mode 100644 index 0000000..9378349 --- /dev/null +++ b/bgp_gen.cpp @@ -0,0 +1,43 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/bgp.h" +#include "eos/types/bgp_impl.h" + +namespace eos { + +bgp_peer_key_t::bgp_peer_key_t() : + pimpl(std::make_shared()) {} +bgp_peer_key_t::bgp_peer_key_t(std::string const & vrf_name, + ip_addr_t const & peer_addr) : + pimpl(std::make_shared( + vrf_name, + peer_addr + )) {} +EOS_SDK_PUBLIC bgp_peer_key_t::bgp_peer_key_t( + const bgp_peer_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC bgp_peer_key_t& +bgp_peer_key_t::operator=( + bgp_peer_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +bgp_peer_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +bgp_peer_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/bgp_path_gen.cpp b/bgp_path_gen.cpp new file mode 100644 index 0000000..c751589 --- /dev/null +++ b/bgp_path_gen.cpp @@ -0,0 +1,176 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/bgp_path.h" +#include "eos/types/bgp_path_impl.h" + +namespace eos { + +bgp_path_attr_fields_t::bgp_path_attr_fields_t() : + pimpl(std::make_shared()) {} +bgp_path_attr_fields_t::bgp_path_attr_fields_t(bool next_hop) : + pimpl(std::make_shared( + next_hop + )) {} +EOS_SDK_PUBLIC bgp_path_attr_fields_t::bgp_path_attr_fields_t( + const bgp_path_attr_fields_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC bgp_path_attr_fields_t& +bgp_path_attr_fields_t::operator=( + bgp_path_attr_fields_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +bgp_path_attr_fields_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +bgp_path_attr_fields_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +bgp_path_options_t::bgp_path_options_t() : + pimpl(std::make_shared()) {} +bgp_path_options_t::bgp_path_options_t( + bgp_receive_route_stage_t receive_route_stage) : + pimpl(std::make_shared( + receive_route_stage + )) {} +EOS_SDK_PUBLIC bgp_path_options_t::bgp_path_options_t( + const bgp_path_options_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC bgp_path_options_t& +bgp_path_options_t::operator=( + bgp_path_options_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +bgp_path_options_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +bgp_path_options_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +bgp_path_attr_t::bgp_path_attr_t() : + pimpl(std::make_shared()) {} +bgp_path_attr_t::bgp_path_attr_t(uint8_t origin, uint32_t med, uint32_t local_pref) : + pimpl(std::make_shared( + origin, + med, + local_pref + )) {} +EOS_SDK_PUBLIC bgp_path_attr_t::bgp_path_attr_t( + const bgp_path_attr_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC bgp_path_attr_t& +bgp_path_attr_t::operator=( + bgp_path_attr_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +bgp_path_attr_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +bgp_path_attr_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +bgp_path_key_t::bgp_path_key_t() : + pimpl(std::make_shared()) {} +bgp_path_key_t::bgp_path_key_t(ip_prefix_t const & prefix, + ip_addr_t const & peer_addr, + std::string const & vrf_name) : + pimpl(std::make_shared( + prefix, + peer_addr, + vrf_name + )) {} +EOS_SDK_PUBLIC bgp_path_key_t::bgp_path_key_t( + const bgp_path_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC bgp_path_key_t& +bgp_path_key_t::operator=( + bgp_path_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +bgp_path_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +bgp_path_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +bgp_path_t::bgp_path_t() : + pimpl(std::make_shared()) {} +bgp_path_t::bgp_path_t(bgp_path_key_t const & path_key) : + pimpl(std::make_shared( + path_key + )) {} +EOS_SDK_PUBLIC bgp_path_t::bgp_path_t( + const bgp_path_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC bgp_path_t& +bgp_path_t::operator=( + bgp_path_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +bgp_path_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +bgp_path_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/class_map_gen.cpp b/class_map_gen.cpp new file mode 100644 index 0000000..a575ce9 --- /dev/null +++ b/class_map_gen.cpp @@ -0,0 +1,75 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/class_map.h" +#include "eos/types/class_map_impl.h" + +namespace eos { + +// Default constructor. +class_map_rule_t::class_map_rule_t() : + pimpl(std::make_shared()) {} +class_map_rule_t::class_map_rule_t(acl_key_t const & acl_key) : + pimpl(std::make_shared( + acl_key + )) {} +EOS_SDK_PUBLIC class_map_rule_t::class_map_rule_t( + const class_map_rule_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC class_map_rule_t& +class_map_rule_t::operator=( + class_map_rule_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +class_map_rule_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +class_map_rule_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +class_map_t::class_map_t() : + pimpl(std::make_shared()) {} +class_map_t::class_map_t(class_map_key_t const & key) : + pimpl(std::make_shared( + key + )) {} +EOS_SDK_PUBLIC class_map_t::class_map_t( + const class_map_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC class_map_t& +class_map_t::operator=( + class_map_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +class_map_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +class_map_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/decap_group_gen.cpp b/decap_group_gen.cpp new file mode 100644 index 0000000..f50e9ef --- /dev/null +++ b/decap_group_gen.cpp @@ -0,0 +1,46 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/decap_group.h" +#include "eos/types/decap_group_impl.h" + +namespace eos { + +// Default constructor, sets NULL protocol type. +decap_group_t::decap_group_t() : + pimpl(std::make_shared()) {} +decap_group_t::decap_group_t(std::string const & group_name, + ip_addr_t const & destination_addr, + decap_protocol_type_t protocol_type) : + pimpl(std::make_shared( + group_name, + destination_addr, + protocol_type + )) {} +EOS_SDK_PUBLIC decap_group_t::decap_group_t( + const decap_group_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC decap_group_t& +decap_group_t::operator=( + decap_group_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +decap_group_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +decap_group_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/directflow_gen.cpp b/directflow_gen.cpp new file mode 100644 index 0000000..19f8b62 --- /dev/null +++ b/directflow_gen.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/directflow.h" +#include "eos/types/directflow_impl.h" + +namespace eos { + +flow_match_t::flow_match_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC flow_match_t::flow_match_t( + const flow_match_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC flow_match_t& +flow_match_t::operator=( + flow_match_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +flow_match_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +flow_match_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +flow_action_t::flow_action_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC flow_action_t::flow_action_t( + const flow_action_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC flow_action_t& +flow_action_t::operator=( + flow_action_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +flow_action_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +flow_action_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +flow_entry_t::flow_entry_t() : + pimpl(std::make_shared()) {} +flow_entry_t::flow_entry_t(std::string const & name, flow_match_t match, + flow_action_t action, flow_priority_t priority) : + pimpl(std::make_shared( + name, + match, + action, + priority + )) {} +EOS_SDK_PUBLIC flow_entry_t::flow_entry_t( + const flow_entry_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC flow_entry_t& +flow_entry_t::operator=( + flow_entry_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +flow_entry_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +flow_entry_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +flow_counters_t::flow_counters_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC flow_counters_t::flow_counters_t( + const flow_counters_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC flow_counters_t& +flow_counters_t::operator=( + flow_counters_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +flow_counters_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +flow_counters_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/directflow_types.cpp b/directflow_types.cpp index cd6b221..491662e 100644 --- a/directflow_types.cpp +++ b/directflow_types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #include "eos/directflow.h" diff --git a/eapi_gen.cpp b/eapi_gen.cpp new file mode 100644 index 0000000..4f9642a --- /dev/null +++ b/eapi_gen.cpp @@ -0,0 +1,46 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/eapi.h" +#include "eos/types/eapi_impl.h" + +namespace eos { + +eapi_response_t::eapi_response_t() : + pimpl(std::make_shared()) {} +eapi_response_t::eapi_response_t(bool success, uint32_t error_code, + std::string const & error_message, + std::vector const & responses) : + pimpl(std::make_shared( + success, + error_code, + error_message, + responses + )) {} +EOS_SDK_PUBLIC eapi_response_t::eapi_response_t( + const eapi_response_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC eapi_response_t& +eapi_response_t::operator=( + eapi_response_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +eapi_response_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +eapi_response_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/eos/inline/types/acl.h b/eos/inline/types/acl.h index b1b5707..e1c3fe6 100644 --- a/eos/inline/types/acl.h +++ b/eos/inline/types/acl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ACL_H @@ -120,37 +120,6 @@ operator<<(std::ostream& os, const acl_ip_type_t & enum_val) { } -// Default constructor. -acl_ttl_spec_t::acl_ttl_spec_t() { - pimpl = std::shared_ptr( - new acl_ttl_spec_impl_t() - ); -} -// Constructor for different ttl specs, note if oper is ACL_RANGE_ANY, the ttl -// should be set to 0. -acl_ttl_spec_t::acl_ttl_spec_t(acl_range_operator_t oper, uint8_t ttl) { - pimpl = std::shared_ptr( - new acl_ttl_spec_impl_t( - oper, - ttl - ) - ); -} -acl_ttl_spec_t::acl_ttl_spec_t( - const acl_ttl_spec_t& other) -{ - pimpl = std::make_unique( - acl_ttl_spec_impl_t(*other.pimpl)); -} -acl_ttl_spec_t& -acl_ttl_spec_t::operator=( - acl_ttl_spec_t const & other) -{ - pimpl = std::shared_ptr( - new acl_ttl_spec_impl_t(*other.pimpl)); - return *this; -} - acl_range_operator_t acl_ttl_spec_t::oper() const { return pimpl->oper(); @@ -197,35 +166,6 @@ operator<<(std::ostream& os, const acl_ttl_spec_t& obj) { } -acl_port_spec_t::acl_port_spec_t() { - pimpl = std::shared_ptr( - new acl_port_spec_impl_t() - ); -} -acl_port_spec_t::acl_port_spec_t(acl_range_operator_t oper, - std::list const & ports) { - pimpl = std::shared_ptr( - new acl_port_spec_impl_t( - oper, - ports - ) - ); -} -acl_port_spec_t::acl_port_spec_t( - const acl_port_spec_t& other) -{ - pimpl = std::make_unique( - acl_port_spec_impl_t(*other.pimpl)); -} -acl_port_spec_t& -acl_port_spec_t::operator=( - acl_port_spec_t const & other) -{ - pimpl = std::shared_ptr( - new acl_port_spec_impl_t(*other.pimpl)); - return *this; -} - acl_range_operator_t acl_port_spec_t::oper() const { return pimpl->oper(); @@ -361,26 +301,6 @@ operator<<(std::ostream& os, const acl_key_t& obj) { -acl_rule_base_t::acl_rule_base_t() { - pimpl = std::shared_ptr( - new acl_rule_base_impl_t() - ); -} -acl_rule_base_t::acl_rule_base_t( - const acl_rule_base_t& other) -{ - pimpl = std::make_unique( - acl_rule_base_impl_t(*other.pimpl)); -} -acl_rule_base_t& -acl_rule_base_t::operator=( - acl_rule_base_t const & other) -{ - pimpl = std::shared_ptr( - new acl_rule_base_impl_t(*other.pimpl)); - return *this; -} - acl_action_t acl_rule_base_t::action() const { return pimpl->action(); @@ -423,28 +343,6 @@ operator<<(std::ostream& os, const acl_rule_base_t& obj) { } -// Constructor for concrete rule ip type passed to acl_add_rule() variants. -acl_rule_ip_t::acl_rule_ip_t(): acl_rule_base_t() { - pimpl = std::shared_ptr( - new acl_rule_ip_impl_t() - ); -} -acl_rule_ip_t::acl_rule_ip_t( - const acl_rule_ip_t& other): acl_rule_base_t(other) -{ - pimpl = std::make_unique( - acl_rule_ip_impl_t(*other.pimpl)); -} -acl_rule_ip_t& -acl_rule_ip_t::operator=( - acl_rule_ip_t const & other) -{ - acl_rule_base_t::operator=(other); - pimpl = std::shared_ptr( - new acl_rule_ip_impl_t(*other.pimpl)); - return *this; -} - vlan_id_t acl_rule_ip_t::vlan() const { return pimpl->vlan(); @@ -635,27 +533,6 @@ operator<<(std::ostream& os, const acl_rule_ip_t& obj) { } -acl_rule_eth_t::acl_rule_eth_t(): acl_rule_base_t() { - pimpl = std::shared_ptr( - new acl_rule_eth_impl_t() - ); -} -acl_rule_eth_t::acl_rule_eth_t( - const acl_rule_eth_t& other): acl_rule_base_t(other) -{ - pimpl = std::make_unique( - acl_rule_eth_impl_t(*other.pimpl)); -} -acl_rule_eth_t& -acl_rule_eth_t::operator=( - acl_rule_eth_t const & other) -{ - acl_rule_base_t::operator=(other); - pimpl = std::shared_ptr( - new acl_rule_eth_impl_t(*other.pimpl)); - return *this; -} - vlan_id_t acl_rule_eth_t::vlan() const { return pimpl->vlan(); diff --git a/eos/inline/types/acl_impl.h b/eos/inline/types/acl_impl.h index 4918a59..95e3b76 100644 --- a/eos/inline/types/acl_impl.h +++ b/eos/inline/types/acl_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ACL_IMPL_H diff --git a/eos/inline/types/aresolve.h b/eos/inline/types/aresolve.h index 176e153..6d824b6 100644 --- a/eos/inline/types/aresolve.h +++ b/eos/inline/types/aresolve.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ARESOLVE_H diff --git a/eos/inline/types/aresolve_impl.h b/eos/inline/types/aresolve_impl.h index a5e88c7..a98afe7 100644 --- a/eos/inline/types/aresolve_impl.h +++ b/eos/inline/types/aresolve_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ARESOLVE_IMPL_H diff --git a/eos/inline/types/bfd.h b/eos/inline/types/bfd.h index e491f55..f26eabb 100644 --- a/eos/inline/types/bfd.h +++ b/eos/inline/types/bfd.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_BFD_H @@ -52,81 +52,6 @@ operator<<(std::ostream& os, const bfd_session_type_t & enum_val) { } -// Default constructor. -bfd_session_key_t::bfd_session_key_t() { - pimpl = std::shared_ptr( - new bfd_session_key_impl_t() - ); -} -bfd_session_key_t::bfd_session_key_t(ip_addr_t ip_addr, std::string vrf, - bfd_session_type_t type, - intf_id_t intf) { - pimpl = std::shared_ptr( - new bfd_session_key_impl_t( - ip_addr, - vrf, - type, - intf - ) - ); -} -bfd_session_key_t::bfd_session_key_t(ip_addr_t ip_addr, std::string vrf, - bfd_session_type_t type, - intf_id_t intf, ip_addr_t src_ip_addr) { - pimpl = std::shared_ptr( - new bfd_session_key_impl_t( - ip_addr, - vrf, - type, - intf, - src_ip_addr - ) - ); -} -// Sbfd session constructor. -bfd_session_key_t::bfd_session_key_t(ip_addr_t ip_addr, std::string vrf, - bfd_session_type_t type, - uint64_t tunnel_id) { - pimpl = std::shared_ptr( - new bfd_session_key_impl_t( - ip_addr, - vrf, - type, - tunnel_id - ) - ); -} -// Constructor with complete argument list. -bfd_session_key_t::bfd_session_key_t(ip_addr_t ip_addr, std::string vrf, - bfd_session_type_t type, - intf_id_t intf, ip_addr_t src_ip_addr, - uint64_t tunnel_id) { - pimpl = std::shared_ptr( - new bfd_session_key_impl_t( - ip_addr, - vrf, - type, - intf, - src_ip_addr, - tunnel_id - ) - ); -} -bfd_session_key_t::bfd_session_key_t( - const bfd_session_key_t& other) -{ - pimpl = std::make_unique( - bfd_session_key_impl_t(*other.pimpl)); -} -bfd_session_key_t& -bfd_session_key_t::operator=( - bfd_session_key_t const & other) -{ - pimpl = std::shared_ptr( - new bfd_session_key_impl_t(*other.pimpl)); - return *this; -} - ip_addr_t bfd_session_key_t::ip_addr() const { return pimpl->ip_addr(); @@ -181,36 +106,6 @@ operator<<(std::ostream& os, const bfd_session_key_t& obj) { } -// Default constructor. -bfd_interval_t::bfd_interval_t() { - pimpl = std::shared_ptr( - new bfd_interval_impl_t() - ); -} -bfd_interval_t::bfd_interval_t(uint16_t tx, uint16_t rx, uint8_t mult) { - pimpl = std::shared_ptr( - new bfd_interval_impl_t( - tx, - rx, - mult - ) - ); -} -bfd_interval_t::bfd_interval_t( - const bfd_interval_t& other) -{ - pimpl = std::make_unique( - bfd_interval_impl_t(*other.pimpl)); -} -bfd_interval_t& -bfd_interval_t::operator=( - bfd_interval_t const & other) -{ - pimpl = std::shared_ptr( - new bfd_interval_impl_t(*other.pimpl)); - return *this; -} - uint16_t bfd_interval_t::tx() const { return pimpl->tx(); @@ -249,36 +144,6 @@ operator<<(std::ostream& os, const bfd_interval_t& obj) { } -// Default constructor. -bfd_session_t::bfd_session_t() { - pimpl = std::shared_ptr( - new bfd_session_impl_t() - ); -} -bfd_session_t::bfd_session_t(bfd_session_key_t peer, - bfd_session_status_t status) { - pimpl = std::shared_ptr( - new bfd_session_impl_t( - peer, - status - ) - ); -} -bfd_session_t::bfd_session_t( - const bfd_session_t& other) -{ - pimpl = std::make_unique( - bfd_session_impl_t(*other.pimpl)); -} -bfd_session_t& -bfd_session_t::operator=( - bfd_session_t const & other) -{ - pimpl = std::shared_ptr( - new bfd_session_impl_t(*other.pimpl)); - return *this; -} - bfd_session_key_t bfd_session_t::peer() const { return pimpl->peer(); @@ -317,52 +182,6 @@ operator<<(std::ostream& os, const bfd_session_t& obj) { } -// Default constructor. -sbfd_echo_session_key_t::sbfd_echo_session_key_t() { - pimpl = std::shared_ptr( - new sbfd_echo_session_key_impl_t() - ); -} -sbfd_echo_session_key_t::sbfd_echo_session_key_t( - ip_addr_t nexthop, intf_id_t nexthop_intf, - std::forward_list const & labels, uint8_t ip_dscp, - uint8_t mpls_exp) { - pimpl = std::shared_ptr( - new sbfd_echo_session_key_impl_t( - nexthop, - nexthop_intf, - labels, - ip_dscp, - mpls_exp - ) - ); -} -sbfd_echo_session_key_t::sbfd_echo_session_key_t( - ip_addr_t nexthop, intf_id_t nexthop_intf, - std::forward_list const & labels) { - pimpl = std::shared_ptr( - new sbfd_echo_session_key_impl_t( - nexthop, - nexthop_intf, - labels - ) - ); -} -sbfd_echo_session_key_t::sbfd_echo_session_key_t( - const sbfd_echo_session_key_t& other) -{ - pimpl = std::make_unique( - sbfd_echo_session_key_impl_t(*other.pimpl)); -} -sbfd_echo_session_key_t& -sbfd_echo_session_key_t::operator=( - sbfd_echo_session_key_t const & other) -{ - pimpl = std::shared_ptr( - new sbfd_echo_session_key_impl_t(*other.pimpl)); - return *this; -} - ip_addr_t sbfd_echo_session_key_t::nexthop() const { return pimpl->nexthop(); @@ -413,35 +232,6 @@ operator<<(std::ostream& os, const sbfd_echo_session_key_t& obj) { } -// Default constructor. -sbfd_interval_t::sbfd_interval_t() { - pimpl = std::shared_ptr( - new sbfd_interval_impl_t() - ); -} -sbfd_interval_t::sbfd_interval_t(uint16_t tx, uint8_t mult) { - pimpl = std::shared_ptr( - new sbfd_interval_impl_t( - tx, - mult - ) - ); -} -sbfd_interval_t::sbfd_interval_t( - const sbfd_interval_t& other) -{ - pimpl = std::make_unique( - sbfd_interval_impl_t(*other.pimpl)); -} -sbfd_interval_t& -sbfd_interval_t::operator=( - sbfd_interval_t const & other) -{ - pimpl = std::shared_ptr( - new sbfd_interval_impl_t(*other.pimpl)); - return *this; -} - uint16_t sbfd_interval_t::tx() const { return pimpl->tx(); @@ -476,37 +266,6 @@ operator<<(std::ostream& os, const sbfd_interval_t& obj) { } -sbfd_echo_session_rtt_stats_t::sbfd_echo_session_rtt_stats_t( - uint32_t last_rtt, uint32_t min_rtt, uint32_t avg_rtt, uint32_t max_rtt, - uint32_t snapshot_min_rtt, uint32_t snapshot_avg_rtt, - uint32_t snapshot_max_rtt) { - pimpl = std::shared_ptr( - new sbfd_echo_session_rtt_stats_impl_t( - last_rtt, - min_rtt, - avg_rtt, - max_rtt, - snapshot_min_rtt, - snapshot_avg_rtt, - snapshot_max_rtt - ) - ); -} -sbfd_echo_session_rtt_stats_t::sbfd_echo_session_rtt_stats_t( - const sbfd_echo_session_rtt_stats_t& other) -{ - pimpl = std::make_unique( - sbfd_echo_session_rtt_stats_impl_t(*other.pimpl)); -} -sbfd_echo_session_rtt_stats_t& -sbfd_echo_session_rtt_stats_t::operator=( - sbfd_echo_session_rtt_stats_t const & other) -{ - pimpl = std::shared_ptr( - new sbfd_echo_session_rtt_stats_impl_t(*other.pimpl)); - return *this; -} - uint32_t sbfd_echo_session_rtt_stats_t::last_rtt() const { return pimpl->last_rtt(); diff --git a/eos/inline/types/bfd_impl.h b/eos/inline/types/bfd_impl.h index d4f2f1e..bcb7961 100644 --- a/eos/inline/types/bfd_impl.h +++ b/eos/inline/types/bfd_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_BFD_IMPL_H diff --git a/eos/inline/types/bgp.h b/eos/inline/types/bgp.h index f7ce7d1..8c8ce83 100644 --- a/eos/inline/types/bgp.h +++ b/eos/inline/types/bgp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_BGP_H @@ -6,35 +6,6 @@ namespace eos { -bgp_peer_key_t::bgp_peer_key_t() { - pimpl = std::shared_ptr( - new bgp_peer_key_impl_t() - ); -} -bgp_peer_key_t::bgp_peer_key_t(std::string const & vrf_name, - ip_addr_t const & peer_addr) { - pimpl = std::shared_ptr( - new bgp_peer_key_impl_t( - vrf_name, - peer_addr - ) - ); -} -bgp_peer_key_t::bgp_peer_key_t( - const bgp_peer_key_t& other) -{ - pimpl = std::make_unique( - bgp_peer_key_impl_t(*other.pimpl)); -} -bgp_peer_key_t& -bgp_peer_key_t::operator=( - bgp_peer_key_t const & other) -{ - pimpl = std::shared_ptr( - new bgp_peer_key_impl_t(*other.pimpl)); - return *this; -} - std::string bgp_peer_key_t::vrf_name() const { return pimpl->vrf_name(); diff --git a/eos/inline/types/bgp_impl.h b/eos/inline/types/bgp_impl.h index 04f30d0..e82c471 100644 --- a/eos/inline/types/bgp_impl.h +++ b/eos/inline/types/bgp_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_BGP_IMPL_H diff --git a/eos/inline/types/bgp_path.h b/eos/inline/types/bgp_path.h index 0f7c758..702492a 100644 --- a/eos/inline/types/bgp_path.h +++ b/eos/inline/types/bgp_path.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_BGP_PATH_H @@ -32,33 +32,6 @@ operator<<(std::ostream& os, const bgp_receive_route_stage_t & enum_val) { } -bgp_path_attr_fields_t::bgp_path_attr_fields_t() { - pimpl = std::shared_ptr( - new bgp_path_attr_fields_impl_t() - ); -} -bgp_path_attr_fields_t::bgp_path_attr_fields_t(bool next_hop) { - pimpl = std::shared_ptr( - new bgp_path_attr_fields_impl_t( - next_hop - ) - ); -} -bgp_path_attr_fields_t::bgp_path_attr_fields_t( - const bgp_path_attr_fields_t& other) -{ - pimpl = std::make_unique( - bgp_path_attr_fields_impl_t(*other.pimpl)); -} -bgp_path_attr_fields_t& -bgp_path_attr_fields_t::operator=( - bgp_path_attr_fields_t const & other) -{ - pimpl = std::shared_ptr( - new bgp_path_attr_fields_impl_t(*other.pimpl)); - return *this; -} - bool bgp_path_attr_fields_t::next_hop() const { return pimpl->next_hop(); @@ -101,34 +74,6 @@ operator<<(std::ostream& os, const bgp_path_attr_fields_t& obj) { } -bgp_path_options_t::bgp_path_options_t() { - pimpl = std::shared_ptr( - new bgp_path_options_impl_t() - ); -} -bgp_path_options_t::bgp_path_options_t( - bgp_receive_route_stage_t receive_route_stage) { - pimpl = std::shared_ptr( - new bgp_path_options_impl_t( - receive_route_stage - ) - ); -} -bgp_path_options_t::bgp_path_options_t( - const bgp_path_options_t& other) -{ - pimpl = std::make_unique( - bgp_path_options_impl_t(*other.pimpl)); -} -bgp_path_options_t& -bgp_path_options_t::operator=( - bgp_path_options_t const & other) -{ - pimpl = std::shared_ptr( - new bgp_path_options_impl_t(*other.pimpl)); - return *this; -} - bgp_receive_route_stage_t bgp_path_options_t::receive_route_stage() const { return pimpl->receive_route_stage(); @@ -173,36 +118,6 @@ operator<<(std::ostream& os, const bgp_path_options_t& obj) { } -bgp_path_attr_t::bgp_path_attr_t() { - pimpl = std::shared_ptr( - new bgp_path_attr_impl_t() - ); -} -bgp_path_attr_t::bgp_path_attr_t(uint8_t origin, uint32_t med, - uint32_t local_pref) { - pimpl = std::shared_ptr( - new bgp_path_attr_impl_t( - origin, - med, - local_pref - ) - ); -} -bgp_path_attr_t::bgp_path_attr_t( - const bgp_path_attr_t& other) -{ - pimpl = std::make_unique( - bgp_path_attr_impl_t(*other.pimpl)); -} -bgp_path_attr_t& -bgp_path_attr_t::operator=( - bgp_path_attr_t const & other) -{ - pimpl = std::shared_ptr( - new bgp_path_attr_impl_t(*other.pimpl)); - return *this; -} - ip_addr_t bgp_path_attr_t::next_hop() const { return pimpl->next_hop(); @@ -278,37 +193,6 @@ operator<<(std::ostream& os, const bgp_path_attr_t& obj) { } -bgp_path_key_t::bgp_path_key_t() { - pimpl = std::shared_ptr( - new bgp_path_key_impl_t() - ); -} -bgp_path_key_t::bgp_path_key_t(ip_prefix_t const & prefix, - ip_addr_t const & peer_addr, - std::string const & vrf_name) { - pimpl = std::shared_ptr( - new bgp_path_key_impl_t( - prefix, - peer_addr, - vrf_name - ) - ); -} -bgp_path_key_t::bgp_path_key_t( - const bgp_path_key_t& other) -{ - pimpl = std::make_unique( - bgp_path_key_impl_t(*other.pimpl)); -} -bgp_path_key_t& -bgp_path_key_t::operator=( - bgp_path_key_t const & other) -{ - pimpl = std::shared_ptr( - new bgp_path_key_impl_t(*other.pimpl)); - return *this; -} - ip_prefix_t bgp_path_key_t::prefix() const { return pimpl->prefix(); @@ -363,33 +247,6 @@ operator<<(std::ostream& os, const bgp_path_key_t& obj) { } -bgp_path_t::bgp_path_t() { - pimpl = std::shared_ptr( - new bgp_path_impl_t() - ); -} -bgp_path_t::bgp_path_t(bgp_path_key_t const & path_key) { - pimpl = std::shared_ptr( - new bgp_path_impl_t( - path_key - ) - ); -} -bgp_path_t::bgp_path_t( - const bgp_path_t& other) -{ - pimpl = std::make_unique( - bgp_path_impl_t(*other.pimpl)); -} -bgp_path_t& -bgp_path_t::operator=( - bgp_path_t const & other) -{ - pimpl = std::shared_ptr( - new bgp_path_impl_t(*other.pimpl)); - return *this; -} - bgp_path_key_t bgp_path_t::path_key() const { return pimpl->path_key(); diff --git a/eos/inline/types/bgp_path_impl.h b/eos/inline/types/bgp_path_impl.h index bcc1ddd..b8b7e53 100644 --- a/eos/inline/types/bgp_path_impl.h +++ b/eos/inline/types/bgp_path_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_BGP_PATH_IMPL_H diff --git a/eos/inline/types/class_map.h b/eos/inline/types/class_map.h index 03205b4..2d5e509 100644 --- a/eos/inline/types/class_map.h +++ b/eos/inline/types/class_map.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_CLASS_MAP_H @@ -6,34 +6,6 @@ namespace eos { -// Default constructor. -class_map_rule_t::class_map_rule_t() { - pimpl = std::shared_ptr( - new class_map_rule_impl_t() - ); -} -class_map_rule_t::class_map_rule_t(acl_key_t const & acl_key) { - pimpl = std::shared_ptr( - new class_map_rule_impl_t( - acl_key - ) - ); -} -class_map_rule_t::class_map_rule_t( - const class_map_rule_t& other) -{ - pimpl = std::make_unique( - class_map_rule_impl_t(*other.pimpl)); -} -class_map_rule_t& -class_map_rule_t::operator=( - class_map_rule_t const & other) -{ - pimpl = std::shared_ptr( - new class_map_rule_impl_t(*other.pimpl)); - return *this; -} - acl_key_t class_map_rule_t::acl_key() const { return pimpl->acl_key(); @@ -64,34 +36,6 @@ operator<<(std::ostream& os, const class_map_rule_t& obj) { } -// Default constructor. -class_map_t::class_map_t() { - pimpl = std::shared_ptr( - new class_map_impl_t() - ); -} -class_map_t::class_map_t(class_map_key_t const & key) { - pimpl = std::shared_ptr( - new class_map_impl_t( - key - ) - ); -} -class_map_t::class_map_t( - const class_map_t& other) -{ - pimpl = std::make_unique( - class_map_impl_t(*other.pimpl)); -} -class_map_t& -class_map_t::operator=( - class_map_t const & other) -{ - pimpl = std::shared_ptr( - new class_map_impl_t(*other.pimpl)); - return *this; -} - class_map_key_t class_map_t::key() const { return pimpl->key(); diff --git a/eos/inline/types/class_map_impl.h b/eos/inline/types/class_map_impl.h index 22c7b41..9da5b39 100644 --- a/eos/inline/types/class_map_impl.h +++ b/eos/inline/types/class_map_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_CLASS_MAP_IMPL_H diff --git a/eos/inline/types/decap_group.h b/eos/inline/types/decap_group.h index 11504e2..b5bef91 100644 --- a/eos/inline/types/decap_group.h +++ b/eos/inline/types/decap_group.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_DECAP_GROUP_H @@ -19,38 +19,6 @@ operator<<(std::ostream& os, const decap_protocol_type_t & enum_val) { } -// Default constructor, sets NULL protocol type. -decap_group_t::decap_group_t() { - pimpl = std::shared_ptr( - new decap_group_impl_t() - ); -} -decap_group_t::decap_group_t(std::string const & group_name, - ip_addr_t const & destination_addr, - decap_protocol_type_t protocol_type) { - pimpl = std::shared_ptr( - new decap_group_impl_t( - group_name, - destination_addr, - protocol_type - ) - ); -} -decap_group_t::decap_group_t( - const decap_group_t& other) -{ - pimpl = std::make_unique( - decap_group_impl_t(*other.pimpl)); -} -decap_group_t& -decap_group_t::operator=( - decap_group_t const & other) -{ - pimpl = std::shared_ptr( - new decap_group_impl_t(*other.pimpl)); - return *this; -} - std::string decap_group_t::group_name() const { return pimpl->group_name(); diff --git a/eos/inline/types/decap_group_impl.h b/eos/inline/types/decap_group_impl.h index 22e063d..5887246 100644 --- a/eos/inline/types/decap_group_impl.h +++ b/eos/inline/types/decap_group_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_DECAP_GROUP_IMPL_H diff --git a/eos/inline/types/directflow.h b/eos/inline/types/directflow.h index 2d22bc4..d1622ba 100644 --- a/eos/inline/types/directflow.h +++ b/eos/inline/types/directflow.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_DIRECTFLOW_H @@ -57,26 +57,6 @@ operator<<(std::ostream& os, const flow_match_field_set_t& obj) { -flow_match_t::flow_match_t() { - pimpl = std::shared_ptr( - new flow_match_impl_t() - ); -} -flow_match_t::flow_match_t( - const flow_match_t& other) -{ - pimpl = std::make_unique( - flow_match_impl_t(*other.pimpl)); -} -flow_match_t& -flow_match_t::operator=( - flow_match_t const & other) -{ - pimpl = std::shared_ptr( - new flow_match_impl_t(*other.pimpl)); - return *this; -} - flow_match_field_set_t flow_match_t::match_field_set() const { return pimpl->match_field_set(); @@ -290,26 +270,6 @@ operator<<(std::ostream& os, const flow_action_set_t& obj) { -flow_action_t::flow_action_t() { - pimpl = std::shared_ptr( - new flow_action_impl_t() - ); -} -flow_action_t::flow_action_t( - const flow_action_t& other) -{ - pimpl = std::make_unique( - flow_action_impl_t(*other.pimpl)); -} -flow_action_t& -flow_action_t::operator=( - flow_action_t const & other) -{ - pimpl = std::shared_ptr( - new flow_action_impl_t(*other.pimpl)); - return *this; -} - flow_action_set_t flow_action_t::action_set() const { return pimpl->action_set(); @@ -408,37 +368,6 @@ operator<<(std::ostream& os, const flow_action_t& obj) { } -flow_entry_t::flow_entry_t() { - pimpl = std::shared_ptr( - new flow_entry_impl_t() - ); -} -flow_entry_t::flow_entry_t(std::string const & name, flow_match_t match, - flow_action_t action, flow_priority_t priority) { - pimpl = std::shared_ptr( - new flow_entry_impl_t( - name, - match, - action, - priority - ) - ); -} -flow_entry_t::flow_entry_t( - const flow_entry_t& other) -{ - pimpl = std::make_unique( - flow_entry_impl_t(*other.pimpl)); -} -flow_entry_t& -flow_entry_t::operator=( - flow_entry_t const & other) -{ - pimpl = std::shared_ptr( - new flow_entry_impl_t(*other.pimpl)); - return *this; -} - std::string flow_entry_t::name() const { return pimpl->name(); @@ -481,26 +410,6 @@ operator<<(std::ostream& os, const flow_entry_t& obj) { } -flow_counters_t::flow_counters_t() { - pimpl = std::shared_ptr( - new flow_counters_impl_t() - ); -} -flow_counters_t::flow_counters_t( - const flow_counters_t& other) -{ - pimpl = std::make_unique( - flow_counters_impl_t(*other.pimpl)); -} -flow_counters_t& -flow_counters_t::operator=( - flow_counters_t const & other) -{ - pimpl = std::shared_ptr( - new flow_counters_impl_t(*other.pimpl)); - return *this; -} - uint64_t flow_counters_t::bytes() const { return pimpl->bytes(); diff --git a/eos/inline/types/directflow_impl.h b/eos/inline/types/directflow_impl.h index d6a6c6e..58bdd76 100644 --- a/eos/inline/types/directflow_impl.h +++ b/eos/inline/types/directflow_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_DIRECTFLOW_IMPL_H diff --git a/eos/inline/types/eapi.h b/eos/inline/types/eapi.h index 0ceb6c1..0457177 100644 --- a/eos/inline/types/eapi.h +++ b/eos/inline/types/eapi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_EAPI_H @@ -6,38 +6,6 @@ namespace eos { -eapi_response_t::eapi_response_t() { - pimpl = std::shared_ptr( - new eapi_response_impl_t() - ); -} -eapi_response_t::eapi_response_t(bool success, uint32_t error_code, - std::string const & error_message, - std::vector const & responses) { - pimpl = std::shared_ptr( - new eapi_response_impl_t( - success, - error_code, - error_message, - responses - ) - ); -} -eapi_response_t::eapi_response_t( - const eapi_response_t& other) -{ - pimpl = std::make_unique( - eapi_response_impl_t(*other.pimpl)); -} -eapi_response_t& -eapi_response_t::operator=( - eapi_response_t const & other) -{ - pimpl = std::shared_ptr( - new eapi_response_impl_t(*other.pimpl)); - return *this; -} - bool eapi_response_t::success() const { return pimpl->success(); diff --git a/eos/inline/types/eapi_impl.h b/eos/inline/types/eapi_impl.h index 2cc1f45..8e5d469 100644 --- a/eos/inline/types/eapi_impl.h +++ b/eos/inline/types/eapi_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_EAPI_IMPL_H diff --git a/eos/inline/types/eth.h b/eos/inline/types/eth.h index 1c1a784..c028c61 100644 --- a/eos/inline/types/eth.h +++ b/eos/inline/types/eth.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ETH_H diff --git a/eos/inline/types/eth_impl.h b/eos/inline/types/eth_impl.h index 04fd543..ed04b7c 100644 --- a/eos/inline/types/eth_impl.h +++ b/eos/inline/types/eth_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ETH_IMPL_H diff --git a/eos/inline/types/eth_intf.h b/eos/inline/types/eth_intf.h index 61d0183..3dc6e19 100644 --- a/eos/inline/types/eth_intf.h +++ b/eos/inline/types/eth_intf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ETH_INTF_H diff --git a/eos/inline/types/eth_intf_impl.h b/eos/inline/types/eth_intf_impl.h index 08379aa..ec9c8f6 100644 --- a/eos/inline/types/eth_intf_impl.h +++ b/eos/inline/types/eth_intf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ETH_INTF_IMPL_H diff --git a/eos/inline/types/eth_lag_intf.h b/eos/inline/types/eth_lag_intf.h index 2eaa201..2bf59b2 100644 --- a/eos/inline/types/eth_lag_intf.h +++ b/eos/inline/types/eth_lag_intf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ETH_LAG_INTF_H @@ -78,40 +78,6 @@ operator<<(std::ostream& os, const eth_lag_intf_member_lacp_timeout_t & enum_val } -// Default constructor. -eth_lag_intf_membership_t::eth_lag_intf_membership_t() { - pimpl = std::shared_ptr( - new eth_lag_intf_membership_impl_t() - ); -} -eth_lag_intf_membership_t::eth_lag_intf_membership_t( - intf_id_t eth_lag_intf_id, bool active, std::string const & reason, - double member_time, eth_lag_intf_member_lacp_mode_t mode) { - pimpl = std::shared_ptr( - new eth_lag_intf_membership_impl_t( - eth_lag_intf_id, - active, - reason, - member_time, - mode - ) - ); -} -eth_lag_intf_membership_t::eth_lag_intf_membership_t( - const eth_lag_intf_membership_t& other) -{ - pimpl = std::make_unique( - eth_lag_intf_membership_impl_t(*other.pimpl)); -} -eth_lag_intf_membership_t& -eth_lag_intf_membership_t::operator=( - eth_lag_intf_membership_t const & other) -{ - pimpl = std::shared_ptr( - new eth_lag_intf_membership_impl_t(*other.pimpl)); - return *this; -} - intf_id_t eth_lag_intf_membership_t::eth_lag_intf_id() const { return pimpl->eth_lag_intf_id(); @@ -173,48 +139,6 @@ operator<<(std::ostream& os, const eth_lag_intf_membership_t& obj) { } -// Default constructor. -eth_lag_intf_t::eth_lag_intf_t() { - pimpl = std::shared_ptr( - new eth_lag_intf_impl_t() - ); -} -eth_lag_intf_t::eth_lag_intf_t(intf_id_t intf) { - pimpl = std::shared_ptr( - new eth_lag_intf_impl_t( - intf - ) - ); -} -eth_lag_intf_t::eth_lag_intf_t(intf_id_t intf, uint32_t min_links, - uint64_t speed, - eth_lag_intf_fallback_type_t fallback_type, - uint16_t fallback_timeout) { - pimpl = std::shared_ptr( - new eth_lag_intf_impl_t( - intf, - min_links, - speed, - fallback_type, - fallback_timeout - ) - ); -} -eth_lag_intf_t::eth_lag_intf_t( - const eth_lag_intf_t& other) -{ - pimpl = std::make_unique( - eth_lag_intf_impl_t(*other.pimpl)); -} -eth_lag_intf_t& -eth_lag_intf_t::operator=( - eth_lag_intf_t const & other) -{ - pimpl = std::shared_ptr( - new eth_lag_intf_impl_t(*other.pimpl)); - return *this; -} - intf_id_t eth_lag_intf_t::intf() const { return pimpl->intf(); diff --git a/eos/inline/types/eth_lag_intf_impl.h b/eos/inline/types/eth_lag_intf_impl.h index b2de141..91d286f 100644 --- a/eos/inline/types/eth_lag_intf_impl.h +++ b/eos/inline/types/eth_lag_intf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ETH_LAG_INTF_IMPL_H diff --git a/eos/inline/types/eth_phy_intf.h b/eos/inline/types/eth_phy_intf.h index 60c1e9d..81ea581 100644 --- a/eos/inline/types/eth_phy_intf.h +++ b/eos/inline/types/eth_phy_intf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ETH_PHY_INTF_H @@ -45,61 +45,6 @@ operator<<(std::ostream& os, const eth_link_speed_t & enum_val) { } -// Default constructor. -eth_phy_intf_counters_t::eth_phy_intf_counters_t() { - pimpl = std::shared_ptr( - new eth_phy_intf_counters_impl_t() - ); -} -eth_phy_intf_counters_t::eth_phy_intf_counters_t( - uint64_t single_collision_frames, uint64_t multiple_collision_frames, - uint64_t fcs_errors, uint64_t alignment_errors, - uint64_t deferred_transmissions, uint64_t late_collisions, - uint64_t excessive_collisions, uint64_t internal_mac_transmit_errors, - uint64_t carrier_sense_errors, uint64_t internal_mac_receive_errors, - uint64_t frame_too_shorts, uint64_t frame_too_longs, - uint64_t sqe_test_errors, uint64_t symbol_errors, - uint64_t in_unknown_opcodes, uint64_t out_pause_frames, - uint64_t in_pause_frames, uint64_t fragments, uint64_t jabbers) { - pimpl = std::shared_ptr( - new eth_phy_intf_counters_impl_t( - single_collision_frames, - multiple_collision_frames, - fcs_errors, - alignment_errors, - deferred_transmissions, - late_collisions, - excessive_collisions, - internal_mac_transmit_errors, - carrier_sense_errors, - internal_mac_receive_errors, - frame_too_shorts, - frame_too_longs, - sqe_test_errors, - symbol_errors, - in_unknown_opcodes, - out_pause_frames, - in_pause_frames, - fragments, - jabbers - ) - ); -} -eth_phy_intf_counters_t::eth_phy_intf_counters_t( - const eth_phy_intf_counters_t& other) -{ - pimpl = std::make_unique( - eth_phy_intf_counters_impl_t(*other.pimpl)); -} -eth_phy_intf_counters_t& -eth_phy_intf_counters_t::operator=( - eth_phy_intf_counters_t const & other) -{ - pimpl = std::shared_ptr( - new eth_phy_intf_counters_impl_t(*other.pimpl)); - return *this; -} - uint64_t eth_phy_intf_counters_t::single_collision_frames() const { return pimpl->single_collision_frames(); @@ -202,57 +147,6 @@ operator<<(std::ostream& os, const eth_phy_intf_counters_t& obj) { } -// Default constructor. -eth_phy_intf_bin_counters_t::eth_phy_intf_bin_counters_t() { - pimpl = std::shared_ptr( - new eth_phy_intf_bin_counters_impl_t() - ); -} -eth_phy_intf_bin_counters_t::eth_phy_intf_bin_counters_t( - uint64_t in_64_octet_frames, uint64_t in_65_to_127_octet_frames, - uint64_t in_128_to_255_octet_frames, uint64_t in_256_to_511_octet_frames, - uint64_t in_512_to_1023_octet_frames, - uint64_t in_1024_to_1522_octet_frames, - uint64_t in_1523_to_max_octet_frames, uint64_t out_64_octet_frames, - uint64_t out_65_to_127_octet_frames, uint64_t out_128_to_255_octet_frames, - uint64_t out_256_to_511_octet_frames, - uint64_t out_512_to_1023_octet_frames, - uint64_t out_1024_to_1522_octet_frames, - uint64_t out_1523_to_max_octet_frames) { - pimpl = std::shared_ptr( - new eth_phy_intf_bin_counters_impl_t( - in_64_octet_frames, - in_65_to_127_octet_frames, - in_128_to_255_octet_frames, - in_256_to_511_octet_frames, - in_512_to_1023_octet_frames, - in_1024_to_1522_octet_frames, - in_1523_to_max_octet_frames, - out_64_octet_frames, - out_65_to_127_octet_frames, - out_128_to_255_octet_frames, - out_256_to_511_octet_frames, - out_512_to_1023_octet_frames, - out_1024_to_1522_octet_frames, - out_1523_to_max_octet_frames - ) - ); -} -eth_phy_intf_bin_counters_t::eth_phy_intf_bin_counters_t( - const eth_phy_intf_bin_counters_t& other) -{ - pimpl = std::make_unique( - eth_phy_intf_bin_counters_impl_t(*other.pimpl)); -} -eth_phy_intf_bin_counters_t& -eth_phy_intf_bin_counters_t::operator=( - eth_phy_intf_bin_counters_t const & other) -{ - pimpl = std::shared_ptr( - new eth_phy_intf_bin_counters_impl_t(*other.pimpl)); - return *this; -} - uint64_t eth_phy_intf_bin_counters_t::in_64_octet_frames() const { return pimpl->in_64_octet_frames(); diff --git a/eos/inline/types/eth_phy_intf_impl.h b/eos/inline/types/eth_phy_intf_impl.h index 6dcd0e2..851befe 100644 --- a/eos/inline/types/eth_phy_intf_impl.h +++ b/eos/inline/types/eth_phy_intf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ETH_PHY_INTF_IMPL_H diff --git a/eos/inline/types/fib.h b/eos/inline/types/fib.h index 7bef23b..74debdc 100644 --- a/eos/inline/types/fib.h +++ b/eos/inline/types/fib.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_FIB_H @@ -6,34 +6,6 @@ namespace eos { -// Default constructor. -fib_route_key_t::fib_route_key_t() { - pimpl = std::shared_ptr( - new fib_route_key_impl_t() - ); -} -fib_route_key_t::fib_route_key_t(ip_prefix_t const & prefix) { - pimpl = std::shared_ptr( - new fib_route_key_impl_t( - prefix - ) - ); -} -fib_route_key_t::fib_route_key_t( - const fib_route_key_t& other) -{ - pimpl = std::make_unique( - fib_route_key_impl_t(*other.pimpl)); -} -fib_route_key_t& -fib_route_key_t::operator=( - fib_route_key_t const & other) -{ - pimpl = std::shared_ptr( - new fib_route_key_impl_t(*other.pimpl)); - return *this; -} - ip_prefix_t fib_route_key_t::prefix() const { return pimpl->prefix(); @@ -131,34 +103,6 @@ operator<<(std::ostream& os, const fib_route_type_t & enum_val) { } -// Default constructor. -fib_route_t::fib_route_t() { - pimpl = std::shared_ptr( - new fib_route_impl_t() - ); -} -fib_route_t::fib_route_t(fib_route_key_t const & route_key) { - pimpl = std::shared_ptr( - new fib_route_impl_t( - route_key - ) - ); -} -fib_route_t::fib_route_t( - const fib_route_t& other) -{ - pimpl = std::make_unique( - fib_route_impl_t(*other.pimpl)); -} -fib_route_t& -fib_route_t::operator=( - fib_route_t const & other) -{ - pimpl = std::shared_ptr( - new fib_route_impl_t(*other.pimpl)); - return *this; -} - fib_route_key_t fib_route_t::route_key() const { return pimpl->route_key(); @@ -225,34 +169,6 @@ operator<<(std::ostream& os, const fib_route_t& obj) { } -// Default constructor. -fib_fec_key_t::fib_fec_key_t() { - pimpl = std::shared_ptr( - new fib_fec_key_impl_t() - ); -} -fib_fec_key_t::fib_fec_key_t(uint64_t fec_id) { - pimpl = std::shared_ptr( - new fib_fec_key_impl_t( - fec_id - ) - ); -} -fib_fec_key_t::fib_fec_key_t( - const fib_fec_key_t& other) -{ - pimpl = std::make_unique( - fib_fec_key_impl_t(*other.pimpl)); -} -fib_fec_key_t& -fib_fec_key_t::operator=( - fib_fec_key_t const & other) -{ - pimpl = std::shared_ptr( - new fib_fec_key_impl_t(*other.pimpl)); - return *this; -} - uint64_t fib_fec_key_t::fec_id() const { return pimpl->fec_id(); @@ -287,35 +203,6 @@ operator<<(std::ostream& os, const fib_fec_key_t& obj) { } -// Default constructor. -fib_via_t::fib_via_t() { - pimpl = std::shared_ptr( - new fib_via_impl_t() - ); -} -fib_via_t::fib_via_t(ip_addr_t const & hop, intf_id_t intf) { - pimpl = std::shared_ptr( - new fib_via_impl_t( - hop, - intf - ) - ); -} -fib_via_t::fib_via_t( - const fib_via_t& other) -{ - pimpl = std::make_unique( - fib_via_impl_t(*other.pimpl)); -} -fib_via_t& -fib_via_t::operator=( - fib_via_t const & other) -{ - pimpl = std::shared_ptr( - new fib_via_impl_t(*other.pimpl)); - return *this; -} - ip_addr_t fib_via_t::hop() const { return pimpl->hop(); @@ -391,34 +278,6 @@ operator<<(std::ostream& os, const fib_fec_type_t & enum_val) { } -// Default constructor. -fib_fec_t::fib_fec_t() { - pimpl = std::shared_ptr( - new fib_fec_impl_t() - ); -} -fib_fec_t::fib_fec_t(fib_fec_key_t fec_key) { - pimpl = std::shared_ptr( - new fib_fec_impl_t( - fec_key - ) - ); -} -fib_fec_t::fib_fec_t( - const fib_fec_t& other) -{ - pimpl = std::make_unique( - fib_fec_impl_t(*other.pimpl)); -} -fib_fec_t& -fib_fec_t::operator=( - fib_fec_t const & other) -{ - pimpl = std::shared_ptr( - new fib_fec_impl_t(*other.pimpl)); - return *this; -} - fib_fec_key_t fib_fec_t::fec_key() const { return pimpl->fec_key(); diff --git a/eos/inline/types/fib_impl.h b/eos/inline/types/fib_impl.h index eb0e07a..b596b3a 100644 --- a/eos/inline/types/fib_impl.h +++ b/eos/inline/types/fib_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_FIB_IMPL_H diff --git a/eos/inline/types/hardware_table.h b/eos/inline/types/hardware_table.h index a58aeeb..9a114a7 100644 --- a/eos/inline/types/hardware_table.h +++ b/eos/inline/types/hardware_table.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_HARDWARE_TABLE_H @@ -6,53 +6,6 @@ namespace eos { -hardware_table_key_t::hardware_table_key_t() { - pimpl = std::shared_ptr( - new hardware_table_key_impl_t() - ); -} -hardware_table_key_t::hardware_table_key_t(std::string const & table_name, - std::string const & feature, - std::string const & chip) { - pimpl = std::shared_ptr( - new hardware_table_key_impl_t( - table_name, - feature, - chip - ) - ); -} -hardware_table_key_t::hardware_table_key_t(std::string const & table_name, - std::string const & feature) { - pimpl = std::shared_ptr( - new hardware_table_key_impl_t( - table_name, - feature - ) - ); -} -hardware_table_key_t::hardware_table_key_t(std::string const & table_name) { - pimpl = std::shared_ptr( - new hardware_table_key_impl_t( - table_name - ) - ); -} -hardware_table_key_t::hardware_table_key_t( - const hardware_table_key_t& other) -{ - pimpl = std::make_unique( - hardware_table_key_impl_t(*other.pimpl)); -} -hardware_table_key_t& -hardware_table_key_t::operator=( - hardware_table_key_t const & other) -{ - pimpl = std::shared_ptr( - new hardware_table_key_impl_t(*other.pimpl)); - return *this; -} - std::string hardware_table_key_t::table_name() const { return pimpl->table_name(); @@ -95,35 +48,6 @@ operator<<(std::ostream& os, const hardware_table_key_t& obj) { } -hardware_table_high_watermark_t::hardware_table_high_watermark_t() { - pimpl = std::shared_ptr( - new hardware_table_high_watermark_impl_t() - ); -} -hardware_table_high_watermark_t::hardware_table_high_watermark_t( - uint32_t max_entries, time_t timestamp) { - pimpl = std::shared_ptr( - new hardware_table_high_watermark_impl_t( - max_entries, - timestamp - ) - ); -} -hardware_table_high_watermark_t::hardware_table_high_watermark_t( - const hardware_table_high_watermark_t& other) -{ - pimpl = std::make_unique( - hardware_table_high_watermark_impl_t(*other.pimpl)); -} -hardware_table_high_watermark_t& -hardware_table_high_watermark_t::operator=( - hardware_table_high_watermark_t const & other) -{ - pimpl = std::shared_ptr( - new hardware_table_high_watermark_impl_t(*other.pimpl)); - return *this; -} - uint32_t hardware_table_high_watermark_t::max_entries() const { return pimpl->max_entries(); @@ -165,37 +89,6 @@ operator<<(std::ostream& os, const hardware_table_high_watermark_t& obj) { } -hardware_table_usage_t::hardware_table_usage_t() { - pimpl = std::shared_ptr( - new hardware_table_usage_impl_t() - ); -} -hardware_table_usage_t::hardware_table_usage_t(uint32_t used_entries, - uint32_t free_entries, - uint32_t committed_entries) { - pimpl = std::shared_ptr( - new hardware_table_usage_impl_t( - used_entries, - free_entries, - committed_entries - ) - ); -} -hardware_table_usage_t::hardware_table_usage_t( - const hardware_table_usage_t& other) -{ - pimpl = std::make_unique( - hardware_table_usage_impl_t(*other.pimpl)); -} -hardware_table_usage_t& -hardware_table_usage_t::operator=( - hardware_table_usage_t const & other) -{ - pimpl = std::shared_ptr( - new hardware_table_usage_impl_t(*other.pimpl)); - return *this; -} - uint32_t hardware_table_usage_t::used_entries() const { return pimpl->used_entries(); @@ -238,37 +131,6 @@ operator<<(std::ostream& os, const hardware_table_usage_t& obj) { } -hardware_table_entry_t::hardware_table_entry_t() { - pimpl = std::shared_ptr( - new hardware_table_entry_impl_t() - ); -} -hardware_table_entry_t::hardware_table_entry_t( - hardware_table_usage_t const & usage, uint32_t max_entries, - hardware_table_high_watermark_t const & high_watermark) { - pimpl = std::shared_ptr( - new hardware_table_entry_impl_t( - usage, - max_entries, - high_watermark - ) - ); -} -hardware_table_entry_t::hardware_table_entry_t( - const hardware_table_entry_t& other) -{ - pimpl = std::make_unique( - hardware_table_entry_impl_t(*other.pimpl)); -} -hardware_table_entry_t& -hardware_table_entry_t::operator=( - hardware_table_entry_t const & other) -{ - pimpl = std::shared_ptr( - new hardware_table_entry_impl_t(*other.pimpl)); - return *this; -} - hardware_table_usage_t hardware_table_entry_t::usage() const { return pimpl->usage(); diff --git a/eos/inline/types/hardware_table_impl.h b/eos/inline/types/hardware_table_impl.h index 6a9d44f..75a6fe9 100644 --- a/eos/inline/types/hardware_table_impl.h +++ b/eos/inline/types/hardware_table_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_HARDWARE_TABLE_IMPL_H diff --git a/eos/inline/types/intf.h b/eos/inline/types/intf.h index cc073cc..86412c0 100644 --- a/eos/inline/types/intf.h +++ b/eos/inline/types/intf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_INTF_H @@ -92,55 +92,6 @@ operator<<(std::ostream& os, const intf_id_t& obj) { -// Default constructor. -intf_counters_t::intf_counters_t() { - pimpl = std::shared_ptr( - new intf_counters_impl_t() - ); -} -intf_counters_t::intf_counters_t(uint64_t out_ucast_pkts, - uint64_t out_multicast_pkts, - uint64_t out_broadcast_pkts, - uint64_t in_ucast_pkts, - uint64_t in_multicast_pkts, - uint64_t in_broadcast_pkts, - uint64_t out_octets, uint64_t in_octets, - uint64_t out_discards, uint64_t out_errors, - uint64_t in_discards, uint64_t in_errors, - seconds_t sample_time) { - pimpl = std::shared_ptr( - new intf_counters_impl_t( - out_ucast_pkts, - out_multicast_pkts, - out_broadcast_pkts, - in_ucast_pkts, - in_multicast_pkts, - in_broadcast_pkts, - out_octets, - in_octets, - out_discards, - out_errors, - in_discards, - in_errors, - sample_time - ) - ); -} -intf_counters_t::intf_counters_t( - const intf_counters_t& other) -{ - pimpl = std::make_unique( - intf_counters_impl_t(*other.pimpl)); -} -intf_counters_t& -intf_counters_t::operator=( - intf_counters_t const & other) -{ - pimpl = std::shared_ptr( - new intf_counters_impl_t(*other.pimpl)); - return *this; -} - uint64_t intf_counters_t::out_ucast_pkts() const { return pimpl->out_ucast_pkts(); @@ -219,42 +170,6 @@ operator<<(std::ostream& os, const intf_counters_t& obj) { } -// Default constructor. -intf_traffic_rates_t::intf_traffic_rates_t() { - pimpl = std::shared_ptr( - new intf_traffic_rates_impl_t() - ); -} -intf_traffic_rates_t::intf_traffic_rates_t(double out_pkts_rate, - double in_pkts_rate, - double out_bits_rate, - double in_bits_rate, - seconds_t sample_time) { - pimpl = std::shared_ptr( - new intf_traffic_rates_impl_t( - out_pkts_rate, - in_pkts_rate, - out_bits_rate, - in_bits_rate, - sample_time - ) - ); -} -intf_traffic_rates_t::intf_traffic_rates_t( - const intf_traffic_rates_t& other) -{ - pimpl = std::make_unique( - intf_traffic_rates_impl_t(*other.pimpl)); -} -intf_traffic_rates_t& -intf_traffic_rates_t::operator=( - intf_traffic_rates_t const & other) -{ - pimpl = std::shared_ptr( - new intf_traffic_rates_impl_t(*other.pimpl)); - return *this; -} - double intf_traffic_rates_t::out_pkts_rate() const { return pimpl->out_pkts_rate(); diff --git a/eos/inline/types/intf_impl.h b/eos/inline/types/intf_impl.h index ecfea28..6d813a0 100644 --- a/eos/inline/types/intf_impl.h +++ b/eos/inline/types/intf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_INTF_IMPL_H diff --git a/eos/inline/types/ip.h b/eos/inline/types/ip.h index 04ef9f1..ad7bf81 100644 --- a/eos/inline/types/ip.h +++ b/eos/inline/types/ip.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_IP_H @@ -251,34 +251,6 @@ operator<<(std::ostream& os, const ip_prefix_t& obj) { -ip_addr_mask_t::ip_addr_mask_t() { - pimpl = std::shared_ptr( - new ip_addr_mask_impl_t() - ); -} -ip_addr_mask_t::ip_addr_mask_t(ip_addr_t const & addr, uint8_t mask_length) { - pimpl = std::shared_ptr( - new ip_addr_mask_impl_t( - addr, - mask_length - ) - ); -} -ip_addr_mask_t::ip_addr_mask_t( - const ip_addr_mask_t& other) -{ - pimpl = std::make_unique( - ip_addr_mask_impl_t(*other.pimpl)); -} -ip_addr_mask_t& -ip_addr_mask_t::operator=( - ip_addr_mask_t const & other) -{ - pimpl = std::shared_ptr( - new ip_addr_mask_impl_t(*other.pimpl)); - return *this; -} - ip_addr_t ip_addr_mask_t::addr() const { return pimpl->addr(); diff --git a/eos/inline/types/ip_impl.h b/eos/inline/types/ip_impl.h index 8909b87..be5e716 100644 --- a/eos/inline/types/ip_impl.h +++ b/eos/inline/types/ip_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_IP_IMPL_H diff --git a/eos/inline/types/ip_route.h b/eos/inline/types/ip_route.h index a37a3c0..67f7589 100644 --- a/eos/inline/types/ip_route.h +++ b/eos/inline/types/ip_route.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_IP_ROUTE_H @@ -23,42 +23,6 @@ operator<<(std::ostream& os, const ip_route_action_t & enum_val) { } -ip_route_key_t::ip_route_key_t() { - pimpl = std::shared_ptr( - new ip_route_key_impl_t() - ); -} -ip_route_key_t::ip_route_key_t(ip_prefix_t const & prefix) { - pimpl = std::shared_ptr( - new ip_route_key_impl_t( - prefix - ) - ); -} -ip_route_key_t::ip_route_key_t(ip_prefix_t const & prefix, - ip_route_preference_t preference) { - pimpl = std::shared_ptr( - new ip_route_key_impl_t( - prefix, - preference - ) - ); -} -ip_route_key_t::ip_route_key_t( - const ip_route_key_t& other) -{ - pimpl = std::make_unique( - ip_route_key_impl_t(*other.pimpl)); -} -ip_route_key_t& -ip_route_key_t::operator=( - ip_route_key_t const & other) -{ - pimpl = std::shared_ptr( - new ip_route_key_impl_t(*other.pimpl)); - return *this; -} - ip_prefix_t ip_route_key_t::prefix() const { return pimpl->prefix(); @@ -75,6 +39,10 @@ void ip_route_key_t::preference_is(ip_route_preference_t preference) { pimpl->preference_is(preference); } +af_t +ip_route_key_t::af() const { + return pimpl->af(); +} bool ip_route_key_t::operator==(ip_route_key_t const & other) const { return pimpl->operator==(*other.pimpl); @@ -101,33 +69,6 @@ operator<<(std::ostream& os, const ip_route_key_t& obj) { } -ip_route_t::ip_route_t() { - pimpl = std::shared_ptr( - new ip_route_impl_t() - ); -} -ip_route_t::ip_route_t(ip_route_key_t const & key) { - pimpl = std::shared_ptr( - new ip_route_impl_t( - key - ) - ); -} -ip_route_t::ip_route_t( - const ip_route_t& other) -{ - pimpl = std::make_unique( - ip_route_impl_t(*other.pimpl)); -} -ip_route_t& -ip_route_t::operator=( - ip_route_t const & other) -{ - pimpl = std::shared_ptr( - new ip_route_impl_t(*other.pimpl)); - return *this; -} - ip_route_key_t ip_route_t::key() const { return pimpl->key(); @@ -160,6 +101,10 @@ void ip_route_t::command_tag_is(std::string const & command_tag) { pimpl->command_tag_is(command_tag); } +af_t +ip_route_t::af() const { + return pimpl->af(); +} bool ip_route_t::operator==(ip_route_t const & other) const { return pimpl->operator==(*other.pimpl); @@ -186,33 +131,6 @@ operator<<(std::ostream& os, const ip_route_t& obj) { } -ip_route_via_t::ip_route_via_t() { - pimpl = std::shared_ptr( - new ip_route_via_impl_t() - ); -} -ip_route_via_t::ip_route_via_t(ip_route_key_t const & route_key) { - pimpl = std::shared_ptr( - new ip_route_via_impl_t( - route_key - ) - ); -} -ip_route_via_t::ip_route_via_t( - const ip_route_via_t& other) -{ - pimpl = std::make_unique( - ip_route_via_impl_t(*other.pimpl)); -} -ip_route_via_t& -ip_route_via_t::operator=( - ip_route_via_t const & other) -{ - pimpl = std::shared_ptr( - new ip_route_via_impl_t(*other.pimpl)); - return *this; -} - ip_route_key_t ip_route_via_t::route_key() const { return pimpl->route_key(); diff --git a/eos/inline/types/ip_route_impl.h b/eos/inline/types/ip_route_impl.h index 6e7f714..0638689 100644 --- a/eos/inline/types/ip_route_impl.h +++ b/eos/inline/types/ip_route_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_IP_ROUTE_IMPL_H @@ -41,6 +41,11 @@ ip_route_key_impl_t::preference_is(ip_route_preference_t preference) { preference_ = preference; } +af_t +ip_route_key_impl_t::af() const { + return prefix_.af(); +} + bool ip_route_key_impl_t::operator==(ip_route_key_impl_t const & other) const { return prefix_ == other.prefix_ && @@ -131,6 +136,11 @@ ip_route_impl_t::command_tag_is(std::string const & command_tag) { command_tag_ = command_tag; } +af_t +ip_route_impl_t::af() const { + return key_.af(); +} + bool ip_route_impl_t::operator==(ip_route_impl_t const & other) const { return key_ == other.key_ && diff --git a/eos/inline/types/lldp.h b/eos/inline/types/lldp.h index d947a48..5d4dba0 100644 --- a/eos/inline/types/lldp.h +++ b/eos/inline/types/lldp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_LLDP_H @@ -8,36 +8,6 @@ namespace eos { -// TLV Type, default constructor. -lldp_tlv_type_t::lldp_tlv_type_t() { - pimpl = std::shared_ptr( - new lldp_tlv_type_impl_t() - ); -} -// TLV Type, full constructor. -lldp_tlv_type_t::lldp_tlv_type_t(uint32_t organization, uint8_t subtype) { - pimpl = std::shared_ptr( - new lldp_tlv_type_impl_t( - organization, - subtype - ) - ); -} -lldp_tlv_type_t::lldp_tlv_type_t( - const lldp_tlv_type_t& other) -{ - pimpl = std::make_unique( - lldp_tlv_type_impl_t(*other.pimpl)); -} -lldp_tlv_type_t& -lldp_tlv_type_t::operator=( - lldp_tlv_type_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_tlv_type_impl_t(*other.pimpl)); - return *this; -} - uint32_t lldp_tlv_type_t::organization() const { return pimpl->organization(); @@ -115,26 +85,6 @@ operator<<(std::ostream& os, const lldp_std_tlv_type_bit_t & enum_val) { } -lldp_std_tlv_type_t::lldp_std_tlv_type_t() { - pimpl = std::shared_ptr( - new lldp_std_tlv_type_impl_t() - ); -} -lldp_std_tlv_type_t::lldp_std_tlv_type_t( - const lldp_std_tlv_type_t& other) -{ - pimpl = std::make_unique( - lldp_std_tlv_type_impl_t(*other.pimpl)); -} -lldp_std_tlv_type_t& -lldp_std_tlv_type_t::operator=( - lldp_std_tlv_type_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_std_tlv_type_impl_t(*other.pimpl)); - return *this; -} - void lldp_std_tlv_type_t::chassis_id_is(bool enabled) { pimpl->chassis_id_is(enabled); @@ -258,34 +208,6 @@ operator<<(std::ostream& os, const lldp_syscap_bits_t & enum_val) { } -lldp_syscap_t::lldp_syscap_t() { - pimpl = std::shared_ptr( - new lldp_syscap_impl_t() - ); -} -// syscap, full constructor. -lldp_syscap_t::lldp_syscap_t(lldp_syscap_bits_t bitset) { - pimpl = std::shared_ptr( - new lldp_syscap_impl_t( - bitset - ) - ); -} -lldp_syscap_t::lldp_syscap_t( - const lldp_syscap_t& other) -{ - pimpl = std::make_unique( - lldp_syscap_impl_t(*other.pimpl)); -} -lldp_syscap_t& -lldp_syscap_t::operator=( - lldp_syscap_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_syscap_impl_t(*other.pimpl)); - return *this; -} - bool lldp_syscap_t::other() const { return pimpl->other(); @@ -336,39 +258,6 @@ operator<<(std::ostream& os, const lldp_syscap_t& obj) { } -lldp_management_address_t::lldp_management_address_t() { - pimpl = std::shared_ptr( - new lldp_management_address_impl_t() - ); -} -// Managment Info constructor. -lldp_management_address_t::lldp_management_address_t( - uint32_t address_family, std::string address, uint32_t snmp_ifindex, - std::string oid) { - pimpl = std::shared_ptr( - new lldp_management_address_impl_t( - address_family, - address, - snmp_ifindex, - oid - ) - ); -} -lldp_management_address_t::lldp_management_address_t( - const lldp_management_address_t& other) -{ - pimpl = std::make_unique( - lldp_management_address_impl_t(*other.pimpl)); -} -lldp_management_address_t& -lldp_management_address_t::operator=( - lldp_management_address_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_management_address_impl_t(*other.pimpl)); - return *this; -} - uint32_t lldp_management_address_t::address_family() const { return pimpl->address_family(); @@ -408,38 +297,6 @@ operator<<(std::ostream& os, const lldp_management_address_t& obj) { } -lldp_lacp_t::lldp_lacp_t() { - pimpl = std::shared_ptr( - new lldp_lacp_impl_t() - ); -} -// LACP Info constructor. -lldp_lacp_t::lldp_lacp_t(bool capable, bool enabled, uint32_t id, - bool valid) { - pimpl = std::shared_ptr( - new lldp_lacp_impl_t( - capable, - enabled, - id, - valid - ) - ); -} -lldp_lacp_t::lldp_lacp_t( - const lldp_lacp_t& other) -{ - pimpl = std::make_unique( - lldp_lacp_impl_t(*other.pimpl)); -} -lldp_lacp_t& -lldp_lacp_t::operator=( - lldp_lacp_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_lacp_impl_t(*other.pimpl)); - return *this; -} - bool lldp_lacp_t::capable() const { return pimpl->capable(); @@ -478,38 +335,6 @@ operator<<(std::ostream& os, const lldp_lacp_t& obj) { } -lldp_phy_t::lldp_phy_t() { - pimpl = std::shared_ptr( - new lldp_phy_impl_t() - ); -} -// PHY Info constructor. -lldp_phy_t::lldp_phy_t(bool autonegSupported, bool autonegEnabled, - uint16_t autonegCapabilitiesBm, bool valid) { - pimpl = std::shared_ptr( - new lldp_phy_impl_t( - autonegSupported, - autonegEnabled, - autonegCapabilitiesBm, - valid - ) - ); -} -lldp_phy_t::lldp_phy_t( - const lldp_phy_t& other) -{ - pimpl = std::make_unique( - lldp_phy_impl_t(*other.pimpl)); -} -lldp_phy_t& -lldp_phy_t::operator=( - lldp_phy_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_phy_impl_t(*other.pimpl)); - return *this; -} - bool lldp_phy_t::autonegSupported() const { return pimpl->autonegSupported(); @@ -590,36 +415,6 @@ operator<<(std::ostream& os, const lldp_chassis_id_encoding_t & enum_val) { } -lldp_chassis_id_t::lldp_chassis_id_t() { - pimpl = std::shared_ptr( - new lldp_chassis_id_impl_t() - ); -} -// chassis name, full constructor. -lldp_chassis_id_t::lldp_chassis_id_t(lldp_chassis_id_encoding_t encoding, - std::string value) { - pimpl = std::shared_ptr( - new lldp_chassis_id_impl_t( - encoding, - value - ) - ); -} -lldp_chassis_id_t::lldp_chassis_id_t( - const lldp_chassis_id_t& other) -{ - pimpl = std::make_unique( - lldp_chassis_id_impl_t(*other.pimpl)); -} -lldp_chassis_id_t& -lldp_chassis_id_t::operator=( - lldp_chassis_id_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_chassis_id_impl_t(*other.pimpl)); - return *this; -} - lldp_chassis_id_encoding_t lldp_chassis_id_t::encoding() const { return pimpl->encoding(); @@ -689,36 +484,6 @@ operator<<(std::ostream& os, const lldp_intf_id_encoding_t & enum_val) { } -lldp_intf_id_t::lldp_intf_id_t() { - pimpl = std::shared_ptr( - new lldp_intf_id_impl_t() - ); -} -// interface name, full constructor. -lldp_intf_id_t::lldp_intf_id_t(lldp_intf_id_encoding_t encoding, - std::string value) { - pimpl = std::shared_ptr( - new lldp_intf_id_impl_t( - encoding, - value - ) - ); -} -lldp_intf_id_t::lldp_intf_id_t( - const lldp_intf_id_t& other) -{ - pimpl = std::make_unique( - lldp_intf_id_impl_t(*other.pimpl)); -} -lldp_intf_id_t& -lldp_intf_id_t::operator=( - lldp_intf_id_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_intf_id_impl_t(*other.pimpl)); - return *this; -} - lldp_intf_id_encoding_t lldp_intf_id_t::encoding() const { return pimpl->encoding(); @@ -761,37 +526,6 @@ operator<<(std::ostream& os, const lldp_intf_id_t& obj) { } -// remote system, default constructor. -lldp_remote_system_t::lldp_remote_system_t() { - pimpl = std::shared_ptr( - new lldp_remote_system_impl_t() - ); -} -// remote system, full constructor. -lldp_remote_system_t::lldp_remote_system_t(lldp_chassis_id_t chassis, - lldp_intf_id_t port) { - pimpl = std::shared_ptr( - new lldp_remote_system_impl_t( - chassis, - port - ) - ); -} -lldp_remote_system_t::lldp_remote_system_t( - const lldp_remote_system_t& other) -{ - pimpl = std::make_unique( - lldp_remote_system_impl_t(*other.pimpl)); -} -lldp_remote_system_t& -lldp_remote_system_t::operator=( - lldp_remote_system_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_remote_system_impl_t(*other.pimpl)); - return *this; -} - lldp_chassis_id_t lldp_remote_system_t::chassis() const { return pimpl->chassis(); @@ -842,45 +576,6 @@ operator<<(std::ostream& os, const lldp_remote_system_t& obj) { } -// remote system, default constructor. -lldp_neighbor_t::lldp_neighbor_t() { - pimpl = std::shared_ptr( - new lldp_neighbor_impl_t() - ); -} -// first remote system. -lldp_neighbor_t::lldp_neighbor_t(intf_id_t intf) { - pimpl = std::shared_ptr( - new lldp_neighbor_impl_t( - intf - ) - ); -} -// specific remote system. -lldp_neighbor_t::lldp_neighbor_t(intf_id_t intf, - lldp_remote_system_t remote_system) { - pimpl = std::shared_ptr( - new lldp_neighbor_impl_t( - intf, - remote_system - ) - ); -} -lldp_neighbor_t::lldp_neighbor_t( - const lldp_neighbor_t& other) -{ - pimpl = std::make_unique( - lldp_neighbor_impl_t(*other.pimpl)); -} -lldp_neighbor_t& -lldp_neighbor_t::operator=( - lldp_neighbor_t const & other) -{ - pimpl = std::shared_ptr( - new lldp_neighbor_impl_t(*other.pimpl)); - return *this; -} - intf_id_t lldp_neighbor_t::intf() const { return pimpl->intf(); diff --git a/eos/inline/types/lldp_impl.h b/eos/inline/types/lldp_impl.h index 04faacf..46c475e 100644 --- a/eos/inline/types/lldp_impl.h +++ b/eos/inline/types/lldp_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_LLDP_IMPL_H diff --git a/eos/inline/types/mac_table.h b/eos/inline/types/mac_table.h index 4376277..5afff85 100644 --- a/eos/inline/types/mac_table.h +++ b/eos/inline/types/mac_table.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MAC_TABLE_H @@ -75,34 +75,6 @@ operator<<(std::ostream& os, const mac_entry_type_t & enum_val) { } -mac_key_t::mac_key_t() { - pimpl = std::shared_ptr( - new mac_key_impl_t() - ); -} -mac_key_t::mac_key_t(vlan_id_t vlan_id, eth_addr_t const & eth_addr) { - pimpl = std::shared_ptr( - new mac_key_impl_t( - vlan_id, - eth_addr - ) - ); -} -mac_key_t::mac_key_t( - const mac_key_t& other) -{ - pimpl = std::make_unique( - mac_key_impl_t(*other.pimpl)); -} -mac_key_t& -mac_key_t::operator=( - mac_key_t const & other) -{ - pimpl = std::shared_ptr( - new mac_key_impl_t(*other.pimpl)); - return *this; -} - vlan_id_t mac_key_t::vlan_id() const { return pimpl->vlan_id(); @@ -145,66 +117,6 @@ operator<<(std::ostream& os, const mac_key_t& obj) { } -mac_entry_t::mac_entry_t() { - pimpl = std::shared_ptr( - new mac_entry_impl_t() - ); -} -mac_entry_t::mac_entry_t(mac_key_t const & mac_key) { - pimpl = std::shared_ptr( - new mac_entry_impl_t( - mac_key - ) - ); -} -mac_entry_t::mac_entry_t(mac_key_t const & mac_key, intf_id_t intf) { - pimpl = std::shared_ptr( - new mac_entry_impl_t( - mac_key, - intf - ) - ); -} -mac_entry_t::mac_entry_t(mac_key_t const & mac_key, - std::set const & intfs) { - pimpl = std::shared_ptr( - new mac_entry_impl_t( - mac_key, - intfs - ) - ); -} -mac_entry_t::mac_entry_t(vlan_id_t vlan_id, eth_addr_t eth_addr) { - pimpl = std::shared_ptr( - new mac_entry_impl_t( - vlan_id, - eth_addr - ) - ); -} -mac_entry_t::mac_entry_t(eth_addr_t eth_addr, intf_id_t intf) { - pimpl = std::shared_ptr( - new mac_entry_impl_t( - eth_addr, - intf - ) - ); -} -mac_entry_t::mac_entry_t( - const mac_entry_t& other) -{ - pimpl = std::make_unique( - mac_entry_impl_t(*other.pimpl)); -} -mac_entry_t& -mac_entry_t::operator=( - mac_entry_t const & other) -{ - pimpl = std::shared_ptr( - new mac_entry_impl_t(*other.pimpl)); - return *this; -} - mac_key_t mac_entry_t::mac_key() const { return pimpl->mac_key(); diff --git a/eos/inline/types/mac_table_impl.h b/eos/inline/types/mac_table_impl.h index cae08f4..cec30cc 100644 --- a/eos/inline/types/mac_table_impl.h +++ b/eos/inline/types/mac_table_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MAC_TABLE_IMPL_H diff --git a/eos/inline/types/macsec.h b/eos/inline/types/macsec.h index d9fa440..6c18f5a 100644 --- a/eos/inline/types/macsec.h +++ b/eos/inline/types/macsec.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MACSEC_H @@ -93,26 +93,6 @@ operator<<(std::ostream& os, const macsec_profile_traffic_policy_t & enum_val) { } -macsec_key_t::macsec_key_t() { - pimpl = std::shared_ptr( - new macsec_key_impl_t() - ); -} -macsec_key_t::macsec_key_t( - const macsec_key_t& other) -{ - pimpl = std::make_unique( - macsec_key_impl_t(*other.pimpl)); -} -macsec_key_t& -macsec_key_t::operator=( - macsec_key_t const & other) -{ - pimpl = std::shared_ptr( - new macsec_key_impl_t(*other.pimpl)); - return *this; -} - std::string macsec_key_t::cak() const { return pimpl->cak(); @@ -167,33 +147,6 @@ operator<<(std::ostream& os, const macsec_key_t& obj) { } -macsec_profile_t::macsec_profile_t() { - pimpl = std::shared_ptr( - new macsec_profile_impl_t() - ); -} -macsec_profile_t::macsec_profile_t(macsec_profile_name_t name) { - pimpl = std::shared_ptr( - new macsec_profile_impl_t( - name - ) - ); -} -macsec_profile_t::macsec_profile_t( - const macsec_profile_t& other) -{ - pimpl = std::make_unique( - macsec_profile_impl_t(*other.pimpl)); -} -macsec_profile_t& -macsec_profile_t::operator=( - macsec_profile_t const & other) -{ - pimpl = std::shared_ptr( - new macsec_profile_impl_t(*other.pimpl)); - return *this; -} - macsec_profile_name_t macsec_profile_t::name() const { return pimpl->name(); @@ -357,26 +310,6 @@ operator<<(std::ostream& os, const macsec_profile_t& obj) { } -macsec_intf_status_t::macsec_intf_status_t() { - pimpl = std::shared_ptr( - new macsec_intf_status_impl_t() - ); -} -macsec_intf_status_t::macsec_intf_status_t( - const macsec_intf_status_t& other) -{ - pimpl = std::make_unique( - macsec_intf_status_impl_t(*other.pimpl)); -} -macsec_intf_status_t& -macsec_intf_status_t::operator=( - macsec_intf_status_t const & other) -{ - pimpl = std::shared_ptr( - new macsec_intf_status_impl_t(*other.pimpl)); - return *this; -} - macsec_intf_key_status_t macsec_intf_status_t::key_status() const { return pimpl->key_status(); @@ -423,40 +356,6 @@ operator<<(std::ostream& os, const macsec_intf_status_t& obj) { } -macsec_intf_counters_t::macsec_intf_counters_t() { - pimpl = std::shared_ptr( - new macsec_intf_counters_impl_t() - ); -} -macsec_intf_counters_t::macsec_intf_counters_t( - uint64_t out_pkts_encrypted, uint64_t out_octets_encrypted, - uint64_t in_pkts_decrypted, uint64_t in_octets_decrypted, - uint64_t in_pkts_not_valid) { - pimpl = std::shared_ptr( - new macsec_intf_counters_impl_t( - out_pkts_encrypted, - out_octets_encrypted, - in_pkts_decrypted, - in_octets_decrypted, - in_pkts_not_valid - ) - ); -} -macsec_intf_counters_t::macsec_intf_counters_t( - const macsec_intf_counters_t& other) -{ - pimpl = std::make_unique( - macsec_intf_counters_impl_t(*other.pimpl)); -} -macsec_intf_counters_t& -macsec_intf_counters_t::operator=( - macsec_intf_counters_t const & other) -{ - pimpl = std::shared_ptr( - new macsec_intf_counters_impl_t(*other.pimpl)); - return *this; -} - uint64_t macsec_intf_counters_t::out_pkts_encrypted() const { return pimpl->out_pkts_encrypted(); diff --git a/eos/inline/types/macsec_impl.h b/eos/inline/types/macsec_impl.h index 3dd3734..593ccce 100644 --- a/eos/inline/types/macsec_impl.h +++ b/eos/inline/types/macsec_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MACSEC_IMPL_H diff --git a/eos/inline/types/mlag.h b/eos/inline/types/mlag.h index 55b51cc..1f572f0 100644 --- a/eos/inline/types/mlag.h +++ b/eos/inline/types/mlag.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MLAG_H diff --git a/eos/inline/types/mlag_impl.h b/eos/inline/types/mlag_impl.h index 372b502..0cf958e 100644 --- a/eos/inline/types/mlag_impl.h +++ b/eos/inline/types/mlag_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MLAG_IMPL_H diff --git a/eos/inline/types/mpls.h b/eos/inline/types/mpls.h index 0335319..add8d23 100644 --- a/eos/inline/types/mpls.h +++ b/eos/inline/types/mpls.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MPLS_H diff --git a/eos/inline/types/mpls_impl.h b/eos/inline/types/mpls_impl.h index f3ddaa7..9be3ba4 100644 --- a/eos/inline/types/mpls_impl.h +++ b/eos/inline/types/mpls_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MPLS_IMPL_H diff --git a/eos/inline/types/mpls_route.h b/eos/inline/types/mpls_route.h index 220ed43..9eb218d 100644 --- a/eos/inline/types/mpls_route.h +++ b/eos/inline/types/mpls_route.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MPLS_ROUTE_H @@ -6,44 +6,6 @@ namespace eos { -mpls_route_key_t::mpls_route_key_t() { - pimpl = std::shared_ptr( - new mpls_route_key_impl_t() - ); -} -mpls_route_key_t::mpls_route_key_t(mpls_label_t top_label, - mpls_route_metric_t metric) { - pimpl = std::shared_ptr( - new mpls_route_key_impl_t( - top_label, - metric - ) - ); -} -mpls_route_key_t::mpls_route_key_t(std::vector const & labels, - mpls_route_metric_t metric) { - pimpl = std::shared_ptr( - new mpls_route_key_impl_t( - labels, - metric - ) - ); -} -mpls_route_key_t::mpls_route_key_t( - const mpls_route_key_t& other) -{ - pimpl = std::make_unique( - mpls_route_key_impl_t(*other.pimpl)); -} -mpls_route_key_t& -mpls_route_key_t::operator=( - mpls_route_key_t const & other) -{ - pimpl = std::shared_ptr( - new mpls_route_key_impl_t(*other.pimpl)); - return *this; -} - std::vector const & mpls_route_key_t::labels() const { return pimpl->labels(); @@ -106,33 +68,6 @@ operator<<(std::ostream& os, const mpls_route_key_t& obj) { } -mpls_route_t::mpls_route_t() { - pimpl = std::shared_ptr( - new mpls_route_impl_t() - ); -} -mpls_route_t::mpls_route_t(mpls_route_key_t key) { - pimpl = std::shared_ptr( - new mpls_route_impl_t( - key - ) - ); -} -mpls_route_t::mpls_route_t( - const mpls_route_t& other) -{ - pimpl = std::make_unique( - mpls_route_impl_t(*other.pimpl)); -} -mpls_route_t& -mpls_route_t::operator=( - mpls_route_t const & other) -{ - pimpl = std::shared_ptr( - new mpls_route_impl_t(*other.pimpl)); - return *this; -} - mpls_route_key_t mpls_route_t::key() const { return pimpl->key(); @@ -167,42 +102,6 @@ operator<<(std::ostream& os, const mpls_route_t& obj) { } -mpls_route_via_t::mpls_route_via_t() { - pimpl = std::shared_ptr( - new mpls_route_via_impl_t() - ); -} -mpls_route_via_t::mpls_route_via_t(mpls_route_key_t route_key) { - pimpl = std::shared_ptr( - new mpls_route_via_impl_t( - route_key - ) - ); -} -mpls_route_via_t::mpls_route_via_t(mpls_route_key_t route_key, - mpls_action_t label_action) { - pimpl = std::shared_ptr( - new mpls_route_via_impl_t( - route_key, - label_action - ) - ); -} -mpls_route_via_t::mpls_route_via_t( - const mpls_route_via_t& other) -{ - pimpl = std::make_unique( - mpls_route_via_impl_t(*other.pimpl)); -} -mpls_route_via_t& -mpls_route_via_t::operator=( - mpls_route_via_t const & other) -{ - pimpl = std::shared_ptr( - new mpls_route_via_impl_t(*other.pimpl)); - return *this; -} - mpls_route_key_t mpls_route_via_t::route_key() const { return pimpl->route_key(); @@ -301,33 +200,6 @@ operator<<(std::ostream& os, const mpls_route_via_t& obj) { } -mpls_fec_id_t::mpls_fec_id_t() { - pimpl = std::shared_ptr( - new mpls_fec_id_impl_t() - ); -} -mpls_fec_id_t::mpls_fec_id_t(uint64_t id) { - pimpl = std::shared_ptr( - new mpls_fec_id_impl_t( - id - ) - ); -} -mpls_fec_id_t::mpls_fec_id_t( - const mpls_fec_id_t& other) -{ - pimpl = std::make_unique( - mpls_fec_id_impl_t(*other.pimpl)); -} -mpls_fec_id_t& -mpls_fec_id_t::operator=( - mpls_fec_id_t const & other) -{ - pimpl = std::shared_ptr( - new mpls_fec_id_impl_t(*other.pimpl)); - return *this; -} - uint64_t mpls_fec_id_t::id() const { return pimpl->id(); diff --git a/eos/inline/types/mpls_route_impl.h b/eos/inline/types/mpls_route_impl.h index cd85569..3b6992b 100644 --- a/eos/inline/types/mpls_route_impl.h +++ b/eos/inline/types/mpls_route_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MPLS_ROUTE_IMPL_H diff --git a/eos/inline/types/mpls_vrf_label.h b/eos/inline/types/mpls_vrf_label.h index 0b9d411..4dbf0e2 100644 --- a/eos/inline/types/mpls_vrf_label.h +++ b/eos/inline/types/mpls_vrf_label.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MPLS_VRF_LABEL_H @@ -6,35 +6,6 @@ namespace eos { -// Default constructor. -mpls_vrf_label_t::mpls_vrf_label_t() { - pimpl = std::shared_ptr( - new mpls_vrf_label_impl_t() - ); -} -mpls_vrf_label_t::mpls_vrf_label_t(mpls_label_t label, std::string vrf_name) { - pimpl = std::shared_ptr( - new mpls_vrf_label_impl_t( - label, - vrf_name - ) - ); -} -mpls_vrf_label_t::mpls_vrf_label_t( - const mpls_vrf_label_t& other) -{ - pimpl = std::make_unique( - mpls_vrf_label_impl_t(*other.pimpl)); -} -mpls_vrf_label_t& -mpls_vrf_label_t::operator=( - mpls_vrf_label_t const & other) -{ - pimpl = std::shared_ptr( - new mpls_vrf_label_impl_t(*other.pimpl)); - return *this; -} - mpls_label_t mpls_vrf_label_t::label() const { return pimpl->label(); diff --git a/eos/inline/types/mpls_vrf_label_impl.h b/eos/inline/types/mpls_vrf_label_impl.h index 9580cd6..9a9625e 100644 --- a/eos/inline/types/mpls_vrf_label_impl.h +++ b/eos/inline/types/mpls_vrf_label_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_MPLS_VRF_LABEL_IMPL_H diff --git a/eos/inline/types/neighbor_table.h b/eos/inline/types/neighbor_table.h index 5924ac0..ae368e5 100644 --- a/eos/inline/types/neighbor_table.h +++ b/eos/inline/types/neighbor_table.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_NEIGHBOR_TABLE_H @@ -21,42 +21,6 @@ operator<<(std::ostream& os, const neighbor_entry_type_t & enum_val) { } -// Default constructor. -neighbor_key_t::neighbor_key_t() { - pimpl = std::shared_ptr( - new neighbor_key_impl_t() - ); -} -neighbor_key_t::neighbor_key_t(ip_addr_t const & ip_addr) { - pimpl = std::shared_ptr( - new neighbor_key_impl_t( - ip_addr - ) - ); -} -neighbor_key_t::neighbor_key_t(ip_addr_t const & ip_addr, intf_id_t intf_id) { - pimpl = std::shared_ptr( - new neighbor_key_impl_t( - ip_addr, - intf_id - ) - ); -} -neighbor_key_t::neighbor_key_t( - const neighbor_key_t& other) -{ - pimpl = std::make_unique( - neighbor_key_impl_t(*other.pimpl)); -} -neighbor_key_t& -neighbor_key_t::operator=( - neighbor_key_t const & other) -{ - pimpl = std::shared_ptr( - new neighbor_key_impl_t(*other.pimpl)); - return *this; -} - ip_addr_t neighbor_key_t::ip_addr() const { return pimpl->ip_addr(); @@ -95,38 +59,6 @@ operator<<(std::ostream& os, const neighbor_key_t& obj) { } -// Default constructor. -neighbor_entry_t::neighbor_entry_t() { - pimpl = std::shared_ptr( - new neighbor_entry_impl_t() - ); -} -neighbor_entry_t::neighbor_entry_t(neighbor_key_t const & neighbor_key, - eth_addr_t eth_addr, - neighbor_entry_type_t entry_type) { - pimpl = std::shared_ptr( - new neighbor_entry_impl_t( - neighbor_key, - eth_addr, - entry_type - ) - ); -} -neighbor_entry_t::neighbor_entry_t( - const neighbor_entry_t& other) -{ - pimpl = std::make_unique( - neighbor_entry_impl_t(*other.pimpl)); -} -neighbor_entry_t& -neighbor_entry_t::operator=( - neighbor_entry_t const & other) -{ - pimpl = std::shared_ptr( - new neighbor_entry_impl_t(*other.pimpl)); - return *this; -} - neighbor_key_t neighbor_entry_t::neighbor_key() const { return pimpl->neighbor_key(); diff --git a/eos/inline/types/neighbor_table_impl.h b/eos/inline/types/neighbor_table_impl.h index 21190fa..a820dbf 100644 --- a/eos/inline/types/neighbor_table_impl.h +++ b/eos/inline/types/neighbor_table_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_NEIGHBOR_TABLE_IMPL_H diff --git a/eos/inline/types/nexthop_group.h b/eos/inline/types/nexthop_group.h index 565c156..a1435d4 100644 --- a/eos/inline/types/nexthop_group.h +++ b/eos/inline/types/nexthop_group.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_NEXTHOP_GROUP_H @@ -40,44 +40,6 @@ operator<<(std::ostream& os, const nexthop_group_gre_key_t & enum_val) { } -nexthop_group_mpls_action_t::nexthop_group_mpls_action_t() { - pimpl = std::shared_ptr( - new nexthop_group_mpls_action_impl_t() - ); -} -nexthop_group_mpls_action_t::nexthop_group_mpls_action_t( - mpls_action_t action_type) { - pimpl = std::shared_ptr( - new nexthop_group_mpls_action_impl_t( - action_type - ) - ); -} -nexthop_group_mpls_action_t::nexthop_group_mpls_action_t( - mpls_action_t action_type, - std::forward_list const & label_stack) { - pimpl = std::shared_ptr( - new nexthop_group_mpls_action_impl_t( - action_type, - label_stack - ) - ); -} -nexthop_group_mpls_action_t::nexthop_group_mpls_action_t( - const nexthop_group_mpls_action_t& other) -{ - pimpl = std::make_unique( - nexthop_group_mpls_action_impl_t(*other.pimpl)); -} -nexthop_group_mpls_action_t& -nexthop_group_mpls_action_t::operator=( - nexthop_group_mpls_action_t const & other) -{ - pimpl = std::shared_ptr( - new nexthop_group_mpls_action_impl_t(*other.pimpl)); - return *this; -} - mpls_action_t nexthop_group_mpls_action_t::action_type() const { return pimpl->action_type(); @@ -136,36 +98,6 @@ operator<<(std::ostream& os, const nexthop_group_mpls_action_t& obj) { } -nexthop_group_entry_counter_t::nexthop_group_entry_counter_t() { - pimpl = std::shared_ptr( - new nexthop_group_entry_counter_impl_t() - ); -} -nexthop_group_entry_counter_t::nexthop_group_entry_counter_t( - uint64_t packets, uint64_t bytes, bool valid) { - pimpl = std::shared_ptr( - new nexthop_group_entry_counter_impl_t( - packets, - bytes, - valid - ) - ); -} -nexthop_group_entry_counter_t::nexthop_group_entry_counter_t( - const nexthop_group_entry_counter_t& other) -{ - pimpl = std::make_unique( - nexthop_group_entry_counter_impl_t(*other.pimpl)); -} -nexthop_group_entry_counter_t& -nexthop_group_entry_counter_t::operator=( - nexthop_group_entry_counter_t const & other) -{ - pimpl = std::shared_ptr( - new nexthop_group_entry_counter_impl_t(*other.pimpl)); - return *this; -} - uint64_t nexthop_group_entry_counter_t::packets() const { return pimpl->packets(); @@ -211,50 +143,6 @@ operator<<(std::ostream& os, const nexthop_group_entry_counter_t& obj) { } -nexthop_group_entry_t::nexthop_group_entry_t() { - pimpl = std::shared_ptr( - new nexthop_group_entry_impl_t() - ); -} -nexthop_group_entry_t::nexthop_group_entry_t(ip_addr_t const & nexthop) { - pimpl = std::shared_ptr( - new nexthop_group_entry_impl_t( - nexthop - ) - ); -} -nexthop_group_entry_t::nexthop_group_entry_t(ip_addr_t const & nexthop, - intf_id_t const & intf) { - pimpl = std::shared_ptr( - new nexthop_group_entry_impl_t( - nexthop, - intf - ) - ); -} -nexthop_group_entry_t::nexthop_group_entry_t( - std::string const & child_nexthop_group) { - pimpl = std::shared_ptr( - new nexthop_group_entry_impl_t( - child_nexthop_group - ) - ); -} -nexthop_group_entry_t::nexthop_group_entry_t( - const nexthop_group_entry_t& other) -{ - pimpl = std::make_unique( - nexthop_group_entry_impl_t(*other.pimpl)); -} -nexthop_group_entry_t& -nexthop_group_entry_t::operator=( - nexthop_group_entry_t const & other) -{ - pimpl = std::shared_ptr( - new nexthop_group_entry_impl_t(*other.pimpl)); - return *this; -} - nexthop_group_mpls_action_t nexthop_group_entry_t::mpls_action() const { return pimpl->mpls_action(); @@ -328,66 +216,6 @@ operator<<(std::ostream& os, const nexthop_group_entry_t& obj) { } -nexthop_group_t::nexthop_group_t() { - pimpl = std::shared_ptr( - new nexthop_group_impl_t() - ); -} -nexthop_group_t::nexthop_group_t(std::string name, - nexthop_group_encap_t type) { - pimpl = std::shared_ptr( - new nexthop_group_impl_t( - name, - type - ) - ); -} -nexthop_group_t::nexthop_group_t(std::string name, - nexthop_group_encap_t type, - nexthop_group_gre_key_t gre_key_type) { - pimpl = std::shared_ptr( - new nexthop_group_impl_t( - name, - type, - gre_key_type - ) - ); -} -nexthop_group_t::nexthop_group_t(std::string name, - ip_addr_t const & source_ip) { - pimpl = std::shared_ptr( - new nexthop_group_impl_t( - name, - source_ip - ) - ); -} -nexthop_group_t::nexthop_group_t( - std::string name, ip_addr_t const & source_ip, - std::map const & nexthops) { - pimpl = std::shared_ptr( - new nexthop_group_impl_t( - name, - source_ip, - nexthops - ) - ); -} -nexthop_group_t::nexthop_group_t( - const nexthop_group_t& other) -{ - pimpl = std::make_unique( - nexthop_group_impl_t(*other.pimpl)); -} -nexthop_group_t& -nexthop_group_t::operator=( - nexthop_group_t const & other) -{ - pimpl = std::shared_ptr( - new nexthop_group_impl_t(*other.pimpl)); - return *this; -} - std::string nexthop_group_t::name() const { return pimpl->name(); @@ -547,34 +375,6 @@ operator<<(std::ostream& os, const nexthop_group_counter_state_t & enum_val) { } -nexthop_group_programmed_status_t::nexthop_group_programmed_status_t() { - pimpl = std::shared_ptr( - new nexthop_group_programmed_status_impl_t() - ); -} -nexthop_group_programmed_status_t::nexthop_group_programmed_status_t( - nexthop_group_counter_state_t counter_state) { - pimpl = std::shared_ptr( - new nexthop_group_programmed_status_impl_t( - counter_state - ) - ); -} -nexthop_group_programmed_status_t::nexthop_group_programmed_status_t( - const nexthop_group_programmed_status_t& other) -{ - pimpl = std::make_unique( - nexthop_group_programmed_status_impl_t(*other.pimpl)); -} -nexthop_group_programmed_status_t& -nexthop_group_programmed_status_t::operator=( - nexthop_group_programmed_status_t const & other) -{ - pimpl = std::shared_ptr( - new nexthop_group_programmed_status_impl_t(*other.pimpl)); - return *this; -} - nexthop_group_counter_state_t nexthop_group_programmed_status_t::counter_state() const { return pimpl->counter_state(); diff --git a/eos/inline/types/nexthop_group_impl.h b/eos/inline/types/nexthop_group_impl.h index 02d63a7..7a3ff6e 100644 --- a/eos/inline/types/nexthop_group_impl.h +++ b/eos/inline/types/nexthop_group_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_NEXTHOP_GROUP_IMPL_H diff --git a/eos/inline/types/nexthop_group_tunnel.h b/eos/inline/types/nexthop_group_tunnel.h index 5c36a36..e83cfb4 100644 --- a/eos/inline/types/nexthop_group_tunnel.h +++ b/eos/inline/types/nexthop_group_tunnel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_NEXTHOP_GROUP_TUNNEL_H @@ -6,35 +6,6 @@ namespace eos { -nexthop_group_tunnel_t::nexthop_group_tunnel_t() { - pimpl = std::shared_ptr( - new nexthop_group_tunnel_impl_t() - ); -} -nexthop_group_tunnel_t::nexthop_group_tunnel_t( - ip_prefix_t const & tunnel_endpoint, std::string const & nhg_name) { - pimpl = std::shared_ptr( - new nexthop_group_tunnel_impl_t( - tunnel_endpoint, - nhg_name - ) - ); -} -nexthop_group_tunnel_t::nexthop_group_tunnel_t( - const nexthop_group_tunnel_t& other) -{ - pimpl = std::make_unique( - nexthop_group_tunnel_impl_t(*other.pimpl)); -} -nexthop_group_tunnel_t& -nexthop_group_tunnel_t::operator=( - nexthop_group_tunnel_t const & other) -{ - pimpl = std::shared_ptr( - new nexthop_group_tunnel_impl_t(*other.pimpl)); - return *this; -} - ip_prefix_t nexthop_group_tunnel_t::tunnel_endpoint() const { return pimpl->tunnel_endpoint(); diff --git a/eos/inline/types/nexthop_group_tunnel_impl.h b/eos/inline/types/nexthop_group_tunnel_impl.h index 2e8f446..2f823c8 100644 --- a/eos/inline/types/nexthop_group_tunnel_impl.h +++ b/eos/inline/types/nexthop_group_tunnel_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_NEXTHOP_GROUP_TUNNEL_IMPL_H diff --git a/eos/inline/types/policy_map.h b/eos/inline/types/policy_map.h index ea7eb63..9abf5ff 100644 --- a/eos/inline/types/policy_map.h +++ b/eos/inline/types/policy_map.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_POLICY_MAP_H @@ -126,35 +126,6 @@ operator<<(std::ostream& os, const policy_map_rule_type_t & enum_val) { } -policy_map_key_t::policy_map_key_t() { - pimpl = std::shared_ptr( - new policy_map_key_impl_t() - ); -} -policy_map_key_t::policy_map_key_t(std::string const & name, - policy_feature_t feature) { - pimpl = std::shared_ptr( - new policy_map_key_impl_t( - name, - feature - ) - ); -} -policy_map_key_t::policy_map_key_t( - const policy_map_key_t& other) -{ - pimpl = std::make_unique( - policy_map_key_impl_t(*other.pimpl)); -} -policy_map_key_t& -policy_map_key_t::operator=( - policy_map_key_t const & other) -{ - pimpl = std::shared_ptr( - new policy_map_key_impl_t(*other.pimpl)); - return *this; -} - std::string policy_map_key_t::name() const { return pimpl->name(); @@ -233,34 +204,6 @@ operator<<(std::ostream& os, const police_burst_unit_t & enum_val) { } -// Default constructor of a PBR/QOS action. -policy_map_action_t::policy_map_action_t() { - pimpl = std::shared_ptr( - new policy_map_action_impl_t() - ); -} -policy_map_action_t::policy_map_action_t(policy_action_type_t action_type) { - pimpl = std::shared_ptr( - new policy_map_action_impl_t( - action_type - ) - ); -} -policy_map_action_t::policy_map_action_t( - const policy_map_action_t& other) -{ - pimpl = std::make_unique( - policy_map_action_impl_t(*other.pimpl)); -} -policy_map_action_t& -policy_map_action_t::operator=( - policy_map_action_t const & other) -{ - pimpl = std::shared_ptr( - new policy_map_action_impl_t(*other.pimpl)); - return *this; -} - policy_map_action_t::~policy_map_action_t() { @@ -351,35 +294,6 @@ operator<<(std::ostream& os, const policy_map_action_t& obj) { } -// Default constructor of a traffic-policy action. -traffic_policy_action_t::traffic_policy_action_t() { - pimpl = std::shared_ptr( - new traffic_policy_action_impl_t() - ); -} -traffic_policy_action_t::traffic_policy_action_t( - traffic_policy_action_type_t action_type) { - pimpl = std::shared_ptr( - new traffic_policy_action_impl_t( - action_type - ) - ); -} -traffic_policy_action_t::traffic_policy_action_t( - const traffic_policy_action_t& other) -{ - pimpl = std::make_unique( - traffic_policy_action_impl_t(*other.pimpl)); -} -traffic_policy_action_t& -traffic_policy_action_t::operator=( - traffic_policy_action_t const & other) -{ - pimpl = std::shared_ptr( - new traffic_policy_action_impl_t(*other.pimpl)); - return *this; -} - traffic_policy_action_t::~traffic_policy_action_t() { @@ -393,6 +307,14 @@ traffic_policy_action_t::action_type_is(traffic_policy_action_type_t action_type pimpl->action_type_is(action_type); } std::string +traffic_policy_action_t::counter_name() const { + return pimpl->counter_name(); +} +void +traffic_policy_action_t::counter_name_is(std::string const & counter_name) { + pimpl->counter_name_is(counter_name); +} +std::string traffic_policy_action_t::goto_class_name() const { return pimpl->goto_class_name(); } @@ -538,33 +460,6 @@ operator<<(std::ostream& os, const traffic_policy_action_t& obj) { } -policy_map_rule_t::policy_map_rule_t() { - pimpl = std::shared_ptr( - new policy_map_rule_impl_t() - ); -} -policy_map_rule_t::policy_map_rule_t(class_map_key_t const & class_map_key) { - pimpl = std::shared_ptr( - new policy_map_rule_impl_t( - class_map_key - ) - ); -} -policy_map_rule_t::policy_map_rule_t( - const policy_map_rule_t& other) -{ - pimpl = std::make_unique( - policy_map_rule_impl_t(*other.pimpl)); -} -policy_map_rule_t& -policy_map_rule_t::operator=( - policy_map_rule_t const & other) -{ - pimpl = std::shared_ptr( - new policy_map_rule_impl_t(*other.pimpl)); - return *this; -} - class_map_key_t policy_map_rule_t::class_map_key() const { return pimpl->class_map_key(); @@ -645,33 +540,6 @@ operator<<(std::ostream& os, const policy_map_rule_t& obj) { } -policy_map_t::policy_map_t() { - pimpl = std::shared_ptr( - new policy_map_impl_t() - ); -} -policy_map_t::policy_map_t(policy_map_key_t const & key) { - pimpl = std::shared_ptr( - new policy_map_impl_t( - key - ) - ); -} -policy_map_t::policy_map_t( - const policy_map_t& other) -{ - pimpl = std::make_unique( - policy_map_impl_t(*other.pimpl)); -} -policy_map_t& -policy_map_t::operator=( - policy_map_t const & other) -{ - pimpl = std::shared_ptr( - new policy_map_impl_t(*other.pimpl)); - return *this; -} - policy_map_key_t policy_map_t::key() const { return pimpl->key(); @@ -726,36 +594,6 @@ operator<<(std::ostream& os, const policy_map_t& obj) { } -traffic_policy_rule_t::traffic_policy_rule_t() { - pimpl = std::shared_ptr( - new traffic_policy_rule_impl_t() - ); -} -traffic_policy_rule_t::traffic_policy_rule_t( - std::string match_rule_name, - traffic_policy_rule_type_t traffic_policy_rule_type) { - pimpl = std::shared_ptr( - new traffic_policy_rule_impl_t( - match_rule_name, - traffic_policy_rule_type - ) - ); -} -traffic_policy_rule_t::traffic_policy_rule_t( - const traffic_policy_rule_t& other) -{ - pimpl = std::make_unique( - traffic_policy_rule_impl_t(*other.pimpl)); -} -traffic_policy_rule_t& -traffic_policy_rule_t::operator=( - traffic_policy_rule_t const & other) -{ - pimpl = std::shared_ptr( - new traffic_policy_rule_impl_t(*other.pimpl)); - return *this; -} - std::string traffic_policy_rule_t::match_rule_name() const { return pimpl->match_rule_name(); @@ -823,32 +661,27 @@ operator<<(std::ostream& os, const traffic_policy_rule_t& obj) { } -traffic_policy_t::traffic_policy_t(std::string const & key) { - pimpl = std::shared_ptr( - new traffic_policy_impl_t( - key - ) - ); -} -traffic_policy_t::traffic_policy_t( - const traffic_policy_t& other) -{ - pimpl = std::make_unique( - traffic_policy_impl_t(*other.pimpl)); -} -traffic_policy_t& -traffic_policy_t::operator=( - traffic_policy_t const & other) -{ - pimpl = std::shared_ptr( - new traffic_policy_impl_t(*other.pimpl)); - return *this; -} - std::string traffic_policy_t::key() const { return pimpl->key(); } +std::unordered_set const & +traffic_policy_t::named_counters() const { + return pimpl->named_counters(); +} +void +traffic_policy_t::named_counters_is( + std::unordered_set const & named_counters) { + pimpl->named_counters_is(named_counters); +} +void +traffic_policy_t::named_counter_set(std::string const & value) { + pimpl->named_counter_set(value); +} +void +traffic_policy_t::named_counter_del(std::string const & value) { + pimpl->named_counter_del(value); +} std::map const & traffic_policy_t::rules() const { return pimpl->rules(); @@ -964,35 +797,6 @@ operator<<(std::ostream& os, const policy_map_status_t & enum_val) { } -policy_map_hw_status_key_t::policy_map_hw_status_key_t() { - pimpl = std::shared_ptr( - new policy_map_hw_status_key_impl_t() - ); -} -policy_map_hw_status_key_t::policy_map_hw_status_key_t( - intf_id_t intf_id, acl_direction_t direction) { - pimpl = std::shared_ptr( - new policy_map_hw_status_key_impl_t( - intf_id, - direction - ) - ); -} -policy_map_hw_status_key_t::policy_map_hw_status_key_t( - const policy_map_hw_status_key_t& other) -{ - pimpl = std::make_unique( - policy_map_hw_status_key_impl_t(*other.pimpl)); -} -policy_map_hw_status_key_t& -policy_map_hw_status_key_t::operator=( - policy_map_hw_status_key_t const & other) -{ - pimpl = std::shared_ptr( - new policy_map_hw_status_key_impl_t(*other.pimpl)); - return *this; -} - intf_id_t policy_map_hw_status_key_t::intf_id() const { return pimpl->intf_id(); @@ -1042,36 +846,6 @@ operator<<(std::ostream& os, const policy_map_hw_status_key_t& obj) { } -policy_map_hw_statuses_t::policy_map_hw_statuses_t() { - pimpl = std::shared_ptr( - new policy_map_hw_statuses_impl_t() - ); -} -policy_map_hw_statuses_t::policy_map_hw_statuses_t( - - std::map const & - intf_statuses) { - pimpl = std::shared_ptr( - new policy_map_hw_statuses_impl_t( - intf_statuses - ) - ); -} -policy_map_hw_statuses_t::policy_map_hw_statuses_t( - const policy_map_hw_statuses_t& other) -{ - pimpl = std::make_unique( - policy_map_hw_statuses_impl_t(*other.pimpl)); -} -policy_map_hw_statuses_t& -policy_map_hw_statuses_t::operator=( - policy_map_hw_statuses_t const & other) -{ - pimpl = std::shared_ptr( - new policy_map_hw_statuses_impl_t(*other.pimpl)); - return *this; -} - std::map const & policy_map_hw_statuses_t::intf_statuses() const { return pimpl->intf_statuses(); diff --git a/eos/inline/types/policy_map_impl.h b/eos/inline/types/policy_map_impl.h index 94afc82..b61efd6 100644 --- a/eos/inline/types/policy_map_impl.h +++ b/eos/inline/types/policy_map_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_POLICY_MAP_IMPL_H @@ -278,15 +278,16 @@ operator<<(std::ostream& os, const policy_map_action_impl_t& obj) { // Default constructor of a traffic-policy action. traffic_policy_action_impl_t::traffic_policy_action_impl_t() : - action_type_(), goto_class_name_(), goto_next_(), dscp_(), traffic_class_(), - vrf_(), mirror_session_(), police_rate_(), police_burst_size_(), - police_rate_unit_(), police_burst_unit_(), nexthop_groups_(), nexthops_() { + action_type_(), counter_name_(), goto_class_name_(), goto_next_(), dscp_(), + traffic_class_(), vrf_(), mirror_session_(), police_rate_(), + police_burst_size_(), police_rate_unit_(), police_burst_unit_(), + nexthop_groups_(), nexthops_() { } traffic_policy_action_impl_t::traffic_policy_action_impl_t( traffic_policy_action_type_t action_type) : - action_type_(action_type), goto_class_name_(), goto_next_(), dscp_(), - traffic_class_(), vrf_(), mirror_session_(), police_rate_(), + action_type_(action_type), counter_name_(), goto_class_name_(), goto_next_(), + dscp_(), traffic_class_(), vrf_(), mirror_session_(), police_rate_(), police_burst_size_(), police_rate_unit_(), police_burst_unit_(), nexthop_groups_(), nexthops_() { } @@ -307,6 +308,16 @@ traffic_policy_action_impl_t::action_type_is( action_type_ = action_type; } +std::string +traffic_policy_action_impl_t::counter_name() const { + return counter_name_; +} + +void +traffic_policy_action_impl_t::counter_name_is(std::string const & counter_name) { + counter_name_ = counter_name; +} + std::string traffic_policy_action_impl_t::goto_class_name() const { return goto_class_name_; @@ -458,6 +469,7 @@ bool traffic_policy_action_impl_t::operator==( traffic_policy_action_impl_t const & other) const { return action_type_ == other.action_type_ && + counter_name_ == other.counter_name_ && goto_class_name_ == other.goto_class_name_ && goto_next_ == other.goto_next_ && dscp_ == other.dscp_ && @@ -483,6 +495,8 @@ traffic_policy_action_impl_t::operator<(traffic_policy_action_impl_t const & oth const { if(action_type_ != other.action_type_) { return action_type_ < other.action_type_; + } else if(counter_name_ != other.counter_name_) { + return counter_name_ < other.counter_name_; } else if(goto_class_name_ != other.goto_class_name_) { return goto_class_name_ < other.goto_class_name_; } else if(goto_next_ != other.goto_next_) { @@ -517,6 +531,7 @@ traffic_policy_action_impl_t::hash() const { void traffic_policy_action_impl_t::mix_me(hash_mix & h) const { h.mix(action_type_); // traffic_policy_action_type_t + h.mix(counter_name_); // std::string h.mix(goto_class_name_); // std::string h.mix(goto_next_); // bool h.mix(dscp_); // uint8_t @@ -542,6 +557,7 @@ traffic_policy_action_impl_t::to_string() const { std::ostringstream ss; ss << "traffic_policy_action_t("; ss << "action_type=" << action_type_; + ss << ", counter_name='" << counter_name_ << "'"; ss << ", goto_class_name='" << goto_class_name_ << "'"; ss << ", goto_next=" << goto_next_; ss << ", dscp=" << dscp_; @@ -1063,7 +1079,7 @@ operator<<(std::ostream& os, const traffic_policy_rule_impl_t& obj) { traffic_policy_impl_t::traffic_policy_impl_t(std::string const & key) : - key_(key), rules_() { + key_(key), named_counters_(), rules_() { } std::string @@ -1071,6 +1087,27 @@ traffic_policy_impl_t::key() const { return key_; } +std::unordered_set const & +traffic_policy_impl_t::named_counters() const { + return named_counters_; +} + +void +traffic_policy_impl_t::named_counters_is( + std::unordered_set const & named_counters) { + named_counters_ = named_counters; +} + +void +traffic_policy_impl_t::named_counter_set(std::string const & value) { + named_counters_.insert(value); +} + +void +traffic_policy_impl_t::named_counter_del(std::string const & value) { + named_counters_.erase(value); +} + std::map const & traffic_policy_impl_t::rules() const { return rules_; @@ -1095,6 +1132,7 @@ traffic_policy_impl_t::rule_del(uint32_t key) { bool traffic_policy_impl_t::operator==(traffic_policy_impl_t const & other) const { return key_ == other.key_ && + named_counters_ == other.named_counters_ && rules_ == other.rules_; } @@ -1123,6 +1161,10 @@ traffic_policy_impl_t::hash() const { void traffic_policy_impl_t::mix_me(hash_mix & h) const { h.mix(key_); // std::string + for (auto it=named_counters_.cbegin(); + it!=named_counters_.cend(); ++it) { + h.mix(*it); // std::string + } for (auto it=rules_.cbegin(); it!=rules_.cend(); ++it) { h.mix(it->first); // uint32_t @@ -1135,6 +1177,18 @@ traffic_policy_impl_t::to_string() const { std::ostringstream ss; ss << "traffic_policy_t("; ss << "key='" << key_ << "'"; + ss << ", named_counters=" <<"'"; + bool first_named_counters = true; + for (auto it=named_counters_.cbegin(); + it!=named_counters_.cend(); ++it) { + if (first_named_counters) { + ss << (*it); + first_named_counters = false; + } else { + ss << "," << (*it); + } + } + ss << "'"; ss << ", rules=" <<"'"; bool first_rules = true; for (auto it=rules_.cbegin(); diff --git a/eos/inline/types/route_map.h b/eos/inline/types/route_map.h index 96cc596..7638299 100644 --- a/eos/inline/types/route_map.h +++ b/eos/inline/types/route_map.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ROUTE_MAP_H @@ -23,41 +23,6 @@ operator<<(std::ostream& os, const bandwidth_unit_t & enum_val) { } -link_bandwidth_t::link_bandwidth_t(float value, bandwidth_unit_t unit) { - pimpl = std::shared_ptr( - new link_bandwidth_impl_t( - value, - unit - ) - ); -} -link_bandwidth_t::link_bandwidth_t(float value) { - pimpl = std::shared_ptr( - new link_bandwidth_impl_t( - value - ) - ); -} -link_bandwidth_t::link_bandwidth_t() { - pimpl = std::shared_ptr( - new link_bandwidth_impl_t() - ); -} -link_bandwidth_t::link_bandwidth_t( - const link_bandwidth_t& other) -{ - pimpl = std::make_unique( - link_bandwidth_impl_t(*other.pimpl)); -} -link_bandwidth_t& -link_bandwidth_t::operator=( - link_bandwidth_t const & other) -{ - pimpl = std::shared_ptr( - new link_bandwidth_impl_t(*other.pimpl)); - return *this; -} - float link_bandwidth_t::value() const { return pimpl->value(); @@ -119,26 +84,6 @@ operator<<(std::ostream& os, const route_map_operation_type_t & enum_val) { } -route_map_link_bandwidth_t::route_map_link_bandwidth_t() { - pimpl = std::shared_ptr( - new route_map_link_bandwidth_impl_t() - ); -} -route_map_link_bandwidth_t::route_map_link_bandwidth_t( - const route_map_link_bandwidth_t& other) -{ - pimpl = std::make_unique( - route_map_link_bandwidth_impl_t(*other.pimpl)); -} -route_map_link_bandwidth_t& -route_map_link_bandwidth_t::operator=( - route_map_link_bandwidth_t const & other) -{ - pimpl = std::shared_ptr( - new route_map_link_bandwidth_impl_t(*other.pimpl)); - return *this; -} - route_map_operation_type_t route_map_link_bandwidth_t::operation() const { return pimpl->operation(); @@ -194,33 +139,6 @@ operator<<(std::ostream& os, const route_map_link_bandwidth_t& obj) { } -route_map_entry_t::route_map_entry_t() { - pimpl = std::shared_ptr( - new route_map_entry_impl_t() - ); -} -route_map_entry_t::route_map_entry_t(bool permit) { - pimpl = std::shared_ptr( - new route_map_entry_impl_t( - permit - ) - ); -} -route_map_entry_t::route_map_entry_t( - const route_map_entry_t& other) -{ - pimpl = std::make_unique( - route_map_entry_impl_t(*other.pimpl)); -} -route_map_entry_t& -route_map_entry_t::operator=( - route_map_entry_t const & other) -{ - pimpl = std::shared_ptr( - new route_map_entry_impl_t(*other.pimpl)); - return *this; -} - bool route_map_entry_t::permit() const { return pimpl->permit(); @@ -277,26 +195,6 @@ operator<<(std::ostream& os, const route_map_entry_t& obj) { } -route_map_t::route_map_t() { - pimpl = std::shared_ptr( - new route_map_impl_t() - ); -} -route_map_t::route_map_t( - const route_map_t& other) -{ - pimpl = std::make_unique( - route_map_impl_t(*other.pimpl)); -} -route_map_t& -route_map_t::operator=( - route_map_t const & other) -{ - pimpl = std::shared_ptr( - new route_map_impl_t(*other.pimpl)); - return *this; -} - std::map const & route_map_t::map_entry() const { return pimpl->map_entry(); diff --git a/eos/inline/types/route_map_impl.h b/eos/inline/types/route_map_impl.h index 9cbc980..0637cb0 100644 --- a/eos/inline/types/route_map_impl.h +++ b/eos/inline/types/route_map_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_ROUTE_MAP_IMPL_H diff --git a/eos/inline/types/sdk.h b/eos/inline/types/sdk.h index f70e2c1..87ce1ee 100644 --- a/eos/inline/types/sdk.h +++ b/eos/inline/types/sdk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_SDK_H diff --git a/eos/inline/types/sdk_impl.h b/eos/inline/types/sdk_impl.h index 90d0489..597fd12 100644 --- a/eos/inline/types/sdk_impl.h +++ b/eos/inline/types/sdk_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_SDK_IMPL_H diff --git a/eos/inline/types/structured_filter.h b/eos/inline/types/structured_filter.h index 96d9c2d..5634f3e 100644 --- a/eos/inline/types/structured_filter.h +++ b/eos/inline/types/structured_filter.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_STRUCTURED_FILTER_H @@ -19,26 +19,6 @@ operator<<(std::ostream& os, const tp_max_values_t & enum_val) { } -protocol_range_t::protocol_range_t() { - pimpl = std::shared_ptr( - new protocol_range_impl_t() - ); -} -protocol_range_t::protocol_range_t( - const protocol_range_t& other) -{ - pimpl = std::make_unique( - protocol_range_impl_t(*other.pimpl)); -} -protocol_range_t& -protocol_range_t::operator=( - protocol_range_t const & other) -{ - pimpl = std::shared_ptr( - new protocol_range_impl_t(*other.pimpl)); - return *this; -} - uint32_t protocol_range_t::range_start() const { return pimpl->range_start(); @@ -85,26 +65,6 @@ operator<<(std::ostream& os, const protocol_range_t& obj) { } -port_range_t::port_range_t() { - pimpl = std::shared_ptr( - new port_range_impl_t() - ); -} -port_range_t::port_range_t( - const port_range_t& other) -{ - pimpl = std::make_unique( - port_range_impl_t(*other.pimpl)); -} -port_range_t& -port_range_t::operator=( - port_range_t const & other) -{ - pimpl = std::shared_ptr( - new port_range_impl_t(*other.pimpl)); - return *this; -} - uint32_t port_range_t::range_start() const { return pimpl->range_start(); @@ -151,26 +111,6 @@ operator<<(std::ostream& os, const port_range_t& obj) { } -port_field_t::port_field_t() { - pimpl = std::shared_ptr( - new port_field_impl_t() - ); -} -port_field_t::port_field_t( - const port_field_t& other) -{ - pimpl = std::make_unique( - port_field_impl_t(*other.pimpl)); -} -port_field_t& -port_field_t::operator=( - port_field_t const & other) -{ - pimpl = std::shared_ptr( - new port_field_impl_t(*other.pimpl)); - return *this; -} - std::set const & port_field_t::src_ports() const { return pimpl->src_ports(); @@ -267,26 +207,6 @@ operator<<(std::ostream& os, const port_field_t& obj) { } -protocol_field_t::protocol_field_t() { - pimpl = std::shared_ptr( - new protocol_field_impl_t() - ); -} -protocol_field_t::protocol_field_t( - const protocol_field_t& other) -{ - pimpl = std::make_unique( - protocol_field_impl_t(*other.pimpl)); -} -protocol_field_t& -protocol_field_t::operator=( - protocol_field_t const & other) -{ - pimpl = std::shared_ptr( - new protocol_field_impl_t(*other.pimpl)); - return *this; -} - std::map const & protocol_field_t::ports() const { return pimpl->ports(); @@ -356,33 +276,6 @@ operator<<(std::ostream& os, const traffic_policy_rule_type_t & enum_val) { -tp_rule_filter_t::tp_rule_filter_t() { - pimpl = std::shared_ptr( - new tp_rule_filter_impl_t() - ); -} -tp_rule_filter_t::tp_rule_filter_t(traffic_policy_rule_type_t filter_type) { - pimpl = std::shared_ptr( - new tp_rule_filter_impl_t( - filter_type - ) - ); -} -tp_rule_filter_t::tp_rule_filter_t( - const tp_rule_filter_t& other) -{ - pimpl = std::make_unique( - tp_rule_filter_impl_t(*other.pimpl)); -} -tp_rule_filter_t& -tp_rule_filter_t::operator=( - tp_rule_filter_t const & other) -{ - pimpl = std::shared_ptr( - new tp_rule_filter_impl_t(*other.pimpl)); - return *this; -} - std::set const & tp_rule_filter_t::src_addrs() const { return pimpl->src_addrs(); diff --git a/eos/inline/types/structured_filter_impl.h b/eos/inline/types/structured_filter_impl.h index 261e711..7e4f782 100644 --- a/eos/inline/types/structured_filter_impl.h +++ b/eos/inline/types/structured_filter_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_STRUCTURED_FILTER_IMPL_H diff --git a/eos/inline/types/subintf.h b/eos/inline/types/subintf.h index ef9c68f..d23a139 100644 --- a/eos/inline/types/subintf.h +++ b/eos/inline/types/subintf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_SUBINTF_H @@ -6,35 +6,6 @@ namespace eos { -// Default constructor. -subintf_t::subintf_t() { - pimpl = std::shared_ptr( - new subintf_impl_t() - ); -} -subintf_t::subintf_t(intf_id_t intf_id, vlan_id_t vlan_id) { - pimpl = std::shared_ptr( - new subintf_impl_t( - intf_id, - vlan_id - ) - ); -} -subintf_t::subintf_t( - const subintf_t& other) -{ - pimpl = std::make_unique( - subintf_impl_t(*other.pimpl)); -} -subintf_t& -subintf_t::operator=( - subintf_t const & other) -{ - pimpl = std::shared_ptr( - new subintf_impl_t(*other.pimpl)); - return *this; -} - intf_id_t subintf_t::intf_id() const { return pimpl->intf_id(); diff --git a/eos/inline/types/subintf_impl.h b/eos/inline/types/subintf_impl.h index 0730f45..0aed2f5 100644 --- a/eos/inline/types/subintf_impl.h +++ b/eos/inline/types/subintf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_SUBINTF_IMPL_H diff --git a/eos/inline/types/vrf.h b/eos/inline/types/vrf.h index 6327f11..c87544a 100644 --- a/eos/inline/types/vrf.h +++ b/eos/inline/types/vrf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_VRF_H @@ -23,36 +23,6 @@ operator<<(std::ostream& os, const vrf_state_t & enum_val) { } -// Default constructor. -vrf_t::vrf_t() { - pimpl = std::shared_ptr( - new vrf_impl_t() - ); -} -vrf_t::vrf_t(std::string name, vrf_state_t state, uint64_t rd) { - pimpl = std::shared_ptr( - new vrf_impl_t( - name, - state, - rd - ) - ); -} -vrf_t::vrf_t( - const vrf_t& other) -{ - pimpl = std::make_unique( - vrf_impl_t(*other.pimpl)); -} -vrf_t& -vrf_t::operator=( - vrf_t const & other) -{ - pimpl = std::shared_ptr( - new vrf_impl_t(*other.pimpl)); - return *this; -} - std::string vrf_t::name() const { return pimpl->name(); diff --git a/eos/inline/types/vrf_impl.h b/eos/inline/types/vrf_impl.h index 12022bd..a5f5a20 100644 --- a/eos/inline/types/vrf_impl.h +++ b/eos/inline/types/vrf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_INLINE_TYPES_VRF_IMPL_H diff --git a/eos/sdk.h b/eos/sdk.h index 11b6160..fddbec0 100644 --- a/eos/sdk.h +++ b/eos/sdk.h @@ -159,6 +159,7 @@ class EOS_SDK_PUBLIC sdk { hardware_table_mgr * get_hardware_table_mgr(); intf_mgr * get_intf_mgr(); intf_counter_mgr * get_intf_counter_mgr(); + intf_counter_mgr * get_intf_counter_mgr_with_mode(mgr_mode_type_t mode); ip_intf_mgr * get_ip_intf_mgr(); ip_route_mgr * get_ip_route_mgr(); lldp_mgr * get_lldp_mgr(); diff --git a/eos/types/acl.h b/eos/types/acl.h index b756509..a0c4292 100644 --- a/eos/types/acl.h +++ b/eos/types/acl.h @@ -1,10 +1,12 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ACL_H #define EOS_TYPES_ACL_H +#include #include +#include #include #include #include @@ -120,6 +122,11 @@ class EOS_SDK_PUBLIC acl_ttl_spec_t { acl_ttl_spec_t& operator=( acl_ttl_spec_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'oper': the type of range, note, BETWEEN is not supported. */ acl_range_operator_t oper() const; @@ -171,6 +178,11 @@ class EOS_SDK_PUBLIC acl_port_spec_t { acl_port_spec_t& operator=( acl_port_spec_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; acl_range_operator_t oper() const; void oper_is(acl_range_operator_t oper); @@ -289,6 +301,11 @@ class EOS_SDK_PUBLIC acl_rule_base_t { acl_rule_base_t& operator=( acl_rule_base_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; acl_action_t action() const; void action_is(acl_action_t action); @@ -327,6 +344,11 @@ class EOS_SDK_PUBLIC acl_rule_ip_t : public acl_rule_base_t { acl_rule_ip_t& operator=( acl_rule_ip_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; vlan_id_t vlan() const; void vlan_is(vlan_id_t vlan); @@ -453,6 +475,11 @@ class EOS_SDK_PUBLIC acl_rule_eth_t : public acl_rule_base_t { acl_rule_eth_t& operator=( acl_rule_eth_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; vlan_id_t vlan() const; void vlan_is(vlan_id_t vlan); diff --git a/eos/types/acl_impl.h b/eos/types/acl_impl.h index e6d095f..4648936 100644 --- a/eos/types/acl_impl.h +++ b/eos/types/acl_impl.h @@ -1,10 +1,12 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ACL_IMPL_H #define EOS_TYPES_ACL_IMPL_H +#include #include +#include #include #include #include @@ -121,10 +123,7 @@ class EOS_SDK_PUBLIC acl_port_spec_impl_t { */ class EOS_SDK_PUBLIC acl_rule_base_impl_t { public: - protected: acl_rule_base_impl_t(); - friend class acl_rule_base_t; - public: acl_action_t action() const; void action_is(acl_action_t action); diff --git a/eos/types/aresolve.h b/eos/types/aresolve.h index dc53e04..0cf446b 100644 --- a/eos/types/aresolve.h +++ b/eos/types/aresolve.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ARESOLVE_H diff --git a/eos/types/aresolve_impl.h b/eos/types/aresolve_impl.h index fff1680..81218ca 100644 --- a/eos/types/aresolve_impl.h +++ b/eos/types/aresolve_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ARESOLVE_IMPL_H diff --git a/eos/types/bfd.h b/eos/types/bfd.h index a094844..f5df5c0 100644 --- a/eos/types/bfd.h +++ b/eos/types/bfd.h @@ -1,10 +1,13 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_BFD_H #define EOS_TYPES_BFD_H #include +#include +#include +#include #include #include #include @@ -65,6 +68,11 @@ class EOS_SDK_PUBLIC bfd_session_key_t { bfd_session_key_t& operator=( bfd_session_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'ip_addr': IP address of the peer. */ ip_addr_t ip_addr() const; @@ -119,6 +127,11 @@ class EOS_SDK_PUBLIC bfd_interval_t { bfd_interval_t& operator=( bfd_interval_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'tx': desired minimum tx interval. */ uint16_t tx() const; @@ -160,6 +173,11 @@ class EOS_SDK_PUBLIC bfd_session_t { bfd_session_t& operator=( bfd_session_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'peer': the peer for this BFD session. */ bfd_session_key_t peer() const; @@ -207,6 +225,11 @@ class EOS_SDK_PUBLIC sbfd_echo_session_key_t { sbfd_echo_session_key_t& operator=( sbfd_echo_session_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'nexthop': nexthop IP address to send the probes to. @@ -271,6 +294,11 @@ class EOS_SDK_PUBLIC sbfd_interval_t { sbfd_interval_t& operator=( sbfd_interval_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'tx': desired minimum tx interval, in milliseconds. */ uint16_t tx() const; @@ -315,6 +343,11 @@ class EOS_SDK_PUBLIC sbfd_echo_session_rtt_stats_t { sbfd_echo_session_rtt_stats_t& operator=( sbfd_echo_session_rtt_stats_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'last_rtt': RTT of the last received probe, in microseconds. */ uint32_t last_rtt() const; diff --git a/eos/types/bfd_impl.h b/eos/types/bfd_impl.h index 2e40c8f..483f908 100644 --- a/eos/types/bfd_impl.h +++ b/eos/types/bfd_impl.h @@ -1,10 +1,13 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_BFD_IMPL_H #define EOS_TYPES_BFD_IMPL_H #include +#include +#include +#include #include #include #include diff --git a/eos/types/bgp.h b/eos/types/bgp.h index a196465..6a10021 100644 --- a/eos/types/bgp.h +++ b/eos/types/bgp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_BGP_H @@ -25,6 +25,11 @@ class EOS_SDK_PUBLIC bgp_peer_key_t { bgp_peer_key_t& operator=( bgp_peer_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'vrf_name': VRF name. */ std::string vrf_name() const; diff --git a/eos/types/bgp_impl.h b/eos/types/bgp_impl.h index 32d7c7b..2ce44ed 100644 --- a/eos/types/bgp_impl.h +++ b/eos/types/bgp_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_BGP_IMPL_H diff --git a/eos/types/bgp_path.h b/eos/types/bgp_path.h index 22bb827..978a275 100644 --- a/eos/types/bgp_path.h +++ b/eos/types/bgp_path.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_BGP_PATH_H @@ -45,6 +45,11 @@ class EOS_SDK_PUBLIC bgp_path_attr_fields_t { bgp_path_attr_fields_t& operator=( bgp_path_attr_fields_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'next_hop': true if these path attribute options enable next hop @@ -95,6 +100,11 @@ class EOS_SDK_PUBLIC bgp_path_options_t { bgp_path_options_t& operator=( bgp_path_options_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'receive_route_stage': The received routes stage of a path to @@ -143,6 +153,11 @@ class EOS_SDK_PUBLIC bgp_path_attr_t { bgp_path_attr_t& operator=( bgp_path_attr_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'next_hop': The nexthop address for the route. */ ip_addr_t next_hop() const; @@ -206,6 +221,11 @@ class EOS_SDK_PUBLIC bgp_path_key_t { bgp_path_key_t& operator=( bgp_path_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'prefix': IPv4/IPv6 network prefix. */ ip_prefix_t prefix() const; @@ -254,6 +274,11 @@ class EOS_SDK_PUBLIC bgp_path_t { bgp_path_t& operator=( bgp_path_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'path_key': The BGP path key. */ bgp_path_key_t path_key() const; diff --git a/eos/types/bgp_path_impl.h b/eos/types/bgp_path_impl.h index 15c22ac..9c4fb18 100644 --- a/eos/types/bgp_path_impl.h +++ b/eos/types/bgp_path_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_BGP_PATH_IMPL_H diff --git a/eos/types/class_map.h b/eos/types/class_map.h index 6ab57a9..c401d4e 100644 --- a/eos/types/class_map.h +++ b/eos/types/class_map.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_CLASS_MAP_H @@ -46,6 +46,11 @@ class EOS_SDK_PUBLIC class_map_rule_t { class_map_rule_t& operator=( class_map_rule_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'acl_key': the ACL name and type to use as a class map match rule. @@ -88,6 +93,11 @@ class EOS_SDK_PUBLIC class_map_t { class_map_t& operator=( class_map_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'key': the class map key. */ class_map_key_t key() const; diff --git a/eos/types/class_map_impl.h b/eos/types/class_map_impl.h index f95bcf9..eb477c9 100644 --- a/eos/types/class_map_impl.h +++ b/eos/types/class_map_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_CLASS_MAP_IMPL_H diff --git a/eos/types/decap_group.h b/eos/types/decap_group.h index 9f389a3..5608f93 100644 --- a/eos/types/decap_group.h +++ b/eos/types/decap_group.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_DECAP_GROUP_H @@ -42,6 +42,11 @@ class EOS_SDK_PUBLIC decap_group_t { decap_group_t& operator=( decap_group_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'group_name': the decap group name. Used to uniquely identify this diff --git a/eos/types/decap_group_impl.h b/eos/types/decap_group_impl.h index 594c2c4..53b5957 100644 --- a/eos/types/decap_group_impl.h +++ b/eos/types/decap_group_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_DECAP_GROUP_IMPL_H diff --git a/eos/types/directflow.h b/eos/types/directflow.h index e8c6204..7e56689 100644 --- a/eos/types/directflow.h +++ b/eos/types/directflow.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_DIRECTFLOW_H @@ -76,6 +76,11 @@ class EOS_SDK_PUBLIC flow_match_t { flow_match_t& operator=( flow_match_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'match_field_set': the fields to match on. */ flow_match_field_set_t match_field_set() const; @@ -233,6 +238,11 @@ class EOS_SDK_PUBLIC flow_action_t { flow_action_t& operator=( flow_action_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'action_set': actions that are enabled. */ flow_action_set_t action_set() const; @@ -311,6 +321,11 @@ class EOS_SDK_PUBLIC flow_entry_t { flow_entry_t& operator=( flow_entry_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; std::string name() const; @@ -350,6 +365,11 @@ class EOS_SDK_PUBLIC flow_counters_t { flow_counters_t& operator=( flow_counters_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; uint64_t bytes() const; diff --git a/eos/types/directflow_impl.h b/eos/types/directflow_impl.h index 5c6416a..23f5a17 100644 --- a/eos/types/directflow_impl.h +++ b/eos/types/directflow_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_DIRECTFLOW_IMPL_H diff --git a/eos/types/eapi.h b/eos/types/eapi.h index 88f6088..c5fc6fe 100644 --- a/eos/types/eapi.h +++ b/eos/types/eapi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_EAPI_H @@ -25,6 +25,11 @@ class EOS_SDK_PUBLIC eapi_response_t { eapi_response_t& operator=( eapi_response_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'success': indicates if a response was received. */ bool success() const; diff --git a/eos/types/eapi_impl.h b/eos/types/eapi_impl.h index 7ae182e..089858a 100644 --- a/eos/types/eapi_impl.h +++ b/eos/types/eapi_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_EAPI_IMPL_H diff --git a/eos/types/eth.h b/eos/types/eth.h index 3b1574d..b638040 100644 --- a/eos/types/eth.h +++ b/eos/types/eth.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ETH_H @@ -63,7 +63,7 @@ class EOS_SDK_PUBLIC eth_addr_t { bool operator==(eth_addr_t other) const; bool operator!=(eth_addr_t other) const; bool operator<(eth_addr_t other) const; - operator bool() const; + explicit operator bool() const; /** The hash function for type eth_addr_t. */ uint32_t hash() const; /** The hash mix function for type eth_addr_t. */ diff --git a/eos/types/eth_impl.h b/eos/types/eth_impl.h index b6cb5e2..0aea556 100644 --- a/eos/types/eth_impl.h +++ b/eos/types/eth_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ETH_IMPL_H diff --git a/eos/types/eth_intf.h b/eos/types/eth_intf.h index 942dd5c..6f2d5cb 100644 --- a/eos/types/eth_intf.h +++ b/eos/types/eth_intf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ETH_INTF_H diff --git a/eos/types/eth_intf_impl.h b/eos/types/eth_intf_impl.h index e360c4d..d3a4965 100644 --- a/eos/types/eth_intf_impl.h +++ b/eos/types/eth_intf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ETH_INTF_IMPL_H diff --git a/eos/types/eth_lag_intf.h b/eos/types/eth_lag_intf.h index 44f37ce..0a093c5 100644 --- a/eos/types/eth_lag_intf.h +++ b/eos/types/eth_lag_intf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ETH_LAG_INTF_H @@ -95,6 +95,11 @@ class EOS_SDK_PUBLIC eth_lag_intf_membership_t { eth_lag_intf_membership_t& operator=( eth_lag_intf_membership_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'eth_lag_intf_id': the LAG interface id this interface is @@ -168,6 +173,11 @@ class EOS_SDK_PUBLIC eth_lag_intf_t { eth_lag_intf_t& operator=( eth_lag_intf_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'intf': the id of this LAG interface. */ intf_id_t intf() const; diff --git a/eos/types/eth_lag_intf_impl.h b/eos/types/eth_lag_intf_impl.h index d3a4c16..f36b585 100644 --- a/eos/types/eth_lag_intf_impl.h +++ b/eos/types/eth_lag_intf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ETH_LAG_INTF_IMPL_H diff --git a/eos/types/eth_phy_intf.h b/eos/types/eth_phy_intf.h index c118dfd..1d71336 100644 --- a/eos/types/eth_phy_intf.h +++ b/eos/types/eth_phy_intf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ETH_PHY_INTF_H @@ -60,6 +60,11 @@ class EOS_SDK_PUBLIC eth_phy_intf_counters_t { eth_phy_intf_counters_t& operator=( eth_phy_intf_counters_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'single_collision_frames': Etherlike-MIB singleCollisionFrames @@ -190,6 +195,11 @@ class EOS_SDK_PUBLIC eth_phy_intf_bin_counters_t { eth_phy_intf_bin_counters_t& operator=( eth_phy_intf_bin_counters_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'in_64_octet_frames': Input 64 octet frame counter. */ uint64_t in_64_octet_frames() const; diff --git a/eos/types/eth_phy_intf_impl.h b/eos/types/eth_phy_intf_impl.h index 05dc263..948afe9 100644 --- a/eos/types/eth_phy_intf_impl.h +++ b/eos/types/eth_phy_intf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ETH_PHY_INTF_IMPL_H diff --git a/eos/types/fib.h b/eos/types/fib.h index 6640b59..58b9f59 100644 --- a/eos/types/fib.h +++ b/eos/types/fib.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_FIB_H @@ -25,6 +25,11 @@ class EOS_SDK_PUBLIC fib_route_key_t { fib_route_key_t& operator=( fib_route_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'prefix': IP v4/v6 network prefix. */ ip_prefix_t prefix() const; @@ -104,6 +109,11 @@ class EOS_SDK_PUBLIC fib_route_t { fib_route_t& operator=( fib_route_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'route_key': IP v4/v6 network route key consisting of prefix. */ fib_route_key_t route_key() const; @@ -157,6 +167,11 @@ class EOS_SDK_PUBLIC fib_fec_key_t { fib_fec_key_t& operator=( fib_fec_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'fec_id': fec_id[56:63] denotes the feature, 0: fib Fec, 1: @@ -197,6 +212,11 @@ class EOS_SDK_PUBLIC fib_via_t { fib_via_t& operator=( fib_via_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; ip_addr_t hop() const; void hop_is(ip_addr_t const & hop); @@ -255,6 +275,11 @@ class EOS_SDK_PUBLIC fib_fec_t { fib_fec_t& operator=( fib_fec_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'fec_key': fec_key consisting of fec_id. */ fib_fec_key_t fec_key() const; diff --git a/eos/types/fib_impl.h b/eos/types/fib_impl.h index e7c675e..3027a07 100644 --- a/eos/types/fib_impl.h +++ b/eos/types/fib_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_FIB_IMPL_H diff --git a/eos/types/hardware_table.h b/eos/types/hardware_table.h index 2694f83..116a6aa 100644 --- a/eos/types/hardware_table.h +++ b/eos/types/hardware_table.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_HARDWARE_TABLE_H @@ -25,6 +25,11 @@ class EOS_SDK_PUBLIC hardware_table_key_t { hardware_table_key_t& operator=( hardware_table_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'table_name': the name of the hardware resource. For example, this @@ -77,6 +82,11 @@ class EOS_SDK_PUBLIC hardware_table_high_watermark_t { hardware_table_high_watermark_t& operator=( hardware_table_high_watermark_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'max_entries': the maximum number of entries used so far. */ uint32_t max_entries() const; @@ -119,6 +129,11 @@ class EOS_SDK_PUBLIC hardware_table_usage_t { hardware_table_usage_t& operator=( hardware_table_usage_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'used_entries': number of entries used by this feature on this @@ -175,6 +190,11 @@ class EOS_SDK_PUBLIC hardware_table_entry_t { hardware_table_entry_t& operator=( hardware_table_entry_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'usage': the compound usage statistics. */ hardware_table_usage_t usage() const; diff --git a/eos/types/hardware_table_impl.h b/eos/types/hardware_table_impl.h index 5d97903..7d3c2f1 100644 --- a/eos/types/hardware_table_impl.h +++ b/eos/types/hardware_table_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_HARDWARE_TABLE_IMPL_H diff --git a/eos/types/intf.h b/eos/types/intf.h index c78e975..fb4c75b 100644 --- a/eos/types/intf.h +++ b/eos/types/intf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_INTF_H @@ -115,6 +115,11 @@ class EOS_SDK_PUBLIC intf_counters_t { intf_counters_t& operator=( intf_counters_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'out_ucast_pkts': IF-MIB ifOutUcastPkts. @@ -212,6 +217,11 @@ class EOS_SDK_PUBLIC intf_traffic_rates_t { intf_traffic_rates_t& operator=( intf_traffic_rates_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'out_pkts_rate': output packets per second. */ double out_pkts_rate() const; diff --git a/eos/types/intf_impl.h b/eos/types/intf_impl.h index 332df57..189f82e 100644 --- a/eos/types/intf_impl.h +++ b/eos/types/intf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_INTF_IMPL_H diff --git a/eos/types/ip.h b/eos/types/ip.h index ffafe3a..d29c1b1 100644 --- a/eos/types/ip.h +++ b/eos/types/ip.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_IP_H @@ -84,7 +84,7 @@ class EOS_SDK_PUBLIC ip_addr_t { /** String representation of the IP address, e.g. "1.2.3.4" or "f00d::1". */ std::string to_string() const; - operator bool() const; + explicit operator bool() const; /** The hash function for type ip_addr_t. */ uint32_t hash() const; /** The hash mix function for type ip_addr_t. */ @@ -187,6 +187,11 @@ class EOS_SDK_PUBLIC ip_addr_mask_t { ip_addr_mask_t& operator=( ip_addr_mask_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'addr': the address/mask's IP address. */ ip_addr_t addr() const; diff --git a/eos/types/ip_impl.h b/eos/types/ip_impl.h index fc2f04d..d75ffcc 100644 --- a/eos/types/ip_impl.h +++ b/eos/types/ip_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_IP_IMPL_H diff --git a/eos/types/ip_route.h b/eos/types/ip_route.h index 3709ab3..95b46fc 100644 --- a/eos/types/ip_route.h +++ b/eos/types/ip_route.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_IP_ROUTE_H @@ -50,6 +50,11 @@ class EOS_SDK_PUBLIC ip_route_key_t { ip_route_key_t& operator=( ip_route_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'prefix': the IP v4/v6 network prefix. */ ip_prefix_t prefix() const; @@ -61,6 +66,8 @@ class EOS_SDK_PUBLIC ip_route_key_t { /** Setter for 'preference'. */ void preference_is(ip_route_preference_t preference); + /** The address family of the route_key_t prefix. */ + af_t af() const; bool operator==(ip_route_key_t const & other) const; bool operator!=(ip_route_key_t const & other) const; /** The hash function for type ip_route_key_t. */ @@ -97,6 +104,11 @@ class EOS_SDK_PUBLIC ip_route_t { ip_route_t& operator=( ip_route_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'key': the route's key. */ ip_route_key_t key() const; @@ -124,6 +136,8 @@ class EOS_SDK_PUBLIC ip_route_t { /** Setter for 'command_tag'. */ void command_tag_is(std::string const & command_tag); + /** The address family of the route_key_t prefix. */ + af_t af() const; bool operator==(ip_route_t const & other) const; bool operator!=(ip_route_t const & other) const; /** The hash function for type ip_route_t. */ @@ -160,6 +174,11 @@ class EOS_SDK_PUBLIC ip_route_via_t { ip_route_via_t& operator=( ip_route_via_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'route_key': key for the route that this via is attached to. */ ip_route_key_t route_key() const; diff --git a/eos/types/ip_route_impl.h b/eos/types/ip_route_impl.h index 4ade9c7..2486feb 100644 --- a/eos/types/ip_route_impl.h +++ b/eos/types/ip_route_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_IP_ROUTE_IMPL_H @@ -33,6 +33,8 @@ class EOS_SDK_PUBLIC ip_route_key_impl_t { /** Setter for 'preference'. */ void preference_is(ip_route_preference_t preference); + /** The address family of the route_key_t prefix. */ + af_t af() const; bool operator==(ip_route_key_impl_t const & other) const; bool operator!=(ip_route_key_impl_t const & other) const; /** The hash function for type ip_route_key_t. */ @@ -90,6 +92,8 @@ class EOS_SDK_PUBLIC ip_route_impl_t { /** Setter for 'command_tag'. */ void command_tag_is(std::string const & command_tag); + /** The address family of the route_key_t prefix. */ + af_t af() const; bool operator==(ip_route_impl_t const & other) const; bool operator!=(ip_route_impl_t const & other) const; /** The hash function for type ip_route_t. */ diff --git a/eos/types/lldp.h b/eos/types/lldp.h index bf9ee86..df618ca 100644 --- a/eos/types/lldp.h +++ b/eos/types/lldp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_LLDP_H @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -23,6 +24,11 @@ class EOS_SDK_PUBLIC lldp_tlv_type_t { lldp_tlv_type_t& operator=( lldp_tlv_type_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'organization': IEEE assigned Organizationally Unique Identifier @@ -89,6 +95,11 @@ class EOS_SDK_PUBLIC lldp_std_tlv_type_t { lldp_std_tlv_type_t& operator=( lldp_std_tlv_type_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; void chassis_id_is(bool enabled); void intf_id_is(bool enabled); @@ -157,6 +168,11 @@ class EOS_SDK_PUBLIC lldp_syscap_t { lldp_syscap_t& operator=( lldp_syscap_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; bool other() const; bool repeater() const; @@ -196,6 +212,11 @@ class EOS_SDK_PUBLIC lldp_management_address_t { lldp_management_address_t& operator=( lldp_management_address_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'address_family': Type of address encoded in address field (see @@ -252,6 +273,11 @@ class EOS_SDK_PUBLIC lldp_lacp_t { lldp_lacp_t& operator=( lldp_lacp_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'capable': if port can become a member of a port-channel. */ bool capable() const; @@ -303,6 +329,11 @@ class EOS_SDK_PUBLIC lldp_phy_t { lldp_phy_t& operator=( lldp_phy_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'autonegSupported': if auto-negotiation supported. */ bool autonegSupported() const; @@ -379,6 +410,11 @@ class EOS_SDK_PUBLIC lldp_chassis_id_t { lldp_chassis_id_t& operator=( lldp_chassis_id_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; lldp_chassis_id_encoding_t encoding() const; @@ -437,6 +473,11 @@ class EOS_SDK_PUBLIC lldp_intf_id_t { lldp_intf_id_t& operator=( lldp_intf_id_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; lldp_intf_id_encoding_t encoding() const; @@ -476,6 +517,11 @@ class EOS_SDK_PUBLIC lldp_remote_system_t { lldp_remote_system_t& operator=( lldp_remote_system_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'chassis': The chassis-id of the remote system. */ lldp_chassis_id_t chassis() const; @@ -523,6 +569,11 @@ class EOS_SDK_PUBLIC lldp_neighbor_t { lldp_neighbor_t& operator=( lldp_neighbor_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'intf': The local interface that sees this neighbor. */ intf_id_t intf() const; diff --git a/eos/types/lldp_impl.h b/eos/types/lldp_impl.h index 4a59755..6d4134c 100644 --- a/eos/types/lldp_impl.h +++ b/eos/types/lldp_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_LLDP_IMPL_H @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/eos/types/mac_table.h b/eos/types/mac_table.h index 31d9b90..ef12684 100644 --- a/eos/types/mac_table.h +++ b/eos/types/mac_table.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MAC_TABLE_H @@ -68,6 +68,11 @@ class EOS_SDK_PUBLIC mac_key_t { mac_key_t& operator=( mac_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'vlan_id': the VLAN subdomain identifier. */ vlan_id_t vlan_id() const; @@ -122,6 +127,11 @@ class EOS_SDK_PUBLIC mac_entry_t { mac_entry_t& operator=( mac_entry_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'mac_key': the key of the MAC entry. */ mac_key_t mac_key() const; diff --git a/eos/types/mac_table_impl.h b/eos/types/mac_table_impl.h index 9f935aa..110af0f 100644 --- a/eos/types/mac_table_impl.h +++ b/eos/types/mac_table_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MAC_TABLE_IMPL_H diff --git a/eos/types/macsec.h b/eos/types/macsec.h index 255042d..ae08873 100644 --- a/eos/types/macsec.h +++ b/eos/types/macsec.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MACSEC_H @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -114,6 +115,11 @@ class EOS_SDK_PUBLIC macsec_key_t { macsec_key_t& operator=( macsec_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'cak': connectivity association key (CAK). CAK is a hex string. */ std::string cak() const; @@ -165,6 +171,11 @@ class EOS_SDK_PUBLIC macsec_profile_t { macsec_profile_t& operator=( macsec_profile_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'name': the name of the profile. */ macsec_profile_name_t name() const; @@ -306,6 +317,11 @@ class EOS_SDK_PUBLIC macsec_intf_status_t { macsec_intf_status_t& operator=( macsec_intf_status_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; macsec_intf_key_status_t key_status() const; @@ -354,6 +370,11 @@ class EOS_SDK_PUBLIC macsec_intf_counters_t { macsec_intf_counters_t& operator=( macsec_intf_counters_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; uint64_t out_pkts_encrypted() const; diff --git a/eos/types/macsec_impl.h b/eos/types/macsec_impl.h index 6f5a0da..0961212 100644 --- a/eos/types/macsec_impl.h +++ b/eos/types/macsec_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MACSEC_IMPL_H @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/eos/types/mlag.h b/eos/types/mlag.h index a91681e..2ebc60a 100644 --- a/eos/types/mlag.h +++ b/eos/types/mlag.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MLAG_H diff --git a/eos/types/mlag_impl.h b/eos/types/mlag_impl.h index f8825f4..03a5d52 100644 --- a/eos/types/mlag_impl.h +++ b/eos/types/mlag_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MLAG_IMPL_H diff --git a/eos/types/mpls.h b/eos/types/mpls.h index ab8a0a2..652c3e3 100644 --- a/eos/types/mpls.h +++ b/eos/types/mpls.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MPLS_H diff --git a/eos/types/mpls_impl.h b/eos/types/mpls_impl.h index 86ea36c..f05c424 100644 --- a/eos/types/mpls_impl.h +++ b/eos/types/mpls_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MPLS_IMPL_H diff --git a/eos/types/mpls_route.h b/eos/types/mpls_route.h index 0dfd369..ceb7ffd 100644 --- a/eos/types/mpls_route.h +++ b/eos/types/mpls_route.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MPLS_ROUTE_H @@ -43,6 +43,11 @@ class EOS_SDK_PUBLIC mpls_route_key_t { mpls_route_key_t& operator=( mpls_route_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'labels': a list of labels ( [ TOP, ..., BOT ] ) to match on @@ -107,6 +112,11 @@ class EOS_SDK_PUBLIC mpls_route_t { mpls_route_t& operator=( mpls_route_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'key': the MPLS route key. */ mpls_route_key_t key() const; @@ -146,6 +156,11 @@ class EOS_SDK_PUBLIC mpls_route_via_t { mpls_route_via_t& operator=( mpls_route_via_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; mpls_route_key_t route_key() const; void route_key_is(mpls_route_key_t route_key); @@ -234,6 +249,11 @@ class EOS_SDK_PUBLIC mpls_fec_id_t { mpls_fec_id_t& operator=( mpls_fec_id_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'id': the internal ID of this FEC. diff --git a/eos/types/mpls_route_impl.h b/eos/types/mpls_route_impl.h index be24eb4..ab94342 100644 --- a/eos/types/mpls_route_impl.h +++ b/eos/types/mpls_route_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MPLS_ROUTE_IMPL_H diff --git a/eos/types/mpls_vrf_label.h b/eos/types/mpls_vrf_label.h index b4c729e..2f5c928 100644 --- a/eos/types/mpls_vrf_label.h +++ b/eos/types/mpls_vrf_label.h @@ -1,10 +1,11 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MPLS_VRF_LABEL_H #define EOS_TYPES_MPLS_VRF_LABEL_H #include +#include #include #include #include @@ -21,6 +22,11 @@ class EOS_SDK_PUBLIC mpls_vrf_label_t { mpls_vrf_label_t& operator=( mpls_vrf_label_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'label': the decap label. */ mpls_label_t label() const; diff --git a/eos/types/mpls_vrf_label_impl.h b/eos/types/mpls_vrf_label_impl.h index 5f3a6a7..716e62a 100644 --- a/eos/types/mpls_vrf_label_impl.h +++ b/eos/types/mpls_vrf_label_impl.h @@ -1,10 +1,11 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_MPLS_VRF_LABEL_IMPL_H #define EOS_TYPES_MPLS_VRF_LABEL_IMPL_H #include +#include #include #include #include diff --git a/eos/types/neighbor_table.h b/eos/types/neighbor_table.h index 6efd322..e67cb9f 100644 --- a/eos/types/neighbor_table.h +++ b/eos/types/neighbor_table.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_NEIGHBOR_TABLE_H @@ -43,6 +43,11 @@ class EOS_SDK_PUBLIC neighbor_key_t { neighbor_key_t& operator=( neighbor_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'ip_addr': the ip address of the neighbor entry. */ ip_addr_t ip_addr() const; @@ -83,6 +88,11 @@ class EOS_SDK_PUBLIC neighbor_entry_t { neighbor_entry_t& operator=( neighbor_entry_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'neighbor_key': the key of the neighbor entry. */ neighbor_key_t neighbor_key() const; diff --git a/eos/types/neighbor_table_impl.h b/eos/types/neighbor_table_impl.h index 2772101..ca991ad 100644 --- a/eos/types/neighbor_table_impl.h +++ b/eos/types/neighbor_table_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_NEIGHBOR_TABLE_IMPL_H diff --git a/eos/types/nexthop_group.h b/eos/types/nexthop_group.h index 37b2c4b..addbed0 100644 --- a/eos/types/nexthop_group.h +++ b/eos/types/nexthop_group.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_NEXTHOP_GROUP_H @@ -79,6 +79,11 @@ class EOS_SDK_PUBLIC nexthop_group_mpls_action_t { nexthop_group_mpls_action_t& operator=( nexthop_group_mpls_action_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'action_type': the MPLS switching operation for this action. */ mpls_action_t action_type() const; @@ -135,6 +140,11 @@ class EOS_SDK_PUBLIC nexthop_group_entry_counter_t { nexthop_group_entry_counter_t& operator=( nexthop_group_entry_counter_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; uint64_t packets() const; @@ -183,6 +193,11 @@ class EOS_SDK_PUBLIC nexthop_group_entry_t { nexthop_group_entry_t& operator=( nexthop_group_entry_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'mpls_action': MPLS label switching stack for this entry. */ nexthop_group_mpls_action_t mpls_action() const; @@ -252,6 +267,11 @@ class EOS_SDK_PUBLIC nexthop_group_t { nexthop_group_t& operator=( nexthop_group_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'name': the unique name of the nexthop group. */ std::string name() const; @@ -420,6 +440,11 @@ class EOS_SDK_PUBLIC nexthop_group_programmed_status_t { nexthop_group_programmed_status_t& operator=( nexthop_group_programmed_status_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'counter_state': The status of the counter programming for this diff --git a/eos/types/nexthop_group_impl.h b/eos/types/nexthop_group_impl.h index 25bbecb..f52c790 100644 --- a/eos/types/nexthop_group_impl.h +++ b/eos/types/nexthop_group_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_NEXTHOP_GROUP_IMPL_H diff --git a/eos/types/nexthop_group_tunnel.h b/eos/types/nexthop_group_tunnel.h index fed7ac6..66cb1bf 100644 --- a/eos/types/nexthop_group_tunnel.h +++ b/eos/types/nexthop_group_tunnel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_NEXTHOP_GROUP_TUNNEL_H @@ -34,6 +34,11 @@ class EOS_SDK_PUBLIC nexthop_group_tunnel_t { nexthop_group_tunnel_t& operator=( nexthop_group_tunnel_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'tunnel_endpoint': IP v4/v6 prefix. */ ip_prefix_t tunnel_endpoint() const; diff --git a/eos/types/nexthop_group_tunnel_impl.h b/eos/types/nexthop_group_tunnel_impl.h index 4fb6b1b..e767670 100644 --- a/eos/types/nexthop_group_tunnel_impl.h +++ b/eos/types/nexthop_group_tunnel_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_NEXTHOP_GROUP_TUNNEL_IMPL_H diff --git a/eos/types/policy_map.h b/eos/types/policy_map.h index b21c583..59691b6 100644 --- a/eos/types/policy_map.h +++ b/eos/types/policy_map.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_POLICY_MAP_H @@ -147,6 +147,11 @@ class EOS_SDK_PUBLIC policy_map_key_t { policy_map_key_t& operator=( policy_map_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; std::string name() const; void name_is(std::string const & name); @@ -228,6 +233,11 @@ class EOS_SDK_PUBLIC policy_map_action_t { policy_map_action_t& operator=( policy_map_action_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; virtual ~policy_map_action_t(); policy_action_type_t action_type() const; @@ -324,11 +334,21 @@ class EOS_SDK_PUBLIC traffic_policy_action_t { traffic_policy_action_t& operator=( traffic_policy_action_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; virtual ~traffic_policy_action_t(); traffic_policy_action_type_t action_type() const; void action_type_is(traffic_policy_action_type_t action_type); + /** Getter for 'counter_name': the name of counter for count action. */ + std::string counter_name() const; + /** Setter for 'counter_name'. */ + void counter_name_is(std::string const & counter_name); + /** Getter for 'goto_class_name': the name of class for goto action. */ std::string goto_class_name() const; /** Setter for 'goto_class_name'. */ @@ -460,6 +480,11 @@ class EOS_SDK_PUBLIC policy_map_rule_t { policy_map_rule_t& operator=( policy_map_rule_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'class_map_key': the class map key (name is CLASS_MAP_MPLS_ANY if @@ -535,6 +560,11 @@ class EOS_SDK_PUBLIC policy_map_t { policy_map_t& operator=( policy_map_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; policy_map_key_t key() const; void key_is(policy_map_key_t const & key); @@ -586,6 +616,11 @@ class EOS_SDK_PUBLIC traffic_policy_rule_t { traffic_policy_rule_t& operator=( traffic_policy_rule_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; std::string match_rule_name() const; @@ -650,9 +685,21 @@ class EOS_SDK_PUBLIC traffic_policy_t { traffic_policy_t& operator=( traffic_policy_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; std::string key() const; + std::unordered_set const & named_counters() const; + void named_counters_is(std::unordered_set const & named_counters); + /** Inserts one named_counter of 'value' to the set. */ + void named_counter_set(std::string const & value); + /** Deletes one named_counter of 'value' from the set. */ + void named_counter_del(std::string const & value); + std::map const & rules() const; void rules_is(std::map const & rules); @@ -735,6 +782,11 @@ class EOS_SDK_PUBLIC policy_map_hw_status_key_t { policy_map_hw_status_key_t& operator=( policy_map_hw_status_key_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'intf_id': Interface ID at with a policy map is applied. @@ -786,6 +838,11 @@ class EOS_SDK_PUBLIC policy_map_hw_statuses_t { policy_map_hw_statuses_t& operator=( policy_map_hw_statuses_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'intf_statuses': A map of interface key and policy map status. */ std::map const & intf_statuses() diff --git a/eos/types/policy_map_impl.h b/eos/types/policy_map_impl.h index 5a51bab..be88f93 100644 --- a/eos/types/policy_map_impl.h +++ b/eos/types/policy_map_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_POLICY_MAP_IMPL_H @@ -168,6 +168,11 @@ class EOS_SDK_PUBLIC traffic_policy_action_impl_t { traffic_policy_action_type_t action_type() const; void action_type_is(traffic_policy_action_type_t action_type); + /** Getter for 'counter_name': the name of counter for count action. */ + std::string counter_name() const; + /** Setter for 'counter_name'. */ + void counter_name_is(std::string const & counter_name); + /** Getter for 'goto_class_name': the name of class for goto action. */ std::string goto_class_name() const; /** Setter for 'goto_class_name'. */ @@ -269,6 +274,7 @@ class EOS_SDK_PUBLIC traffic_policy_action_impl_t { private: traffic_policy_action_type_t action_type_; + std::string counter_name_; std::string goto_class_name_; bool goto_next_; uint8_t dscp_; @@ -480,6 +486,13 @@ class EOS_SDK_PUBLIC traffic_policy_impl_t { std::string key() const; + std::unordered_set const & named_counters() const; + void named_counters_is(std::unordered_set const & named_counters); + /** Inserts one named_counter of 'value' to the set. */ + void named_counter_set(std::string const & value); + /** Deletes one named_counter of 'value' from the set. */ + void named_counter_del(std::string const & value); + std::map const & rules() const; void rules_is(std::map const & rules); @@ -503,6 +516,7 @@ class EOS_SDK_PUBLIC traffic_policy_impl_t { private: std::string key_; + std::unordered_set named_counters_; std::map rules_; }; diff --git a/eos/types/route_map.h b/eos/types/route_map.h index d873491..b7d491f 100644 --- a/eos/types/route_map.h +++ b/eos/types/route_map.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ROUTE_MAP_H @@ -34,6 +34,11 @@ class EOS_SDK_PUBLIC link_bandwidth_t { link_bandwidth_t& operator=( link_bandwidth_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'value': The link bandwidth value. */ float value() const; @@ -94,6 +99,11 @@ class EOS_SDK_PUBLIC route_map_link_bandwidth_t { route_map_link_bandwidth_t& operator=( route_map_link_bandwidth_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'operation': Operation type. */ route_map_operation_type_t operation() const; @@ -140,6 +150,11 @@ class EOS_SDK_PUBLIC route_map_entry_t { route_map_entry_t& operator=( route_map_entry_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'permit': Permit sequence entry when true, deny otherwise. */ bool permit() const; @@ -192,6 +207,11 @@ class EOS_SDK_PUBLIC route_map_t { route_map_t& operator=( route_map_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** * Getter for 'map_entry': A map of route map entries, keyed by sequence number. diff --git a/eos/types/route_map_impl.h b/eos/types/route_map_impl.h index cbbe412..2f718f7 100644 --- a/eos/types/route_map_impl.h +++ b/eos/types/route_map_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_ROUTE_MAP_IMPL_H diff --git a/eos/types/sdk.h b/eos/types/sdk.h index 44f6974..72cda56 100644 --- a/eos/types/sdk.h +++ b/eos/types/sdk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_SDK_H diff --git a/eos/types/sdk_impl.h b/eos/types/sdk_impl.h index ea0b5d8..a49f512 100644 --- a/eos/types/sdk_impl.h +++ b/eos/types/sdk_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_SDK_IMPL_H diff --git a/eos/types/structured_filter.h b/eos/types/structured_filter.h index 8aea0a6..4ece965 100644 --- a/eos/types/structured_filter.h +++ b/eos/types/structured_filter.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_STRUCTURED_FILTER_H @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -36,6 +37,11 @@ class EOS_SDK_PUBLIC protocol_range_t { protocol_range_t& operator=( protocol_range_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; uint32_t range_start() const; void range_start_is(uint32_t range_start); @@ -74,6 +80,11 @@ class EOS_SDK_PUBLIC port_range_t { port_range_t& operator=( port_range_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; uint32_t range_start() const; void range_start_is(uint32_t range_start); @@ -112,6 +123,11 @@ class EOS_SDK_PUBLIC port_field_t { port_field_t& operator=( port_field_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; std::set const & src_ports() const; void src_ports_is(std::set const & src_ports); @@ -174,6 +190,11 @@ class EOS_SDK_PUBLIC protocol_field_t { protocol_field_t& operator=( protocol_field_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'ports': the key of the map ports should be an unique id. */ std::map const & ports() const; @@ -232,6 +253,11 @@ class EOS_SDK_PUBLIC tp_rule_filter_t { tp_rule_filter_t& operator=( tp_rule_filter_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; std::set const & src_addrs() const; diff --git a/eos/types/structured_filter_impl.h b/eos/types/structured_filter_impl.h index 2b6c527..56d3930 100644 --- a/eos/types/structured_filter_impl.h +++ b/eos/types/structured_filter_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_STRUCTURED_FILTER_IMPL_H @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/eos/types/subintf.h b/eos/types/subintf.h index f176ccd..f6218d5 100644 --- a/eos/types/subintf.h +++ b/eos/types/subintf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_SUBINTF_H @@ -23,6 +23,11 @@ class EOS_SDK_PUBLIC subintf_t { subintf_t& operator=( subintf_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'intf_id': the interface ID of this subinterface. */ intf_id_t intf_id() const; diff --git a/eos/types/subintf_impl.h b/eos/types/subintf_impl.h index 39ddc89..88c1833 100644 --- a/eos/types/subintf_impl.h +++ b/eos/types/subintf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_SUBINTF_IMPL_H diff --git a/eos/types/vrf.h b/eos/types/vrf.h index cf58cbb..6b1def9 100644 --- a/eos/types/vrf.h +++ b/eos/types/vrf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_VRF_H @@ -36,6 +36,11 @@ class EOS_SDK_PUBLIC vrf_t { vrf_t& operator=( vrf_t const & other); + static void * operator new( std::size_t, void * ptr ) { + return ptr; + } + static void * operator new( std::size_t ); + static void operator delete( void * ) noexcept; /** Getter for 'name': the name of the VRF. */ std::string name() const; diff --git a/eos/types/vrf_impl.h b/eos/types/vrf_impl.h index 116cd06..e1fd816 100644 --- a/eos/types/vrf_impl.h +++ b/eos/types/vrf_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef EOS_TYPES_VRF_IMPL_H diff --git a/eos/version.h b/eos/version.h index 0636e56..4084c87 100644 --- a/eos/version.h +++ b/eos/version.h @@ -24,7 +24,7 @@ #include -#define EOSSDK_VERSION "2.22.5" +#define EOSSDK_VERSION "2.22.5.1" #define EOSSDK_MAJOR 2 #define EOSSDK_MINOR 22 #define EOSSDK_PATCH 5 diff --git a/eth_lag_intf_gen.cpp b/eth_lag_intf_gen.cpp new file mode 100644 index 0000000..cc88fa2 --- /dev/null +++ b/eth_lag_intf_gen.cpp @@ -0,0 +1,91 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/eth_lag_intf.h" +#include "eos/types/eth_lag_intf_impl.h" + +namespace eos { + +// Default constructor. +eth_lag_intf_membership_t::eth_lag_intf_membership_t() : + pimpl(std::make_shared()) {} +eth_lag_intf_membership_t::eth_lag_intf_membership_t( + intf_id_t eth_lag_intf_id, bool active, std::string const & reason, + double member_time, eth_lag_intf_member_lacp_mode_t mode) : + pimpl(std::make_shared( + eth_lag_intf_id, + active, + reason, + member_time, + mode + )) {} +EOS_SDK_PUBLIC eth_lag_intf_membership_t::eth_lag_intf_membership_t( + const eth_lag_intf_membership_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC eth_lag_intf_membership_t& +eth_lag_intf_membership_t::operator=( + eth_lag_intf_membership_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +eth_lag_intf_membership_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +eth_lag_intf_membership_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +eth_lag_intf_t::eth_lag_intf_t() : + pimpl(std::make_shared()) {} +eth_lag_intf_t::eth_lag_intf_t(intf_id_t intf) : + pimpl(std::make_shared( + intf + )) {} +eth_lag_intf_t::eth_lag_intf_t(intf_id_t intf, uint32_t min_links, uint64_t speed, + eth_lag_intf_fallback_type_t fallback_type, + uint16_t fallback_timeout) : + pimpl(std::make_shared( + intf, + min_links, + speed, + fallback_type, + fallback_timeout + )) {} +EOS_SDK_PUBLIC eth_lag_intf_t::eth_lag_intf_t( + const eth_lag_intf_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC eth_lag_intf_t& +eth_lag_intf_t::operator=( + eth_lag_intf_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +eth_lag_intf_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +eth_lag_intf_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/eth_phy_intf_gen.cpp b/eth_phy_intf_gen.cpp new file mode 100644 index 0000000..2902b25 --- /dev/null +++ b/eth_phy_intf_gen.cpp @@ -0,0 +1,125 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/eth_phy_intf.h" +#include "eos/types/eth_phy_intf_impl.h" + +namespace eos { + +// Default constructor. +eth_phy_intf_counters_t::eth_phy_intf_counters_t() : + pimpl(std::make_shared()) {} +eth_phy_intf_counters_t::eth_phy_intf_counters_t( + uint64_t single_collision_frames, uint64_t multiple_collision_frames, + uint64_t fcs_errors, uint64_t alignment_errors, + uint64_t deferred_transmissions, uint64_t late_collisions, + uint64_t excessive_collisions, uint64_t internal_mac_transmit_errors, + uint64_t carrier_sense_errors, uint64_t internal_mac_receive_errors, + uint64_t frame_too_shorts, uint64_t frame_too_longs, + uint64_t sqe_test_errors, uint64_t symbol_errors, + uint64_t in_unknown_opcodes, uint64_t out_pause_frames, + uint64_t in_pause_frames, uint64_t fragments, uint64_t jabbers) : + pimpl(std::make_shared( + single_collision_frames, + multiple_collision_frames, + fcs_errors, + alignment_errors, + deferred_transmissions, + late_collisions, + excessive_collisions, + internal_mac_transmit_errors, + carrier_sense_errors, + internal_mac_receive_errors, + frame_too_shorts, + frame_too_longs, + sqe_test_errors, + symbol_errors, + in_unknown_opcodes, + out_pause_frames, + in_pause_frames, + fragments, + jabbers + )) {} +EOS_SDK_PUBLIC eth_phy_intf_counters_t::eth_phy_intf_counters_t( + const eth_phy_intf_counters_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC eth_phy_intf_counters_t& +eth_phy_intf_counters_t::operator=( + eth_phy_intf_counters_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +eth_phy_intf_counters_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +eth_phy_intf_counters_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +eth_phy_intf_bin_counters_t::eth_phy_intf_bin_counters_t() : + pimpl(std::make_shared()) {} +eth_phy_intf_bin_counters_t::eth_phy_intf_bin_counters_t( + uint64_t in_64_octet_frames, uint64_t in_65_to_127_octet_frames, + uint64_t in_128_to_255_octet_frames, uint64_t in_256_to_511_octet_frames, + uint64_t in_512_to_1023_octet_frames, + uint64_t in_1024_to_1522_octet_frames, + uint64_t in_1523_to_max_octet_frames, uint64_t out_64_octet_frames, + uint64_t out_65_to_127_octet_frames, uint64_t out_128_to_255_octet_frames, + uint64_t out_256_to_511_octet_frames, + uint64_t out_512_to_1023_octet_frames, + uint64_t out_1024_to_1522_octet_frames, + uint64_t out_1523_to_max_octet_frames) : + pimpl(std::make_shared( + in_64_octet_frames, + in_65_to_127_octet_frames, + in_128_to_255_octet_frames, + in_256_to_511_octet_frames, + in_512_to_1023_octet_frames, + in_1024_to_1522_octet_frames, + in_1523_to_max_octet_frames, + out_64_octet_frames, + out_65_to_127_octet_frames, + out_128_to_255_octet_frames, + out_256_to_511_octet_frames, + out_512_to_1023_octet_frames, + out_1024_to_1522_octet_frames, + out_1523_to_max_octet_frames + )) {} +EOS_SDK_PUBLIC eth_phy_intf_bin_counters_t::eth_phy_intf_bin_counters_t( + const eth_phy_intf_bin_counters_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC eth_phy_intf_bin_counters_t& +eth_phy_intf_bin_counters_t::operator=( + eth_phy_intf_bin_counters_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +eth_phy_intf_bin_counters_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +eth_phy_intf_bin_counters_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/eth_types.cpp b/eth_types.cpp index 76a7f72..379c83a 100644 --- a/eth_types.cpp +++ b/eth_types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #include "eos/eth.h" diff --git a/examples/EosThrift_constants.cpp b/examples/EosThrift_constants.cpp deleted file mode 100644 index fc9d357..0000000 --- a/examples/EosThrift_constants.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.10.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#include "EosThrift_constants.h" - -namespace eos { - -const EosThriftConstants g_EosThrift_constants; - -EosThriftConstants::EosThriftConstants() { -} - -} // namespace - diff --git a/examples/EosThrift_constants.h b/examples/EosThrift_constants.h deleted file mode 100644 index 08d8366..0000000 --- a/examples/EosThrift_constants.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.10.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#ifndef EosThrift_CONSTANTS_H -#define EosThrift_CONSTANTS_H - -#include "EosThrift_types.h" - -namespace eos { - -class EosThriftConstants { - public: - EosThriftConstants(); - -}; - -extern const EosThriftConstants g_EosThrift_constants; - -} // namespace - -#endif diff --git a/examples/EosThrift_types.cpp b/examples/EosThrift_types.cpp deleted file mode 100644 index fc74dc8..0000000 --- a/examples/EosThrift_types.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.10.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#include "EosThrift_types.h" - -#include -#include - -#include - -namespace eos { - -int _kOperStatusValues[] = { - OperStatus::UNKNOWN, - OperStatus::UP, - OperStatus::DOWN -}; -const char* _kOperStatusNames[] = { - "UNKNOWN", - "UP", - "DOWN" -}; -const std::map _OperStatus_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kOperStatusValues, _kOperStatusNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -int _kInterfaceTypeValues[] = { - InterfaceType::UNKNOWN, - InterfaceType::OTHER, - InterfaceType::ETH, - InterfaceType::VLAN, - InterfaceType::MANAGEMENT, - InterfaceType::LOOPBACK, - InterfaceType::LAG, - InterfaceType::NULL0 -}; -const char* _kInterfaceTypeNames[] = { - "UNKNOWN", - "OTHER", - "ETH", - "VLAN", - "MANAGEMENT", - "LOOPBACK", - "LAG", - "NULL0" -}; -const std::map _InterfaceType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(8, _kInterfaceTypeValues, _kInterfaceTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -} // namespace diff --git a/examples/EosThrift_types.h b/examples/EosThrift_types.h deleted file mode 100644 index 4d8ee91..0000000 --- a/examples/EosThrift_types.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.10.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#ifndef EosThrift_TYPES_H -#define EosThrift_TYPES_H - -#include - -#include -#include -#include -#include -#include - -#include - - -namespace eos { - -struct OperStatus { - enum type { - UNKNOWN = 0, - UP = 1, - DOWN = 2 - }; -}; - -extern const std::map _OperStatus_VALUES_TO_NAMES; - -struct InterfaceType { - enum type { - UNKNOWN = 0, - OTHER = 1, - ETH = 2, - VLAN = 3, - MANAGEMENT = 4, - LOOPBACK = 5, - LAG = 6, - NULL0 = 7 - }; -}; - -extern const std::map _InterfaceType_VALUES_TO_NAMES; - -} // namespace - -#endif diff --git a/examples/MplsTunnelLivenessAgent.py b/examples/MplsTunnelLivenessAgent.py index 67eecb5..be150dd 100755 --- a/examples/MplsTunnelLivenessAgent.py +++ b/examples/MplsTunnelLivenessAgent.py @@ -72,7 +72,7 @@ def serialize(self): # First put the length of this packet ret = struct.pack(Message.header_format, 1, self.pid, self.egress_tunnel_key, self.msg_id, len(self.tunnel_liveness)) - for tunnel_key, is_alive in self.tunnel_liveness.iteritems(): + for tunnel_key, is_alive in self.tunnel_liveness.items(): ret += struct.pack(Message.tunnel_entry_format, tunnel_key, is_alive) if len(ret) > MAX_PKT_SIZE: assert False, "Packet %s too large to send!" % self.__str__() @@ -286,12 +286,12 @@ def on_timeout(self): check if we haven't heard about any of our tunnels recently, and if so, mark them as dead. """ cur_time = time.time() - for host in self.remote_switches.itervalues(): + for host in self.remote_switches.values(): liveness_dict = host.liveness_dict(cur_time) host.last_tx_msg_id += 1 if host.last_tx_msg_id > MAX_INT: host.last_tx_msg_id = 1 - for key, tunnel in host.egress_tunnels.iteritems(): + for key, tunnel in host.egress_tunnels.items(): msg = Message(self.pid, key, host.last_tx_msg_id, liveness_dict) self.send_packet(host.destination_ip, tunnel, msg) if tunnel.is_alive and ( @@ -365,7 +365,7 @@ def on_readable(self, fd): return remote_switch.last_rx_msg_id = msg.msg_id - for tunnel_key, is_alive in msg.tunnel_liveness.iteritems(): + for tunnel_key, is_alive in msg.tunnel_liveness.items(): if tunnel_key not in remote_switch.egress_tunnels: # They are telling us about one of our egress tunnels that # we have no record of... @@ -468,7 +468,7 @@ def process_config(self): for rs in cfg["remote_switches"]: dst_ip = rs["destination_ip"] dst = RemoteSwitch(dst_ip) - for tunnel_key_str, tunnel_info in rs["tunnels"].iteritems(): + for tunnel_key_str, tunnel_info in rs["tunnels"].items(): tunnel_key = int(tunnel_key_str) dst.egress_tunnels[tunnel_key] = EgressTunnel( tunnel_info["label"], tunnel_info["nexthop_ip"]) @@ -479,8 +479,8 @@ def process_config(self): def resolve_config(self): self.tracer.trace2("Resolving all of our configured tunnels") - for host in self.remote_switches.itervalues(): - for tunnel in host.egress_tunnels.itervalues(): + for host in self.remote_switches.values(): + for tunnel in host.egress_tunnels.values(): tunnel.last_update_time = time.time() + STARTUP_GRACEPERIOD self.resolve_egress_tunnel(tunnel) self.timeout_time_is(eossdk.now() + POLL_TIME) diff --git a/examples/StreamHandler.cpp b/examples/StreamHandler.cpp index e8c1daf..c853eb2 100644 --- a/examples/StreamHandler.cpp +++ b/examples/StreamHandler.cpp @@ -288,8 +288,8 @@ stream_handler::on_readable(int notifying_fd) { } if(bytes_recvd == 0) { tracer.trace0("Connection to %d closed", fd); - on_connection_closed(); watch_stream(fd, false); + on_connection_closed(); return; } bytes_read += bytes_recvd; diff --git a/examples/ThriftSdk.cpp b/examples/ThriftSdk.cpp deleted file mode 100644 index d2777ff..0000000 --- a/examples/ThriftSdk.cpp +++ /dev/null @@ -1,1907 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.10.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#include "ThriftSdk.h" - -namespace eos { - - -ThriftSdk_exists_args::~ThriftSdk_exists_args() throw() { -} - - -uint32_t ThriftSdk_exists_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->intf); - this->__isset.intf = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_exists_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_exists_args"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->intf); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_exists_pargs::~ThriftSdk_exists_pargs() throw() { -} - - -uint32_t ThriftSdk_exists_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_exists_pargs"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString((*(this->intf))); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_exists_result::~ThriftSdk_exists_result() throw() { -} - - -uint32_t ThriftSdk_exists_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 0: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->success); - this->__isset.success = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_exists_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("ThriftSdk_exists_result"); - - if (this->__isset.success) { - xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); - xfer += oprot->writeBool(this->success); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_exists_presult::~ThriftSdk_exists_presult() throw() { -} - - -uint32_t ThriftSdk_exists_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 0: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool((*(this->success))); - this->__isset.success = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - - -ThriftSdk_adminEnabled_args::~ThriftSdk_adminEnabled_args() throw() { -} - - -uint32_t ThriftSdk_adminEnabled_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->intf); - this->__isset.intf = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_adminEnabled_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_adminEnabled_args"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->intf); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_adminEnabled_pargs::~ThriftSdk_adminEnabled_pargs() throw() { -} - - -uint32_t ThriftSdk_adminEnabled_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_adminEnabled_pargs"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString((*(this->intf))); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_adminEnabled_result::~ThriftSdk_adminEnabled_result() throw() { -} - - -uint32_t ThriftSdk_adminEnabled_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 0: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->success); - this->__isset.success = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_adminEnabled_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("ThriftSdk_adminEnabled_result"); - - if (this->__isset.success) { - xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); - xfer += oprot->writeBool(this->success); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_adminEnabled_presult::~ThriftSdk_adminEnabled_presult() throw() { -} - - -uint32_t ThriftSdk_adminEnabled_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 0: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool((*(this->success))); - this->__isset.success = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - - -ThriftSdk_adminEnabledIs_args::~ThriftSdk_adminEnabledIs_args() throw() { -} - - -uint32_t ThriftSdk_adminEnabledIs_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->intf); - this->__isset.intf = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->enabled); - this->__isset.enabled = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_adminEnabledIs_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_adminEnabledIs_args"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->intf); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("enabled", ::apache::thrift::protocol::T_BOOL, 2); - xfer += oprot->writeBool(this->enabled); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_adminEnabledIs_pargs::~ThriftSdk_adminEnabledIs_pargs() throw() { -} - - -uint32_t ThriftSdk_adminEnabledIs_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_adminEnabledIs_pargs"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString((*(this->intf))); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("enabled", ::apache::thrift::protocol::T_BOOL, 2); - xfer += oprot->writeBool((*(this->enabled))); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_adminEnabledIs_result::~ThriftSdk_adminEnabledIs_result() throw() { -} - - -uint32_t ThriftSdk_adminEnabledIs_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - xfer += iprot->skip(ftype); - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_adminEnabledIs_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("ThriftSdk_adminEnabledIs_result"); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_adminEnabledIs_presult::~ThriftSdk_adminEnabledIs_presult() throw() { -} - - -uint32_t ThriftSdk_adminEnabledIs_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - xfer += iprot->skip(ftype); - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - - -ThriftSdk_descriptionIs_args::~ThriftSdk_descriptionIs_args() throw() { -} - - -uint32_t ThriftSdk_descriptionIs_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->intf); - this->__isset.intf = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->description); - this->__isset.description = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_descriptionIs_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_descriptionIs_args"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->intf); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->description); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_descriptionIs_pargs::~ThriftSdk_descriptionIs_pargs() throw() { -} - - -uint32_t ThriftSdk_descriptionIs_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_descriptionIs_pargs"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString((*(this->intf))); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString((*(this->description))); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_descriptionIs_result::~ThriftSdk_descriptionIs_result() throw() { -} - - -uint32_t ThriftSdk_descriptionIs_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - xfer += iprot->skip(ftype); - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_descriptionIs_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("ThriftSdk_descriptionIs_result"); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_descriptionIs_presult::~ThriftSdk_descriptionIs_presult() throw() { -} - - -uint32_t ThriftSdk_descriptionIs_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - xfer += iprot->skip(ftype); - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - - -ThriftSdk_operStatus_args::~ThriftSdk_operStatus_args() throw() { -} - - -uint32_t ThriftSdk_operStatus_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->intf); - this->__isset.intf = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_operStatus_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_operStatus_args"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->intf); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_operStatus_pargs::~ThriftSdk_operStatus_pargs() throw() { -} - - -uint32_t ThriftSdk_operStatus_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("ThriftSdk_operStatus_pargs"); - - xfer += oprot->writeFieldBegin("intf", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString((*(this->intf))); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_operStatus_result::~ThriftSdk_operStatus_result() throw() { -} - - -uint32_t ThriftSdk_operStatus_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 0: - if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast0; - xfer += iprot->readI32(ecast0); - this->success = (OperStatus::type)ecast0; - this->__isset.success = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t ThriftSdk_operStatus_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("ThriftSdk_operStatus_result"); - - if (this->__isset.success) { - xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0); - xfer += oprot->writeI32((int32_t)this->success); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - - -ThriftSdk_operStatus_presult::~ThriftSdk_operStatus_presult() throw() { -} - - -uint32_t ThriftSdk_operStatus_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 0: - if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast1; - xfer += iprot->readI32(ecast1); - (*(this->success)) = (OperStatus::type)ecast1; - this->__isset.success = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -bool ThriftSdkClient::exists(const std::string& intf) -{ - send_exists(intf); - return recv_exists(); -} - -void ThriftSdkClient::send_exists(const std::string& intf) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("exists", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_exists_pargs args; - args.intf = &intf; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -bool ThriftSdkClient::recv_exists() -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - iprot_->readMessageBegin(fname, mtype, rseqid); - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("exists") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - bool _return; - ThriftSdk_exists_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - return _return; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "exists failed: unknown result"); -} - -bool ThriftSdkClient::adminEnabled(const std::string& intf) -{ - send_adminEnabled(intf); - return recv_adminEnabled(); -} - -void ThriftSdkClient::send_adminEnabled(const std::string& intf) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("adminEnabled", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_adminEnabled_pargs args; - args.intf = &intf; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -bool ThriftSdkClient::recv_adminEnabled() -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - iprot_->readMessageBegin(fname, mtype, rseqid); - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("adminEnabled") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - bool _return; - ThriftSdk_adminEnabled_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - return _return; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "adminEnabled failed: unknown result"); -} - -void ThriftSdkClient::adminEnabledIs(const std::string& intf, const bool enabled) -{ - send_adminEnabledIs(intf, enabled); - recv_adminEnabledIs(); -} - -void ThriftSdkClient::send_adminEnabledIs(const std::string& intf, const bool enabled) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("adminEnabledIs", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_adminEnabledIs_pargs args; - args.intf = &intf; - args.enabled = &enabled; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void ThriftSdkClient::recv_adminEnabledIs() -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - iprot_->readMessageBegin(fname, mtype, rseqid); - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("adminEnabledIs") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - ThriftSdk_adminEnabledIs_presult result; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - return; -} - -void ThriftSdkClient::descriptionIs(const std::string& intf, const std::string& description) -{ - send_descriptionIs(intf, description); - recv_descriptionIs(); -} - -void ThriftSdkClient::send_descriptionIs(const std::string& intf, const std::string& description) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("descriptionIs", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_descriptionIs_pargs args; - args.intf = &intf; - args.description = &description; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void ThriftSdkClient::recv_descriptionIs() -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - iprot_->readMessageBegin(fname, mtype, rseqid); - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("descriptionIs") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - ThriftSdk_descriptionIs_presult result; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - return; -} - -OperStatus::type ThriftSdkClient::operStatus(const std::string& intf) -{ - send_operStatus(intf); - return recv_operStatus(); -} - -void ThriftSdkClient::send_operStatus(const std::string& intf) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("operStatus", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_operStatus_pargs args; - args.intf = &intf; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -OperStatus::type ThriftSdkClient::recv_operStatus() -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - iprot_->readMessageBegin(fname, mtype, rseqid); - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("operStatus") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - OperStatus::type _return; - ThriftSdk_operStatus_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - return _return; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "operStatus failed: unknown result"); -} - -bool ThriftSdkProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) { - ProcessMap::iterator pfn; - pfn = processMap_.find(fname); - if (pfn == processMap_.end()) { - iprot->skip(::apache::thrift::protocol::T_STRUCT); - iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); - ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'"); - oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); - x.write(oprot); - oprot->writeMessageEnd(); - oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - return true; - } - (this->*(pfn->second))(seqid, iprot, oprot, callContext); - return true; -} - -void ThriftSdkProcessor::process_exists(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) -{ - void* ctx = NULL; - if (this->eventHandler_.get() != NULL) { - ctx = this->eventHandler_->getContext("ThriftSdk.exists", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftSdk.exists"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "ThriftSdk.exists"); - } - - ThriftSdk_exists_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "ThriftSdk.exists", bytes); - } - - ThriftSdk_exists_result result; - try { - result.success = iface_->exists(args.intf); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "ThriftSdk.exists"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("exists", ::apache::thrift::protocol::T_EXCEPTION, seqid); - x.write(oprot); - oprot->writeMessageEnd(); - oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - return; - } - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preWrite(ctx, "ThriftSdk.exists"); - } - - oprot->writeMessageBegin("exists", ::apache::thrift::protocol::T_REPLY, seqid); - result.write(oprot); - oprot->writeMessageEnd(); - bytes = oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postWrite(ctx, "ThriftSdk.exists", bytes); - } -} - -void ThriftSdkProcessor::process_adminEnabled(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) -{ - void* ctx = NULL; - if (this->eventHandler_.get() != NULL) { - ctx = this->eventHandler_->getContext("ThriftSdk.adminEnabled", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftSdk.adminEnabled"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "ThriftSdk.adminEnabled"); - } - - ThriftSdk_adminEnabled_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "ThriftSdk.adminEnabled", bytes); - } - - ThriftSdk_adminEnabled_result result; - try { - result.success = iface_->adminEnabled(args.intf); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "ThriftSdk.adminEnabled"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("adminEnabled", ::apache::thrift::protocol::T_EXCEPTION, seqid); - x.write(oprot); - oprot->writeMessageEnd(); - oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - return; - } - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preWrite(ctx, "ThriftSdk.adminEnabled"); - } - - oprot->writeMessageBegin("adminEnabled", ::apache::thrift::protocol::T_REPLY, seqid); - result.write(oprot); - oprot->writeMessageEnd(); - bytes = oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postWrite(ctx, "ThriftSdk.adminEnabled", bytes); - } -} - -void ThriftSdkProcessor::process_adminEnabledIs(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) -{ - void* ctx = NULL; - if (this->eventHandler_.get() != NULL) { - ctx = this->eventHandler_->getContext("ThriftSdk.adminEnabledIs", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftSdk.adminEnabledIs"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "ThriftSdk.adminEnabledIs"); - } - - ThriftSdk_adminEnabledIs_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "ThriftSdk.adminEnabledIs", bytes); - } - - ThriftSdk_adminEnabledIs_result result; - try { - iface_->adminEnabledIs(args.intf, args.enabled); - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "ThriftSdk.adminEnabledIs"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("adminEnabledIs", ::apache::thrift::protocol::T_EXCEPTION, seqid); - x.write(oprot); - oprot->writeMessageEnd(); - oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - return; - } - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preWrite(ctx, "ThriftSdk.adminEnabledIs"); - } - - oprot->writeMessageBegin("adminEnabledIs", ::apache::thrift::protocol::T_REPLY, seqid); - result.write(oprot); - oprot->writeMessageEnd(); - bytes = oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postWrite(ctx, "ThriftSdk.adminEnabledIs", bytes); - } -} - -void ThriftSdkProcessor::process_descriptionIs(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) -{ - void* ctx = NULL; - if (this->eventHandler_.get() != NULL) { - ctx = this->eventHandler_->getContext("ThriftSdk.descriptionIs", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftSdk.descriptionIs"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "ThriftSdk.descriptionIs"); - } - - ThriftSdk_descriptionIs_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "ThriftSdk.descriptionIs", bytes); - } - - ThriftSdk_descriptionIs_result result; - try { - iface_->descriptionIs(args.intf, args.description); - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "ThriftSdk.descriptionIs"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("descriptionIs", ::apache::thrift::protocol::T_EXCEPTION, seqid); - x.write(oprot); - oprot->writeMessageEnd(); - oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - return; - } - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preWrite(ctx, "ThriftSdk.descriptionIs"); - } - - oprot->writeMessageBegin("descriptionIs", ::apache::thrift::protocol::T_REPLY, seqid); - result.write(oprot); - oprot->writeMessageEnd(); - bytes = oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postWrite(ctx, "ThriftSdk.descriptionIs", bytes); - } -} - -void ThriftSdkProcessor::process_operStatus(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) -{ - void* ctx = NULL; - if (this->eventHandler_.get() != NULL) { - ctx = this->eventHandler_->getContext("ThriftSdk.operStatus", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftSdk.operStatus"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "ThriftSdk.operStatus"); - } - - ThriftSdk_operStatus_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "ThriftSdk.operStatus", bytes); - } - - ThriftSdk_operStatus_result result; - try { - result.success = iface_->operStatus(args.intf); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "ThriftSdk.operStatus"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("operStatus", ::apache::thrift::protocol::T_EXCEPTION, seqid); - x.write(oprot); - oprot->writeMessageEnd(); - oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - return; - } - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preWrite(ctx, "ThriftSdk.operStatus"); - } - - oprot->writeMessageBegin("operStatus", ::apache::thrift::protocol::T_REPLY, seqid); - result.write(oprot); - oprot->writeMessageEnd(); - bytes = oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postWrite(ctx, "ThriftSdk.operStatus", bytes); - } -} - -::boost::shared_ptr< ::apache::thrift::TProcessor > ThriftSdkProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) { - ::apache::thrift::ReleaseHandler< ThriftSdkIfFactory > cleanup(handlerFactory_); - ::boost::shared_ptr< ThriftSdkIf > handler(handlerFactory_->getHandler(connInfo), cleanup); - ::boost::shared_ptr< ::apache::thrift::TProcessor > processor(new ThriftSdkProcessor(handler)); - return processor; -} - -bool ThriftSdkConcurrentClient::exists(const std::string& intf) -{ - int32_t seqid = send_exists(intf); - return recv_exists(seqid); -} - -int32_t ThriftSdkConcurrentClient::send_exists(const std::string& intf) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("exists", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_exists_pargs args; - args.intf = &intf; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -bool ThriftSdkConcurrentClient::recv_exists(const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("exists") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - bool _return; - ThriftSdk_exists_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - sentry.commit(); - return _return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "exists failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -bool ThriftSdkConcurrentClient::adminEnabled(const std::string& intf) -{ - int32_t seqid = send_adminEnabled(intf); - return recv_adminEnabled(seqid); -} - -int32_t ThriftSdkConcurrentClient::send_adminEnabled(const std::string& intf) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("adminEnabled", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_adminEnabled_pargs args; - args.intf = &intf; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -bool ThriftSdkConcurrentClient::recv_adminEnabled(const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("adminEnabled") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - bool _return; - ThriftSdk_adminEnabled_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - sentry.commit(); - return _return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "adminEnabled failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void ThriftSdkConcurrentClient::adminEnabledIs(const std::string& intf, const bool enabled) -{ - int32_t seqid = send_adminEnabledIs(intf, enabled); - recv_adminEnabledIs(seqid); -} - -int32_t ThriftSdkConcurrentClient::send_adminEnabledIs(const std::string& intf, const bool enabled) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("adminEnabledIs", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_adminEnabledIs_pargs args; - args.intf = &intf; - args.enabled = &enabled; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void ThriftSdkConcurrentClient::recv_adminEnabledIs(const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("adminEnabledIs") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - ThriftSdk_adminEnabledIs_presult result; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - sentry.commit(); - return; - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void ThriftSdkConcurrentClient::descriptionIs(const std::string& intf, const std::string& description) -{ - int32_t seqid = send_descriptionIs(intf, description); - recv_descriptionIs(seqid); -} - -int32_t ThriftSdkConcurrentClient::send_descriptionIs(const std::string& intf, const std::string& description) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("descriptionIs", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_descriptionIs_pargs args; - args.intf = &intf; - args.description = &description; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void ThriftSdkConcurrentClient::recv_descriptionIs(const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("descriptionIs") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - ThriftSdk_descriptionIs_presult result; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - sentry.commit(); - return; - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -OperStatus::type ThriftSdkConcurrentClient::operStatus(const std::string& intf) -{ - int32_t seqid = send_operStatus(intf); - return recv_operStatus(seqid); -} - -int32_t ThriftSdkConcurrentClient::send_operStatus(const std::string& intf) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("operStatus", ::apache::thrift::protocol::T_CALL, cseqid); - - ThriftSdk_operStatus_pargs args; - args.intf = &intf; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -OperStatus::type ThriftSdkConcurrentClient::recv_operStatus(const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("operStatus") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - OperStatus::type _return; - ThriftSdk_operStatus_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - sentry.commit(); - return _return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "operStatus failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -} // namespace - diff --git a/examples/ThriftSdk.h b/examples/ThriftSdk.h deleted file mode 100644 index 14da5d9..0000000 --- a/examples/ThriftSdk.h +++ /dev/null @@ -1,776 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.10.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#ifndef ThriftSdk_H -#define ThriftSdk_H - -#include -#include -#include "EosThrift_types.h" - -namespace eos { - -#ifdef _WIN32 - #pragma warning( push ) - #pragma warning (disable : 4250 ) //inheriting methods via dominance -#endif - -class ThriftSdkIf { - public: - virtual ~ThriftSdkIf() {} - virtual bool exists(const std::string& intf) = 0; - virtual bool adminEnabled(const std::string& intf) = 0; - virtual void adminEnabledIs(const std::string& intf, const bool enabled) = 0; - virtual void descriptionIs(const std::string& intf, const std::string& description) = 0; - virtual OperStatus::type operStatus(const std::string& intf) = 0; -}; - -class ThriftSdkIfFactory { - public: - typedef ThriftSdkIf Handler; - - virtual ~ThriftSdkIfFactory() {} - - virtual ThriftSdkIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; - virtual void releaseHandler(ThriftSdkIf* /* handler */) = 0; -}; - -class ThriftSdkIfSingletonFactory : virtual public ThriftSdkIfFactory { - public: - ThriftSdkIfSingletonFactory(const boost::shared_ptr& iface) : iface_(iface) {} - virtual ~ThriftSdkIfSingletonFactory() {} - - virtual ThriftSdkIf* getHandler(const ::apache::thrift::TConnectionInfo&) { - return iface_.get(); - } - virtual void releaseHandler(ThriftSdkIf* /* handler */) {} - - protected: - boost::shared_ptr iface_; -}; - -class ThriftSdkNull : virtual public ThriftSdkIf { - public: - virtual ~ThriftSdkNull() {} - bool exists(const std::string& /* intf */) { - bool _return = false; - return _return; - } - bool adminEnabled(const std::string& /* intf */) { - bool _return = false; - return _return; - } - void adminEnabledIs(const std::string& /* intf */, const bool /* enabled */) { - return; - } - void descriptionIs(const std::string& /* intf */, const std::string& /* description */) { - return; - } - OperStatus::type operStatus(const std::string& /* intf */) { - OperStatus::type _return = (OperStatus::type)0; - return _return; - } -}; - -typedef struct _ThriftSdk_exists_args__isset { - _ThriftSdk_exists_args__isset() : intf(false) {} - bool intf :1; -} _ThriftSdk_exists_args__isset; - -class ThriftSdk_exists_args { - public: - - ThriftSdk_exists_args(const ThriftSdk_exists_args&); - ThriftSdk_exists_args& operator=(const ThriftSdk_exists_args&); - ThriftSdk_exists_args() : intf() { - } - - virtual ~ThriftSdk_exists_args() throw(); - std::string intf; - - _ThriftSdk_exists_args__isset __isset; - - void __set_intf(const std::string& val); - - bool operator == (const ThriftSdk_exists_args & rhs) const - { - if (!(intf == rhs.intf)) - return false; - return true; - } - bool operator != (const ThriftSdk_exists_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_exists_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class ThriftSdk_exists_pargs { - public: - - - virtual ~ThriftSdk_exists_pargs() throw(); - const std::string* intf; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _ThriftSdk_exists_result__isset { - _ThriftSdk_exists_result__isset() : success(false) {} - bool success :1; -} _ThriftSdk_exists_result__isset; - -class ThriftSdk_exists_result { - public: - - ThriftSdk_exists_result(const ThriftSdk_exists_result&); - ThriftSdk_exists_result& operator=(const ThriftSdk_exists_result&); - ThriftSdk_exists_result() : success(0) { - } - - virtual ~ThriftSdk_exists_result() throw(); - bool success; - - _ThriftSdk_exists_result__isset __isset; - - void __set_success(const bool val); - - bool operator == (const ThriftSdk_exists_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const ThriftSdk_exists_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_exists_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _ThriftSdk_exists_presult__isset { - _ThriftSdk_exists_presult__isset() : success(false) {} - bool success :1; -} _ThriftSdk_exists_presult__isset; - -class ThriftSdk_exists_presult { - public: - - - virtual ~ThriftSdk_exists_presult() throw(); - bool* success; - - _ThriftSdk_exists_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _ThriftSdk_adminEnabled_args__isset { - _ThriftSdk_adminEnabled_args__isset() : intf(false) {} - bool intf :1; -} _ThriftSdk_adminEnabled_args__isset; - -class ThriftSdk_adminEnabled_args { - public: - - ThriftSdk_adminEnabled_args(const ThriftSdk_adminEnabled_args&); - ThriftSdk_adminEnabled_args& operator=(const ThriftSdk_adminEnabled_args&); - ThriftSdk_adminEnabled_args() : intf() { - } - - virtual ~ThriftSdk_adminEnabled_args() throw(); - std::string intf; - - _ThriftSdk_adminEnabled_args__isset __isset; - - void __set_intf(const std::string& val); - - bool operator == (const ThriftSdk_adminEnabled_args & rhs) const - { - if (!(intf == rhs.intf)) - return false; - return true; - } - bool operator != (const ThriftSdk_adminEnabled_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_adminEnabled_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class ThriftSdk_adminEnabled_pargs { - public: - - - virtual ~ThriftSdk_adminEnabled_pargs() throw(); - const std::string* intf; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _ThriftSdk_adminEnabled_result__isset { - _ThriftSdk_adminEnabled_result__isset() : success(false) {} - bool success :1; -} _ThriftSdk_adminEnabled_result__isset; - -class ThriftSdk_adminEnabled_result { - public: - - ThriftSdk_adminEnabled_result(const ThriftSdk_adminEnabled_result&); - ThriftSdk_adminEnabled_result& operator=(const ThriftSdk_adminEnabled_result&); - ThriftSdk_adminEnabled_result() : success(0) { - } - - virtual ~ThriftSdk_adminEnabled_result() throw(); - bool success; - - _ThriftSdk_adminEnabled_result__isset __isset; - - void __set_success(const bool val); - - bool operator == (const ThriftSdk_adminEnabled_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const ThriftSdk_adminEnabled_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_adminEnabled_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _ThriftSdk_adminEnabled_presult__isset { - _ThriftSdk_adminEnabled_presult__isset() : success(false) {} - bool success :1; -} _ThriftSdk_adminEnabled_presult__isset; - -class ThriftSdk_adminEnabled_presult { - public: - - - virtual ~ThriftSdk_adminEnabled_presult() throw(); - bool* success; - - _ThriftSdk_adminEnabled_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _ThriftSdk_adminEnabledIs_args__isset { - _ThriftSdk_adminEnabledIs_args__isset() : intf(false), enabled(false) {} - bool intf :1; - bool enabled :1; -} _ThriftSdk_adminEnabledIs_args__isset; - -class ThriftSdk_adminEnabledIs_args { - public: - - ThriftSdk_adminEnabledIs_args(const ThriftSdk_adminEnabledIs_args&); - ThriftSdk_adminEnabledIs_args& operator=(const ThriftSdk_adminEnabledIs_args&); - ThriftSdk_adminEnabledIs_args() : intf(), enabled(0) { - } - - virtual ~ThriftSdk_adminEnabledIs_args() throw(); - std::string intf; - bool enabled; - - _ThriftSdk_adminEnabledIs_args__isset __isset; - - void __set_intf(const std::string& val); - - void __set_enabled(const bool val); - - bool operator == (const ThriftSdk_adminEnabledIs_args & rhs) const - { - if (!(intf == rhs.intf)) - return false; - if (!(enabled == rhs.enabled)) - return false; - return true; - } - bool operator != (const ThriftSdk_adminEnabledIs_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_adminEnabledIs_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class ThriftSdk_adminEnabledIs_pargs { - public: - - - virtual ~ThriftSdk_adminEnabledIs_pargs() throw(); - const std::string* intf; - const bool* enabled; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class ThriftSdk_adminEnabledIs_result { - public: - - ThriftSdk_adminEnabledIs_result(const ThriftSdk_adminEnabledIs_result&); - ThriftSdk_adminEnabledIs_result& operator=(const ThriftSdk_adminEnabledIs_result&); - ThriftSdk_adminEnabledIs_result() { - } - - virtual ~ThriftSdk_adminEnabledIs_result() throw(); - - bool operator == (const ThriftSdk_adminEnabledIs_result & /* rhs */) const - { - return true; - } - bool operator != (const ThriftSdk_adminEnabledIs_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_adminEnabledIs_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class ThriftSdk_adminEnabledIs_presult { - public: - - - virtual ~ThriftSdk_adminEnabledIs_presult() throw(); - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _ThriftSdk_descriptionIs_args__isset { - _ThriftSdk_descriptionIs_args__isset() : intf(false), description(false) {} - bool intf :1; - bool description :1; -} _ThriftSdk_descriptionIs_args__isset; - -class ThriftSdk_descriptionIs_args { - public: - - ThriftSdk_descriptionIs_args(const ThriftSdk_descriptionIs_args&); - ThriftSdk_descriptionIs_args& operator=(const ThriftSdk_descriptionIs_args&); - ThriftSdk_descriptionIs_args() : intf(), description() { - } - - virtual ~ThriftSdk_descriptionIs_args() throw(); - std::string intf; - std::string description; - - _ThriftSdk_descriptionIs_args__isset __isset; - - void __set_intf(const std::string& val); - - void __set_description(const std::string& val); - - bool operator == (const ThriftSdk_descriptionIs_args & rhs) const - { - if (!(intf == rhs.intf)) - return false; - if (!(description == rhs.description)) - return false; - return true; - } - bool operator != (const ThriftSdk_descriptionIs_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_descriptionIs_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class ThriftSdk_descriptionIs_pargs { - public: - - - virtual ~ThriftSdk_descriptionIs_pargs() throw(); - const std::string* intf; - const std::string* description; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class ThriftSdk_descriptionIs_result { - public: - - ThriftSdk_descriptionIs_result(const ThriftSdk_descriptionIs_result&); - ThriftSdk_descriptionIs_result& operator=(const ThriftSdk_descriptionIs_result&); - ThriftSdk_descriptionIs_result() { - } - - virtual ~ThriftSdk_descriptionIs_result() throw(); - - bool operator == (const ThriftSdk_descriptionIs_result & /* rhs */) const - { - return true; - } - bool operator != (const ThriftSdk_descriptionIs_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_descriptionIs_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class ThriftSdk_descriptionIs_presult { - public: - - - virtual ~ThriftSdk_descriptionIs_presult() throw(); - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _ThriftSdk_operStatus_args__isset { - _ThriftSdk_operStatus_args__isset() : intf(false) {} - bool intf :1; -} _ThriftSdk_operStatus_args__isset; - -class ThriftSdk_operStatus_args { - public: - - ThriftSdk_operStatus_args(const ThriftSdk_operStatus_args&); - ThriftSdk_operStatus_args& operator=(const ThriftSdk_operStatus_args&); - ThriftSdk_operStatus_args() : intf() { - } - - virtual ~ThriftSdk_operStatus_args() throw(); - std::string intf; - - _ThriftSdk_operStatus_args__isset __isset; - - void __set_intf(const std::string& val); - - bool operator == (const ThriftSdk_operStatus_args & rhs) const - { - if (!(intf == rhs.intf)) - return false; - return true; - } - bool operator != (const ThriftSdk_operStatus_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_operStatus_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class ThriftSdk_operStatus_pargs { - public: - - - virtual ~ThriftSdk_operStatus_pargs() throw(); - const std::string* intf; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _ThriftSdk_operStatus_result__isset { - _ThriftSdk_operStatus_result__isset() : success(false) {} - bool success :1; -} _ThriftSdk_operStatus_result__isset; - -class ThriftSdk_operStatus_result { - public: - - ThriftSdk_operStatus_result(const ThriftSdk_operStatus_result&); - ThriftSdk_operStatus_result& operator=(const ThriftSdk_operStatus_result&); - ThriftSdk_operStatus_result() : success((OperStatus::type)0) { - } - - virtual ~ThriftSdk_operStatus_result() throw(); - OperStatus::type success; - - _ThriftSdk_operStatus_result__isset __isset; - - void __set_success(const OperStatus::type val); - - bool operator == (const ThriftSdk_operStatus_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const ThriftSdk_operStatus_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const ThriftSdk_operStatus_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _ThriftSdk_operStatus_presult__isset { - _ThriftSdk_operStatus_presult__isset() : success(false) {} - bool success :1; -} _ThriftSdk_operStatus_presult__isset; - -class ThriftSdk_operStatus_presult { - public: - - - virtual ~ThriftSdk_operStatus_presult() throw(); - OperStatus::type* success; - - _ThriftSdk_operStatus_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -class ThriftSdkClient : virtual public ThriftSdkIf { - public: - ThriftSdkClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { - setProtocol(prot); - } - ThriftSdkClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { - setProtocol(iprot,oprot); - } - private: - void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { - setProtocol(prot,prot); - } - void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { - piprot_=iprot; - poprot_=oprot; - iprot_ = iprot.get(); - oprot_ = oprot.get(); - } - public: - boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { - return piprot_; - } - boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { - return poprot_; - } - bool exists(const std::string& intf); - void send_exists(const std::string& intf); - bool recv_exists(); - bool adminEnabled(const std::string& intf); - void send_adminEnabled(const std::string& intf); - bool recv_adminEnabled(); - void adminEnabledIs(const std::string& intf, const bool enabled); - void send_adminEnabledIs(const std::string& intf, const bool enabled); - void recv_adminEnabledIs(); - void descriptionIs(const std::string& intf, const std::string& description); - void send_descriptionIs(const std::string& intf, const std::string& description); - void recv_descriptionIs(); - OperStatus::type operStatus(const std::string& intf); - void send_operStatus(const std::string& intf); - OperStatus::type recv_operStatus(); - protected: - boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; - boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; - ::apache::thrift::protocol::TProtocol* iprot_; - ::apache::thrift::protocol::TProtocol* oprot_; -}; - -class ThriftSdkProcessor : public ::apache::thrift::TDispatchProcessor { - protected: - boost::shared_ptr iface_; - virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext); - private: - typedef void (ThriftSdkProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); - typedef std::map ProcessMap; - ProcessMap processMap_; - void process_exists(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_adminEnabled(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_adminEnabledIs(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_descriptionIs(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_operStatus(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - public: - ThriftSdkProcessor(boost::shared_ptr iface) : - iface_(iface) { - processMap_["exists"] = &ThriftSdkProcessor::process_exists; - processMap_["adminEnabled"] = &ThriftSdkProcessor::process_adminEnabled; - processMap_["adminEnabledIs"] = &ThriftSdkProcessor::process_adminEnabledIs; - processMap_["descriptionIs"] = &ThriftSdkProcessor::process_descriptionIs; - processMap_["operStatus"] = &ThriftSdkProcessor::process_operStatus; - } - - virtual ~ThriftSdkProcessor() {} -}; - -class ThriftSdkProcessorFactory : public ::apache::thrift::TProcessorFactory { - public: - ThriftSdkProcessorFactory(const ::boost::shared_ptr< ThriftSdkIfFactory >& handlerFactory) : - handlerFactory_(handlerFactory) {} - - ::boost::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo); - - protected: - ::boost::shared_ptr< ThriftSdkIfFactory > handlerFactory_; -}; - -class ThriftSdkMultiface : virtual public ThriftSdkIf { - public: - ThriftSdkMultiface(std::vector >& ifaces) : ifaces_(ifaces) { - } - virtual ~ThriftSdkMultiface() {} - protected: - std::vector > ifaces_; - ThriftSdkMultiface() {} - void add(boost::shared_ptr iface) { - ifaces_.push_back(iface); - } - public: - bool exists(const std::string& intf) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->exists(intf); - } - return ifaces_[i]->exists(intf); - } - - bool adminEnabled(const std::string& intf) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->adminEnabled(intf); - } - return ifaces_[i]->adminEnabled(intf); - } - - void adminEnabledIs(const std::string& intf, const bool enabled) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->adminEnabledIs(intf, enabled); - } - ifaces_[i]->adminEnabledIs(intf, enabled); - } - - void descriptionIs(const std::string& intf, const std::string& description) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->descriptionIs(intf, description); - } - ifaces_[i]->descriptionIs(intf, description); - } - - OperStatus::type operStatus(const std::string& intf) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->operStatus(intf); - } - return ifaces_[i]->operStatus(intf); - } - -}; - -// The 'concurrent' client is a thread safe client that correctly handles -// out of order responses. It is slower than the regular client, so should -// only be used when you need to share a connection among multiple threads -class ThriftSdkConcurrentClient : virtual public ThriftSdkIf { - public: - ThriftSdkConcurrentClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { - setProtocol(prot); - } - ThriftSdkConcurrentClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { - setProtocol(iprot,oprot); - } - private: - void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { - setProtocol(prot,prot); - } - void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { - piprot_=iprot; - poprot_=oprot; - iprot_ = iprot.get(); - oprot_ = oprot.get(); - } - public: - boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { - return piprot_; - } - boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { - return poprot_; - } - bool exists(const std::string& intf); - int32_t send_exists(const std::string& intf); - bool recv_exists(const int32_t seqid); - bool adminEnabled(const std::string& intf); - int32_t send_adminEnabled(const std::string& intf); - bool recv_adminEnabled(const int32_t seqid); - void adminEnabledIs(const std::string& intf, const bool enabled); - int32_t send_adminEnabledIs(const std::string& intf, const bool enabled); - void recv_adminEnabledIs(const int32_t seqid); - void descriptionIs(const std::string& intf, const std::string& description); - int32_t send_descriptionIs(const std::string& intf, const std::string& description); - void recv_descriptionIs(const int32_t seqid); - OperStatus::type operStatus(const std::string& intf); - int32_t send_operStatus(const std::string& intf); - OperStatus::type recv_operStatus(const int32_t seqid); - protected: - boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; - boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; - ::apache::thrift::protocol::TProtocol* iprot_; - ::apache::thrift::protocol::TProtocol* oprot_; - ::apache::thrift::async::TConcurrentClientSyncInfo sync_; -}; - -#ifdef _WIN32 - #pragma warning( pop ) -#endif - -} // namespace - -#endif diff --git a/examples/thriftconfig.h b/examples/thriftconfig.h deleted file mode 100644 index 51208d7..0000000 --- a/examples/thriftconfig.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Define for version 0.14.0+. */ -/* #undef HAVE_RECENT_THRIFT */ - diff --git a/fib_gen.cpp b/fib_gen.cpp new file mode 100644 index 0000000..aca2676 --- /dev/null +++ b/fib_gen.cpp @@ -0,0 +1,175 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/fib.h" +#include "eos/types/fib_impl.h" + +namespace eos { + +// Default constructor. +fib_route_key_t::fib_route_key_t() : + pimpl(std::make_shared()) {} +fib_route_key_t::fib_route_key_t(ip_prefix_t const & prefix) : + pimpl(std::make_shared( + prefix + )) {} +EOS_SDK_PUBLIC fib_route_key_t::fib_route_key_t( + const fib_route_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC fib_route_key_t& +fib_route_key_t::operator=( + fib_route_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +fib_route_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +fib_route_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +fib_route_t::fib_route_t() : + pimpl(std::make_shared()) {} +fib_route_t::fib_route_t(fib_route_key_t const & route_key) : + pimpl(std::make_shared( + route_key + )) {} +EOS_SDK_PUBLIC fib_route_t::fib_route_t( + const fib_route_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC fib_route_t& +fib_route_t::operator=( + fib_route_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +fib_route_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +fib_route_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +fib_fec_key_t::fib_fec_key_t() : + pimpl(std::make_shared()) {} +fib_fec_key_t::fib_fec_key_t(uint64_t fec_id) : + pimpl(std::make_shared( + fec_id + )) {} +EOS_SDK_PUBLIC fib_fec_key_t::fib_fec_key_t( + const fib_fec_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC fib_fec_key_t& +fib_fec_key_t::operator=( + fib_fec_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +fib_fec_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +fib_fec_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +fib_via_t::fib_via_t() : + pimpl(std::make_shared()) {} +fib_via_t::fib_via_t(ip_addr_t const & hop, intf_id_t intf) : + pimpl(std::make_shared( + hop, + intf + )) {} +EOS_SDK_PUBLIC fib_via_t::fib_via_t( + const fib_via_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC fib_via_t& +fib_via_t::operator=( + fib_via_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +fib_via_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +fib_via_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +fib_fec_t::fib_fec_t() : + pimpl(std::make_shared()) {} +fib_fec_t::fib_fec_t(fib_fec_key_t fec_key) : + pimpl(std::make_shared( + fec_key + )) {} +EOS_SDK_PUBLIC fib_fec_t::fib_fec_t( + const fib_fec_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC fib_fec_t& +fib_fec_t::operator=( + fib_fec_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +fib_fec_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +fib_fec_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/hardware_table_gen.cpp b/hardware_table_gen.cpp new file mode 100644 index 0000000..6833a8f --- /dev/null +++ b/hardware_table_gen.cpp @@ -0,0 +1,161 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/hardware_table.h" +#include "eos/types/hardware_table_impl.h" + +namespace eos { + +hardware_table_key_t::hardware_table_key_t() : + pimpl(std::make_shared()) {} +hardware_table_key_t::hardware_table_key_t(std::string const & table_name, + std::string const & feature, + std::string const & chip) : + pimpl(std::make_shared( + table_name, + feature, + chip + )) {} +hardware_table_key_t::hardware_table_key_t(std::string const & table_name, + std::string const & feature) : + pimpl(std::make_shared( + table_name, + feature + )) {} +hardware_table_key_t::hardware_table_key_t(std::string const & table_name) : + pimpl(std::make_shared( + table_name + )) {} +EOS_SDK_PUBLIC hardware_table_key_t::hardware_table_key_t( + const hardware_table_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC hardware_table_key_t& +hardware_table_key_t::operator=( + hardware_table_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +hardware_table_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +hardware_table_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +hardware_table_high_watermark_t::hardware_table_high_watermark_t() : + pimpl(std::make_shared()) {} +hardware_table_high_watermark_t::hardware_table_high_watermark_t( + uint32_t max_entries, time_t timestamp) : + pimpl(std::make_shared( + max_entries, + timestamp + )) {} +EOS_SDK_PUBLIC hardware_table_high_watermark_t::hardware_table_high_watermark_t( + const hardware_table_high_watermark_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC hardware_table_high_watermark_t& +hardware_table_high_watermark_t::operator=( + hardware_table_high_watermark_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +hardware_table_high_watermark_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +hardware_table_high_watermark_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +hardware_table_usage_t::hardware_table_usage_t() : + pimpl(std::make_shared()) {} +hardware_table_usage_t::hardware_table_usage_t(uint32_t used_entries, + uint32_t free_entries, + uint32_t committed_entries) : + pimpl(std::make_shared( + used_entries, + free_entries, + committed_entries + )) {} +EOS_SDK_PUBLIC hardware_table_usage_t::hardware_table_usage_t( + const hardware_table_usage_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC hardware_table_usage_t& +hardware_table_usage_t::operator=( + hardware_table_usage_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +hardware_table_usage_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +hardware_table_usage_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +hardware_table_entry_t::hardware_table_entry_t() : + pimpl(std::make_shared()) {} +hardware_table_entry_t::hardware_table_entry_t( + hardware_table_usage_t const & usage, uint32_t max_entries, + hardware_table_high_watermark_t const & high_watermark) : + pimpl(std::make_shared( + usage, + max_entries, + high_watermark + )) {} +EOS_SDK_PUBLIC hardware_table_entry_t::hardware_table_entry_t( + const hardware_table_entry_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC hardware_table_entry_t& +hardware_table_entry_t::operator=( + hardware_table_entry_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +hardware_table_entry_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +hardware_table_entry_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/intf_gen.cpp b/intf_gen.cpp new file mode 100644 index 0000000..d62e0b8 --- /dev/null +++ b/intf_gen.cpp @@ -0,0 +1,103 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/intf.h" +#include "eos/types/intf_impl.h" + +namespace eos { + +// Default constructor. +intf_counters_t::intf_counters_t() : + pimpl(std::make_shared()) {} +intf_counters_t::intf_counters_t(uint64_t out_ucast_pkts, + uint64_t out_multicast_pkts, + uint64_t out_broadcast_pkts, + uint64_t in_ucast_pkts, + uint64_t in_multicast_pkts, + uint64_t in_broadcast_pkts, uint64_t out_octets, + uint64_t in_octets, uint64_t out_discards, + uint64_t out_errors, uint64_t in_discards, + uint64_t in_errors, seconds_t sample_time) : + pimpl(std::make_shared( + out_ucast_pkts, + out_multicast_pkts, + out_broadcast_pkts, + in_ucast_pkts, + in_multicast_pkts, + in_broadcast_pkts, + out_octets, + in_octets, + out_discards, + out_errors, + in_discards, + in_errors, + sample_time + )) {} +EOS_SDK_PUBLIC intf_counters_t::intf_counters_t( + const intf_counters_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC intf_counters_t& +intf_counters_t::operator=( + intf_counters_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +intf_counters_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +intf_counters_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +intf_traffic_rates_t::intf_traffic_rates_t() : + pimpl(std::make_shared()) {} +intf_traffic_rates_t::intf_traffic_rates_t(double out_pkts_rate, + double in_pkts_rate, + double out_bits_rate, + double in_bits_rate, + seconds_t sample_time) : + pimpl(std::make_shared( + out_pkts_rate, + in_pkts_rate, + out_bits_rate, + in_bits_rate, + sample_time + )) {} +EOS_SDK_PUBLIC intf_traffic_rates_t::intf_traffic_rates_t( + const intf_traffic_rates_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC intf_traffic_rates_t& +intf_traffic_rates_t::operator=( + intf_traffic_rates_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +intf_traffic_rates_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +intf_traffic_rates_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/intf_types.cpp b/intf_types.cpp index 85c8f11..803ebdc 100644 --- a/intf_types.cpp +++ b/intf_types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #include "eos/intf.h" diff --git a/ip_gen.cpp b/ip_gen.cpp new file mode 100644 index 0000000..476d110 --- /dev/null +++ b/ip_gen.cpp @@ -0,0 +1,42 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/ip.h" +#include "eos/types/ip_impl.h" + +namespace eos { + +ip_addr_mask_t::ip_addr_mask_t() : + pimpl(std::make_shared()) {} +ip_addr_mask_t::ip_addr_mask_t(ip_addr_t const & addr, uint8_t mask_length) : + pimpl(std::make_shared( + addr, + mask_length + )) {} +EOS_SDK_PUBLIC ip_addr_mask_t::ip_addr_mask_t( + const ip_addr_mask_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC ip_addr_mask_t& +ip_addr_mask_t::operator=( + ip_addr_mask_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +ip_addr_mask_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +ip_addr_mask_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/ip_route_gen.cpp b/ip_route_gen.cpp new file mode 100644 index 0000000..80a4395 --- /dev/null +++ b/ip_route_gen.cpp @@ -0,0 +1,111 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/ip_route.h" +#include "eos/types/ip_route_impl.h" + +namespace eos { + +ip_route_key_t::ip_route_key_t() : + pimpl(std::make_shared()) {} +ip_route_key_t::ip_route_key_t(ip_prefix_t const & prefix) : + pimpl(std::make_shared( + prefix + )) {} +ip_route_key_t::ip_route_key_t(ip_prefix_t const & prefix, + ip_route_preference_t preference) : + pimpl(std::make_shared( + prefix, + preference + )) {} +EOS_SDK_PUBLIC ip_route_key_t::ip_route_key_t( + const ip_route_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC ip_route_key_t& +ip_route_key_t::operator=( + ip_route_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +ip_route_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +ip_route_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +ip_route_t::ip_route_t() : + pimpl(std::make_shared()) {} +ip_route_t::ip_route_t(ip_route_key_t const & key) : + pimpl(std::make_shared( + key + )) {} +EOS_SDK_PUBLIC ip_route_t::ip_route_t( + const ip_route_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC ip_route_t& +ip_route_t::operator=( + ip_route_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +ip_route_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +ip_route_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +ip_route_via_t::ip_route_via_t() : + pimpl(std::make_shared()) {} +ip_route_via_t::ip_route_via_t(ip_route_key_t const & route_key) : + pimpl(std::make_shared( + route_key + )) {} +EOS_SDK_PUBLIC ip_route_via_t::ip_route_via_t( + const ip_route_via_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC ip_route_via_t& +ip_route_via_t::operator=( + ip_route_via_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +ip_route_via_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +ip_route_via_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/ip_types.cpp b/ip_types.cpp index 24c3d63..68549b4 100644 --- a/ip_types.cpp +++ b/ip_types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #include "eos/ip.h" diff --git a/lldp_gen.cpp b/lldp_gen.cpp new file mode 100644 index 0000000..0f785b9 --- /dev/null +++ b/lldp_gen.cpp @@ -0,0 +1,363 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/lldp.h" +#include "eos/types/lldp_impl.h" + +namespace eos { + +// TLV Type, default constructor. +lldp_tlv_type_t::lldp_tlv_type_t() : + pimpl(std::make_shared()) {} +// TLV Type, full constructor. +lldp_tlv_type_t::lldp_tlv_type_t(uint32_t organization, uint8_t subtype) : + pimpl(std::make_shared( + organization, + subtype + )) {} +EOS_SDK_PUBLIC lldp_tlv_type_t::lldp_tlv_type_t( + const lldp_tlv_type_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_tlv_type_t& +lldp_tlv_type_t::operator=( + lldp_tlv_type_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_tlv_type_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_tlv_type_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +lldp_std_tlv_type_t::lldp_std_tlv_type_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC lldp_std_tlv_type_t::lldp_std_tlv_type_t( + const lldp_std_tlv_type_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_std_tlv_type_t& +lldp_std_tlv_type_t::operator=( + lldp_std_tlv_type_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_std_tlv_type_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_std_tlv_type_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +lldp_syscap_t::lldp_syscap_t() : + pimpl(std::make_shared()) {} +// syscap, full constructor. +lldp_syscap_t::lldp_syscap_t(lldp_syscap_bits_t bitset) : + pimpl(std::make_shared( + bitset + )) {} +EOS_SDK_PUBLIC lldp_syscap_t::lldp_syscap_t( + const lldp_syscap_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_syscap_t& +lldp_syscap_t::operator=( + lldp_syscap_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_syscap_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_syscap_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +lldp_management_address_t::lldp_management_address_t() : + pimpl(std::make_shared()) {} +// Managment Info constructor. +lldp_management_address_t::lldp_management_address_t(uint32_t address_family, + std::string address, + uint32_t snmp_ifindex, + std::string oid) : + pimpl(std::make_shared( + address_family, + address, + snmp_ifindex, + oid + )) {} +EOS_SDK_PUBLIC lldp_management_address_t::lldp_management_address_t( + const lldp_management_address_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_management_address_t& +lldp_management_address_t::operator=( + lldp_management_address_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_management_address_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_management_address_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +lldp_lacp_t::lldp_lacp_t() : + pimpl(std::make_shared()) {} +// LACP Info constructor. +lldp_lacp_t::lldp_lacp_t(bool capable, bool enabled, uint32_t id, bool valid) : + pimpl(std::make_shared( + capable, + enabled, + id, + valid + )) {} +EOS_SDK_PUBLIC lldp_lacp_t::lldp_lacp_t( + const lldp_lacp_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_lacp_t& +lldp_lacp_t::operator=( + lldp_lacp_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_lacp_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_lacp_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +lldp_phy_t::lldp_phy_t() : + pimpl(std::make_shared()) {} +// PHY Info constructor. +lldp_phy_t::lldp_phy_t(bool autonegSupported, bool autonegEnabled, + uint16_t autonegCapabilitiesBm, bool valid) : + pimpl(std::make_shared( + autonegSupported, + autonegEnabled, + autonegCapabilitiesBm, + valid + )) {} +EOS_SDK_PUBLIC lldp_phy_t::lldp_phy_t( + const lldp_phy_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_phy_t& +lldp_phy_t::operator=( + lldp_phy_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_phy_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_phy_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +lldp_chassis_id_t::lldp_chassis_id_t() : + pimpl(std::make_shared()) {} +// chassis name, full constructor. +lldp_chassis_id_t::lldp_chassis_id_t(lldp_chassis_id_encoding_t encoding, + std::string value) : + pimpl(std::make_shared( + encoding, + value + )) {} +EOS_SDK_PUBLIC lldp_chassis_id_t::lldp_chassis_id_t( + const lldp_chassis_id_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_chassis_id_t& +lldp_chassis_id_t::operator=( + lldp_chassis_id_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_chassis_id_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_chassis_id_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +lldp_intf_id_t::lldp_intf_id_t() : + pimpl(std::make_shared()) {} +// interface name, full constructor. +lldp_intf_id_t::lldp_intf_id_t(lldp_intf_id_encoding_t encoding, std::string value) : + pimpl(std::make_shared( + encoding, + value + )) {} +EOS_SDK_PUBLIC lldp_intf_id_t::lldp_intf_id_t( + const lldp_intf_id_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_intf_id_t& +lldp_intf_id_t::operator=( + lldp_intf_id_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_intf_id_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_intf_id_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// remote system, default constructor. +lldp_remote_system_t::lldp_remote_system_t() : + pimpl(std::make_shared()) {} +// remote system, full constructor. +lldp_remote_system_t::lldp_remote_system_t(lldp_chassis_id_t chassis, + lldp_intf_id_t port) : + pimpl(std::make_shared( + chassis, + port + )) {} +EOS_SDK_PUBLIC lldp_remote_system_t::lldp_remote_system_t( + const lldp_remote_system_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_remote_system_t& +lldp_remote_system_t::operator=( + lldp_remote_system_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_remote_system_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_remote_system_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// remote system, default constructor. +lldp_neighbor_t::lldp_neighbor_t() : + pimpl(std::make_shared()) {} +// first remote system. +lldp_neighbor_t::lldp_neighbor_t(intf_id_t intf) : + pimpl(std::make_shared( + intf + )) {} +// specific remote system. +lldp_neighbor_t::lldp_neighbor_t(intf_id_t intf, + lldp_remote_system_t remote_system) : + pimpl(std::make_shared( + intf, + remote_system + )) {} +EOS_SDK_PUBLIC lldp_neighbor_t::lldp_neighbor_t( + const lldp_neighbor_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC lldp_neighbor_t& +lldp_neighbor_t::operator=( + lldp_neighbor_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +lldp_neighbor_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +lldp_neighbor_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/mac_table_gen.cpp b/mac_table_gen.cpp new file mode 100644 index 0000000..67a3f6b --- /dev/null +++ b/mac_table_gen.cpp @@ -0,0 +1,95 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/mac_table.h" +#include "eos/types/mac_table_impl.h" + +namespace eos { + +mac_key_t::mac_key_t() : + pimpl(std::make_shared()) {} +mac_key_t::mac_key_t(vlan_id_t vlan_id, eth_addr_t const & eth_addr) : + pimpl(std::make_shared( + vlan_id, + eth_addr + )) {} +EOS_SDK_PUBLIC mac_key_t::mac_key_t( + const mac_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC mac_key_t& +mac_key_t::operator=( + mac_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +mac_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +mac_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +mac_entry_t::mac_entry_t() : + pimpl(std::make_shared()) {} +mac_entry_t::mac_entry_t(mac_key_t const & mac_key) : + pimpl(std::make_shared( + mac_key + )) {} +mac_entry_t::mac_entry_t(mac_key_t const & mac_key, intf_id_t intf) : + pimpl(std::make_shared( + mac_key, + intf + )) {} +mac_entry_t::mac_entry_t(mac_key_t const & mac_key, + std::set const & intfs) : + pimpl(std::make_shared( + mac_key, + intfs + )) {} +mac_entry_t::mac_entry_t(vlan_id_t vlan_id, eth_addr_t eth_addr) : + pimpl(std::make_shared( + vlan_id, + eth_addr + )) {} +mac_entry_t::mac_entry_t(eth_addr_t eth_addr, intf_id_t intf) : + pimpl(std::make_shared( + eth_addr, + intf + )) {} +EOS_SDK_PUBLIC mac_entry_t::mac_entry_t( + const mac_entry_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC mac_entry_t& +mac_entry_t::operator=( + mac_entry_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +mac_entry_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +mac_entry_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/macsec_gen.cpp b/macsec_gen.cpp new file mode 100644 index 0000000..2257b27 --- /dev/null +++ b/macsec_gen.cpp @@ -0,0 +1,137 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/macsec.h" +#include "eos/types/macsec_impl.h" + +namespace eos { + +macsec_key_t::macsec_key_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC macsec_key_t::macsec_key_t( + const macsec_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC macsec_key_t& +macsec_key_t::operator=( + macsec_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +macsec_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +macsec_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +macsec_profile_t::macsec_profile_t() : + pimpl(std::make_shared()) {} +macsec_profile_t::macsec_profile_t(macsec_profile_name_t name) : + pimpl(std::make_shared( + name + )) {} +EOS_SDK_PUBLIC macsec_profile_t::macsec_profile_t( + const macsec_profile_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC macsec_profile_t& +macsec_profile_t::operator=( + macsec_profile_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +macsec_profile_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +macsec_profile_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +macsec_intf_status_t::macsec_intf_status_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC macsec_intf_status_t::macsec_intf_status_t( + const macsec_intf_status_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC macsec_intf_status_t& +macsec_intf_status_t::operator=( + macsec_intf_status_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +macsec_intf_status_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +macsec_intf_status_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +macsec_intf_counters_t::macsec_intf_counters_t() : + pimpl(std::make_shared()) {} +macsec_intf_counters_t::macsec_intf_counters_t(uint64_t out_pkts_encrypted, + uint64_t out_octets_encrypted, + uint64_t in_pkts_decrypted, + uint64_t in_octets_decrypted, + uint64_t in_pkts_not_valid) : + pimpl(std::make_shared( + out_pkts_encrypted, + out_octets_encrypted, + in_pkts_decrypted, + in_octets_decrypted, + in_pkts_not_valid + )) {} +EOS_SDK_PUBLIC macsec_intf_counters_t::macsec_intf_counters_t( + const macsec_intf_counters_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC macsec_intf_counters_t& +macsec_intf_counters_t::operator=( + macsec_intf_counters_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +macsec_intf_counters_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +macsec_intf_counters_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/mpls_route_gen.cpp b/mpls_route_gen.cpp new file mode 100644 index 0000000..5b4aedd --- /dev/null +++ b/mpls_route_gen.cpp @@ -0,0 +1,151 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/mpls_route.h" +#include "eos/types/mpls_route_impl.h" + +namespace eos { + +mpls_route_key_t::mpls_route_key_t() : + pimpl(std::make_shared()) {} +mpls_route_key_t::mpls_route_key_t(mpls_label_t top_label, + mpls_route_metric_t metric) : + pimpl(std::make_shared( + top_label, + metric + )) {} +mpls_route_key_t::mpls_route_key_t(std::vector const & labels, + mpls_route_metric_t metric) : + pimpl(std::make_shared( + labels, + metric + )) {} +EOS_SDK_PUBLIC mpls_route_key_t::mpls_route_key_t( + const mpls_route_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC mpls_route_key_t& +mpls_route_key_t::operator=( + mpls_route_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +mpls_route_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +mpls_route_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +mpls_route_t::mpls_route_t() : + pimpl(std::make_shared()) {} +mpls_route_t::mpls_route_t(mpls_route_key_t key) : + pimpl(std::make_shared( + key + )) {} +EOS_SDK_PUBLIC mpls_route_t::mpls_route_t( + const mpls_route_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC mpls_route_t& +mpls_route_t::operator=( + mpls_route_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +mpls_route_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +mpls_route_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +mpls_route_via_t::mpls_route_via_t() : + pimpl(std::make_shared()) {} +mpls_route_via_t::mpls_route_via_t(mpls_route_key_t route_key) : + pimpl(std::make_shared( + route_key + )) {} +mpls_route_via_t::mpls_route_via_t(mpls_route_key_t route_key, + mpls_action_t label_action) : + pimpl(std::make_shared( + route_key, + label_action + )) {} +EOS_SDK_PUBLIC mpls_route_via_t::mpls_route_via_t( + const mpls_route_via_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC mpls_route_via_t& +mpls_route_via_t::operator=( + mpls_route_via_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +mpls_route_via_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +mpls_route_via_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +mpls_fec_id_t::mpls_fec_id_t() : + pimpl(std::make_shared()) {} +mpls_fec_id_t::mpls_fec_id_t(uint64_t id) : + pimpl(std::make_shared( + id + )) {} +EOS_SDK_PUBLIC mpls_fec_id_t::mpls_fec_id_t( + const mpls_fec_id_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC mpls_fec_id_t& +mpls_fec_id_t::operator=( + mpls_fec_id_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +mpls_fec_id_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +mpls_fec_id_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/mpls_vrf_label_gen.cpp b/mpls_vrf_label_gen.cpp new file mode 100644 index 0000000..d89ad32 --- /dev/null +++ b/mpls_vrf_label_gen.cpp @@ -0,0 +1,43 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/mpls_vrf_label.h" +#include "eos/types/mpls_vrf_label_impl.h" + +namespace eos { + +// Default constructor. +mpls_vrf_label_t::mpls_vrf_label_t() : + pimpl(std::make_shared()) {} +mpls_vrf_label_t::mpls_vrf_label_t(mpls_label_t label, std::string vrf_name) : + pimpl(std::make_shared( + label, + vrf_name + )) {} +EOS_SDK_PUBLIC mpls_vrf_label_t::mpls_vrf_label_t( + const mpls_vrf_label_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC mpls_vrf_label_t& +mpls_vrf_label_t::operator=( + mpls_vrf_label_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +mpls_vrf_label_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +mpls_vrf_label_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/neighbor_table_gen.cpp b/neighbor_table_gen.cpp new file mode 100644 index 0000000..fb59d7a --- /dev/null +++ b/neighbor_table_gen.cpp @@ -0,0 +1,84 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/neighbor_table.h" +#include "eos/types/neighbor_table_impl.h" + +namespace eos { + +// Default constructor. +neighbor_key_t::neighbor_key_t() : + pimpl(std::make_shared()) {} +neighbor_key_t::neighbor_key_t(ip_addr_t const & ip_addr) : + pimpl(std::make_shared( + ip_addr + )) {} +neighbor_key_t::neighbor_key_t(ip_addr_t const & ip_addr, intf_id_t intf_id) : + pimpl(std::make_shared( + ip_addr, + intf_id + )) {} +EOS_SDK_PUBLIC neighbor_key_t::neighbor_key_t( + const neighbor_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC neighbor_key_t& +neighbor_key_t::operator=( + neighbor_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +neighbor_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +neighbor_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor. +neighbor_entry_t::neighbor_entry_t() : + pimpl(std::make_shared()) {} +neighbor_entry_t::neighbor_entry_t(neighbor_key_t const & neighbor_key, + eth_addr_t eth_addr, + neighbor_entry_type_t entry_type) : + pimpl(std::make_shared( + neighbor_key, + eth_addr, + entry_type + )) {} +EOS_SDK_PUBLIC neighbor_entry_t::neighbor_entry_t( + const neighbor_entry_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC neighbor_entry_t& +neighbor_entry_t::operator=( + neighbor_entry_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +neighbor_entry_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +neighbor_entry_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/nexthop_group_gen.cpp b/nexthop_group_gen.cpp new file mode 100644 index 0000000..51b1599 --- /dev/null +++ b/nexthop_group_gen.cpp @@ -0,0 +1,213 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/nexthop_group.h" +#include "eos/types/nexthop_group_impl.h" + +namespace eos { + +nexthop_group_mpls_action_t::nexthop_group_mpls_action_t() : + pimpl(std::make_shared()) {} +nexthop_group_mpls_action_t::nexthop_group_mpls_action_t(mpls_action_t action_type) : + pimpl(std::make_shared( + action_type + )) {} +nexthop_group_mpls_action_t::nexthop_group_mpls_action_t( + mpls_action_t action_type, + std::forward_list const & label_stack) : + pimpl(std::make_shared( + action_type, + label_stack + )) {} +EOS_SDK_PUBLIC nexthop_group_mpls_action_t::nexthop_group_mpls_action_t( + const nexthop_group_mpls_action_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC nexthop_group_mpls_action_t& +nexthop_group_mpls_action_t::operator=( + nexthop_group_mpls_action_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +nexthop_group_mpls_action_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +nexthop_group_mpls_action_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +nexthop_group_entry_counter_t::nexthop_group_entry_counter_t() : + pimpl(std::make_shared()) {} +nexthop_group_entry_counter_t::nexthop_group_entry_counter_t(uint64_t packets, + uint64_t bytes, + bool valid) : + pimpl(std::make_shared( + packets, + bytes, + valid + )) {} +EOS_SDK_PUBLIC nexthop_group_entry_counter_t::nexthop_group_entry_counter_t( + const nexthop_group_entry_counter_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC nexthop_group_entry_counter_t& +nexthop_group_entry_counter_t::operator=( + nexthop_group_entry_counter_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +nexthop_group_entry_counter_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +nexthop_group_entry_counter_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +nexthop_group_entry_t::nexthop_group_entry_t() : + pimpl(std::make_shared()) {} +nexthop_group_entry_t::nexthop_group_entry_t(ip_addr_t const & nexthop) : + pimpl(std::make_shared( + nexthop + )) {} +nexthop_group_entry_t::nexthop_group_entry_t(ip_addr_t const & nexthop, + intf_id_t const & intf) : + pimpl(std::make_shared( + nexthop, + intf + )) {} +nexthop_group_entry_t::nexthop_group_entry_t( + std::string const & child_nexthop_group) : + pimpl(std::make_shared( + child_nexthop_group + )) {} +EOS_SDK_PUBLIC nexthop_group_entry_t::nexthop_group_entry_t( + const nexthop_group_entry_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC nexthop_group_entry_t& +nexthop_group_entry_t::operator=( + nexthop_group_entry_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +nexthop_group_entry_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +nexthop_group_entry_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +nexthop_group_t::nexthop_group_t() : + pimpl(std::make_shared()) {} +nexthop_group_t::nexthop_group_t(std::string name, nexthop_group_encap_t type) : + pimpl(std::make_shared( + name, + type + )) {} +nexthop_group_t::nexthop_group_t(std::string name, nexthop_group_encap_t type, + nexthop_group_gre_key_t gre_key_type) : + pimpl(std::make_shared( + name, + type, + gre_key_type + )) {} +nexthop_group_t::nexthop_group_t(std::string name, ip_addr_t const & source_ip) : + pimpl(std::make_shared( + name, + source_ip + )) {} +nexthop_group_t::nexthop_group_t( + std::string name, ip_addr_t const & source_ip, + std::map const & nexthops) : + pimpl(std::make_shared( + name, + source_ip, + nexthops + )) {} +EOS_SDK_PUBLIC nexthop_group_t::nexthop_group_t( + const nexthop_group_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC nexthop_group_t& +nexthop_group_t::operator=( + nexthop_group_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +nexthop_group_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +nexthop_group_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +nexthop_group_programmed_status_t::nexthop_group_programmed_status_t() : + pimpl(std::make_shared()) {} +nexthop_group_programmed_status_t::nexthop_group_programmed_status_t( + nexthop_group_counter_state_t counter_state) : + pimpl(std::make_shared( + counter_state + )) {} +EOS_SDK_PUBLIC nexthop_group_programmed_status_t::nexthop_group_programmed_status_t( + const nexthop_group_programmed_status_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC nexthop_group_programmed_status_t& +nexthop_group_programmed_status_t::operator=( + nexthop_group_programmed_status_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +nexthop_group_programmed_status_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +nexthop_group_programmed_status_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/nexthop_group_tunnel_gen.cpp b/nexthop_group_tunnel_gen.cpp new file mode 100644 index 0000000..86022da --- /dev/null +++ b/nexthop_group_tunnel_gen.cpp @@ -0,0 +1,43 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/nexthop_group_tunnel.h" +#include "eos/types/nexthop_group_tunnel_impl.h" + +namespace eos { + +nexthop_group_tunnel_t::nexthop_group_tunnel_t() : + pimpl(std::make_shared()) {} +nexthop_group_tunnel_t::nexthop_group_tunnel_t(ip_prefix_t const & tunnel_endpoint, + std::string const & nhg_name) : + pimpl(std::make_shared( + tunnel_endpoint, + nhg_name + )) {} +EOS_SDK_PUBLIC nexthop_group_tunnel_t::nexthop_group_tunnel_t( + const nexthop_group_tunnel_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC nexthop_group_tunnel_t& +nexthop_group_tunnel_t::operator=( + nexthop_group_tunnel_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +nexthop_group_tunnel_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +nexthop_group_tunnel_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/policy_map_gen.cpp b/policy_map_gen.cpp new file mode 100644 index 0000000..d45bf6b --- /dev/null +++ b/policy_map_gen.cpp @@ -0,0 +1,308 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/policy_map.h" +#include "eos/types/policy_map_impl.h" + +namespace eos { + +policy_map_key_t::policy_map_key_t() : + pimpl(std::make_shared()) {} +policy_map_key_t::policy_map_key_t(std::string const & name, + policy_feature_t feature) : + pimpl(std::make_shared( + name, + feature + )) {} +EOS_SDK_PUBLIC policy_map_key_t::policy_map_key_t( + const policy_map_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC policy_map_key_t& +policy_map_key_t::operator=( + policy_map_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +policy_map_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +policy_map_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor of a PBR/QOS action. +policy_map_action_t::policy_map_action_t() : + pimpl(std::make_shared()) {} +policy_map_action_t::policy_map_action_t(policy_action_type_t action_type) : + pimpl(std::make_shared( + action_type + )) {} +EOS_SDK_PUBLIC policy_map_action_t::policy_map_action_t( + const policy_map_action_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC policy_map_action_t& +policy_map_action_t::operator=( + policy_map_action_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +policy_map_action_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +policy_map_action_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +// Default constructor of a traffic-policy action. +traffic_policy_action_t::traffic_policy_action_t() : + pimpl(std::make_shared()) {} +traffic_policy_action_t::traffic_policy_action_t( + traffic_policy_action_type_t action_type) : + pimpl(std::make_shared( + action_type + )) {} +EOS_SDK_PUBLIC traffic_policy_action_t::traffic_policy_action_t( + const traffic_policy_action_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC traffic_policy_action_t& +traffic_policy_action_t::operator=( + traffic_policy_action_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +traffic_policy_action_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +traffic_policy_action_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +policy_map_rule_t::policy_map_rule_t() : + pimpl(std::make_shared()) {} +policy_map_rule_t::policy_map_rule_t(class_map_key_t const & class_map_key) : + pimpl(std::make_shared( + class_map_key + )) {} +EOS_SDK_PUBLIC policy_map_rule_t::policy_map_rule_t( + const policy_map_rule_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC policy_map_rule_t& +policy_map_rule_t::operator=( + policy_map_rule_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +policy_map_rule_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +policy_map_rule_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +policy_map_t::policy_map_t() : + pimpl(std::make_shared()) {} +policy_map_t::policy_map_t(policy_map_key_t const & key) : + pimpl(std::make_shared( + key + )) {} +EOS_SDK_PUBLIC policy_map_t::policy_map_t( + const policy_map_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC policy_map_t& +policy_map_t::operator=( + policy_map_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +policy_map_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +policy_map_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +traffic_policy_rule_t::traffic_policy_rule_t() : + pimpl(std::make_shared()) {} +traffic_policy_rule_t::traffic_policy_rule_t( + std::string match_rule_name, + traffic_policy_rule_type_t traffic_policy_rule_type) : + pimpl(std::make_shared( + match_rule_name, + traffic_policy_rule_type + )) {} +EOS_SDK_PUBLIC traffic_policy_rule_t::traffic_policy_rule_t( + const traffic_policy_rule_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC traffic_policy_rule_t& +traffic_policy_rule_t::operator=( + traffic_policy_rule_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +traffic_policy_rule_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +traffic_policy_rule_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +traffic_policy_t::traffic_policy_t(std::string const & key) : + pimpl(std::make_shared( + key + )) {} +EOS_SDK_PUBLIC traffic_policy_t::traffic_policy_t( + const traffic_policy_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC traffic_policy_t& +traffic_policy_t::operator=( + traffic_policy_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +traffic_policy_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +traffic_policy_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +policy_map_hw_status_key_t::policy_map_hw_status_key_t() : + pimpl(std::make_shared()) {} +policy_map_hw_status_key_t::policy_map_hw_status_key_t(intf_id_t intf_id, + acl_direction_t direction) : + pimpl(std::make_shared( + intf_id, + direction + )) {} +EOS_SDK_PUBLIC policy_map_hw_status_key_t::policy_map_hw_status_key_t( + const policy_map_hw_status_key_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC policy_map_hw_status_key_t& +policy_map_hw_status_key_t::operator=( + policy_map_hw_status_key_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +policy_map_hw_status_key_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +policy_map_hw_status_key_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +policy_map_hw_statuses_t::policy_map_hw_statuses_t() : + pimpl(std::make_shared()) {} +policy_map_hw_statuses_t::policy_map_hw_statuses_t( + + std::map const & + intf_statuses) : + pimpl(std::make_shared( + intf_statuses + )) {} +EOS_SDK_PUBLIC policy_map_hw_statuses_t::policy_map_hw_statuses_t( + const policy_map_hw_statuses_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC policy_map_hw_statuses_t& +policy_map_hw_statuses_t::operator=( + policy_map_hw_statuses_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +policy_map_hw_statuses_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +policy_map_hw_statuses_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/policy_map_types.cpp b/policy_map_types.cpp index f7d81b3..de72088 100644 --- a/policy_map_types.cpp +++ b/policy_map_types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Arista Networks, Inc. All rights reserved. +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #include "eos/policy_map.h" diff --git a/route_map_gen.cpp b/route_map_gen.cpp new file mode 100644 index 0000000..684f8a6 --- /dev/null +++ b/route_map_gen.cpp @@ -0,0 +1,134 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/route_map.h" +#include "eos/types/route_map_impl.h" + +namespace eos { + +link_bandwidth_t::link_bandwidth_t(float value, bandwidth_unit_t unit) : + pimpl(std::make_shared( + value, + unit + )) {} +link_bandwidth_t::link_bandwidth_t(float value) : + pimpl(std::make_shared( + value + )) {} +link_bandwidth_t::link_bandwidth_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC link_bandwidth_t::link_bandwidth_t( + const link_bandwidth_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC link_bandwidth_t& +link_bandwidth_t::operator=( + link_bandwidth_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +link_bandwidth_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +link_bandwidth_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +route_map_link_bandwidth_t::route_map_link_bandwidth_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC route_map_link_bandwidth_t::route_map_link_bandwidth_t( + const route_map_link_bandwidth_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC route_map_link_bandwidth_t& +route_map_link_bandwidth_t::operator=( + route_map_link_bandwidth_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +route_map_link_bandwidth_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +route_map_link_bandwidth_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +route_map_entry_t::route_map_entry_t() : + pimpl(std::make_shared()) {} +route_map_entry_t::route_map_entry_t(bool permit) : + pimpl(std::make_shared( + permit + )) {} +EOS_SDK_PUBLIC route_map_entry_t::route_map_entry_t( + const route_map_entry_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC route_map_entry_t& +route_map_entry_t::operator=( + route_map_entry_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +route_map_entry_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +route_map_entry_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +route_map_t::route_map_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC route_map_t::route_map_t( + const route_map_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC route_map_t& +route_map_t::operator=( + route_map_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +route_map_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +route_map_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/sdk.cpp b/sdk.cpp index 37c92f7..680f8ff 100644 --- a/sdk.cpp +++ b/sdk.cpp @@ -295,6 +295,10 @@ intf_counter_mgr * sdk::get_intf_counter_mgr() { return sdkImpl->get_intf_counter_mgr(); } +intf_counter_mgr * sdk::get_intf_counter_mgr_with_mode(mgr_mode_type_t mode) { + return sdkImpl->get_intf_counter_mgr(mode); +} + ip_intf_mgr * sdk::get_ip_intf_mgr() { return sdkImpl->get_ip_intf_mgr(); } diff --git a/structured_filter_gen.cpp b/structured_filter_gen.cpp new file mode 100644 index 0000000..ee041e5 --- /dev/null +++ b/structured_filter_gen.cpp @@ -0,0 +1,153 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/structured_filter.h" +#include "eos/types/structured_filter_impl.h" + +namespace eos { + +protocol_range_t::protocol_range_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC protocol_range_t::protocol_range_t( + const protocol_range_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC protocol_range_t& +protocol_range_t::operator=( + protocol_range_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +protocol_range_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +protocol_range_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +port_range_t::port_range_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC port_range_t::port_range_t( + const port_range_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC port_range_t& +port_range_t::operator=( + port_range_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +port_range_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +port_range_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +port_field_t::port_field_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC port_field_t::port_field_t( + const port_field_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC port_field_t& +port_field_t::operator=( + port_field_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +port_field_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +port_field_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +protocol_field_t::protocol_field_t() : + pimpl(std::make_shared()) {} +EOS_SDK_PUBLIC protocol_field_t::protocol_field_t( + const protocol_field_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC protocol_field_t& +protocol_field_t::operator=( + protocol_field_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +protocol_field_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +protocol_field_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + + +tp_rule_filter_t::tp_rule_filter_t() : + pimpl(std::make_shared()) {} +tp_rule_filter_t::tp_rule_filter_t(traffic_policy_rule_type_t filter_type) : + pimpl(std::make_shared( + filter_type + )) {} +EOS_SDK_PUBLIC tp_rule_filter_t::tp_rule_filter_t( + const tp_rule_filter_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC tp_rule_filter_t& +tp_rule_filter_t::operator=( + tp_rule_filter_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +tp_rule_filter_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +tp_rule_filter_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/subintf_gen.cpp b/subintf_gen.cpp new file mode 100644 index 0000000..f95ca0d --- /dev/null +++ b/subintf_gen.cpp @@ -0,0 +1,43 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/subintf.h" +#include "eos/types/subintf_impl.h" + +namespace eos { + +// Default constructor. +subintf_t::subintf_t() : + pimpl(std::make_shared()) {} +subintf_t::subintf_t(intf_id_t intf_id, vlan_id_t vlan_id) : + pimpl(std::make_shared( + intf_id, + vlan_id + )) {} +EOS_SDK_PUBLIC subintf_t::subintf_t( + const subintf_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC subintf_t& +subintf_t::operator=( + subintf_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +subintf_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +subintf_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos diff --git a/version.m4 b/version.m4 index 36e65b1..57d5d38 100644 --- a/version.m4 +++ b/version.m4 @@ -1,2 +1,2 @@ m4_define([_NAME_],[EosSdk]) -m4_define([_VERSION_],[2.22.5]) \ No newline at end of file +m4_define([_VERSION_],[2.22.5.1]) \ No newline at end of file diff --git a/vrf_gen.cpp b/vrf_gen.cpp new file mode 100644 index 0000000..3ff19be --- /dev/null +++ b/vrf_gen.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2024 Arista Networks, Inc. All rights reserved. +// Arista Networks, Inc. Confidential and Proprietary. + +#include "eos/base.h" +#include "eos/types/vrf.h" +#include "eos/types/vrf_impl.h" + +namespace eos { + +// Default constructor. +vrf_t::vrf_t() : + pimpl(std::make_shared()) {} +vrf_t::vrf_t(std::string name, vrf_state_t state, uint64_t rd) : + pimpl(std::make_shared( + name, + state, + rd + )) {} +EOS_SDK_PUBLIC vrf_t::vrf_t( + const vrf_t& other) : + pimpl(std::make_shared( + *other.pimpl)) {} +EOS_SDK_PUBLIC vrf_t& +vrf_t::operator=( + vrf_t const & other) +{ + if(this != &other) { + pimpl = std::make_shared( + *other.pimpl); + } + return *this; +} + +EOS_SDK_PUBLIC void * +vrf_t::operator new( std::size_t size ) { + return ::operator new( size ); +} +EOS_SDK_PUBLIC void +vrf_t::operator delete( void * p ) noexcept { + ::operator delete( p ); +} + + +} // namespace eos