diff options
Diffstat (limited to 'examples/stream-client.c')
-rw-r--r-- | examples/stream-client.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/examples/stream-client.c b/examples/stream-client.c index 8836223..a1f57b0 100644 --- a/examples/stream-client.c +++ b/examples/stream-client.c @@ -14,7 +14,7 @@ #define DSTREAMTEST 0 -struct log_info_cat osmo_stream_client_test_cat[] = { +struct log_info_cat osmo_stream_cli_test_cat[] = { [DSTREAMTEST] = { .name = "DSTREAMTEST", .description = "STREAMCLIENT-mode test", @@ -23,13 +23,13 @@ struct log_info_cat osmo_stream_client_test_cat[] = { }, }; -const struct log_info osmo_stream_client_test_log_info = { +const struct log_info osmo_stream_cli_test_log_info = { .filter_fn = NULL, - .cat = osmo_stream_client_test_cat, - .num_cat = ARRAY_SIZE(osmo_stream_client_test_cat), + .cat = osmo_stream_cli_test_cat, + .num_cat = ARRAY_SIZE(osmo_stream_cli_test_cat), }; -static struct osmo_stream_client_conn *conn; +static struct osmo_stream_cli *conn; void sighandler(int foo) { @@ -37,13 +37,13 @@ void sighandler(int foo) exit(EXIT_SUCCESS); } -static int connect_cb(struct osmo_stream_client_conn *conn) +static int connect_cb(struct osmo_stream_cli *conn) { LOGP(DSTREAMTEST, LOGL_NOTICE, "connected\n"); return 0; } -static int read_cb(struct osmo_stream_client_conn *conn) +static int read_cb(struct osmo_stream_cli *conn) { struct msgb *msg; @@ -54,7 +54,7 @@ static int read_cb(struct osmo_stream_client_conn *conn) LOGP(DSTREAMTEST, LOGL_ERROR, "cannot allocate message\n"); return 0; } - if (osmo_stream_client_conn_recv(conn, msg) < 0) { + if (osmo_stream_cli_recv(conn, msg) < 0) { LOGP(DSTREAMTEST, LOGL_ERROR, "cannot receive message\n"); return 0; } @@ -83,7 +83,7 @@ static int kbd_cb(struct osmo_fd *fd, unsigned int what) ptr = msgb_put(msg, strlen(buf)); memcpy(ptr, buf, ret); - osmo_stream_client_conn_send(conn, msg); + osmo_stream_cli_send(conn, msg); LOGP(DSTREAMTEST, LOGL_NOTICE, "message of %d bytes sent\n", msg->len); @@ -94,27 +94,27 @@ int main(void) { struct osmo_fd *kbd_ofd; - tall_test = talloc_named_const(NULL, 1, "osmo_stream_client_test"); + tall_test = talloc_named_const(NULL, 1, "osmo_stream_cli_test"); - osmo_init_logging(&osmo_stream_client_test_log_info); + osmo_init_logging(&osmo_stream_cli_test_log_info); log_set_log_level(osmo_stderr_target, 1); /* - * initialize stream client. + * initialize stream cli. */ - conn = osmo_stream_client_conn_create(tall_test); + conn = osmo_stream_cli_create(tall_test); if (conn == NULL) { - fprintf(stderr, "cannot create client\n"); + fprintf(stderr, "cannot create cli\n"); exit(EXIT_FAILURE); } - osmo_stream_client_conn_set_addr(conn, "127.0.0.1"); - osmo_stream_client_conn_set_port(conn, 10000); - osmo_stream_client_conn_set_connect_cb(conn, connect_cb); - osmo_stream_client_conn_set_read_cb(conn, read_cb); + osmo_stream_cli_set_addr(conn, "127.0.0.1"); + osmo_stream_cli_set_port(conn, 10000); + osmo_stream_cli_set_connect_cb(conn, connect_cb); + osmo_stream_cli_set_read_cb(conn, read_cb); - if (osmo_stream_client_conn_open(conn) < 0) { - fprintf(stderr, "cannot open client\n"); + if (osmo_stream_cli_open(conn) < 0) { + fprintf(stderr, "cannot open cli\n"); exit(EXIT_FAILURE); } |