blob: f98ebd692abbe0fa8646205944dfacf955c6b8b4 [file] [log] [blame]
Sylvain Munaut12ba7782014-06-16 10:13:40 +02001#pragma once
Harald Welte4185fa52011-05-22 21:57:15 +02002
3#include <stdint.h>
4
5#define IPA_TCP_PORT_OML 3002
6#define IPA_TCP_PORT_RSL 3003
7
8struct ipaccess_head {
9 uint16_t len; /* network byte order */
10 uint8_t proto;
11 uint8_t data[0];
12} __attribute__ ((packed));
13
14struct ipaccess_head_ext {
15 uint8_t proto;
16 uint8_t data[0];
17} __attribute__ ((packed));
18
19enum ipaccess_proto {
20 IPAC_PROTO_RSL = 0x00,
21 IPAC_PROTO_IPACCESS = 0xfe,
22 IPAC_PROTO_SCCP = 0xfd,
23 IPAC_PROTO_OML = 0xff,
24
25
26 /* OpenBSC extensions */
27 IPAC_PROTO_OSMO = 0xee,
28 IPAC_PROTO_MGCP_OLD = 0xfc,
29};
30
31enum ipaccess_proto_ext {
32 IPAC_PROTO_EXT_CTRL = 0x00,
33 IPAC_PROTO_EXT_MGCP = 0x01,
34 IPAC_PROTO_EXT_LAC = 0x02,
Holger Hans Peter Freyther59b31752011-07-23 09:59:24 +020035 IPAC_PROTO_EXT_SMSC = 0x03,
Harald Welte900e1802014-08-18 11:34:17 +020036 IPAC_PROTO_EXT_ORC = 0x04, /* OML Router Control */
Holger Hans Peter Freyther44480482014-12-14 19:01:14 +010037 IPAC_PROTO_EXT_GSUP = 0x05, /* GSUP GPRS extension */
Harald Welte4185fa52011-05-22 21:57:15 +020038};
39
40enum ipaccess_msgtype {
41 IPAC_MSGT_PING = 0x00,
42 IPAC_MSGT_PONG = 0x01,
43 IPAC_MSGT_ID_GET = 0x04,
44 IPAC_MSGT_ID_RESP = 0x05,
45 IPAC_MSGT_ID_ACK = 0x06,
46
47 /* OpenBSC extension */
48 IPAC_MSGT_SCCP_OLD = 0xff,
49};
50
51enum ipaccess_id_tags {
52 IPAC_IDTAG_SERNR = 0x00,
53 IPAC_IDTAG_UNITNAME = 0x01,
54 IPAC_IDTAG_LOCATION1 = 0x02,
55 IPAC_IDTAG_LOCATION2 = 0x03,
56 IPAC_IDTAG_EQUIPVERS = 0x04,
57 IPAC_IDTAG_SWVERSION = 0x05,
58 IPAC_IDTAG_IPADDR = 0x06,
59 IPAC_IDTAG_MACADDR = 0x07,
60 IPAC_IDTAG_UNIT = 0x08,
61};
62
63/*
64 * Firmware specific header
65 */
66struct sdp_firmware {
67 char magic[4];
68 char more_magic[2];
69 uint16_t more_more_magic;
70 uint32_t header_length;
71 uint32_t file_length;
72 char sw_part[20];
73 char text1[64];
74 char time[12];
75 char date[14];
76 char text2[10];
77 char version[20];
78 uint16_t table_offset;
79 /* stuff i don't know */
80} __attribute__((packed));
81
82struct sdp_header_entry {
83 uint16_t something1;
84 char text1[64];
85 char time[12];
86 char date[14];
87 char text2[10];
88 char version[20];
89 uint32_t length;
90 uint32_t addr1;
91 uint32_t addr2;
92 uint32_t start;
93} __attribute__((packed));