Merge remote branch 'origin/master'

This commit is contained in:
Harald Welte 2009-10-26 20:12:07 +01:00
commit 85c00cc3d9
26 changed files with 473 additions and 409 deletions

View File

@ -482,6 +482,7 @@ enum abis_nm_avail_state {
NM_AVSTATE_DEPENDENCY = 5,
NM_AVSTATE_DEGRADED = 6,
NM_AVSTATE_NOT_INSTALLED= 7,
NM_AVSTATE_OK = 0xff,
};
/* Section 9.4.13: Channel Combination */
@ -748,6 +749,9 @@ int abis_nm_ipaccess_msg(struct gsm_bts *bts, u_int8_t msg_type,
int abis_nm_ipaccess_set_nvattr(struct gsm_bts *bts, u_int8_t *attr,
int attr_len);
int abis_nm_ipaccess_restart(struct gsm_bts *bts);
int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, u_int8_t obj_class,
u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr,
u_int8_t *attr, u_int8_t attr_len);
int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx,
u_int32_t ip, u_int16_t port, u_int8_t stream);

View File

@ -539,6 +539,7 @@ int rsl_ipacc_bind(struct gsm_lchan *lchan);
int rsl_ipacc_connect(struct gsm_lchan *lchan, u_int32_t ip,
u_int16_t port, u_int16_t conn_id,
u_int8_t rtp_payload2);
int rsl_ipacc_pdch_activate(struct gsm_lchan *lchan);
int abis_rsl_rcvmsg(struct msgb *msg);

View File

@ -31,7 +31,7 @@
#define static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
char *hexdump(const unsigned char *buf, int len);
void debugp(unsigned int subsys, char *file, int line, int cont, const char *format, ...);
void debugp(unsigned int subsys, char *file, int line, int cont, const char *format, ...) __attribute__ ((format (printf, 5, 6)));
void debug_parse_category_mask(const char* mask);
void debug_use_color(int use_color);
void debug_timestamp(int enable);

View File

@ -726,7 +726,7 @@ int gsm48_mi_to_string(char *string, const int str_len, const u_int8_t *mi, cons
int gsm48_send_rr_release(struct gsm_lchan *lchan);
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv);
int gsm48_send_rr_app_info(struct gsm_lchan *lchan, u_int8_t apdu_id,
u_int8_t apdu_len, u_int8_t *apdu);
u_int8_t apdu_len, const u_int8_t *apdu);
int bsc_upqueue(struct gsm_network *net);

View File

@ -210,4 +210,7 @@ int gsm411_send_sms_lchan(struct gsm_lchan *lchan, struct gsm_sms *sms);
struct gsm_sms *sms_alloc(void);
void sms_free(struct gsm_sms *sms);
void _gsm411_sms_trans_free(struct gsm_trans *trans);
int gsm411_send_sms_subscr(struct gsm_subscriber *subscr,
struct gsm_sms *sms);
#endif

View File

@ -18,6 +18,8 @@ enum gsm_phys_chan_config {
GSM_PCHAN_TCH_F,
GSM_PCHAN_TCH_H,
GSM_PCHAN_SDCCH8_SACCH8C,
GSM_PCHAN_PDCH, /* GPRS PDCH */
GSM_PCHAN_TCH_F_PDCH, /* TCH/F if used, PDCH otherwise */
GSM_PCHAN_UNKNOWN,
};
@ -289,6 +291,12 @@ struct gsm_envabtse {
struct gsm_nm_state nm_state;
};
struct gsm_bts_gprs_nsvc {
struct gsm_bts *bts;
int id;
struct gsm_nm_state nm_state;
};
/* One BTS */
struct gsm_bts {
/* list header in net->bts_list */
@ -356,6 +364,17 @@ struct gsm_bts {
struct gsm_envabtse envabtse[4];
} bs11;
};
/* Not entirely sure how ip.access specific this is */
struct {
struct {
struct gsm_nm_state nm_state;
} nse;
struct {
struct gsm_nm_state nm_state;
} cell;
struct gsm_bts_gprs_nsvc nsvc[2];
} gprs;
/* transceivers */
int num_trx;

View File

@ -1,6 +1,8 @@
#ifndef _IPACCESS_H
#define _IPACCESS_H
#include "e1_input.h"
struct ipaccess_head {
u_int8_t zero;
u_int8_t len;

View File

@ -51,6 +51,7 @@ extern struct msgb *msgb_alloc(u_int16_t size, const char *name);
extern void msgb_free(struct msgb *m);
extern void msgb_enqueue(struct llist_head *queue, struct msgb *msg);
extern struct msgb *msgb_dequeue(struct llist_head *queue);
extern void msgb_reset(struct msgb *m);
#define msgb_l2(m) ((void *)(m->l2h))
#define msgb_l3(m) ((void *)(m->l3h))

View File

@ -67,5 +67,6 @@ int bsc_timer_pending(struct timer_list *timer);
struct timeval *bsc_nearest_timer();
void bsc_prepare_timers();
int bsc_update_timers();
int bsc_timer_check(void);
#endif

View File

@ -6,11 +6,33 @@
#include <openbsc/msgb.h>
/* Terminology / wording
tag length value (in bits)
V - - 8
LV - 8 N * 8
TLV 8 8 N * 8
TL16V 8 16 N * 8
TLV16 8 8 N * 16
TvLV 8 8/16 N * 8
*/
#define LV_GROSS_LEN(x) (x+1)
#define TLV_GROSS_LEN(x) (x+2)
#define TLV16_GROSS_LEN(x) ((2*x)+2)
#define TL16V_GROSS_LEN(x) (x+3)
#define TVLV_MAX_ONEBYTE 0x7f
static inline u_int16_t TVLV_GROSS_LEN(u_int16_t len)
{
if (len <= TVLV_MAX_ONEBYTE)
return TLV_GROSS_LEN(len);
else
return TL16V_GROSS_LEN(len);
}
/* TLV generation */
static inline u_int8_t *lv_put(u_int8_t *buf, u_int8_t len,
@ -49,6 +71,20 @@ static inline u_int8_t *tl16v_put(u_int8_t *buf, u_int8_t tag, u_int16_t len,
return buf + len*2;
}
static inline u_int8_t *tvlv_put(u_int8_t *buf, u_int8_t tag, u_int16_t len,
const u_int8_t *val)
{
u_int8_t *ret;
if (len <= TVLV_MAX_ONEBYTE) {
ret = tlv_put(buf, tag, len, val);
buf[1] |= 0x80;
} else
ret = tl16v_put(buf, tag, len, val);
return ret;
}
static inline u_int8_t *msgb_tlv16_put(struct msgb *msg, u_int8_t tag, u_int8_t len, const u_int16_t *val)
{
u_int8_t *buf = msgb_put(msg, TLV16_GROSS_LEN(len));
@ -62,6 +98,13 @@ static inline u_int8_t *msgb_tl16v_put(struct msgb *msg, u_int8_t tag, u_int16_t
return tl16v_put(buf, tag, len, val);
}
static inline u_int8_t *msgb_tvlv_put(struct msgb *msg, u_int8_t tag, u_int16_t len,
const u_int8_t *val)
{
u_int8_t *buf = msgb_put(msg, TVLV_GROSS_LEN(len));
return tvlv_put(buf, tag, len, val);
}
static inline u_int8_t *v_put(u_int8_t *buf, u_int8_t val)
{
*buf++ = val;
@ -146,6 +189,7 @@ enum tlv_type {
TLV_TYPE_TV,
TLV_TYPE_TLV,
TLV_TYPE_TL16V,
TLV_TYPE_TvLV,
};
struct tlv_def {
@ -161,6 +205,8 @@ struct tlv_parsed {
struct tlv_p_entry lv[0xff];
};
extern struct tlv_definition tvlv_att_def;
int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def,
const u_int8_t *buf, int buf_len, u_int8_t lv_tag, u_int8_t lv_tag2);

View File

@ -410,6 +410,8 @@ static const enum abis_nm_chan_comb chcomb4pchan[] = {
[GSM_PCHAN_TCH_F] = NM_CHANC_TCHFull,
[GSM_PCHAN_TCH_H] = NM_CHANC_TCHHalf,
[GSM_PCHAN_SDCCH8_SACCH8C] = NM_CHANC_SDCCH,
[GSM_PCHAN_PDCH] = NM_CHANC_IPAC_PDCH,
[GSM_PCHAN_TCH_F_PDCH] = NM_CHANC_IPAC_TCHFull_PDCH,
/* FIXME: bounds check */
};
@ -585,6 +587,14 @@ const char *nm_adm_name(u_int8_t adm)
}
}
static void debugp_foh(struct abis_om_fom_hdr *foh)
{
DEBUGP(DNM, "OC=%s(%02x) INST=(%02x,%02x,%02x) ",
obj_class_name(foh->obj_class), foh->obj_class,
foh->obj_inst.bts_nr, foh->obj_inst.trx_nr,
foh->obj_inst.ts_nr);
}
/* obtain the gsm_nm_state data structure for a given object instance */
static struct gsm_nm_state *
objclass2nmstate(struct gsm_bts *bts, u_int8_t obj_class,
@ -648,6 +658,17 @@ objclass2nmstate(struct gsm_bts *bts, u_int8_t obj_class,
return NULL;
nm_state = &bts->bs11.envabtse[obj_inst->trx_nr].nm_state;
break;
case NM_OC_GPRS_NSE:
nm_state = &bts->gprs.nse.nm_state;
break;
case NM_OC_GPRS_CELL:
nm_state = &bts->gprs.cell.nm_state;
break;
case NM_OC_GPRS_NSVC:
if (obj_inst->trx_nr > ARRAY_SIZE(bts->gprs.nsvc))
return NULL;
nm_state = &bts->gprs.nsvc[obj_inst->trx_nr].nm_state;
break;
}
return nm_state;
}
@ -687,6 +708,17 @@ objclass2obj(struct gsm_bts *bts, u_int8_t obj_class,
case NM_OC_SITE_MANAGER:
obj = &bts->site_mgr;
break;
case NM_OC_GPRS_NSE:
obj = &bts->gprs.nse;
break;
case NM_OC_GPRS_CELL:
obj = &bts->gprs.cell;
break;
case NM_OC_GPRS_NSVC:
if (obj_inst->trx_nr > ARRAY_SIZE(bts->gprs.nsvc))
return NULL;
obj = &bts->gprs.nsvc[obj_inst->trx_nr];
break;
}
return obj;
}
@ -751,7 +783,7 @@ static int abis_nm_rx_statechg_rep(struct msgb *mb)
}
if (TLVP_PRESENT(&tp, NM_ATT_ADM_STATE)) {
new_state.administrative = *TLVP_VAL(&tp, NM_ATT_ADM_STATE);
DEBUGPC(DNM, "ADM=%02s ", nm_adm_name(new_state.administrative));
DEBUGPC(DNM, "ADM=%2s ", nm_adm_name(new_state.administrative));
}
DEBUGPC(DNM, "\n");
@ -799,10 +831,7 @@ static int abis_nm_rcvmsg_report(struct msgb *mb)
struct abis_om_fom_hdr *foh = msgb_l3(mb);
u_int8_t mt = foh->msg_type;
DEBUGP(DNM, "OC=%s(%02x) INST=(%02x,%02x,%02x) ",
obj_class_name(foh->obj_class), foh->obj_class,
foh->obj_inst.bts_nr, foh->obj_inst.trx_nr,
foh->obj_inst.ts_nr);
debugp_foh(foh);
//nmh->cfg->report_cb(mb, foh);
@ -860,7 +889,9 @@ static int abis_nm_rx_sw_act_req(struct msgb *mb)
int nack = 0;
int ret;
DEBUGP(DNM, "Software Activate Request ");
debugp_foh(foh);
DEBUGPC(DNM, "SW Activate Request: ");
if (foh->obj_class >= 0xf0 && foh->obj_class <= 0xf3) {
DEBUGPC(DNM, "NACKing for GPRS obj_class 0x%02x\n", foh->obj_class);
@ -965,10 +996,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
if (is_in_arr(mt, nacks, ARRAY_SIZE(nacks))) {
struct tlv_parsed tp;
DEBUGP(DNM, "OC=%s(%02x) INST=(%02x,%02x,%02x) ",
obj_class_name(foh->obj_class), foh->obj_class,
foh->obj_inst.bts_nr, foh->obj_inst.trx_nr,
foh->obj_inst.ts_nr);
debugp_foh(foh);
if (nack_names[mt])
DEBUGPC(DNM, "%s NACK ", nack_names[mt]);
@ -1851,11 +1879,12 @@ int abis_nm_opstart(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, u_int8
struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc();
DEBUGP(DNM, "Sending OPSTART obj_class=0x%02x obj_inst=(0x%02x, 0x%02x, 0x%02x)\n",
obj_class, i0, i1, i2);
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, 0, NM_MT_OPSTART, obj_class, i0, i1, i2);
debugp_foh((struct abis_om_fom_hdr *) oh->data);
DEBUGPC(DNM, "Sending OPSTART\n");
return abis_nm_sendmsg(bts, msg);
}
@ -2474,10 +2503,7 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
foh = (struct abis_om_fom_hdr *) (oh->data + 1 + idstrlen);
abis_nm_tlv_parse(&tp, foh->data, oh->length-sizeof(*foh));
DEBUGP(DNM, "OC=%s(%02x) INST=(%02x,%02x,%02x) ",
obj_class_name(foh->obj_class), foh->obj_class,
foh->obj_inst.bts_nr, foh->obj_inst.trx_nr,
foh->obj_inst.ts_nr);
debugp_foh(foh);
DEBUGPC(DNM, "IPACCESS(0x%02x): ", foh->msg_type);
@ -2638,3 +2664,12 @@ int abis_nm_ipaccess_restart(struct gsm_bts *bts)
{
return __simple_cmd(bts, NM_MT_IPACC_RESTART);
}
int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, u_int8_t obj_class,
u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr,
u_int8_t *attr, u_int8_t attr_len)
{
return abis_nm_ipaccess_msg(bts, NM_MT_IPACC_SET_ATTR,
obj_class, bts_nr, trx_nr, ts_nr,
attr, attr_len);
}

View File

@ -202,7 +202,9 @@ struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, u_int8_t chan_nr)
if (cbits == 0x01) {
lch_idx = 0; /* TCH/F */
if (ts->pchan != GSM_PCHAN_TCH_F)
if (ts->pchan != GSM_PCHAN_TCH_F &&
ts->pchan != GSM_PCHAN_PDCH &&
ts->pchan != GSM_PCHAN_TCH_F_PDCH)
fprintf(stderr, "chan_nr=0x%02x but pchan=%u\n",
chan_nr, ts->pchan);
} else if ((cbits & 0x1e) == 0x02) {
@ -244,6 +246,8 @@ u_int8_t lchan2chan_nr(struct gsm_lchan *lchan)
switch (ts->pchan) {
case GSM_PCHAN_TCH_F:
case GSM_PCHAN_PDCH:
case GSM_PCHAN_TCH_F_PDCH:
cbits = 0x01;
break;
case GSM_PCHAN_TCH_H:
@ -971,7 +975,7 @@ static int rsl_rx_meas_res(struct msgb *msg)
}
if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) {
DEBUGPC(DMEAS, "L3\n");
msg->l3h = TLVP_VAL(&tp, RSL_IE_L3_INFO);
msg->l3h = (u_int8_t *) TLVP_VAL(&tp, RSL_IE_L3_INFO);
return gsm0408_rcvmsg(msg, 0);
} else
DEBUGPC(DMEAS, "\n");
@ -1016,6 +1020,18 @@ static int abis_rsl_rx_dchan(struct msgb *msg)
case RSL_MT_MODE_MODIFY_NACK:
DEBUGPC(DRSL, "CHANNEL MODE MODIFY NACK\n");
break;
case RSL_MT_IPAC_PDCH_ACT_ACK:
DEBUGPC(DRSL, "IPAC PDCH ACT ACK\n");
break;
case RSL_MT_IPAC_PDCH_ACT_NACK:
DEBUGPC(DRSL, "IPAC PDCH ACT NACK\n");
break;
case RSL_MT_IPAC_PDCH_DEACT_ACK:
DEBUGPC(DRSL, "IPAC PDCH DEACT ACK\n");
break;
case RSL_MT_IPAC_PDCH_DEACT_NACK:
DEBUGPC(DRSL, "IPAC PDCH DEACT NACK\n");
break;
case RSL_MT_PHY_CONTEXT_CONF:
case RSL_MT_PREPROC_MEAS_RES:
case RSL_MT_TALKER_DET:
@ -1414,6 +1430,24 @@ int rsl_ipacc_connect(struct gsm_lchan *lchan, u_int32_t ip, u_int16_t port,
return abis_rsl_sendmsg(msg);
}
int rsl_ipacc_pdch_activate(struct gsm_lchan *lchan)
{
struct msgb *msg = rsl_msgb_alloc();
struct abis_rsl_dchan_hdr *dh;
dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
init_dchan_hdr(dh, RSL_MT_IPAC_PDCH_ACT);
dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN;
dh->chan_nr = lchan2chan_nr(lchan);
DEBUGP(DRSL, "channel=%s chan_nr=0x%02x IPAC_PDCH_ACT\n",
gsm_ts_name(lchan->ts), dh->chan_nr);
msg->trx = lchan->ts->trx;
return abis_rsl_sendmsg(msg);
}
static int abis_rsl_rx_ipacc_bindack(struct msgb *msg)
{
struct abis_rsl_dchan_hdr *dh = msgb_l2(msg);

View File

@ -346,51 +346,84 @@ int nm_state_event(enum nm_evt evt, u_int8_t obj_class, void *obj,
struct gsm_bts_trx *trx;
struct gsm_bts_trx_ts *ts;
/* This is currently only required on nanoBTS */
/* This event-driven BTS setup is currently only required on nanoBTS */
switch (evt) {
case EVT_STATECHG_OPER:
switch (obj_class) {
case NM_OC_SITE_MANAGER:
bts = container_of(obj, struct gsm_bts, site_mgr);
if (old_state->operational != 2 && new_state->operational == 2) {
abis_nm_opstart(bts, NM_OC_SITE_MANAGER, 0xff, 0xff, 0xff);
}
break;
case NM_OC_BTS:
bts = obj;
if (new_state->availability == NM_AVSTATE_DEPENDENCY) {
patch_nm_tables(bts);
abis_nm_set_bts_attr(bts, nanobts_attr_bts,
sizeof(nanobts_attr_bts));
abis_nm_opstart(bts, NM_OC_BTS,
bts->bts_nr, 0xff, 0xff);
abis_nm_chg_adm_state(bts, NM_OC_BTS,
bts->bts_nr, 0xff, 0xff,
NM_STATE_UNLOCKED);
}
break;
case NM_OC_CHANNEL:
ts = obj;
trx = ts->trx;
if (new_state->availability == NM_AVSTATE_DEPENDENCY) {
if (ts->nr == 0 && trx == trx->bts->c0)
abis_nm_set_channel_attr(ts, NM_CHANC_BCCHComb);
else
abis_nm_set_channel_attr(ts, NM_CHANC_TCHFull);
abis_nm_opstart(trx->bts, NM_OC_CHANNEL,
trx->bts->bts_nr, trx->nr, ts->nr);
abis_nm_chg_adm_state(trx->bts, NM_OC_CHANNEL,
trx->bts->bts_nr, trx->nr, ts->nr,
NM_STATE_UNLOCKED);
}
break;
default:
break;
/* EVT_STATECHG_ADM is called after we call chg_adm_state() and would create
* endless loop */
if (evt != EVT_STATECHG_OPER)
return 0;
switch (obj_class) {
case NM_OC_SITE_MANAGER:
bts = container_of(obj, struct gsm_bts, site_mgr);
if (new_state->operational == 2 &&
new_state->availability == NM_AVSTATE_OK)
abis_nm_opstart(bts, obj_class, 0xff, 0xff, 0xff);
break;
case NM_OC_BTS:
bts = obj;
if (new_state->availability == NM_AVSTATE_DEPENDENCY) {
patch_nm_tables(bts);
abis_nm_set_bts_attr(bts, nanobts_attr_bts,
sizeof(nanobts_attr_bts));
abis_nm_chg_adm_state(bts, obj_class,
bts->bts_nr, 0xff, 0xff,
NM_STATE_UNLOCKED);
abis_nm_opstart(bts, obj_class,
bts->bts_nr, 0xff, 0xff);
}
break;
case NM_OC_CHANNEL:
ts = obj;
trx = ts->trx;
if (new_state->operational == 1 &&
new_state->availability == NM_AVSTATE_DEPENDENCY) {
patch_nm_tables(bts);
enum abis_nm_chan_comb ccomb =
abis_nm_chcomb4pchan(ts->pchan);
abis_nm_set_channel_attr(ts, ccomb);
abis_nm_chg_adm_state(trx->bts, obj_class,
trx->bts->bts_nr, trx->nr, ts->nr,
NM_STATE_UNLOCKED);
abis_nm_opstart(trx->bts, obj_class,
trx->bts->bts_nr, trx->nr, ts->nr);
}
break;
case NM_OC_RADIO_CARRIER:
trx = obj;
if (new_state->operational == 1 &&
new_state->availability == NM_AVSTATE_OFF_LINE) {
/* Patch ARFCN into radio attribute */
nanobts_attr_radio[5] &= 0xf0;
nanobts_attr_radio[5] |= trx->arfcn >> 8;
nanobts_attr_radio[6] = trx->arfcn & 0xff;
abis_nm_set_radio_attr(trx, nanobts_attr_radio,
sizeof(nanobts_attr_radio));
abis_nm_chg_adm_state(trx->bts, obj_class,
trx->bts->bts_nr, trx->nr, 0xff,
NM_STATE_UNLOCKED);
abis_nm_opstart(trx->bts, obj_class, trx->bts->bts_nr,
trx->nr, 0xff);
}
if (new_state->operational == 1 &&
new_state->availability == NM_AVSTATE_OK)
abis_nm_opstart(trx->bts, obj_class, trx->bts->bts_nr,
trx->nr, 0xff);
break;
case NM_OC_BASEB_TRANSC:
trx = container_of(obj, struct gsm_bts_trx, bb_transc);
if (new_state->operational == 1 &&
new_state->availability == NM_AVSTATE_DEPENDENCY) {
abis_nm_chg_adm_state(trx->bts, obj_class,
trx->bts->bts_nr, trx->nr, 0xff,
NM_STATE_UNLOCKED);
abis_nm_opstart(trx->bts, obj_class,
trx->bts->bts_nr, trx->nr, 0xff);
/* TRX software is active, tell it to initiate RSL Link */
abis_nm_ipaccess_rsl_connect(trx, 0, 3003, trx->rsl_tei);
}
break;
default:
//DEBUGP(DMM, "Unhandled state change in %s:%d\n", __func__, __LINE__);
break;
}
return 0;
@ -403,29 +436,8 @@ static int sw_activ_rep(struct msgb *mb)
struct gsm_bts *bts = mb->trx->bts;
struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
if (!trx)
return -ENODEV;
switch (foh->obj_class) {
case NM_OC_BASEB_TRANSC:
/* TRX software is active, tell it to initiate RSL Link */
abis_nm_ipaccess_rsl_connect(trx, 0, 3003, trx->rsl_tei);
abis_nm_opstart(trx->bts, NM_OC_BASEB_TRANSC,
trx->bts->bts_nr, trx->nr, 0xff);
abis_nm_chg_adm_state(trx->bts, NM_OC_BASEB_TRANSC,
trx->bts->bts_nr, trx->nr, 0xff,
NM_STATE_UNLOCKED);
break;
case NM_OC_RADIO_CARRIER:
patch_nm_tables(trx->bts);
abis_nm_set_radio_attr(trx, nanobts_attr_radio,
sizeof(nanobts_attr_radio));
abis_nm_opstart(trx->bts, NM_OC_RADIO_CARRIER,
trx->bts->bts_nr, trx->nr, 0xff);
abis_nm_chg_adm_state(trx->bts, NM_OC_RADIO_CARRIER,
trx->bts->bts_nr, trx->nr, 0xff,
NM_STATE_UNLOCKED);
break;
}
return 0;
}
@ -533,7 +545,7 @@ static void nm_reconfig_trx(struct gsm_bts_trx *trx)
case GSM_BAND_1900:
trx->nominal_power = 23;
break;
dedfault:
default:
fprintf(stderr, "Unsupported nanoBTS GSM band %s\n",
gsm_band_name(trx->bts->band));
break;
@ -881,9 +893,6 @@ static void patch_nm_tables(struct gsm_bts *bts)
bs11_attr_radio[2] &= 0xf0;
bs11_attr_radio[2] |= arfcn_high;
bs11_attr_radio[3] = arfcn_low;
nanobts_attr_radio[5] &= 0xf0;
nanobts_attr_radio[5] |= arfcn_high;
nanobts_attr_radio[6] = arfcn_low;
/* patch BSIC */
bs11_attr_bts[1] = bts->bsic;

View File

@ -439,9 +439,11 @@ int db_sync_equipment(struct gsm_equipment *equip)
{
dbi_result result;
unsigned char *cm2, *cm3;
u_int8_t classmark1;
memcpy(&classmark1, &equip->classmark1, sizeof(classmark1));
printf("DB: Sync Equipment IMEI=%s, classmark1=%02x",
equip->imei, equip->classmark1);
equip->imei, classmark1);
if (equip->classmark2_len)
printf(", classmark2=%s",
hexdump(equip->classmark2, equip->classmark2_len));
@ -462,7 +464,7 @@ int db_sync_equipment(struct gsm_equipment *equip)
"classmark2 = %s, "
"classmark3 = %s "
"WHERE imei = '%s' ",
equip->classmark1, cm2, cm3, equip->imei);
classmark1, cm2, cm3, equip->imei);
free(cm2);
free(cm3);
@ -853,7 +855,7 @@ int db_apdu_blob_store(struct gsm_subscriber *subscr,
u_int8_t *apdu)
{
dbi_result result;
char *q_apdu;
unsigned char *q_apdu;
dbi_conn_quote_binary_copy(conn, apdu, len, &q_apdu);

View File

@ -1128,9 +1128,7 @@ int gsm48_tx_mm_info(struct gsm_lchan *lchan)
struct gsm48_hdr *gh;
struct gsm_network *net = lchan->ts->trx->bts->network;
u_int8_t *ptr8;
u_int16_t *ptr16;
int name_len, name_pad;
int i;
#if 0
time_t cur_t;
struct tm* cur_time;
@ -1458,7 +1456,7 @@ static int gsm0408_rcv_mm(struct msgb *msg)
}
/* Receive a PAGING RESPONSE message from the MS */
static int gsm48_rr_rx_pag_resp(struct msgb *msg)
static int gsm48_rx_rr_pag_resp(struct msgb *msg)
{
struct gsm_bts *bts = msg->lchan->ts->trx->bts;
struct gsm48_hdr *gh = msgb_l3(msg);
@ -1613,7 +1611,7 @@ static int gsm0408_rcv_rr(struct msgb *msg)
DEBUGP(DRR, "GRPS SUSPEND REQUEST\n");
break;
case GSM48_MT_RR_PAG_RESP:
rc = gsm48_rr_rx_pag_resp(msg);
rc = gsm48_rx_rr_pag_resp(msg);
break;
case GSM48_MT_RR_CHAN_MODE_MODIF_ACK:
DEBUGP(DRR, "CHANNEL MODE MODIFY ACK\n");
@ -1645,7 +1643,7 @@ static int gsm0408_rcv_rr(struct msgb *msg)
}
int gsm48_send_rr_app_info(struct gsm_lchan *lchan, u_int8_t apdu_id,
u_int8_t apdu_len, u_int8_t *apdu)
u_int8_t apdu_len, const u_int8_t *apdu)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh;

View File

@ -674,7 +674,7 @@ static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
* successfully receive the SMS. We need to investigate
* the cause and take action depending on it */
DEBUGP(DSMS, "RX SMS RP-ERROR, cause %d (%s)\n", cause,
DEBUGP(DSMS, "RX SMS RP-ERROR, cause %d:%d (%s)\n", cause_len, cause,
get_value_string(rp_cause_strs, cause));
if (!trans->sms.is_mt) {
@ -1068,8 +1068,6 @@ static int subscr_sig_cb(unsigned int subsys, unsigned int signal,
struct gsm_lchan *lchan;
struct gsm_sms *sms;
u_int32_t token;
switch (signal) {
case S_SUBSCR_ATTACHED:
/* A subscriber has attached. Check if there are

View File

@ -45,6 +45,8 @@ static const char *pchan_names[] = {
[GSM_PCHAN_TCH_F] = "TCH/F",
[GSM_PCHAN_TCH_H] = "TCH/H",
[GSM_PCHAN_SDCCH8_SACCH8C] = "SDCCH8",
[GSM_PCHAN_PDCH] = "PDCH",
[GSM_PCHAN_TCH_F_PDCH] = "TCH/F_PDCH",
[GSM_PCHAN_UNKNOWN] = "UNKNOWN",
};
@ -139,6 +141,7 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
u_int8_t tsc, u_int8_t bsic)
{
struct gsm_bts *bts = talloc(net, struct gsm_bts);
int i;
if (!bts)
return NULL;
@ -153,6 +156,11 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
INIT_LLIST_HEAD(&bts->trx_list);
bts->ms_max_power = 15; /* dBm */
for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) {
bts->gprs.nsvc[i].bts = bts;
bts->gprs.nsvc[i].id = i;
}
/* create our primary TRX */
bts->c0 = gsm_bts_trx_alloc(bts);
if (!bts->c0) {

View File

@ -236,7 +236,6 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg,
trx->rsl_link = e1inp_sign_link_create(e1i_ts,
E1INP_SIGN_RSL, trx,
trx->rsl_tei, 0);
e1inp_event(e1i_ts, EVT_E1_TEI_UP, trx->rsl_tei, 0);
/* get rid of our old temporary bfd */
memcpy(newbfd, bfd, sizeof(*newbfd));
bsc_unregister_fd(bfd);
@ -250,6 +249,7 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg,
/* FIXME: this is per BTS */
static int oml_up = 0;
static int rsl_up = 0;
/*
* read one ipa message from the socket
@ -347,6 +347,10 @@ static int handle_ts1_read(struct bsc_fd *bfd)
switch (link->type) {
case E1INP_SIGN_RSL:
if (!rsl_up) {
e1inp_event(e1i_ts, EVT_E1_TEI_UP, link->tei, link->sapi);
rsl_up = 1;
}
ret = abis_rsl_rcvmsg(msg);
break;
case E1INP_SIGN_OML:

View File

@ -74,6 +74,26 @@ struct msgb *msgb_dequeue(struct llist_head *queue)
return llist_entry(lh, struct msgb, list);
}
void msgb_reset(struct msgb *msg)
{
msg->len = 0;
msg->len = 0;
msg->data = msg->_data;
msg->head = msg->data;
msg->data = msg->data;
/* reset tail pointer */
msg->tail = msg->data;
/* reset pointers */
msg->bts_link = NULL;
msg->trx = NULL;
msg->lchan = NULL;
msg->l2h = NULL;
msg->l3h = NULL;
msg->smsh = NULL;
}
static __attribute__((constructor)) void on_dso_load_trau_msgb(void)
{
tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 1, "msgb");

View File

@ -26,6 +26,7 @@
#include <openbsc/gsm_04_08.h>
#include <openbsc/signal.h>
#include <openbsc/gsm_subscriber.h>
#include <openbsc/chan_alloc.h>
/* RRLP MS based position request */
static const u_int8_t ms_based_pos_req[] = { 0x40, 0x01, 0x78, 0xa8 };

View File

@ -176,7 +176,7 @@ restart:
int bsc_timer_check(void)
{
struct timer_list *timer;
int i;
int i = 0;
llist_for_each_entry(timer, &timer_list, entry) {
i++;

View File

@ -1,5 +1,8 @@
#include <stdio.h>
#include <openbsc/tlv.h>
#include <openbsc/gsm_data.h>
struct tlv_definition tvlv_att_def;
int tlv_dump(struct tlv_parsed *dec)
{
@ -87,6 +90,20 @@ int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def,
return -2;
num_parsed++;
break;
case TLV_TYPE_TvLV:
if (*(pos+1) & 0x80) {
/* like TLV, but without highest bit of len */
if (pos + 1 > buf + buf_len)
return -1;
dec->lv[tag].val = pos+2;
dec->lv[tag].len = *(pos+1) & 0x7f;
len = dec->lv[tag].len + 2;
if (pos + len > buf + buf_len)
return -2;
num_parsed++;
break;
}
/* like TL16V, fallthrough */
case TLV_TYPE_TL16V:
if (pos + 2 > buf + buf_len)
return -1;
@ -103,3 +120,9 @@ int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def,
return num_parsed;
}
static __attribute__((constructor)) void on_dso_load_tlv(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(tvlv_att_def.def); i++)
tvlv_att_def.def[i].type = TLV_TYPE_TvLV;
}

View File

@ -33,6 +33,9 @@
#define TOKEN_SMS_TEXT "HAR 2009 GSM. Register at http://har2009.gnumonks.org/ " \
"Your IMSI is %s, auth token is %08X, phone no is %s."
extern struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver,
const char *text);
static char *build_sms_string(struct gsm_subscriber *subscr, u_int32_t token)
{
char *sms_str;

View File

@ -86,8 +86,6 @@ struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr,
void trans_free(struct gsm_trans *trans)
{
struct gsm_bts *bts;
switch (trans->protocol) {
case GSM48_PDISC_CC:
_gsm48_cc_trans_free(trans);

View File

@ -1,8 +1,8 @@
Index: wireshark/epan/dissectors/Makefile.common
===================================================================
--- wireshark.orig/epan/dissectors/Makefile.common
+++ wireshark/epan/dissectors/Makefile.common
@@ -473,6 +473,7 @@
--- wireshark.orig/epan/dissectors/Makefile.common 2009-10-21 23:03:44.000000000 +0200
+++ wireshark/epan/dissectors/Makefile.common 2009-10-21 23:03:57.000000000 +0200
@@ -472,6 +472,7 @@
packet-gsm_a_gm.c \
packet-gsm_a_rp.c \
packet-gsm_a_rr.c \
@ -12,8 +12,8 @@ Index: wireshark/epan/dissectors/Makefile.common
packet-gsm_bssmap_le.c \
Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
===================================================================
--- /dev/null
+++ wireshark/epan/dissectors/packet-gsm_abis_oml.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ wireshark/epan/dissectors/packet-gsm_abis_oml.c 2009-10-22 10:06:18.000000000 +0200
@@ -0,0 +1,1365 @@
+/* packet-abis_oml.c
+ * Routines for packet dissection of GSM A-bis over IP (3GPP TS 12.21)
@ -1113,7 +1113,7 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ },
+ { &hf_oml_fom_attr_val,
+ { "FOM Attribute Value", "oml.fom.attr_val",
+ FT_BYTES, BASE_HEX, NULL, 0,
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+
@ -1308,20 +1308,20 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ },
+ { &hf_attr_ipa_tr_si2,
+ { "System Information 2", "oml.fom.attr.ipa.si2",
+ FT_BYTES, BASE_HEX, NULL, 0, NULL, HFILL }
+ FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
+ },
+ { &hf_attr_ipa_tr_si2bis,
+ { "System Information 2bis", "oml.fom.attr.ipa.si2bis",
+ FT_BYTES, BASE_HEX, NULL, 0, NULL, HFILL }
+ FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
+ },
+ { &hf_attr_ipa_tr_si2ter,
+ { "System Information 2ter", "oml.fom.attr.ipa.si2ter",
+ FT_BYTES, BASE_HEX, NULL, 0, NULL, HFILL }
+ FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
+ },
+ { &hf_attr_ipa_tr_chan_desc,
+ { "Cell Channel Description",
+ "oml.fom.attr.ipa.chan_desc",
+ FT_BYTES, BASE_HEX, NULL, 0, NULL, HFILL }
+ FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
+ },
+ { &hf_attr_ipa_nsl_sport,
+ { "NS Link IP Source Port",
@ -1382,8 +1382,8 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+}
Index: wireshark/epan/dissectors/packet-gsm_abis_oml.h
===================================================================
--- /dev/null
+++ wireshark/epan/dissectors/packet-gsm_abis_oml.h
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ wireshark/epan/dissectors/packet-gsm_abis_oml.h 2009-10-21 23:03:57.000000000 +0200
@@ -0,0 +1,786 @@
+/* GSM Network Management messages on the A-bis interface
+ * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */

View File

@ -1,14 +1,14 @@
Index: wireshark/epan/dissectors/packet-rsl.c
===================================================================
--- wireshark.orig/epan/dissectors/packet-rsl.c
+++ wireshark/epan/dissectors/packet-rsl.c
--- wireshark.orig/epan/dissectors/packet-rsl.c 2009-10-21 23:03:41.000000000 +0200
+++ wireshark/epan/dissectors/packet-rsl.c 2009-10-22 10:02:51.000000000 +0200
@@ -2,6 +2,7 @@
* Routines for Radio Signalling Link (RSL) dissection.
*
* Copyright 2007, Anders Broman <anders.broman@ericsson.com>
+ * Copyright 2009, Harald Welte <laforge@gnumonks.org>
*
* $Id: packet-rsl.c 29344 2009-08-09 07:36:13Z krj $
* $Id: packet-rsl.c 29944 2009-09-16 13:39:37Z morriss $
*
@@ -44,6 +45,8 @@
#include <epan/lapd_sapi.h>
@ -19,22 +19,32 @@ Index: wireshark/epan/dissectors/packet-rsl.c
/* Initialize the protocol and registered fields */
static int proto_rsl = -1;
@@ -116,6 +119,14 @@
@@ -117,6 +120,24 @@
static int hf_rsl_rtd = -1;
static int hf_rsl_delay_ind = -1;
static int hf_rsl_tfo = -1;
+static int hf_rsl_speech_mode = -1;
+static int hf_rsl_speech_mode_s = -1;
+static int hf_rsl_speech_mode_m = -1;
+static int hf_rsl_conn_stat = -1;
+static int hf_rsl_conn_id = -1;
+static int hf_rsl_rtp_payload = -1;
+static int hf_rsl_rtp_csd_fmt_d = -1;
+static int hf_rsl_rtp_csd_fmt_ir = -1;
+static int hf_rsl_local_port = -1;
+static int hf_rsl_remote_port = -1;
+static int hf_rsl_local_ip = -1;
+static int hf_rsl_remote_ip = -1;
+static int hf_rsl_cstat_tx_pkts = -1;
+static int hf_rsl_cstat_tx_octs = -1;
+static int hf_rsl_cstat_rx_pkts = -1;
+static int hf_rsl_cstat_rx_octs = -1;
+static int hf_rsl_cstat_lost_pkts = -1;
+static int hf_rsl_cstat_ia_jitter = -1;
+static int hf_rsl_cstat_avg_tx_dly = -1;
/* Initialize the subtree pointers */
static int ett_rsl = -1;
@@ -173,6 +184,15 @@
@@ -174,6 +195,15 @@
static int ett_ie_meas_res_no = -1;
static int ett_ie_message_id = -1;
static int ett_ie_sys_info_type = -1;
@ -50,7 +60,7 @@ Index: wireshark/epan/dissectors/packet-rsl.c
proto_tree *top_tree;
dissector_handle_t gsm_a_ccch_handle;
@@ -208,8 +228,11 @@
@@ -209,8 +239,11 @@
{ 0x06, "Common Channel Management messages" },
{ 0x08, "TRX Management messages" },
{ 0x16, "Location Services messages" },
@ -62,7 +72,7 @@ Index: wireshark/epan/dissectors/packet-rsl.c
/*
* 9.2 MESSAGE TYPE
*/
@@ -276,6 +299,49 @@
@@ -277,6 +310,49 @@
/* 0 1 - - - - - - Location Services messages: */
#define RSL_MSG_LOC_INF 65 /* 8.7.1 */
@ -112,7 +122,7 @@ Index: wireshark/epan/dissectors/packet-rsl.c
static const value_string rsl_msg_type_vals[] = {
/* 0 0 0 0 - - - - Radio Link Layer Management messages: */
@@ -338,6 +404,26 @@
@@ -339,6 +415,26 @@
{ 0x3f, "TFO MODification REQuest" }, /* 8.4.31 */
/* 0 1 - - - - - - Location Services messages: */
{ 0x41, "Location Information" }, /* 8.7.1 */
@ -139,7 +149,7 @@ Index: wireshark/epan/dissectors/packet-rsl.c
{ 0, NULL }
};
@@ -371,10 +457,10 @@
@@ -372,10 +468,10 @@
#define RSL_IE_MESSAGE_ID 28
#define RSL_IE_SYS_INFO_TYPE 30
@ -154,7 +164,7 @@ Index: wireshark/epan/dissectors/packet-rsl.c
#define RSL_IE_FULL_IMM_ASS_INF 35
#define RSL_IE_SMSCB_INF 36
#define RSL_IE_FULL_MS_TIMING_OFFSET 37
@@ -477,6 +563,24 @@
@@ -478,6 +574,24 @@
Not used
*/
@ -179,7 +189,7 @@ Index: wireshark/epan/dissectors/packet-rsl.c
{ 0, NULL }
};
@@ -513,6 +617,95 @@
@@ -514,6 +628,96 @@
{ 0, NULL }
};
@ -265,6 +275,7 @@ Index: wireshark/epan/dissectors/packet-rsl.c
+ [RSL_IE_IPAC_REMOTE_IP] = { TLV_TYPE_FIXED, 4 },
+ [RSL_IE_IPAC_REMOTE_PORT] = { TLV_TYPE_FIXED, 2 },
+ [RSL_IE_IPAC_LOCAL_IP] = { TLV_TYPE_FIXED, 4 },
+ [RSL_IE_IPAC_CONN_STAT] = { TLV_TYPE_TLV, 0 },
+ [RSL_IE_IPAC_LOCAL_PORT] = { TLV_TYPE_FIXED, 2 },
+ [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV, 0 },
+ [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 },
@ -275,7 +286,7 @@ Index: wireshark/epan/dissectors/packet-rsl.c
/* 9.3.1 Channel number 9.3.1 M TV 2 */
static int
dissect_rsl_ie_ch_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
@@ -2043,7 +2236,6 @@
@@ -2044,7 +2248,6 @@
proto_item_set_len(ti, length+2);
proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, FALSE);
@ -283,244 +294,10 @@ Index: wireshark/epan/dissectors/packet-rsl.c
/* Received Message */
offset = dissct_rsl_msg(tvb, pinfo, ie_tree, offset);
@@ -2907,13 +3099,425 @@
return ie_offset + length;
@@ -2909,12 +3112,183 @@
}
+#if 0
+static int
+dissect_rsl_ipac_ie_f8(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
+{
+ proto_item *ti;
+ proto_tree *ie_tree;
+ guint8 ie_id;
+
+ if (is_mandatory == FALSE) {
+ ie_id = tvb_get_guint8(tvb, offset);
+ if (ie_id != 0xf8)
+ return offset;
+ }
+
+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Unknown 0xf8 IE");
+ ie_tree = proto_item_add_subtree(ti, ett_ie_f8);
+
+ /* Element identifier */
+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
+ offset++;
+ /* Fixed Length */
+ proto_item_set_len(ti, 3);
+
+ proto_tree_add_item(ie_tree, hf_rsl_f8, tvb, offset, 2, FALSE);
+ offset += 2;
+
+ return offset;
+}
+
+static int
+dissect_rsl_ipac_ie_local_port(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
+{
+ proto_item *ti;
+ proto_tree *ie_tree;
+ guint8 ie_id;
+
+ if (is_mandatory == FALSE) {
+ ie_id = tvb_get_guint8(tvb, offset);
+ if (ie_id != RSL_IE_IPAC_LOCAL_PORT)
+ return offset;
+ }
+
+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Local RTP Port IE");
+ ie_tree = proto_item_add_subtree(ti, ett_ie_local_port);
+
+ /* Element identifier */
+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
+ offset++;
+ /* Fixed Length */
+ proto_item_set_len(ti, 3);
+
+ proto_tree_add_item(ie_tree, hf_rsl_local_port, tvb, offset, 2, FALSE);
+ offset += 2;
+
+ return offset;
+}
+
+static int
+dissect_rsl_ipac_ie_remote_port(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
+{
+ proto_item *ti;
+ proto_tree *ie_tree;
+ guint8 ie_id;
+
+ if (is_mandatory == FALSE) {
+ ie_id = tvb_get_guint8(tvb, offset);
+ if (ie_id != RSL_IE_IPAC_REMOTE_PORT)
+ return offset;
+ }
+
+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Remote RTP Port IE");
+ ie_tree = proto_item_add_subtree(ti, ett_ie_remote_port);
+
+ /* Element identifier */
+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
+ offset++;
+ /* Fixed Length */
+ proto_item_set_len(ti, 3);
+
+ proto_tree_add_uint(ie_tree, hf_rsl_remote_port, tvb, offset, 2, FALSE);
+ offset += 2;
+
+ return offset;
+}
+
+static int
+dissect_rsl_ipac_ie_local_ip(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
+{
+ proto_item *ti;
+ proto_tree *ie_tree;
+ guint8 ie_id;
+ guint32 ip;
+
+ if (is_mandatory == FALSE) {
+ ie_id = tvb_get_guint8(tvb, offset);
+ if (ie_id != RSL_IE_IPAC_LOCAL_IP)
+ return offset;
+ }
+
+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Local IP Address IE");
+ ie_tree = proto_item_add_subtree(ti, ett_ie_local_ip);
+
+ /* Element identifier */
+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
+ offset++;
+ /* Fixed Length */
+ proto_item_set_len(ti, 5);
+
+ ip = tvb_get_ipv4(tvb, offset);
+ proto_tree_add_ipv4(ie_tree, hf_rsl_local_ip, tvb, offset, 4, ip);
+ offset += 4;
+
+ return offset;
+}
+
+static int
+dissect_rsl_ipac_ie_remote_ip(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
+{
+ proto_item *ti;
+ proto_tree *ie_tree;
+ guint8 ie_id;
+ guint32 ip;
+
+ if (is_mandatory == FALSE) {
+ ie_id = tvb_get_guint8(tvb, offset);
+ if (ie_id != RSL_IE_IPAC_REMOTE_IP)
+ return offset;
+ }
+
+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Remote IP Address IE");
+ ie_tree = proto_item_add_subtree(ti, ett_ie_remote_ip);
+
+ /* Element identifier */
+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
+ offset++;
+ /* Fixed Length */
+ proto_item_set_len(ti, 5);
+
+ ip = tvb_get_ipv4(tvb, offset);
+ proto_tree_add_ipv4(ie_tree, hf_rsl_remote_ip, tvb, offset, 4, ip);
+ offset += 4;
+
+ return offset;
+}
+
+static int
+dissect_rsl_ipac_ie_f6(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
+{
+ proto_item *ti;
+ proto_tree *ie_tree;
+ guint8 length;
+ guint8 ie_id;
+
+ if (is_mandatory == FALSE) {
+ ie_id = tvb_get_guint8(tvb, offset);
+ if (ie_id != 0xf6)
+ return offset;
+ }
+
+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Unknown 0xf6 IE");
+ ie_tree = proto_item_add_subtree(ti, ett_ie_f6);
+
+ /* Element identifier */
+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
+ offset++;
+
+ /* Length */
+ length = tvb_get_guint8(tvb, offset);
+ offset++;
+ proto_item_set_len(ti, length+2);
+
+ proto_tree_add_bytes(ie_tree, hf_rsl_f6, tvb, offset, length,
+ tvb_get_ptr(tvb, offset, length));
+ offset += length;
+
+ return offset;
+}
+
+static int
+dissect_rsl_ipac_ie_f4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory)
+{
+ proto_item *ti;
+ proto_tree *ie_tree;
+ guint8 ie_id;
+
+ if (is_mandatory == FALSE) {
+ ie_id = tvb_get_guint8(tvb, offset);
+ if (ie_id != 0xf4)
+ return offset;
+ }
+
+ ti = proto_tree_add_text(tree, tvb, offset, 0, "Unknown 0xf4 IE");
+ ie_tree = proto_item_add_subtree(ti, ett_ie_f4);
+
+ /* Element identifier */
+ proto_tree_add_item(ie_tree, hf_rsl_ie_id, tvb, offset, 1, FALSE);
+ offset++;
+ /* Fixed Length */
+ proto_item_set_len(ti, 2);
+ proto_tree_add_item(ie_tree, hf_rsl_f4, tvb, offset, 1, FALSE);
+ offset++;
+
+ return offset;