summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg2010-04-25 18:10:59 +0200
committerAndreas Eversberg2010-04-25 18:10:59 +0200
commit0d93f1c917ed25d920e3eb419c2490a3b8439d9c (patch)
tree269691c46558cf3c05646d627fbd810e69a2f0e5 /src
parentAdded new IE definitions to gsm_04_08.h of libosmocore. (diff)
downloadosmocom-0d93f1c917ed25d920e3eb419c2490a3b8439d9c.tar.gz
osmocom-0d93f1c917ed25d920e3eb419c2490a3b8439d9c.tar.xz
osmocom-0d93f1c917ed25d920e3eb419c2490a3b8439d9c.zip
Changes to layer23:
Added name to osmocom_ms structure. l2_ctx is now named l23_ctx, because it is also used there. A work-handler is usefull for applications that need to check queues.
Diffstat (limited to 'src')
-rw-r--r--src/host/layer23/include/osmocom/osmocom_data.h1
-rw-r--r--src/host/layer23/src/main.c13
2 files changed, 10 insertions, 4 deletions
diff --git a/src/host/layer23/include/osmocom/osmocom_data.h b/src/host/layer23/include/osmocom/osmocom_data.h
index 9b9455d..18c3c3c 100644
--- a/src/host/layer23/include/osmocom/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/osmocom_data.h
@@ -18,6 +18,7 @@ struct osmol2_entity {
/* One Mobilestation for osmocom */
struct osmocom_ms {
+ char name[32];
struct write_queue wq;
enum gsm_band band;
uint16_t test_arfcn;
diff --git a/src/host/layer23/src/main.c b/src/host/layer23/src/main.c
index 66a9f49..8e726e9 100644
--- a/src/host/layer23/src/main.c
+++ b/src/host/layer23/src/main.c
@@ -49,10 +49,11 @@ static struct log_target *stderr_target;
#define GSM_L2_LENGTH 256
-static void *l2_ctx = NULL;
+void *l23_ctx = NULL;
static char *socket_path = "/tmp/osmocom_l2";
static struct osmocom_ms *ms = NULL;
static uint32_t gsmtap_ip = 0;
+int (*l23_app_work) (struct osmocom_ms *ms) = NULL;
static int layer2_read(struct bsc_fd *fd)
{
@@ -170,7 +171,7 @@ static void handle_options(int argc, char **argv)
exit(0);
break;
case 's':
- socket_path = talloc_strdup(l2_ctx, optarg);
+ socket_path = talloc_strdup(l23_ctx, optarg);
break;
case 'a':
ms->test_arfcn = atoi(optarg);
@@ -201,14 +202,16 @@ int main(int argc, char **argv)
log_add_target(stderr_target);
log_set_all_filter(stderr_target, 1);
- l2_ctx = talloc_named_const(NULL, 1, "layer2 context");
+ l23_ctx = talloc_named_const(NULL, 1, "layer2 context");
- ms = talloc_zero(l2_ctx, struct osmocom_ms);
+ ms = talloc_zero(l23_ctx, struct osmocom_ms);
if (!ms) {
fprintf(stderr, "Failed to allocate MS\n");
exit(1);
}
+ sprintf(ms->name, "1");
+
ms->test_arfcn = 871;
handle_options(argc, argv);
@@ -255,6 +258,8 @@ int main(int argc, char **argv)
}
while (1) {
+ if (l23_app_work)
+ l23_app_work(ms);
bsc_select_main(0);
}