summaryrefslogtreecommitdiffstats
path: root/test/test_srv6.py
AgeCommit message (Expand)AuthorFilesLines
2022-05-10tests: replace pycodestyle with blackKlement Sekera1-499/+650
2022-04-29tests: fix assert_nothing_capturedKlement Sekera1-4/+4
2021-05-13tests: move test source to vpp/testDave Wallace1-0/+2147
2019-08-22tests: move plugin tests to src/plugins/*/testDave Wallace1-2141/+0
2019-06-18fib: fib api updatesNeale Ranns1-44/+20
2019-04-10Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.Paul Vinciguerra1-2/+6
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra1-1/+1
2019-03-11VPP-1508: Use scapy.compat to manage packet level library differences.Paul Vinciguerra1-7/+8
2019-03-07Tests: Refactor payload_to_info()Paul Vinciguerra1-1/+1
2019-03-07VPP-1508: Python3 tests. Explicitly specify string formatting.Paul Vinciguerra1-2/+2
2019-02-04VTL Cleanup: Fix missing calls to setUpClass/tearDownClass, fix numerous Type...Paul Vinciguerra1-6/+6
2018-12-05VPP-1508: Python3 compatible printPaul Vinciguerra1-1/+0
2018-06-19Fixed bugs in SRv6 APIPablo Camarillo1-18/+27
2018-05-18IP table bind allowed only if table existsNeale Ranns1-1/+7
2018-03-19Scapy upgrade to 2.4.0.rc5Neale Ranns1-0/+4
2017-11-10add classify session action set-sr-policy-indexGabriel Ganne1-0/+145
2017-10-15Revert "Enforce FIB table creation before use"Florin Coras1-17/+2
2017-10-13Enforce FIB table creation before useNeale Ranns1-2/+17
2017-08-22SRv6 testsKris Michielsen1-0/+1997
d on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef __TREX_RPC_CMD_API_H__ #define __TREX_RPC_CMD_API_H__ #include <string> #include <vector> #include <json/json.h> #include <trex_rpc_exception_api.h> /** * describe different types of rc for run() */ typedef enum trex_rpc_cmd_rc_ { TREX_RPC_CMD_OK, TREX_RPC_CMD_PARAM_COUNT_ERR = 1, TREX_RPC_CMD_PARAM_PARSE_ERR, TREX_RPC_CMD_INTERNAL_ERR } trex_rpc_cmd_rc_e; /** * simple exception for RPC command processing * * @author imarom (23-Aug-15) */ class TrexRpcCommandException : TrexRpcException { public: TrexRpcCommandException(trex_rpc_cmd_rc_e rc) : m_rc(rc) { } trex_rpc_cmd_rc_e get_rc() { return m_rc; } protected: trex_rpc_cmd_rc_e m_rc; }; /** * interface for RPC command * * @author imarom (13-Aug-15) */ class TrexRpcCommand { public: /** * method name and params */ TrexRpcCommand(const std::string &method_name) : m_name(method_name) { } /** * entry point for executing RPC command * */ trex_rpc_cmd_rc_e run(const Json::Value &params, Json::Value &result); const std::string &get_name() { return m_name; } virtual ~TrexRpcCommand() {} protected: /** * different types of fields */ enum field_type_e { FIELD_TYPE_INT, FIELD_TYPE_DOUBLE, FIELD_TYPE_BOOL, FIELD_TYPE_STR, FIELD_TYPE_OBJ, FILED_TYPE_ARRAY }; /** * implemented by the dervied class * */ virtual trex_rpc_cmd_rc_e _run(const Json::Value &params, Json::Value &result) = 0; /** * check param count */ void check_param_count(const Json::Value &params, int expected, Json::Value &result); /** * check field type * */ //void check_field_type(const Json::Value &field, field_type_e type, Json::Value &result); void check_field_type(const Json::Value &parent, const std::string &name, field_type_e type, Json::Value &result); /** * error generating functions * */ void generate_err(Json::Value &result, const std::string &msg); /** * translate enum to string * */ const char * type_to_str(field_type_e type); /** * translate JSON values to string * */ const char * json_type_to_name(const Json::Value &value); /* RPC command name */ std::string m_name; }; #endif /* __TREX_RPC_CMD_API_H__ */