blob: 7af882a1235708d81a5f1792b53a17d722b2d41c [file] [log] [blame]
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +02001#ifndef _OSMO_PROTO_IPACCESS_H
2#define _OSMO_PROTO_IPACCESS_H
3
4#include <stdint.h>
5
6#define IPA_TCP_PORT_OML 3002
7#define IPA_TCP_PORT_RSL 3003
8
9struct ipaccess_head {
10 uint16_t len; /* network byte order */
11 uint8_t proto;
12 uint8_t data[0];
13} __attribute__ ((packed));
14
15struct ipaccess_head_ext {
16 uint8_t proto;
17 uint8_t data[0];
18} __attribute__ ((packed));
19
20enum ipaccess_proto {
21 IPAC_PROTO_RSL = 0x00,
22 IPAC_PROTO_IPACCESS = 0xfe,
23 IPAC_PROTO_SCCP = 0xfd,
24 IPAC_PROTO_OML = 0xff,
25
26
27 /* OpenBSC extensions */
28 IPAC_PROTO_OSMO = 0xee,
29 IPAC_PROTO_MGCP_OLD = 0xfc,
30};
31
32enum ipaccess_proto_ext {
33 IPAC_PROTO_EXT_CTRL = 0x00,
34 IPAC_PROTO_EXT_MGCP = 0x01,
35 IPAC_PROTO_EXT_LAC = 0x02,
36};
37
38enum ipaccess_msgtype {
39 IPAC_MSGT_PING = 0x00,
40 IPAC_MSGT_PONG = 0x01,
41 IPAC_MSGT_ID_GET = 0x04,
42 IPAC_MSGT_ID_RESP = 0x05,
43 IPAC_MSGT_ID_ACK = 0x06,
44
45 /* OpenBSC extension */
46 IPAC_MSGT_SCCP_OLD = 0xff,
47};
48
49enum ipaccess_id_tags {
50 IPAC_IDTAG_SERNR = 0x00,
51 IPAC_IDTAG_UNITNAME = 0x01,
52 IPAC_IDTAG_LOCATION1 = 0x02,
53 IPAC_IDTAG_LOCATION2 = 0x03,
54 IPAC_IDTAG_EQUIPVERS = 0x04,
55 IPAC_IDTAG_SWVERSION = 0x05,
56 IPAC_IDTAG_IPADDR = 0x06,
57 IPAC_IDTAG_MACADDR = 0x07,
58 IPAC_IDTAG_UNIT = 0x08,
59};
60
61/*
62 * Firmware specific header
63 */
64struct sdp_firmware {
65 char magic[4];
66 char more_magic[2];
67 uint16_t more_more_magic;
68 uint32_t header_length;
69 uint32_t file_length;
70 char sw_part[20];
71 char text1[64];
72 char time[12];
73 char date[14];
74 char text2[10];
75 char version[20];
76 uint16_t table_offset;
77 /* stuff i don't know */
78} __attribute__((packed));
79
80struct sdp_header_entry {
81 uint16_t something1;
82 char text1[64];
83 char time[12];
84 char date[14];
85 char text2[10];
86 char version[20];
87 uint32_t length;
88 uint32_t addr1;
89 uint32_t addr2;
90 uint32_t start;
91} __attribute__((packed));
92
Pablo Neira Ayusoc9c4fd32011-06-30 12:19:42 +020093struct ipaccess_unit {
94 uint16_t site_id;
95 uint16_t bts_id;
96 uint16_t trx_id;
Pablo Neira Ayusodfafe682011-07-02 14:32:32 +020097 char *unit_name;
98 char *equipvers;
99 char *swversion;
100 uint8_t mac_addr[6];
101 char *location1;
102 char *location2;
103 char *serno;
Pablo Neira Ayusoc9c4fd32011-06-30 12:19:42 +0200104};
105
106struct hsl_unit {
Pablo Neira Ayuso88136fc2011-07-08 16:21:55 +0200107 uint8_t swversion;
108 uint64_t serno;
Pablo Neira Ayusoc9c4fd32011-06-30 12:19:42 +0200109};
110
Pablo Neira Ayuso495ddb62011-07-08 21:04:11 +0200111/* quick solution to get openBSC's ipaccess tools working. */
Pablo Neira Ayusof054b512011-07-08 21:46:29 +0200112extern int ipaccess_fd_cb(struct osmo_fd *bfd, unsigned int what);
Pablo Neira Ayuso495ddb62011-07-08 21:04:11 +0200113
Pablo Neira Ayuso0ba77d52011-06-05 18:32:44 +0200114#endif /* _OSMO_PROTO_IPACCESS_H */