blob: b8225383aa72e6a72fdd987d1f058e1924d5249b [file] [log] [blame]
Harald Welte9af6ddf2011-01-01 15:25:50 +01001/* GSM Network Management (OML) messages on the A-bis interface
2 * Extensions for the ip.access A-bis over IP protocol*/
3
4/* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org>
5 *
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23/* A list of all the 'embedded' attributes of ip.access */
24enum ipa_embedded_att {
25 IPA_ATT_ARFCN_WHITELIST = 0x01,
26 IPA_ATT_ARFCN_BLACKLIST = 0x02,
27 IPA_ATT_FREQ_ERR_LIST = 0x03,
28 IPA_ATT_CHAN_USAGE_LIST = 0x04,
29 IPA_ATT_BCCH_INF_TYPE = 0x05,
30 IPA_ATT_BCCH_INF = 0x06,
31 IPA_ATT_CONFIG = 0x07,
32 IPA_ATT_RESULT_DETAILS = 0x08,
33 IPA_ATT_RXLEV_THRESH = 0x09,
34 IPA_ATT_FREQ_SYNC_OPT = 0x0a,
35 IPA_ATT_MAC_ADDR = 0x0b,
36 IPA_ATT_HW_SW_COMPAT_NR = 0x0c,
37 IPA_ATT_MANUF_SER_NR = 0x0d,
38 IPA_ATT_OEM_ID = 0x0e,
39 IPA_ATT_DATETIME_MANUF = 0x0f,
40 IPA_ATT_DATETIME_CALIB = 0x10,
41 IPA_ATT_BEACON_INF = 0x11,
42 IPA_ATT_FREQ_ERR = 0x12,
43 IPA_ATT_SNMP_COMM_STRING = 0x13,
44 IPA_ATT_SNMP_TRAP_ADDR = 0x14,
45 IPA_ATT_SNMP_TRAP_PORT = 0x15,
46 IPA_ATT_SNMP_MAN_ADDR = 0x16,
47 IPA_ATT_SNMP_SYS_CONTACT = 0x17,
48 IPA_ATT_FACTORY_ID = 0x18,
49 IPA_ATT_FACTORY_SERIAL = 0x19,
50 IPA_ATT_LOGGED_EVT_IND = 0x1a,
51 IPA_ATT_LOCAL_ADD_TEXT = 0x1b,
52 IPA_ATT_FREQ_BANDS = 0x1c,
53 IPA_ATT_MAX_TA = 0x1d,
54 IPA_ATT_CIPH_ALG = 0x1e,
55 IPA_ATT_CHAN_TYPES = 0x1f,
56 IPA_ATT_CHAN_MODES = 0x20,
57 IPA_ATT_GPRS_CODING_SCHEMES = 0x21,
58 IPA_ATT_RTP_FEATURES = 0x22,
59 IPA_ATT_RSL_FEATURES = 0x23,
60 IPA_ATT_BTS_HW_CLASS = 0x24,
61 IPA_ATT_BTS_ID = 0x25,
62 IPA_ATT_BCAST_L2_MSG = 0x26,
63};
64
65/* append an ip.access channel list to the given msgb */
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020066static int ipa_chan_list_append(struct msgb *msg, uint8_t ie,
67 uint16_t *arfcns, int arfcn_count)
Harald Welte9af6ddf2011-01-01 15:25:50 +010068{
69 int i;
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020070 uint8_t *u8;
71 uint16_t *u16;
Harald Welte9af6ddf2011-01-01 15:25:50 +010072
73 /* tag */
74 u8 = msgb_push(msg, 1);
75 *u8 = ie;
76
77 /* length in octets */
78 u16 = msgb_push(msg, 2);
79 *u16 = htons(arfcn_count * 2);
80
81 for (i = 0; i < arfcn_count; i++) {
82 u16 = msgb_push(msg, 2);
83 *u16 = htons(arfcns[i]);
84 }
85
86 return 0;
87}