libosmogsm
0.9.3
Osmocom GSM library
|
00001 #pragma once 00002 00003 #include <stdint.h> 00004 00005 #define IPA_TCP_PORT_OML 3002 00006 #define IPA_TCP_PORT_RSL 3003 00007 00008 struct ipaccess_head { 00009 uint16_t len; /* network byte order */ 00010 uint8_t proto; 00011 uint8_t data[0]; 00012 } __attribute__ ((packed)); 00013 00014 struct ipaccess_head_ext { 00015 uint8_t proto; 00016 uint8_t data[0]; 00017 } __attribute__ ((packed)); 00018 00019 enum ipaccess_proto { 00020 IPAC_PROTO_RSL = 0x00, 00021 IPAC_PROTO_IPACCESS = 0xfe, 00022 IPAC_PROTO_SCCP = 0xfd, 00023 IPAC_PROTO_OML = 0xff, 00024 00025 00026 /* OpenBSC extensions */ 00027 IPAC_PROTO_OSMO = 0xee, 00028 IPAC_PROTO_MGCP_OLD = 0xfc, 00029 }; 00030 00031 enum ipaccess_proto_ext { 00032 IPAC_PROTO_EXT_CTRL = 0x00, 00033 IPAC_PROTO_EXT_MGCP = 0x01, 00034 IPAC_PROTO_EXT_LAC = 0x02, 00035 IPAC_PROTO_EXT_SMSC = 0x03, 00036 IPAC_PROTO_EXT_ORC = 0x04, /* OML Router Control */ 00037 IPAC_PROTO_EXT_GSUP = 0x05, /* GSUP GPRS extension */ 00038 IPAC_PROTO_EXT_OAP = 0x06, /* Osmocom Authn Protocol */ 00039 }; 00040 00041 enum ipaccess_msgtype { 00042 IPAC_MSGT_PING = 0x00, 00043 IPAC_MSGT_PONG = 0x01, 00044 IPAC_MSGT_ID_GET = 0x04, 00045 IPAC_MSGT_ID_RESP = 0x05, 00046 IPAC_MSGT_ID_ACK = 0x06, 00047 00048 /* OpenBSC extension */ 00049 IPAC_MSGT_SCCP_OLD = 0xff, 00050 }; 00051 00052 enum ipaccess_id_tags { 00053 IPAC_IDTAG_SERNR = 0x00, 00054 IPAC_IDTAG_UNITNAME = 0x01, 00055 IPAC_IDTAG_LOCATION1 = 0x02, 00056 IPAC_IDTAG_LOCATION2 = 0x03, 00057 IPAC_IDTAG_EQUIPVERS = 0x04, 00058 IPAC_IDTAG_SWVERSION = 0x05, 00059 IPAC_IDTAG_IPADDR = 0x06, 00060 IPAC_IDTAG_MACADDR = 0x07, 00061 IPAC_IDTAG_UNIT = 0x08, 00062 }; 00063 00064 /* 00065 * Firmware specific header 00066 */ 00067 struct sdp_firmware { 00068 char magic[4]; 00069 char more_magic[2]; 00070 uint16_t more_more_magic; 00071 uint32_t header_length; 00072 uint32_t file_length; 00073 char sw_part[20]; 00074 char text1[64]; 00075 char time[12]; 00076 char date[14]; 00077 char text2[10]; 00078 char version[20]; 00079 uint16_t table_offset; 00080 /* stuff i don't know */ 00081 } __attribute__((packed)); 00082 00083 struct sdp_header_entry { 00084 uint16_t something1; 00085 char text1[64]; 00086 char time[12]; 00087 char date[14]; 00088 char text2[10]; 00089 char version[20]; 00090 uint32_t length; 00091 uint32_t addr1; 00092 uint32_t addr2; 00093 uint32_t start; 00094 } __attribute__((packed));