aboutsummaryrefslogtreecommitdiffstats
path: root/examples/lapd-over-datagram-network.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-08-15 20:10:32 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2012-08-15 20:16:09 +0200
commitad2e9d637e27a6c51fa6f4ae8ec81075a6448c27 (patch)
tree3279404a3cbc23e345bc8a8b8c71f6017d14682b /examples/lapd-over-datagram-network.c
parent4fd56b6d2f40c57ecc68addee2e690c359c212c7 (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/lapd-over-datagram-network.c')
-rw-r--r--examples/lapd-over-datagram-network.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/lapd-over-datagram-network.c b/examples/lapd-over-datagram-network.c
index fb94515..74bba74 100644
--- a/examples/lapd-over-datagram-network.c
+++ b/examples/lapd-over-datagram-network.c
@@ -33,7 +33,7 @@ const struct log_info lapd_test_log_info = {
.num_cat = ARRAY_SIZE(lapd_test_cat),
};
-static struct osmo_dgram_conn *conn;
+static struct osmo_dgram *conn;
static struct lapd_instance *lapd;
static int sapi = 63, tei = 0;
@@ -44,7 +44,7 @@ void sighandler(int foo)
exit(EXIT_SUCCESS);
}
-int read_cb(struct osmo_dgram_conn *conn)
+int read_cb(struct osmo_dgram *conn)
{
int error;
struct msgb *msg;
@@ -56,7 +56,7 @@ int read_cb(struct osmo_dgram_conn *conn)
LOGP(DLAPDTEST, LOGL_ERROR, "cannot allocate message\n");
return -1;
}
- if (osmo_dgram_conn_recv(conn, msg) < 0) {
+ if (osmo_dgram_recv(conn, msg) < 0) {
LOGP(DLAPDTEST, LOGL_ERROR, "cannot receive message\n");
return -1;
}
@@ -70,10 +70,10 @@ int read_cb(struct osmo_dgram_conn *conn)
void lapd_tx_cb(struct msgb *msg, void *cbdata)
{
- struct osmo_dgram_conn *conn = cbdata;
+ struct osmo_dgram *conn = cbdata;
LOGP(DLAPDTEST, LOGL_DEBUG, "sending message over datagram\n");
- osmo_dgram_conn_send(conn, msg);
+ osmo_dgram_send(conn, msg);
}
void lapd_rx_cb(struct osmo_dlsap_prim *dp, uint8_t tei, uint8_t sapi,
@@ -140,16 +140,16 @@ 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) {
fprintf(stderr, "cannot create client\n");
exit(EXIT_FAILURE);
}
- osmo_dgram_conn_set_local_addr(conn, "127.0.0.1");
- osmo_dgram_conn_set_local_port(conn, 10001);
- osmo_dgram_conn_set_remote_addr(conn, "127.0.0.1");
- osmo_dgram_conn_set_remote_port(conn, 10000);
- 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, 10001);
+ osmo_dgram_set_remote_addr(conn, "127.0.0.1");
+ osmo_dgram_set_remote_port(conn, 10000);
+ osmo_dgram_set_read_cb(conn, read_cb);
lapd = lapd_instance_alloc(1, lapd_tx_cb, conn, lapd_rx_cb, conn,
&lapd_profile_sat);
@@ -164,7 +164,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- if (osmo_dgram_conn_open(conn) < 0) {
+ if (osmo_dgram_open(conn) < 0) {
fprintf(stderr, "cannot open client\n");
exit(EXIT_FAILURE);
}