Merge branch 'master' into encryption
This commit is contained in:
commit
23b710fa4f
|
@ -78,6 +78,13 @@ struct gsm48_loc_area_id {
|
||||||
u_int16_t lac;
|
u_int16_t lac;
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
/* Section 9.2.2 */
|
||||||
|
struct gsm48_auth_req {
|
||||||
|
u_int8_t key_seq:4,
|
||||||
|
spare:4;
|
||||||
|
u_int8_t rand[16];
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* Section 9.2.15 */
|
/* Section 9.2.15 */
|
||||||
struct gsm48_loc_upd_req {
|
struct gsm48_loc_upd_req {
|
||||||
u_int8_t type:4,
|
u_int8_t type:4,
|
||||||
|
|
|
@ -264,15 +264,15 @@ struct gsm_subscriber* db_create_subscriber(struct gsm_network *net, char *imsi)
|
||||||
static int get_equipment_by_subscr(struct gsm_subscriber *subscr)
|
static int get_equipment_by_subscr(struct gsm_subscriber *subscr)
|
||||||
{
|
{
|
||||||
dbi_result result;
|
dbi_result result;
|
||||||
char *string;
|
const char *string;
|
||||||
unsigned int cm1;
|
unsigned int cm1;
|
||||||
const unsigned char *cm2, *cm3;
|
const unsigned char *cm2, *cm3;
|
||||||
struct gsm_equipment *equip = &subscr->equipment;
|
struct gsm_equipment *equip = &subscr->equipment;
|
||||||
|
|
||||||
result = dbi_conn_queryf(conn,
|
result = dbi_conn_queryf(conn,
|
||||||
"SELECT equipment.* FROM equipment,equipmentwatch "
|
"SELECT equipment.* FROM Equipment,EquipmentWatch "
|
||||||
"WHERE equipmentwatch.equipment_id=equipment.id "
|
"WHERE EquipmentWatch.equipment_id=Equipment.id "
|
||||||
"AND equipmentwatch.subscriber_id = %llu "
|
"AND EquipmentWatch.subscriber_id = %llu "
|
||||||
"ORDER BY updated DESC", subscr->id);
|
"ORDER BY updated DESC", subscr->id);
|
||||||
if (!result)
|
if (!result)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
|
@ -1233,7 +1233,7 @@ int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand)
|
||||||
{
|
{
|
||||||
struct msgb *msg = gsm48_msgb_alloc();
|
struct msgb *msg = gsm48_msgb_alloc();
|
||||||
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
|
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
|
||||||
u_int8_t *r;
|
struct gsm48_auth_req *ar = (struct gsm48_auth_req *) msgb_put(msg, sizeof(*ar));
|
||||||
|
|
||||||
DEBUGP(DMM, "-> AUTH REQ\n");
|
DEBUGP(DMM, "-> AUTH REQ\n");
|
||||||
|
|
||||||
|
@ -1241,10 +1241,12 @@ int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand)
|
||||||
gh->proto_discr = GSM48_PDISC_MM;
|
gh->proto_discr = GSM48_PDISC_MM;
|
||||||
gh->msg_type = GSM48_MT_MM_AUTH_REQ;
|
gh->msg_type = GSM48_MT_MM_AUTH_REQ;
|
||||||
|
|
||||||
|
/* Key Sequence: FIXME fixed to 0 */
|
||||||
|
ar->key_seq = 0;
|
||||||
|
|
||||||
/* 16 bytes RAND parameters */
|
/* 16 bytes RAND parameters */
|
||||||
r = msgb_put(msg, 16);
|
|
||||||
if (rand)
|
if (rand)
|
||||||
memcpy(r, rand, 16);
|
memcpy(ar->rand, rand, 16);
|
||||||
|
|
||||||
return gsm48_sendmsg(msg, NULL);
|
return gsm48_sendmsg(msg, NULL);
|
||||||
}
|
}
|
||||||
|
@ -3608,11 +3610,12 @@ int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id)
|
||||||
break;
|
break;
|
||||||
case GSM48_PDISC_MM_GPRS:
|
case GSM48_PDISC_MM_GPRS:
|
||||||
case GSM48_PDISC_SM_GPRS:
|
case GSM48_PDISC_SM_GPRS:
|
||||||
fprintf(stderr, "Unimplemented GSM 04.08 discriminator 0x%02d\n",
|
case GSM48_PDISC_NC_SS: /* mobile-originated USSD */
|
||||||
|
fprintf(stderr, "Unimplemented GSM 04.08 discriminator 0x%02x\n",
|
||||||
pdisc);
|
pdisc);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unknown GSM 04.08 discriminator 0x%02d\n",
|
fprintf(stderr, "Unknown GSM 04.08 discriminator 0x%02x\n",
|
||||||
pdisc);
|
pdisc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue