diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-15 20:10:32 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-15 20:16:09 +0200 |
commit | ad2e9d637e27a6c51fa6f4ae8ec81075a6448c27 (patch) | |
tree | 3279404a3cbc23e345bc8a8b8c71f6017d14682b /examples/rtp-udp-test-server.c | |
parent | 4fd56b6d2f40c57ecc68addee2e690c359c212c7 (diff) |
src: shorter names for datagram sockets
%s/_conn_/_/g
%s/_conn//g
%s/_server_/_tx_/g
%s/_client_/_rx_/g
%s/_SERVER_/_TX_/g
%s/_CLIENT_/_RX_/g
%s/_RECONFIG/_RECONF/g
Diffstat (limited to 'examples/rtp-udp-test-server.c')
-rw-r--r-- | examples/rtp-udp-test-server.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/rtp-udp-test-server.c b/examples/rtp-udp-test-server.c index 2f7f291..7d56d44 100644 --- a/examples/rtp-udp-test-server.c +++ b/examples/rtp-udp-test-server.c @@ -31,10 +31,10 @@ const struct log_info rtp_test_log_info = { .num_cat = ARRAY_SIZE(rtp_test_cat), }; -static struct osmo_dgram_conn *conn; +static struct osmo_dgram *conn; static struct osmo_rtp_handle *rtp; -int read_cb(struct osmo_dgram_conn *conn) +int read_cb(struct osmo_dgram *conn) { struct msgb *msg; char dummy_data[RTP_PT_GSM_FULL_PAYLOAD_LEN] = "payload test"; @@ -47,7 +47,7 @@ int read_cb(struct osmo_dgram_conn *conn) LOGP(DRTP_TEST, LOGL_ERROR, "cannot allocate message\n"); return -1; } - if (osmo_dgram_conn_recv(conn, msg) < 0) { + if (osmo_dgram_recv(conn, msg) < 0) { LOGP(DRTP_TEST, LOGL_ERROR, "cannot receive message\n"); return -1; } @@ -80,7 +80,7 @@ int read_cb(struct osmo_dgram_conn *conn) LOGP(DLINP, LOGL_ERROR, "OOM\n"); return -1; } - osmo_dgram_conn_send(conn, msg); + osmo_dgram_send(conn, msg); return 0; } @@ -88,8 +88,8 @@ int read_cb(struct osmo_dgram_conn *conn) void sighandler(int foo) { LOGP(DLINP, LOGL_NOTICE, "closing RTP.\n"); - osmo_dgram_conn_close(conn); - osmo_dgram_conn_destroy(conn); + osmo_dgram_close(conn); + osmo_dgram_destroy(conn); osmo_rtp_handle_free(rtp); exit(EXIT_SUCCESS); } @@ -121,18 +121,18 @@ int main(int argc, char *argv[]) * initialize datagram server. */ - conn = osmo_dgram_conn_create(tall_test); + conn = osmo_dgram_create(tall_test); if (conn == NULL) { LOGP(DRTP_TEST, LOGL_ERROR, "cannot create UDP socket\n"); exit(EXIT_FAILURE); } - osmo_dgram_conn_set_local_addr(conn, "127.0.0.1"); - osmo_dgram_conn_set_local_port(conn, 20000); - osmo_dgram_conn_set_remote_addr(conn, "127.0.0.1"); - osmo_dgram_conn_set_remote_port(conn, 20001); - osmo_dgram_conn_set_read_cb(conn, read_cb); + osmo_dgram_set_local_addr(conn, "127.0.0.1"); + osmo_dgram_set_local_port(conn, 20000); + osmo_dgram_set_remote_addr(conn, "127.0.0.1"); + osmo_dgram_set_remote_port(conn, 20001); + osmo_dgram_set_read_cb(conn, read_cb); - if (osmo_dgram_conn_open(conn) < 0) { + if (osmo_dgram_open(conn) < 0) { fprintf(stderr, "cannot open client\n"); exit(EXIT_FAILURE); } |