|
From: Mattias A. <mat...@us...> - 2001-03-21 18:35:21
|
The following files were modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_ipa.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20
bt_ipa.h 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
fixed error in show_ipset
minor changes and added some debug
The diff of the modified file(s):
--- bt_ipa.c 2001/03/02 10:59:57 1.1
+++ bt_ipa.c 2001/03/21 18:35:20 1.2
@@ -46,6 +46,7 @@
#include <syslog.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <string.h>
=20
/* print in_addr */
#include <sys/socket.h>
@@ -81,7 +82,9 @@
/* Sends msg to IPA socket */
int ipa_write(int ipa_fd, ipa_msg *msg)
{
- syslog(LOG_INFO, "ipa_send : sending ipa request (type : %d)\n", msg->ty=
pe);
+ syslog(LOG_INFO, "ipa_send : sending ipa request (type : %d) len %d \n",
+ msg->type, msg->len);
+=20=20
return write(ipa_fd, msg, msg->len + sizeof(struct ipa_msg));
}
=20
@@ -99,6 +102,8 @@
{
c =3D read(ipa_fd, &ipa_buf+offset, 256-offset);=20=20
=20
+ syslog(LOG_INFO, "ipa_receive : got %d bytes", c);=20=20
+
if (c < 0)
return c;
=20
@@ -117,25 +122,36 @@
=20=20=20
memcpy(msg, ipa_buf, offset);
=20
+ syslog(LOG_INFO, "Got %d bytes", offset);
+
return msg_len;=20=20
}
=20
void show_ipset(struct ip_set* set, int line)
{
- printf("IP set [line:%d]\n", line);
- printf(" ip : %s\n", inet_ntoa(set->ip));
+ syslog(LOG_INFO, "IP set [line:%d]\n", line);
+
+ if (set)
+ {=20=20=20=20
+ syslog(LOG_INFO, " ip : %s\n", inet_ntoa(set->ip));
+
if (set->nbr_of_dns >=3D 1)
- printf(" dns1 : %s\n", inet_ntoa(set->dns[1]));
+ syslog(LOG_INFO, " dns1 : %s\n", inet_ntoa(set->dns[0]));
+
if (set->nbr_of_dns =3D=3D 2)
- printf(" dns2 : %s\n", inet_ntoa(set->dns[2]));
+ syslog(LOG_INFO, " dns2 : %s\n", inet_ntoa(set->dns[1]));
+
if (set->nbr_of_wins >=3D 1)
- printf(" wins 1 : %s\n", inet_ntoa(set->wins[1]));
- if (set->nbr_of_dns =3D=3D 2)
- printf(" wins2 : %s\n", inet_ntoa(set->wins[2]));
- printf(" netmask : %s\n", inet_ntoa(set->netmask));
- printf("useradius : %d\n", set->useradius);
- printf("useradiusip : %d\n", set->useradiusip);
- printf("usingmasq : %d\n", set->usingmasq);
+ syslog(LOG_INFO, " wins 1 : %s\n", inet_ntoa(set->wins[0]));
+
+ if (set->nbr_of_wins =3D=3D 2)
+ syslog(LOG_INFO, " wins2 : %s\n", inet_ntoa(set->wins[1]));
+
+ syslog(LOG_INFO, " netmask : %s\n", inet_ntoa(set->netmask));
+ syslog(LOG_INFO, "useradius : %d\n", set->useradius);
+ syslog(LOG_INFO, "useradiusip : %d\n", set->useradiusip);
+ syslog(LOG_INFO, "usingmasq : %d\n", set->usingmasq);
+ }
}
=20
#endif /* USE_IPASSIGN */
--- bt_ipa.h 2001/03/02 10:59:57 1.1
+++ bt_ipa.h 2001/03/21 18:35:20 1.2
@@ -63,8 +63,8 @@
#define IPARSP_PEERSETTINGS 11
=20
/* Status codes */
-#define IPA_STATUSFAILED 0
-#define IPA_STATUSSUCCESS 1
+#define IPA_STATUSSUCCESS 0
+#define IPA_STATUSFAILED 1
=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=3D=3D=3D=3D=3D=3D*/
/* IPA Client struct */
|