summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-01-30 20:35:41 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-30 20:35:41 +0100
commit44c1119d0d7ab7393871209dbbc4ba5f9f7904b7 (patch)
tree452c10ec086193c8feeb1fbcc54bdaec3a3a0366
parent05943cb3cb8aee13433b0d465a00067f841c9821 (diff)
port to more recent libosmocore API
This code has been bitrotting and missing all of the libosmocore API changes of teh last 1.5 years or so...
-rw-r--r--src/app_support.c4
-rw-r--r--src/csl_cha_cco.c4
-rw-r--r--src/csl_cha_ism.c20
-rw-r--r--src/csl_dha.c6
-rw-r--r--src/dialogue.c8
-rw-r--r--src/scXp.c26
-rw-r--r--src/tcap.h12
-rw-r--r--src/tcap_test.c6
-rw-r--r--src/tcap_user.h6
-rw-r--r--src/tcu.c6
-rw-r--r--src/tsl_tco.c6
-rw-r--r--src/tsl_tsm.c2
12 files changed, 53 insertions, 53 deletions
diff --git a/src/app_support.c b/src/app_support.c
index a583f42..bb919a3 100644
--- a/src/app_support.c
+++ b/src/app_support.c
@@ -22,8 +22,8 @@
#include <stdint.h>
#include <errno.h>
-#include <libosmocore/linuxlist.h>
-#include <libosmocore/msgb.h>
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/msgb.h>
#include "tcap_user.h"
diff --git a/src/csl_cha_cco.c b/src/csl_cha_cco.c
index 092b350..d8e15cf 100644
--- a/src/csl_cha_cco.c
+++ b/src/csl_cha_cco.c
@@ -23,8 +23,8 @@
#include <stdint.h>
#include <errno.h>
-#include <osmocore/talloc.h>
-#include <osmocore/msgb.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/msgb.h>
#include "tcap.h"
diff --git a/src/csl_cha_ism.c b/src/csl_cha_ism.c
index 4ca23be..38296d7 100644
--- a/src/csl_cha_ism.c
+++ b/src/csl_cha_ism.c
@@ -23,8 +23,8 @@
#include <errno.h>
-#include <osmocore/talloc.h>
-#include <osmocore/msgb.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/msgb.h>
#include "tcap.h"
@@ -107,7 +107,7 @@ int tcap_ism_op_sent(struct tcap_invocation *ti)
/* Start invocation timer */
ti->inv_timer.cb = tcap_ism_inv_timer_exp;
ti->inv_timer.data = ti;
- bsc_schedule_timer(&ti->inv_timer, ti->inv_timeout, 0);
+ osmo_timer_schedule(&ti->inv_timer, ti->inv_timeout, 0);
switch (ti->op_class) {
case 1:
@@ -146,11 +146,11 @@ int tcap_ism_rr_l_recv(struct tcap_invocation *ti, struct ReturnResult *res,
/* TC-RESULT-L.ind (TCU <- CHA) */
rc = tcap_tcu_result_l_ind(ti, opCode, param, last_component);
/* Stop invocation timer */
- bsc_del_timer(&ti->inv_timer);
+ osmo_timer_del(&ti->inv_timer);
/* Start reject timer */
ti->rej_timer.cb = tcap_ism_rej_timer_exp;
ti->rej_timer.data = ti;
- bsc_schedule_timer(&ti->rej_timer, ti->rej_timeout, 0);
+ osmo_timer_schedule(&ti->rej_timer, ti->rej_timeout, 0);
tcap_ism_set_state(ti, TCAP_IS_WAIT_REJECT);
break;
case TCAP_IS_OP_SENT_CL2:
@@ -158,7 +158,7 @@ int tcap_ism_rr_l_recv(struct tcap_invocation *ti, struct ReturnResult *res,
/* Generate RJ component (CCO <- ISM) */
rc = tcap_cco_gen_rej(ti);
/* Stop invocation timer */
- bsc_del_timer(&ti->inv_timer);
+ osmo_timer_del(&ti->inv_timer);
tcap_ism_set_state(ti, TCAP_IS_INVALID);
tcap_ism_free(ti);
break;
@@ -174,11 +174,11 @@ int tcap_ism_re_recv(struct tcap_invocation *ti, struct ReturnError *re,
case TCAP_IS_OP_SENT_CL2:
/* TC-U-ERROR.ind (TCU <- CHA) */
/* Stop invocation timer */
- bsc_del_timer(&ti->inv_timer);
+ osmo_timer_del(&ti->inv_timer);
/* Start reject timer */
ti->rej_timer.cb = tcap_ism_rej_timer_exp;
ti->rej_timer.data = ti;
- bsc_schedule_timer(&ti->rej_timer, ti->rej_timeout, 0);
+ osmo_timer_schedule(&ti->rej_timer, ti->rej_timeout, 0);
tcap_ism_set_state(ti, TCAP_IS_WAIT_REJECT);
break;
case TCAP_IS_OP_SENT_CL3:
@@ -218,7 +218,7 @@ int tcap_ism_rr_nl_recv(struct tcap_invocation *ti, struct ReturnResult *res,
/* Generate RJ component (CCO <- ISM) */
rc = tcap_cco_gen_rej(ti);
/* Stop invocation timer */
- bsc_del_timer(&ti->inv_timer);
+ osmo_timer_del(&ti->inv_timer);
tcap_ism_set_state(ti, TCAP_IS_INVALID);
tcap_ism_free(ti);
break;
@@ -244,7 +244,7 @@ int tcap_ism_terminate(struct tcap_invocation *ti)
}
/* Stop invoation timer */
- bsc_del_timer(&ti->inv_timer);
+ osmo_timer_del(&ti->inv_timer);
tcap_ism_set_state(ti, TCAP_IS_INVALID);
tcap_ism_free(ti);
diff --git a/src/csl_dha.c b/src/csl_dha.c
index d9bc328..df07bdc 100644
--- a/src/csl_dha.c
+++ b/src/csl_dha.c
@@ -22,9 +22,9 @@
#include <errno.h>
#include <netinet/in.h>
-#include <osmocore/talloc.h>
-#include <osmocore/msgb.h>
-#include <osmocore/utils.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/utils.h>
#include <asn1c/OBJECT_IDENTIFIER.h>
diff --git a/src/dialogue.c b/src/dialogue.c
index 027049a..2858ca4 100644
--- a/src/dialogue.c
+++ b/src/dialogue.c
@@ -22,10 +22,10 @@
#include <stdint.h>
#include <errno.h>
-#include <osmocore/linuxlist.h>
-#include <osmocore/talloc.h>
-#include <osmocore/utils.h>
-#include <osmocore/logging.h>
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/core/logging.h>
#include "tcap.h"
diff --git a/src/scXp.c b/src/scXp.c
index 32e71d0..0cc1ac4 100644
--- a/src/scXp.c
+++ b/src/scXp.c
@@ -28,9 +28,9 @@
#include <sys/socket.h>
#include <netinet/in.h>
-#include <osmocore/logging.h>
-#include <osmocore/msgb.h>
-#include <osmocore/talloc.h>
+#include <osmocom/core/logging.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/talloc.h>
#include "tcap_user.h"
#include "tcap.h"
@@ -48,22 +48,22 @@ int tcap_tco_n_notice_ind(struct tcap_transport_entity *se);
static int tcap_tp_udp_unitdata_req(struct tcap_transport_entity *se, struct msgb *msg)
{
- return write_queue_enqueue(&se->udp.write_queue, msg);
+ return osmo_wqueue_enqueue(&se->udp.write_queue, msg);
}
/* called by the write queue / FD magic in case we need to write a message */
-static int udp_write_cb(struct bsc_fd *fd, struct msgb *msg)
+static int udp_write_cb(struct osmo_fd *fd, struct msgb *msg)
{
- struct write_queue *wq = container_of(fd, struct write_queue, bfd);
+ struct osmo_wqueue *wq = container_of(fd, struct osmo_wqueue, bfd);
struct tcap_transport_entity *tte = container_of(wq, struct tcap_transport_entity, udp.write_queue);
return sendto(fd->fd, msg->data, msg->len, 0, (struct sockaddr *) &tte->remote_addr, sizeof(tte->remote_addr));
}
/* called by write queue / FD magic in case the socket has some data */
-static int udp_read_cb(struct bsc_fd *fd)
+static int udp_read_cb(struct osmo_fd *fd)
{
- struct write_queue *wq = container_of(fd, struct write_queue, bfd);
+ struct osmo_wqueue *wq = container_of(fd, struct osmo_wqueue, bfd);
struct tcap_transport_entity *tte = container_of(wq, struct tcap_transport_entity, udp.write_queue);
struct msgb *msg = msgb_alloc_headroom(4096+128, 128, "incoming TCAP/UDP");
socklen_t addr_len = sizeof(tte->remote_addr);
@@ -89,7 +89,7 @@ static int udp_read_cb(struct bsc_fd *fd)
LIB_EXPORTED struct tcap_transport_entity *tcap_transp_udp_create(struct sockaddr_storage *local_addr)
{
struct tcap_transport_entity *tte = talloc_zero(NULL, struct tcap_transport_entity);
- struct write_queue *wq;
+ struct osmo_wqueue *wq;
int rc;
if (!tte)
@@ -100,7 +100,7 @@ LIB_EXPORTED struct tcap_transport_entity *tcap_transp_udp_create(struct sockadd
/* Initialize write queue */
wq = &tte->udp.write_queue;
- write_queue_init(wq, 100);
+ osmo_wqueue_init(wq, 100);
wq->read_cb = udp_read_cb;
wq->write_cb = udp_write_cb;
@@ -113,7 +113,7 @@ LIB_EXPORTED struct tcap_transport_entity *tcap_transp_udp_create(struct sockadd
goto err_close;
wq->bfd.when |= BSC_FD_READ;
- bsc_register_fd(&wq->bfd);
+ osmo_fd_register(&wq->bfd);
return tte;
@@ -129,7 +129,7 @@ int tcap_scXp_n_unitdata_req(struct tcap_transport_entity *se, struct msgb *msg)
{
int rc = 0;
- printf("N-UNITDATA.req(%s)\n", hexdump(msg->data, msg->len));
+ //printf("N-UNITDATA.req(%s)\n", osmo_hexdump(msg->data, msg->len));
#if 0
int i = open("ber.out", O_CREAT|O_WRONLY|O_TRUNC);
write(i, msg->data, msg->len);
@@ -137,7 +137,7 @@ int tcap_scXp_n_unitdata_req(struct tcap_transport_entity *se, struct msgb *msg)
#endif
switch (se->type) {
case SCXP_T_UDP:
- rc = write_queue_enqueue(&se->udp.write_queue, msg);
+ rc = osmo_wqueue_enqueue(&se->udp.write_queue, msg);
break;
}
diff --git a/src/tcap.h b/src/tcap.h
index 4dcfcc8..9624225 100644
--- a/src/tcap.h
+++ b/src/tcap.h
@@ -21,10 +21,10 @@
#include <stdint.h>
-#include <osmocore/linuxlist.h>
-#include <osmocore/timer.h>
-#include <osmocore/msgb.h>
-#include <osmocore/select.h>
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/select.h>
#include <osmocom/tcap/TCMessage.h>
#include <osmocom/tcap/OPERATION.h>
@@ -106,8 +106,8 @@ struct tcap_invocation {
/* Invocation timer */
uint32_t inv_timeout; /* Seconds */
uint32_t rej_timeout; /* Seconds */
- struct timer_list inv_timer; /* Invoke Timer */
- struct timer_list rej_timer; /* Reject Timer */
+ struct osmo_timer_list inv_timer; /* Invoke Timer */
+ struct osmo_timer_list rej_timer; /* Reject Timer */
/* user reference */
unsigned long user_ref;
diff --git a/src/tcap_test.c b/src/tcap_test.c
index ef0e0ec..dc79dfe 100644
--- a/src/tcap_test.c
+++ b/src/tcap_test.c
@@ -28,8 +28,8 @@
//#include <asn1/OBJECT_IDENTIFIER.h>
-#include <osmocore/utils.h>
-#include <osmocore/talloc.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/core/talloc.h>
#include "tcap_user.h"
@@ -226,6 +226,6 @@ int main(int argc, char **argv)
}
while (1) {
- bsc_select_main(0);
+ osmo_select_main(0);
}
}
diff --git a/src/tcap_user.h b/src/tcap_user.h
index 5396ab6..1636a33 100644
--- a/src/tcap_user.h
+++ b/src/tcap_user.h
@@ -23,8 +23,8 @@
#include <stdint.h>
#include <sys/socket.h>
-#include <osmocore/select.h>
-#include <osmocore/write_queue.h>
+#include <osmocom/core/select.h>
+#include <osmocom/core/write_queue.h>
#include <asn1c/OBJECT_IDENTIFIER.h>
#include <osmocom/tcap/Parameter.h>
@@ -48,7 +48,7 @@ struct tcap_transport_entity {
enum tcap_transport_entity_type type;
union {
struct {
- struct write_queue write_queue;
+ struct osmo_wqueue write_queue;
} udp;
struct {
} sccp_ipa;
diff --git a/src/tcu.c b/src/tcu.c
index 1103d5a..bbbd4c3 100644
--- a/src/tcu.c
+++ b/src/tcu.c
@@ -22,9 +22,9 @@
#include <stdint.h>
#include <errno.h>
-#include <osmocore/msgb.h>
-#include <osmocore/utils.h>
-#include <osmocore/talloc.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/core/talloc.h>
#include <osmocom/tcap/Parameter.h>
#include <osmocom/tcap/OPERATION.h>
diff --git a/src/tsl_tco.c b/src/tsl_tco.c
index 8b674a0..74dc9f0 100644
--- a/src/tsl_tco.c
+++ b/src/tsl_tco.c
@@ -23,8 +23,8 @@
#include <errno.h>
#include <netinet/in.h>
-#include <osmocore/msgb.h>
-#include <osmocore/logging.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/logging.h>
#include <osmocom/tcap/TCMessage.h>
#include "tcap.h"
@@ -48,7 +48,7 @@ int tcap_tco_n_unitdata_ind(struct tcap_transport_entity *se, struct msgb *msg)
struct tcap_transaction *tt;
uint32_t dest_tid;
- fprintf(stdout, "N-UNITDATA.ind(%s):\n", hexdump(msg->data, msg->len));
+ fprintf(stdout, "N-UNITDATA.ind(%s):\n", osmo_hexdump(msg->data, msg->len));
rv = ber_decode(NULL, &asn_DEF_TCMessage, (void **) &tcmsg, msg->data, msg->len);
if (rv.code != RC_OK) {
diff --git a/src/tsl_tsm.c b/src/tsl_tsm.c
index c66c1ce..a8a3012 100644
--- a/src/tsl_tsm.c
+++ b/src/tsl_tsm.c
@@ -23,7 +23,7 @@
#include <errno.h>
#include <netinet/in.h>
-#include <osmocore/msgb.h>
+#include <osmocom/core/msgb.h>
#include <osmocom/tcap/TCMessage.h>
#include "tcap.h"