Skip to content

Commit

Permalink
EOS SDK v2.22.2 (EOS 4.29.1F)
Browse files Browse the repository at this point in the history
  • Loading branch information
prufer committed Jan 1, 2023
1 parent 79d5651 commit a829ede
Show file tree
Hide file tree
Showing 46 changed files with 331 additions and 105 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#-----------------------------------------------------------------------------------

FROM centos:7
ARG version=2.22.1
ARG version=2.22.2
ARG arch="m32"

# Set eossdk version as label and environ variable.
Expand Down
7 changes: 5 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CXXFLAGS = -fvisibility=hidden
AM_CXXFLAGS += -Wextra -Wall -Wnon-virtual-dtor -Werror -Wno-unused-parameter -Wno-error=unused-value
AM_LDFLAGS = -Wl,--no-undefined

PUBLISHED_HEADER_FILES := $(wildcard eos/*.h) $(wildcard eos/inline/*.h) $(wildcard eos/types/*.h) $(wildcard eos/inline/types/*.h) eos/version.h
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)

EXTRA_DIST = MaybePrintProfilesAndExit.cpp $(wildcard examples/*) $(wildcard examples/test/*)
Expand Down Expand Up @@ -83,7 +83,6 @@ libeos_la_CPPFLAGS = $(AM_CPPFLAGS) $(SHIPPING_FLAG)
libeos_la_LDFLAGS = -version-info $(SDK_LIBTOOL_VERSION) -lrt
libeos_la_LDFLAGS += -soname libeos.so.$(SDK_VERSION_MAJOR).$(SDK_VERSION_MINOR)


noinst_PROGRAMS = HelloWorld
HelloWorld_SOURCES = examples/HelloWorld.cpp
HelloWorld_LDADD = libeos.la
Expand Down Expand Up @@ -151,3 +150,7 @@ EXTRA_DIST += Dockerfile
dist-hook:
chmod -R u+w $(distdir)
$(MKDIR_P) $(srcdir)/$(stubsgosrcdir)

install-exec-hook:
-echo "add major.minor link for stubbed libeos"
cd .libs; ln -sf libeos.so.$(SDK_VERSION_MAJOR).$(SDK_VERSION_MINOR).$(SDK_VERSION_PATCH) libeos.so.$(SDK_VERSION_MAJOR).$(SDK_VERSION_MINOR);
2 changes: 1 addition & 1 deletion aresolve_types.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2016 Arista Networks, Inc. All rights reserved.
// Copyright (c) 2022 Arista Networks, Inc. All rights reserved.
// Arista Networks, Inc. Confidential and Proprietary.

#include "eos/aresolve.h"
Expand Down
15 changes: 12 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ libdir="lib"
configure_flags=''
for arg; do
case $arg in
(--enable-*|--disable-*|--with-*|--without-*|--host=*|--build=*)
(--enable-*|--disable-*|--with-*|--without-*|--host=*|--build=*|--prefix=*|--libdir=*)
configure_flags="$configure_flags $arg"
shift
;;
Expand Down Expand Up @@ -50,13 +50,22 @@ if $target_32b; then
fi

sysroot=$($(which gcc) --print-sysroot) || sysroot = ""
inst_prefix="--prefix=$sysroot/usr"
inst_libdir="--libdir=$sysroot/usr/$libdir"
# if prefix already set in configure_flags, skip sysroot one
if grep -q -- "--prefix=" <<< "$configure_flags"; then
inst_prefix=""
fi
if grep -q -- "--libdir=" <<< "$configure_flags"; then
inst_libdir=""
fi

set -e
test -f configure || ./bootstrap
test -f Makefile || ./configure \
$configure_flags --program-prefix= \
--prefix=$sysroot/usr \
--libdir=$sysroot/usr/$libdir \
$inst_prefix \
$inst_libdir \

set -x
STUBS_DIR=$PWD
Expand Down
2 changes: 1 addition & 1 deletion directflow_types.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2016 Arista Networks, Inc. All rights reserved.
// Copyright (c) 2022 Arista Networks, Inc. All rights reserved.
// Arista Networks, Inc. Confidential and Proprietary.

#include "eos/directflow.h"
Expand Down
8 changes: 4 additions & 4 deletions eos/acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class EOS_SDK_PUBLIC acl_rule_eth_iter_t : public iter_base<acl_rule_eth_entry_t
* commit changes, apply ACLs to interfaces as well as manage
* fragments mode and enabling counters.
*
* When managing ACLs, you provide give an ACL key to modify, a
* When managing ACLs, you provide an ACL key to modify, a
* "sequence number" which starts at 1 and goes up to MAXINT, and for
* set operations, the rule to set. Note: you must call commit() for
* your changes here to get pushed into the hardware, and once you
Expand Down Expand Up @@ -282,20 +282,20 @@ class EOS_SDK_PUBLIC acl_mgr : public base_mgr<acl_handler> {
* everything is loaded into hardware, or when we notice problems.
*
* API call ordering note: any acl_rule_set() or acl_rule_del()
* calls be followed by an acl_commit() prior to calling this
* calls must be followed by an acl_commit() prior to calling this
* function else a panic() will occur.
*/
virtual void acl_apply(acl_key_t const &, intf_id_t, acl_direction_t, bool) = 0;

/**
* Enable or disable counters for the ACL.
* Note: Must call commit() for setting to apply.
* Note: Must call commit() for this setting to apply.
*/
virtual void acl_counters_enabled_set(acl_key_t const &, bool) = 0;

/**
* Enable or disable fragments matching on the ACL.
* Note: Must call commit() for setting to apply.
* Note: Must call commit() for this setting to apply.
*/
virtual void acl_fragments_enabled_set(acl_key_t const &, bool) = 0;

Expand Down
4 changes: 4 additions & 0 deletions eos/inline/types/acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ operator<<(std::ostream& os, const acl_tcp_flag_t & enum_val) {
os << "ACL_TCP_ACK";
} else if (enum_val==ACL_TCP_URG) {
os << "ACL_TCP_URG";
} else if (enum_val==ACL_TCP_ECE) {
os << "ACL_TCP_ECE";
} else if (enum_val==ACL_TCP_CWR) {
os << "ACL_TCP_CWR";
} else {
os << "Unknown value";
}
Expand Down
6 changes: 4 additions & 2 deletions eos/inline/types/acl_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ acl_port_spec_impl_t::hash() const {
void
acl_port_spec_impl_t::mix_me(hash_mix & h) const {
h.mix(oper_); // acl_range_operator_t
for (auto it=ports_.cbegin(); it!=ports_.cend(); ++it) {
for (auto it=ports_.cbegin();
it!=ports_.cend(); ++it) {
h.mix(*it); // uint16_t
}
}
Expand All @@ -189,7 +190,8 @@ acl_port_spec_impl_t::to_string() const {
ss << "oper=" << oper_;
ss << ", ports=" <<"'";
bool first_ports = true;
for (auto it=ports_.cbegin(); it!=ports_.cend(); ++it) {
for (auto it=ports_.cbegin();
it!=ports_.cend(); ++it) {
if (first_ports) {
ss << (*it);
first_ports = false;
Expand Down
12 changes: 8 additions & 4 deletions eos/inline/types/aresolve.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ aresolve_record_host::hash() const {

void
aresolve_record_host::mix_me(hash_mix & h) const {
for (auto it=addr_v4_.cbegin(); it!=addr_v4_.cend(); ++it) {
for (auto it=addr_v4_.cbegin();
it!=addr_v4_.cend(); ++it) {
h.mix(*it); // ip_addr_t
}
for (auto it=addr_v6_.cbegin(); it!=addr_v6_.cend(); ++it) {
for (auto it=addr_v6_.cbegin();
it!=addr_v6_.cend(); ++it) {
h.mix(*it); // ip_addr_t
}
}
Expand All @@ -99,7 +101,8 @@ aresolve_record_host::to_string() const {
ss << "aresolve_record_host(";
ss << "addr_v4=" <<"'";
bool first_addr_v4 = true;
for (auto it=addr_v4_.cbegin(); it!=addr_v4_.cend(); ++it) {
for (auto it=addr_v4_.cbegin();
it!=addr_v4_.cend(); ++it) {
if (first_addr_v4) {
ss << (*it);
first_addr_v4 = false;
Expand All @@ -110,7 +113,8 @@ aresolve_record_host::to_string() const {
ss << "'";
ss << ", addr_v6=" <<"'";
bool first_addr_v6 = true;
for (auto it=addr_v6_.cbegin(); it!=addr_v6_.cend(); ++it) {
for (auto it=addr_v6_.cbegin();
it!=addr_v6_.cend(); ++it) {
if (first_addr_v6) {
ss << (*it);
first_addr_v6 = false;
Expand Down
6 changes: 4 additions & 2 deletions eos/inline/types/bfd_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ void
sbfd_echo_session_key_impl_t::mix_me(hash_mix & h) const {
h.mix(nexthop_); // ip_addr_t
h.mix(nexthop_intf_); // intf_id_t
for (auto it=labels_.cbegin(); it!=labels_.cend(); ++it) {
for (auto it=labels_.cbegin();
it!=labels_.cend(); ++it) {
h.mix(*it); // mpls_label_t
}
h.mix(ip_dscp_); // uint8_t
Expand All @@ -401,7 +402,8 @@ sbfd_echo_session_key_impl_t::to_string() const {
ss << ", nexthop_intf=" << nexthop_intf_;
ss << ", labels=" <<"'";
bool first_labels = true;
for (auto it=labels_.cbegin(); it!=labels_.cend(); ++it) {
for (auto it=labels_.cbegin();
it!=labels_.cend(); ++it) {
if (first_labels) {
ss << (*it);
first_labels = false;
Expand Down
6 changes: 4 additions & 2 deletions eos/inline/types/bgp_path_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ bgp_path_attr_impl_t::mix_me(hash_mix & h) const {
h.mix(origin_); // uint8_t
h.mix(med_); // uint32_t
h.mix(local_pref_); // uint32_t
for (auto it=community_list_.cbegin(); it!=community_list_.cend(); ++it) {
for (auto it=community_list_.cbegin();
it!=community_list_.cend(); ++it) {
h.mix(*it); // uint32_t
}
}
Expand All @@ -268,7 +269,8 @@ bgp_path_attr_impl_t::to_string() const {
ss << ", local_pref=" << local_pref_;
ss << ", community_list=" <<"'";
bool first_community_list = true;
for (auto it=community_list_.cbegin(); it!=community_list_.cend(); ++it) {
for (auto it=community_list_.cbegin();
it!=community_list_.cend(); ++it) {
if (first_community_list) {
ss << (*it);
first_community_list = false;
Expand Down
6 changes: 4 additions & 2 deletions eos/inline/types/class_map_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ class_map_impl_t::hash() const {
void
class_map_impl_t::mix_me(hash_mix & h) const {
h.mix(key_); // class_map_key_t
for (auto it=rules_.cbegin(); it!=rules_.cend(); ++it) {
for (auto it=rules_.cbegin();
it!=rules_.cend(); ++it) {
h.mix(it->first); // uint32_t
h.mix(it->second); // class_map_rule_t
}
Expand All @@ -132,7 +133,8 @@ class_map_impl_t::to_string() const {
ss << "key=" << key_;
ss << ", rules=" <<"'";
bool first_rules = true;
for (auto it=rules_.cbegin(); it!=rules_.cend(); ++it) {
for (auto it=rules_.cbegin();
it!=rules_.cend(); ++it) {
if (first_rules) {
ss << it->first << "=" << it->second;
first_rules = false;
Expand Down
12 changes: 8 additions & 4 deletions eos/inline/types/directflow_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ flow_match_impl_t::hash() const {
void
flow_match_impl_t::mix_me(hash_mix & h) const {
h.mix(match_field_set_); // flow_match_field_set_t
for (auto it=input_intfs_.cbegin(); it!=input_intfs_.cend(); ++it) {
for (auto it=input_intfs_.cbegin();
it!=input_intfs_.cend(); ++it) {
h.mix(*it); // intf_id_t
}
h.mix(eth_src_); // eth_addr_t
Expand All @@ -285,7 +286,8 @@ flow_match_impl_t::to_string() const {
ss << "match_field_set=" << match_field_set_;
ss << ", input_intfs=" <<"'";
bool first_input_intfs = true;
for (auto it=input_intfs_.cbegin(); it!=input_intfs_.cend(); ++it) {
for (auto it=input_intfs_.cbegin();
it!=input_intfs_.cend(); ++it) {
if (first_input_intfs) {
ss << (*it);
first_input_intfs = false;
Expand Down Expand Up @@ -448,7 +450,8 @@ flow_action_impl_t::hash() const {
void
flow_action_impl_t::mix_me(hash_mix & h) const {
h.mix(action_set_); // flow_action_set_t
for (auto it=output_intfs_.cbegin(); it!=output_intfs_.cend(); ++it) {
for (auto it=output_intfs_.cbegin();
it!=output_intfs_.cend(); ++it) {
h.mix(*it); // intf_id_t
}
h.mix(vlan_id_); // vlan_id_t
Expand All @@ -466,7 +469,8 @@ flow_action_impl_t::to_string() const {
ss << "action_set=" << action_set_;
ss << ", output_intfs=" <<"'";
bool first_output_intfs = true;
for (auto it=output_intfs_.cbegin(); it!=output_intfs_.cend(); ++it) {
for (auto it=output_intfs_.cbegin();
it!=output_intfs_.cend(); ++it) {
if (first_output_intfs) {
ss << (*it);
first_output_intfs = false;
Expand Down
3 changes: 2 additions & 1 deletion eos/inline/types/eapi_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ eapi_response_impl_t::to_string() const {
ss << ", error_message='" << error_message_ << "'";
ss << ", responses=" <<"'";
bool first_responses = true;
for (auto it=responses_.cbegin(); it!=responses_.cend(); ++it) {
for (auto it=responses_.cbegin();
it!=responses_.cend(); ++it) {
if (first_responses) {
ss << (*it);
first_responses = false;
Expand Down
6 changes: 4 additions & 2 deletions eos/inline/types/fib_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ fib_fec_impl_t::mix_me(hash_mix & h) const {
h.mix(fec_key_); // fib_fec_key_t
h.mix(fec_type_); // fib_fec_type_t
h.mix(nexthop_group_name_); // std::string
for (auto it=via_.cbegin(); it!=via_.cend(); ++it) {
for (auto it=via_.cbegin();
it!=via_.cend(); ++it) {
h.mix(*it); // fib_via_t
}
}
Expand All @@ -405,7 +406,8 @@ fib_fec_impl_t::to_string() const {
ss << ", nexthop_group_name='" << nexthop_group_name_ << "'";
ss << ", via=" <<"'";
bool first_via = true;
for (auto it=via_.cbegin(); it!=via_.cend(); ++it) {
for (auto it=via_.cbegin();
it!=via_.cend(); ++it) {
if (first_via) {
ss << (*it);
first_via = false;
Expand Down
6 changes: 3 additions & 3 deletions eos/inline/types/ham.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ operator<<(std::ostream& os, const read16_result_t& obj) {
}


read_result_t::read_result_t(response_enum_t status, std::string result) {
read_result_t::read_result_t(response_enum_t status, ByteString result) {
pimpl = std::shared_ptr<read_result_impl_t>(
new read_result_impl_t(
status,
Expand Down Expand Up @@ -502,12 +502,12 @@ void
read_result_t::status_is(response_enum_t status) {
pimpl->status_is(status);
}
std::string
ByteString
read_result_t::result() const {
return pimpl->result();
}
void
read_result_t::result_is(std::string result) {
read_result_t::result_is(ByteString result) {
pimpl->result_is(result);
}
bool
Expand Down
10 changes: 5 additions & 5 deletions eos/inline/types/ham_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ operator<<(std::ostream& os, const read16_result_impl_t& obj) {


read_result_impl_t::read_result_impl_t(response_enum_t status,
std::string result) :
ByteString result) :
status_(status), result_(result) {
}

Expand All @@ -544,13 +544,13 @@ read_result_impl_t::status_is(response_enum_t status) {
status_ = status;
}

std::string
ByteString
read_result_impl_t::result() const {
return result_;
}

void
read_result_impl_t::result_is(std::string result) {
read_result_impl_t::result_is(ByteString result) {
result_ = result;
}

Expand All @@ -575,15 +575,15 @@ read_result_impl_t::hash() const {
void
read_result_impl_t::mix_me(hash_mix & h) const {
h.mix(status_); // response_enum_t
h.mix(result_); // std::string
h.mix(result_); // ByteString
}

std::string
read_result_impl_t::to_string() const {
std::ostringstream ss;
ss << "read_result_t(";
ss << "status=" << status_;
ss << ", result='" << result_ << "'";
ss << ", result=" << result_;
ss << ")";
return ss.str();
}
Expand Down
Loading

0 comments on commit a829ede

Please sign in to comment.