|
From: Peter K. <pk...@us...> - 2002-11-22 16:59:04
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
btd.c 1.40 1.41=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Use the radaxis.so plugin for RADIUS support in combination with ipa.
The diff of the modified file(s):
--- btd.c 20 Nov 2002 16:59:21 -0000 1.40
+++ btd.c 22 Nov 2002 16:59:03 -0000 1.41
@@ -160,7 +160,7 @@
static struct ipa_msg *msg;
static unsigned char ipa_buf[256];
static int parse_ipa_response(struct ipa_msg *msg);
-static int ipa_sendrequest(int line, unsigned char *bd,
+static int ipa_send_request(int line, unsigned char *bd,
unsigned short type);
=20
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
@@ -464,7 +464,7 @@
PEER(line).ipset =3D &IPSET(line);
=20
STATE(line) =3D WAITING_PPPCONF;
- if (ipa_sendrequest(line, PEER(line).remote_bd, IPAREQ_GETIPSET) <=
0)
+ if (ipa_send_request(line, PEER(line).remote_bd, IPAREQ_GETIPSET) =
< 0)
{
syslog(LOG_INFO, "IPA request failed or no IPA server");
=20
@@ -496,6 +496,7 @@
static unsigned char ms_wins1[35];
static unsigned char ms_wins2[35];
static unsigned char netmask[35];
+ static char remote_bd_addr[18];
static char remote_bd_str[36];
static char local_bd_str[32];
static char remote_name[20 + BT_NAME_LENGTH];
@@ -541,6 +542,20 @@
opts[i++] =3D "login";
=20
#ifdef __CRIS__
+ opts[i++] =3D "plugin";
+ opts[i++] =3D "radaxis.so";
+
+ sprintf(remote_bd_addr, "%02x:%02x:%02x:%02x:%02x:%02x",=20
+ PEER(line).remote_bd[0],
+ PEER(line).remote_bd[1],
+ PEER(line).remote_bd[2],
+ PEER(line).remote_bd[3],
+ PEER(line).remote_bd[4],
+ PEER(line).remote_bd[5]);
+
+ opts[i++] =3D "remote-bd-addr";
+ opts[i++] =3D remote_bd_addr;
+
read_local_bd(bt_cfd, local_bd);
sprintf(local_bd_str, "Axis-BT-AP-ID=3D%02x:%02x:%02x:%02x:%02x:%02x=
",
local_bd[0],
@@ -574,7 +589,7 @@
=20
if (ipset->useradiusip)
{
- opts[i++] =3D "useautoip";
+ opts[i++] =3D "use-auto-ip";
}
=20
if (ipset->usingmasq)
@@ -805,7 +820,7 @@
{
STATE(line) =3D WAITING_RETURN_PPPCONF;
=20
- if (ipa_sendrequest(line, PEER(line).remote_bd, IPAREQ_RELEASEIPSET)=
< 0)
+ if (ipa_send_request(line, PEER(line).remote_bd, IPAREQ_RELEASEIPSET=
) < 0)
{
syslog(LOG_INFO, "IPA request failed or no IPA server");
/* put peer into state NOCONNECTION, if still connected this
@@ -954,7 +969,7 @@
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* IPA stuff */
=20
-static int ipa_sendrequest(int line, unsigned char *bd, unsigned short typ=
e)
+static int ipa_send_request(int line, unsigned char *bd, unsigned short ty=
pe)
{
unsigned char buf[IPA_MSG_MAXSIZE];
struct ipa_msg *msg;
@@ -964,10 +979,11 @@
=20
msg =3D (struct ipa_msg*)buf;
msg->type =3D type;
- msg->len =3D sizeof(struct ipa_request);
+ msg->len =3D sizeof *req;
req =3D (struct ipa_request*)msg->msg;
req->id =3D line;
- memcpy(req->remote_bd, bd, 6);
+ memcpy(req->remote_bd, bd, sizeof req->remote_bd);
+
return ipa_write(ipa_fd, msg);
}
=20
|