diff --git a/openbsc/include/openbsc/mncc.h b/openbsc/include/openbsc/mncc.h index 9153d6574..4a99bb11b 100644 --- a/openbsc/include/openbsc/mncc.h +++ b/openbsc/include/openbsc/mncc.h @@ -160,10 +160,20 @@ struct gsm_data_frame { unsigned char data[0]; }; -#define MNCC_SOCK_VERSION 1 +#define MNCC_SOCK_VERSION 2 struct gsm_mncc_hello { uint32_t msg_type; uint32_t version; + + /* send the sizes of the structs */ + uint32_t mncc_size; + uint32_t data_frame_size; + + /* send some offsets */ + uint32_t called_offset; + uint32_t signal_offset; + uint32_t emergency_offset; + uint32_t lchan_type_offset; }; char *get_mncc_name(int value); 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 * (C) 2009 by Andreas Eversberg + * (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;