diff options
author | imarom <imarom@cisco.com> | 2015-09-17 16:27:47 +0300 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2015-09-17 16:27:47 +0300 |
commit | 96765d2bf2c416f652da904cf7524ff75b678aee (patch) | |
tree | adaffcbd4782207e03198814cd288b66b07d7b36 /src/stateless/trex_stateless_api.h | |
parent | 1e723ff84bb6cdf6dd3a58650af059b6814b5331 (diff) |
moved 'owning states' to port granularity instead of machine
Diffstat (limited to 'src/stateless/trex_stateless_api.h')
-rw-r--r-- | src/stateless/trex_stateless_api.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/stateless/trex_stateless_api.h b/src/stateless/trex_stateless_api.h index 60d26878..e02e93da 100644 --- a/src/stateless/trex_stateless_api.h +++ b/src/stateless/trex_stateless_api.h @@ -106,10 +106,58 @@ public: */ void get_properties(std::string &driver, std::string &speed); + /** + * query for ownership + * + */ + const std::string &get_owner() { + return m_owner; + } + + /** + * owner handler + * for the connection + * + */ + const std::string &get_owner_handler() { + return m_owner_handler; + } + + bool is_free_to_aquire() { + return (m_owner == "none"); + } + + /** + * take ownership of the server array + * this is static + * ownership is total + * + */ + void set_owner(const std::string &owner) { + m_owner = owner; + m_owner_handler = generate_handler(); + } + + void clear_owner() { + m_owner = "none"; + m_owner_handler = ""; + } + + bool verify_owner_handler(const std::string &handler) { + + return ( (m_owner != "none") && (m_owner_handler == handler) ); + + } + private: + + std::string generate_handler(); + TrexStreamTable m_stream_table; uint8_t m_port_id; port_state_e m_port_state; + std::string m_owner; + std::string m_owner_handler; }; /** |