summaryrefslogtreecommitdiffstats
path: root/src/vpp-api
AgeCommit message (Expand)AuthorFilesLines
2019-05-09Improve exceptions in vpp_transport_socket.pyVratko Polak1-2/+4
2019-05-09Fix copypaste in vpp_papi/vpp_transport_socket.pyVratko Polak1-3/+2
2019-05-08Fix Exception typo in vpp_papi/vpp_transport_socket.py.Paul Vinciguerra1-1/+1
2019-05-07Allow repeated connects on PAPI socket transportVratko Polak1-1/+10
2019-04-30stats: Add version defines in stat_client.hOle Troan1-0/+3
2019-04-29API: Add support for limits to language.Ole Troan3-10/+46
2019-04-24NAT: VPP-1531 api cleanup & updateFilip Varga1-1/+1
2019-04-23API: Python and Unix domain socket improvementOle Troan1-27/+19
2019-04-23Revert "NAT: VPP-1531 api cleanup & update"Ole Trøan1-1/+1
2019-04-23NAT: VPP-1531 api cleanup & updateFilip Varga1-1/+1
2019-04-16stats: Add name vectors to Python clientOle Troan3-45/+78
2019-04-16API: Handle pthread cond signal case where signal is missed.Ole Troan1-1/+8
2019-04-08GBP: drop and contract countersNeale Ranns1-1/+1
2019-03-22vppapigen: allow for enum size other than u32Andrew Yourtchenko1-3/+5
2019-03-20vpp_papi: Expose the list of field attributes to the client.Paul Vinciguerra1-0/+1
2019-03-19vpp_papi: specify encoding for .encode()/.decode()Paul Vinciguerra3-9/+10
2019-03-15Revert "API: Cleanup APIs interface.api"Ole Trøan1-1/+1
2019-03-15API: Cleanup APIs interface.apiJakub Grajciar1-1/+1
2019-03-11VPP-1486: stat segment file descriptor leakOle Troan1-0/+3
2019-03-07vpp_papi: Adjust aenum import for python3.Paul Vinciguerra2-4/+11
2019-03-07API: Add python2.7 support for enum flags via aenumOle Troan2-4/+8
2019-03-04test framework: add factory function and default parametersOle Troan1-0/+2
2019-02-28vpp_papi.py: Change VppEnum from explicit metaclass to metaclass wrapper/deco...Paul Vinciguerra1-4/+11
2019-02-28stats: Add interface name to sw_if_index as /if/namesOle Troan2-1/+24
2019-02-26vpp-papi: Only install enum34 for python<=3.4.Paul Vinciguerra1-14/+17
2019-01-17cmake: initial cross-compilation supportDamjan Marion1-1/+0
2019-01-06vpp-api: Add context to VPPStatsIOError.Paul Vinciguerra2-7/+29
2018-12-28vpp_papi: MACAddress equals fails in unittest.Paul Vinciguerra2-0/+21
2018-12-18VAPI/VOM: Removing legacy stats tests, add string type.Ole Troan2-0/+2
2018-12-18PAPI: Add MACAddress object wrapper for vl_api_mac_address_tOle Troan4-3/+67
2018-12-13API: Use string type instead of u8.Ole Troan3-17/+80
2018-12-13vapi: code cleanupKlement Sekera1-5/+4
2018-12-12PAPI: Allow ipaddress object as argument and return values from API callsOle Troan4-220/+266
2018-12-10Python API: Use services to determine stream RPCOle Troan1-4/+11
2018-12-10Test framework: StringIO fixes for Python3Ole Troan1-2/+7
2018-12-06stat_client: Fix the type castingMohsin Kazmi2-7/+10
2018-12-06API: Change ip4_address and ip6_address to use type alias.Ole Troan4-20/+39
2018-12-05stat-client: pass names as const stringsNeale Ranns2-4/+4
2018-11-29vpp_papi: Add custom exceptions.Paul Vinciguerra6-54/+121
2018-11-29vpp_papi: Fix: raise NotImplemented.Paul Vinciguerra1-1/+1
2018-11-29API: Add support for type aliasesOle Troan5-23/+87
2018-11-29VPP-1508: vpp_transport_socket.py fix importPaul Vinciguerra1-1/+4
2018-11-28vpp_papi: Reserved keywords.Paul Vinciguerra2-3/+3
2018-11-28vpp_papi: Use new style classes.Paul Vinciguerra6-13/+13
2018-11-26stats: Remove unneeded dependencies in stat_clientOle Troan2-7/+21
2018-11-26vapi: break if parsing progress cannot be madeKlement Sekera1-0/+1
2018-11-22stat_client issues while running parallel tests.Paul Vinciguerra4-52/+162
2018-11-07Unresolved symbols in libvapiclientNeale Ranns1-0/+1
2018-11-05Provide return value for PAPI disconnect()Igor Mikhailov (imichail)2-1/+3
2018-11-05Alter logging semantics for VPP PAPI objectIgor Mikhailov (imichail)1-1/+1
pan> /* Worker thread index */ u32 worker_index; /* Output next index to reach output node from stream input node. */ u32 next_index; u32 if_id; /* Number of packets currently generated. */ u64 n_packets_generated; /* Stream is disabled when packet limit is reached. Zero means no packet limit. */ u64 n_packets_limit; /* Rate for this stream in packets/second. Zero means unlimited rate. */ f64 rate_packets_per_second; f64 time_last_generate; f64 packet_accumulator; pg_buffer_index_t *buffer_indices; u8 **replay_packet_templates; u32 current_replay_packet_index; } pg_stream_t; always_inline void pg_buffer_index_free (pg_buffer_index_t * bi) { vec_free (bi->edits); clib_fifo_free (bi->buffer_fifo); } always_inline void pg_edit_group_free (pg_edit_group_t * g) { pg_edit_t *e; vec_foreach (e, g->edits) pg_edit_free (e); vec_free (g->edits); vec_free (g->fixed_packet_data); vec_free (g->fixed_packet_data_mask); } always_inline void pg_stream_free (pg_stream_t * s) { pg_edit_group_t *g; pg_edit_t *e; vec_foreach (e, s->non_fixed_edits) pg_edit_free (e); vec_free (s->non_fixed_edits); vec_foreach (g, s->edit_groups) pg_edit_group_free (g); vec_free (s->edit_groups); vec_free (s->fixed_packet_data); vec_free (s->fixed_packet_data_mask); vec_free (s->name); { pg_buffer_index_t *bi; vec_foreach (bi, s->buffer_indices) pg_buffer_index_free (bi); vec_free (s->buffer_indices); } } always_inline int pg_stream_is_enabled (pg_stream_t * s) { return (s->flags & PG_STREAM_FLAGS_IS_ENABLED) != 0; } always_inline pg_edit_group_t * pg_stream_get_group (pg_stream_t * s, u32 group_index) { return vec_elt_at_index (s->edit_groups, group_index); } always_inline void * pg_create_edit_group (pg_stream_t * s, int n_edit_bytes, int n_packet_bytes, u32 * group_index) { pg_edit_group_t *g; int n_edits; vec_add2 (s->edit_groups, g, 1); if (group_index) *group_index = g - s->edit_groups; ASSERT (n_edit_bytes % sizeof (pg_edit_t) == 0); n_edits = n_edit_bytes / sizeof (pg_edit_t); vec_resize (g->edits, n_edits); g->n_packet_bytes = n_packet_bytes; return g->edits; } always_inline void * pg_add_edits (pg_stream_t * s, int n_edit_bytes, int n_packet_bytes, u32 group_index) { pg_edit_group_t *g = pg_stream_get_group (s, group_index); pg_edit_t *e; int n_edits; ASSERT (n_edit_bytes % sizeof (pg_edit_t) == 0); n_edits = n_edit_bytes / sizeof (pg_edit_t); vec_add2 (g->edits, e, n_edits); g->n_packet_bytes += n_packet_bytes; return e; } always_inline void * pg_get_edit_group (pg_stream_t * s, u32 group_index) { pg_edit_group_t *g = pg_stream_get_group (s, group_index); return g->edits; } /* Number of bytes for all groups >= given group. */ always_inline uword pg_edit_group_n_bytes (pg_stream_t * s, u32 group_index) { pg_edit_group_t *g; uword n_bytes = 0; for (g = s->edit_groups + group_index; g < vec_end (s->edit_groups); g++) n_bytes += g->n_packet_bytes; return n_bytes; } always_inline void pg_free_edit_group (pg_stream_t * s) { uword i = vec_len (s->edit_groups) - 1; pg_edit_group_t *g = pg_stream_get_group (s, i); pg_edit_group_free (g); memset (g, 0, sizeof (g[0])); _vec_len (s->edit_groups) = i; } typedef struct { /* TX lock */ volatile u32 *lockp; /* VLIB interface indices. */ u32 hw_if_index, sw_if_index; /* Identifies stream for this interface. */ u32 id; pcap_main_t pcap_main; u8 *pcap_file_name; } pg_interface_t; /* Per VLIB node data. */ typedef struct { /* Parser function indexed by node index. */ unformat_function_t *unformat_edit; } pg_node_t; typedef struct pg_main_t { /* Pool of streams. */ pg_stream_t *streams; /* Bitmap indicating which streams are currently enabled. */ uword **enabled_streams; /* Hash mapping name -> stream index. */ uword *stream_index_by_name; /* Pool of interfaces. */ pg_interface_t *interfaces; uword *if_index_by_if_id; /* Per VLIB node information. */ pg_node_t *nodes; } pg_main_t; /* Global main structure. */ extern pg_main_t pg_main; /* Global node. */ extern vlib_node_registration_t pg_input_node; /* Buffer generator input, output node functions. */ vlib_node_function_t pg_input, pg_output; /* Stream add/delete. */ void pg_stream_del (pg_main_t * pg, uword index); void pg_stream_add (pg_main_t * pg, pg_stream_t * s_init); /* Enable/disable stream. */ void pg_stream_enable_disable (pg_main_t * pg, pg_stream_t * s, int is_enable); /* Find/create free packet-generator interface index. */ u32 pg_interface_add_or_get (pg_main_t * pg, uword stream_index); always_inline pg_node_t * pg_get_node (uword node_index) { pg_main_t *pg = &pg_main; vec_validate (pg->nodes, node_index); return pg->nodes + node_index; } void pg_edit_group_get_fixed_packet_data (pg_stream_t * s, u32 group_index, void *fixed_packet_data, void *fixed_packet_data_mask); void pg_enable_disable (u32 stream_index, int is_enable); typedef struct { u32 hw_if_index; u32 dev_instance; u8 is_enabled; u8 *pcap_file_name; u32 count; } pg_capture_args_t; clib_error_t *pg_capture (pg_capture_args_t * a); typedef struct { vlib_buffer_t buffer; u32 buffer_index; } pg_output_trace_t; #endif /* included_vlib_pg_h */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */