blob: 518276077f125068002dba213e668d75fe551a75 [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file ipaccess.h */
2
Sylvain Munaut12ba7782014-06-16 10:13:40 +02003#pragma once
Harald Welte4185fa52011-05-22 21:57:15 +02004
5#include <stdint.h>
6
7#define IPA_TCP_PORT_OML 3002
8#define IPA_TCP_PORT_RSL 3003
9
10struct ipaccess_head {
11 uint16_t len; /* network byte order */
12 uint8_t proto;
13 uint8_t data[0];
14} __attribute__ ((packed));
15
16struct ipaccess_head_ext {
17 uint8_t proto;
18 uint8_t data[0];
19} __attribute__ ((packed));
20
21enum ipaccess_proto {
22 IPAC_PROTO_RSL = 0x00,
23 IPAC_PROTO_IPACCESS = 0xfe,
24 IPAC_PROTO_SCCP = 0xfd,
25 IPAC_PROTO_OML = 0xff,
26
27
28 /* OpenBSC extensions */
29 IPAC_PROTO_OSMO = 0xee,
30 IPAC_PROTO_MGCP_OLD = 0xfc,
31};
32
33enum ipaccess_proto_ext {
34 IPAC_PROTO_EXT_CTRL = 0x00,
35 IPAC_PROTO_EXT_MGCP = 0x01,
36 IPAC_PROTO_EXT_LAC = 0x02,
Holger Hans Peter Freyther59b31752011-07-23 09:59:24 +020037 IPAC_PROTO_EXT_SMSC = 0x03,
Harald Welte900e1802014-08-18 11:34:17 +020038 IPAC_PROTO_EXT_ORC = 0x04, /* OML Router Control */
Holger Hans Peter Freyther44480482014-12-14 19:01:14 +010039 IPAC_PROTO_EXT_GSUP = 0x05, /* GSUP GPRS extension */
Neels Hofmeyr5eeb17a2015-09-23 23:18:15 +020040 IPAC_PROTO_EXT_OAP = 0x06, /* Osmocom Authn Protocol */
Harald Welteb99ed7f2018-08-13 20:54:44 +020041 IPAC_PROTO_EXT_RSPRO = 0x07, /* Remote SIM protocol */
Pau Espin Pedrol8082c142021-05-19 13:27:11 +020042 IPAC_PROTO_EXT_PCU = 0x08, /* BSC<->BTS<->PCU communication */
Harald Welte4185fa52011-05-22 21:57:15 +020043};
44
45enum ipaccess_msgtype {
Harald Welte158143f2020-09-18 16:10:02 +020046 IPAC_MSGT_PING = 0x00, /* Heartbeet */
47 IPAC_MSGT_PONG = 0x01, /* Heartbeat Ack */
48 IPAC_MSGT_ID_GET = 0x04, /* Identity Request */
49 IPAC_MSGT_ID_RESP = 0x05, /* Identity */
50 IPAC_MSGT_ID_ACK = 0x06, /* Identity Ack */
51 IPAC_MSGT_ID_NACK = 0x07, /* Identity Nack */
52 IPAC_MSGT_PROXY = 0x08, /* Proxy */
53 IPAC_MSGT_PROXY_ACK = 0x09, /* Proxy Ack */
54 IPAC_MSGT_PROXY_NACK = 0x0a, /* Proxy Nack */
55 IPAC_MSGT_SSL_INFO = 0x0b, /* SSL Info */
Harald Welte4185fa52011-05-22 21:57:15 +020056
57 /* OpenBSC extension */
58 IPAC_MSGT_SCCP_OLD = 0xff,
59};
60
61enum ipaccess_id_tags {
Harald Welte158143f2020-09-18 16:10:02 +020062 IPAC_IDTAG_SERNR = 0x00, /* Unit Serial Number */
63 IPAC_IDTAG_UNITNAME = 0x01, /* Unit Name */
64 IPAC_IDTAG_LOCATION1 = 0x02, /* Unit Location */
65 IPAC_IDTAG_LOCATION2 = 0x03, /* Unit Type */
66 IPAC_IDTAG_EQUIPVERS = 0x04, /* Hardware Version */
67 IPAC_IDTAG_SWVERSION = 0x05, /* Software Version */
68 IPAC_IDTAG_IPADDR = 0x06, /* IP Address */
69 IPAC_IDTAG_MACADDR = 0x07, /* Ethernet Address */
70 IPAC_IDTAG_UNIT = 0x08, /* Unit ID */
71 IPAC_IDTAG_USERNAME = 0x09, /* User Name */
72 IPAC_IDTAG_PASSWORD = 0x0a, /* Password */
73 IPAC_IDTAG_ACCESS_CLASS = 0x0b, /* Access Class */
74 IPAC_IDTG_APP_PROTO_VER = 0x0c, /* Application Protocol Version */
Harald Welte4185fa52011-05-22 21:57:15 +020075};
76
77/*
78 * Firmware specific header
79 */
80struct sdp_firmware {
81 char magic[4];
82 char more_magic[2];
83 uint16_t more_more_magic;
84 uint32_t header_length;
85 uint32_t file_length;
86 char sw_part[20];
87 char text1[64];
88 char time[12];
89 char date[14];
90 char text2[10];
91 char version[20];
92 uint16_t table_offset;
93 /* stuff i don't know */
94} __attribute__((packed));
95
96struct sdp_header_entry {
97 uint16_t something1;
98 char text1[64];
99 char time[12];
100 char date[14];
101 char text2[10];
102 char version[20];
103 uint32_t length;
104 uint32_t addr1;
105 uint32_t addr2;
106 uint32_t start;
107} __attribute__((packed));