utm->state = STATE_READY;
}
-#define foreach_uri_msg \
+#define foreach_tcp_echo_msg \
_(BIND_URI_REPLY, bind_uri_reply) \
_(CONNECT_URI, connect_uri) \
_(CONNECT_SESSION_REPLY, connect_session_reply) \
_(APPLICATION_DETACH_REPLY, application_detach_reply) \
void
-uri_api_hookup (uri_udp_test_main_t * utm)
+tcp_echo_api_hookup (uri_udp_test_main_t * utm)
{
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
vl_api_##n##_t_endian, \
vl_api_##n##_t_print, \
sizeof(vl_api_##n##_t), 1);
- foreach_uri_msg;
+ foreach_tcp_echo_msg;
#undef _
}
main (int argc, char **argv)
{
uri_udp_test_main_t *utm = &uri_udp_test_main;
+ u8 *bind_name = (u8 *) "udp://0.0.0.0/1234";
unformat_input_t _argv, *a = &_argv;
+ int i_am_master = 1;
+ session_t *session;
u8 *chroot_prefix;
+ char *app_name;
+ mheap_t *h;
u8 *heap;
- u8 *bind_name = (u8 *) "udp://0.0.0.0/1234";
u32 tmp;
- mheap_t *h;
- session_t *session;
int i;
- int i_am_master = 1;
clib_mem_init (0, 256 << 20);
vec_validate (utm->rx_buf, 8192);
utm->session_index_by_vpp_handles = hash_create (0, sizeof (uword));
-
utm->my_pid = getpid ();
utm->configured_segment_size = 1 << 20;
utm->uri = format (0, "%s%c", bind_name, 0);
utm->i_am_master = i_am_master;
utm->segment_main = &svm_fifo_segment_main;
-
utm->connect_uri = format (0, "udp://6.0.1.2/1234%c", 0);
setup_signal_handlers ();
+ tcp_echo_api_hookup (utm);
- uri_api_hookup (utm);
-
- if (connect_to_vpp (i_am_master ? "uri_udp_master" : "uri_udp_slave") < 0)
+ app_name = i_am_master ? "udp_echo_master" : "udp_echo_slave";
+ if (connect_to_vpp (app_name) < 0)
{
svm_region_exit ();
fformat (stderr, "Couldn't connect to vpe, exiting...\n");