diff options
author | Pavel Kotucek <pkotucek@cisco.com> | 2016-07-12 10:18:26 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-07-21 09:34:27 +0000 |
commit | 9e6ed6e2e1b8af46a317f9448da2bca8d8c5395d (patch) | |
tree | bbbd95d27e2a23b18d276ffd82b5fc842d55933d /vpp/vpp-api/custom_dump.c | |
parent | 948b95a9a08d38e7f74a160c11193f73a90e98c9 (diff) |
Add API calls for packet generator
Added new API to:
- create packet generator interface
- enable packet generator per stream or all
- capture into file
Change-Id: I0e6c1f28069853e4b26f0dc9d282353b0b7f6512
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'vpp/vpp-api/custom_dump.c')
-rw-r--r-- | vpp/vpp-api/custom_dump.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/vpp/vpp-api/custom_dump.c b/vpp/vpp-api/custom_dump.c index 4e8b0642..cb91d73c 100644 --- a/vpp/vpp-api/custom_dump.c +++ b/vpp/vpp-api/custom_dump.c @@ -1887,6 +1887,47 @@ static void *vl_api_get_next_index_t_print FINISH; } +static void *vl_api_pg_create_interface_t_print +(vl_api_pg_create_interface_t * mp, void *handle) +{ + u8 * s; + + s = format (0, "SCRIPT: pg_create_interface "); + s = format (0, "if_id %d", ntohl(mp->interface_id)); + + FINISH; +} + +static void *vl_api_pg_capture_t_print +(vl_api_pg_capture_t * mp, void *handle) +{ + u8 * s; + + s = format (0, "SCRIPT: pg_capture "); + s = format (0, "if_id %d ", ntohl(mp->interface_id)); + s = format (0, "pcap %s", mp->pcap_file_name); + if (mp->count != ~0) + s = format (s, "count %d ", ntohl(mp->count)); + if (!mp->is_enabled) + s = format (s, "disable"); + + FINISH; +} + +static void *vl_api_pg_enable_disable_t_print +(vl_api_pg_enable_disable_t * mp, void *handle) +{ + u8 * s; + + s = format (0, "SCRIPT: pg_enable_disable "); + if (ntohl(mp->stream_name_length) > 0) + s = format (s, "stream %s", mp->stream_name); + if (!mp->is_enabled) + s = format (s, "disable"); + + FINISH; +} + #define foreach_custom_print_function \ _(CREATE_LOOPBACK, create_loopback) \ _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \ @@ -1985,7 +2026,10 @@ _(CLASSIFY_TABLE_INFO,classify_table_info) \ _(CLASSIFY_SESSION_DUMP,classify_session_dump) \ _(IPFIX_ENABLE,ipfix_enable) \ _(IPFIX_DUMP,ipfix_dump) \ -_(GET_NEXT_INDEX, get_next_index) +_(GET_NEXT_INDEX, get_next_index) \ +_(PG_CREATE_INTERFACE,pg_create_interface) \ +_(PG_CAPTURE, pg_capture) \ +_(PG_ENABLE_DISABLE, pg_enable_disable) void vl_msg_api_custom_dump_configure (api_main_t *am) { |