aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-01-15 00:38:35 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-01-15 00:40:42 +0100
commit9e7837a14dd245dcd772f08b3afa7a54f09a37df (patch)
tree57be5e9c9c2af40e2a3698063924b98705a35be7 /openbsc/src/libmsc
parentc0a6674614fb362c80d2a83bd3e543ccd4bf0c49 (diff)
mncc: Include size and offsets of struct gsm_mncc in the hello
Increase the version number and send the sizeof of the gsm_mncc and the gsm_data_frame structure. Include the offsets of some members as well to maybe identify ABI problems. The reason we go through this is that we want to benefit from the native ABI and don't want to force packed structs.
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r--openbsc/src/libmsc/mncc_sock.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/mncc_sock.c b/openbsc/src/libmsc/mncc_sock.c
index 697f9560f..cf4bca87a 100644
--- a/openbsc/src/libmsc/mncc_sock.c
+++ b/openbsc/src/libmsc/mncc_sock.c
@@ -2,6 +2,7 @@
/* (C) 2008-2010 by Harald Welte <laforge@gnumonks.org>
* (C) 2009 by Andreas Eversberg <Andreas.Eversberg@versatel.de>
+ * (C) 2012 by Holger Hans Peter Freyther
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
@@ -221,6 +222,12 @@ static void queue_hello(struct mncc_sock_state *mncc)
hello = (struct gsm_mncc_hello *) msgb_put(msg, sizeof(*hello));
hello->msg_type = MNCC_SOCKET_HELLO;
hello->version = MNCC_SOCK_VERSION;
+ hello->mncc_size = sizeof(struct gsm_mncc);
+ hello->data_frame_size = sizeof(struct gsm_data_frame);
+ hello->called_offset = offsetof(struct gsm_mncc, called);
+ hello->signal_offset = offsetof(struct gsm_mncc, signal);
+ hello->emergency_offset = offsetof(struct gsm_mncc, emergency);
+ hello->lchan_type_offset = offsetof(struct gsm_mncc, lchan_type);
msgb_enqueue(&mncc->net->upqueue, msg);
mncc->conn_bfd.when |= BSC_FD_WRITE;