mncc: Use stdint.h from C++, copy newer version of OpenBSC's mncc.h
[lcr.git] / mncc.h
diff --git a/mncc.h b/mncc.h
index dcb8f04..6e9a9dd 100644 (file)
--- a/mncc.h
+++ b/mncc.h
@@ -1,4 +1,6 @@
 
+#include <stdint.h>
+
 #define MNCC_SETUP_REQ         0x0101
 #define MNCC_SETUP_IND         0x0102
 #define MNCC_SETUP_RSP         0x0103
 #define MNCC_RTP_CONNECT       0x0205
 #define MNCC_RTP_FREE          0x0206
 
-#define GSM_TCHF_FRAME          0x0300
-#define GSM_TCHF_FRAME_EFR      0x0301
-#define GSM_TCHF_FRAME_HR       0x0302
-#define GSM_TCHF_FRAME_AMR      0x0303
-#define GSM_TCHF_BAD_FRAME     0x03ff
+#define GSM_TCHF_FRAME         0x0300
+#define GSM_TCHF_FRAME_EFR     0x0301
+#define GSM_TCHH_FRAME         0x0302
+#define GSM_TCH_FRAME_AMR      0x0303
+#define GSM_BAD_FRAME          0x03ff
+
+#define MNCC_SOCKET_HELLO      0x0400
 
 #define GSM_MAX_FACILITY       128
 #define GSM_MAX_SSVERSION      128
@@ -150,11 +154,11 @@ enum {
 
 struct gsm_mncc {
        /* context based information */
-       u_int32_t       msg_type;
-       u_int32_t       callref;
+       uint32_t        msg_type;
+       uint32_t        callref;
 
        /* which fields are present */
-       u_int32_t       fields;
+       uint32_t        fields;
 
        /* data derived informations (MNCC_F_ based) */
        struct gsm_mncc_bearer_cap      bearer_cap;
@@ -186,18 +190,33 @@ struct gsm_mncc {
 };
 
 struct gsm_data_frame {
-       u_int32_t       msg_type;
-       u_int32_t       callref;
+       uint32_t        msg_type;
+       uint32_t        callref;
        unsigned char   data[0];
 };
 
 struct gsm_mncc_rtp {
-       uint32_t        msg_type;
-       uint32_t        callref;
-       uint32_t        ip;
-       uint16_t        port;
-       uint32_t        payload_type;
-       uint32_t        payload_msg_type;
+       u_int32_t       msg_type;
+       u_int32_t       callref;
+       u_int32_t       ip;
+       u_int16_t       port;
+       u_int32_t       payload_type;
+       u_int32_t       payload_msg_type;
 };
 
 
+#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;
+};