Merge branch 'master' into encryption

This commit is contained in:
Harald Welte 2009-09-27 11:13:55 +02:00
commit 23b710fa4f
3 changed files with 19 additions and 9 deletions

View File

@ -78,6 +78,13 @@ struct gsm48_loc_area_id {
u_int16_t lac;
} __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 */
struct gsm48_loc_upd_req {
u_int8_t type:4,

View File

@ -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)
{
dbi_result result;
char *string;
const char *string;
unsigned int cm1;
const unsigned char *cm2, *cm3;
struct gsm_equipment *equip = &subscr->equipment;
result = dbi_conn_queryf(conn,
"SELECT equipment.* FROM equipment,equipmentwatch "
"WHERE equipmentwatch.equipment_id=equipment.id "
"AND equipmentwatch.subscriber_id = %llu "
"SELECT equipment.* FROM Equipment,EquipmentWatch "
"WHERE EquipmentWatch.equipment_id=Equipment.id "
"AND EquipmentWatch.subscriber_id = %llu "
"ORDER BY updated DESC", subscr->id);
if (!result)
return -EIO;

View File

@ -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 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");
@ -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->msg_type = GSM48_MT_MM_AUTH_REQ;
/* Key Sequence: FIXME fixed to 0 */
ar->key_seq = 0;
/* 16 bytes RAND parameters */
r = msgb_put(msg, 16);
if (rand)
memcpy(r, rand, 16);
memcpy(ar->rand, rand, 16);
return gsm48_sendmsg(msg, NULL);
}
@ -3608,11 +3610,12 @@ int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id)
break;
case GSM48_PDISC_MM_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);
break;
default:
fprintf(stderr, "Unknown GSM 04.08 discriminator 0x%02d\n",
fprintf(stderr, "Unknown GSM 04.08 discriminator 0x%02x\n",
pdisc);
break;
}