Skip to content

Commit

Permalink
removing rule protocol info as this isn't in use - TODO squash
Browse files Browse the repository at this point in the history
  • Loading branch information
tomerdbz committed Dec 25, 2024
1 parent acee972 commit c9c3905
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
10 changes: 0 additions & 10 deletions src/vma/proto/rule_table_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ void rule_table_mgr::update_tbl()
// return true if its not related to local or default table, false otherwise.
bool rule_table_mgr::parse_entry(struct nl_object *nl_obj, void *p_val_context)
{
int err = 0;

rule_val *p_val = static_cast<rule_val *>(p_val_context);
// Cast the generic nl_object to a specific route or rule object
struct rtnl_rule *rule = reinterpret_cast<struct rtnl_rule *>(nl_obj);
Expand All @@ -110,14 +108,6 @@ bool rule_table_mgr::parse_entry(struct nl_object *nl_obj, void *p_val_context)
return false;
}

// Set rule properties in p_val using libnl getters
uint8_t protocol = 0;
err = rtnl_rule_get_protocol(rule, &protocol);
if (err < 0) {
throw_vma_exception("Failed to get rule protocol");
}

p_val->set_protocol(protocol);
p_val->set_tos(rtnl_rule_get_dsfield(rule));
p_val->set_table_id(table_id);

Expand Down
1 change: 0 additions & 1 deletion src/vma/proto/rule_val.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
rule_val::rule_val()
: cache_observer()
{
m_protocol = 0;
m_dst_addr = 0;
m_src_addr = 0;
memset(m_oif_name, 0, IFNAMSIZ * sizeof(char));
Expand Down
2 changes: 0 additions & 2 deletions src/vma/proto/rule_val.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class rule_val : public cache_observer {

inline void set_dst_addr(in_addr_t const &dst_addr) { m_dst_addr = dst_addr; };
inline void set_src_addr(in_addr_t const &src_addr) { m_src_addr = src_addr; };
inline void set_protocol(unsigned char protocol) { m_protocol = protocol; };
inline void set_tos(unsigned char tos) { m_tos = tos; };
inline void set_table_id(uint32_t table_id) { m_table_id = table_id; };
inline void set_iif_name(char *iif_name) { memcpy(m_iif_name, iif_name, IFNAMSIZ); };
Expand All @@ -73,7 +72,6 @@ class rule_val : public cache_observer {
char *to_str() { return m_str; };

private:
unsigned char m_protocol;
unsigned char m_tos;

union {
Expand Down

0 comments on commit c9c3905

Please sign in to comment.