@@ -70,7 +70,7 @@ void printerr(char *fmt, ...)
70
70
vsnprintf (errmsg , sizeof (errmsg ), fmt , ap );
71
71
va_end (ap );
72
72
73
- LOGD ("%s" , errmsg );
73
+ ALOGD ("%s" , errmsg );
74
74
}
75
75
76
76
const char * dhcp_lasterror ()
@@ -151,14 +151,14 @@ static const char *dhcp_type_to_name(uint32_t type)
151
151
void dump_dhcp_info (dhcp_info * info )
152
152
{
153
153
char addr [20 ], gway [20 ], mask [20 ];
154
- LOGD ("--- dhcp %s (%d) ---" ,
154
+ ALOGD ("--- dhcp %s (%d) ---" ,
155
155
dhcp_type_to_name (info -> type ), info -> type );
156
156
strcpy (addr , ipaddr (info -> ipaddr ));
157
157
strcpy (gway , ipaddr (info -> gateway ));
158
- LOGD ("ip %s gw %s prefixLength %d" , addr , gway , info -> prefixLength );
159
- if (info -> dns1 ) LOGD ("dns1: %s" , ipaddr (info -> dns1 ));
160
- if (info -> dns2 ) LOGD ("dns2: %s" , ipaddr (info -> dns2 ));
161
- LOGD ("server %s, lease %d seconds" ,
158
+ ALOGD ("ip %s gw %s prefixLength %d" , addr , gway , info -> prefixLength );
159
+ if (info -> dns1 ) ALOGD ("dns1: %s" , ipaddr (info -> dns1 ));
160
+ if (info -> dns2 ) ALOGD ("dns2: %s" , ipaddr (info -> dns2 ));
161
+ ALOGD ("server %s, lease %d seconds" ,
162
162
ipaddr (info -> serveraddr ), info -> lease );
163
163
}
164
164
@@ -250,9 +250,9 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
250
250
const char * name ;
251
251
char buf [2048 ];
252
252
253
- LOGD ("===== DHCP message:" );
253
+ ALOGD ("===== DHCP message:" );
254
254
if (len < DHCP_MSG_FIXED_SIZE ) {
255
- LOGD ("Invalid length %d, should be %d" , len , DHCP_MSG_FIXED_SIZE );
255
+ ALOGD ("Invalid length %d, should be %d" , len , DHCP_MSG_FIXED_SIZE );
256
256
return ;
257
257
}
258
258
@@ -264,18 +264,18 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
264
264
name = "BOOTREPLY" ;
265
265
else
266
266
name = "????" ;
267
- LOGD ("op = %s (%d), htype = %d, hlen = %d, hops = %d" ,
267
+ ALOGD ("op = %s (%d), htype = %d, hlen = %d, hops = %d" ,
268
268
name , msg -> op , msg -> htype , msg -> hlen , msg -> hops );
269
- LOGD ("xid = 0x%08x secs = %d, flags = 0x%04x optlen = %d" ,
269
+ ALOGD ("xid = 0x%08x secs = %d, flags = 0x%04x optlen = %d" ,
270
270
ntohl (msg -> xid ), ntohs (msg -> secs ), ntohs (msg -> flags ), len );
271
- LOGD ("ciaddr = %s" , ipaddr (msg -> ciaddr ));
272
- LOGD ("yiaddr = %s" , ipaddr (msg -> yiaddr ));
273
- LOGD ("siaddr = %s" , ipaddr (msg -> siaddr ));
274
- LOGD ("giaddr = %s" , ipaddr (msg -> giaddr ));
271
+ ALOGD ("ciaddr = %s" , ipaddr (msg -> ciaddr ));
272
+ ALOGD ("yiaddr = %s" , ipaddr (msg -> yiaddr ));
273
+ ALOGD ("siaddr = %s" , ipaddr (msg -> siaddr ));
274
+ ALOGD ("giaddr = %s" , ipaddr (msg -> giaddr ));
275
275
276
276
c = msg -> hlen > 16 ? 16 : msg -> hlen ;
277
277
hex2str (buf , msg -> chaddr , c );
278
- LOGD ("chaddr = {%s}" , buf );
278
+ ALOGD ("chaddr = {%s}" , buf );
279
279
280
280
for (n = 0 ; n < 64 ; n ++ ) {
281
281
if ((msg -> sname [n ] < ' ' ) || (msg -> sname [n ] > 127 )) {
@@ -293,8 +293,8 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
293
293
}
294
294
msg -> file [127 ] = 0 ;
295
295
296
- LOGD ("sname = '%s'" , msg -> sname );
297
- LOGD ("file = '%s'" , msg -> file );
296
+ ALOGD ("sname = '%s'" , msg -> sname );
297
+ ALOGD ("file = '%s'" , msg -> file );
298
298
299
299
if (len < 4 ) return ;
300
300
len -= 4 ;
@@ -327,7 +327,7 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
327
327
name = dhcp_type_to_name (x [2 ]);
328
328
else
329
329
name = NULL ;
330
- LOGD ("op %d len %d {%s} %s" , x [0 ], optsz , buf , name == NULL ? "" : name );
330
+ ALOGD ("op %d len %d {%s} %s" , x [0 ], optsz , buf , name == NULL ? "" : name );
331
331
len -= optsz ;
332
332
x = x + optsz + 2 ;
333
333
}
@@ -347,28 +347,28 @@ static int send_message(int sock, int if_index, dhcp_msg *msg, int size)
347
347
static int is_valid_reply (dhcp_msg * msg , dhcp_msg * reply , int sz )
348
348
{
349
349
if (sz < DHCP_MSG_FIXED_SIZE ) {
350
- if (verbose ) LOGD ("netcfg: Wrong size %d != %d\n" , sz , DHCP_MSG_FIXED_SIZE );
350
+ if (verbose ) ALOGD ("netcfg: Wrong size %d != %d\n" , sz , DHCP_MSG_FIXED_SIZE );
351
351
return 0 ;
352
352
}
353
353
if (reply -> op != OP_BOOTREPLY ) {
354
- if (verbose ) LOGD ("netcfg: Wrong Op %d != %d\n" , reply -> op , OP_BOOTREPLY );
354
+ if (verbose ) ALOGD ("netcfg: Wrong Op %d != %d\n" , reply -> op , OP_BOOTREPLY );
355
355
return 0 ;
356
356
}
357
357
if (reply -> xid != msg -> xid ) {
358
- if (verbose ) LOGD ("netcfg: Wrong Xid 0x%x != 0x%x\n" , ntohl (reply -> xid ),
358
+ if (verbose ) ALOGD ("netcfg: Wrong Xid 0x%x != 0x%x\n" , ntohl (reply -> xid ),
359
359
ntohl (msg -> xid ));
360
360
return 0 ;
361
361
}
362
362
if (reply -> htype != msg -> htype ) {
363
- if (verbose ) LOGD ("netcfg: Wrong Htype %d != %d\n" , reply -> htype , msg -> htype );
363
+ if (verbose ) ALOGD ("netcfg: Wrong Htype %d != %d\n" , reply -> htype , msg -> htype );
364
364
return 0 ;
365
365
}
366
366
if (reply -> hlen != msg -> hlen ) {
367
- if (verbose ) LOGD ("netcfg: Wrong Hlen %d != %d\n" , reply -> hlen , msg -> hlen );
367
+ if (verbose ) ALOGD ("netcfg: Wrong Hlen %d != %d\n" , reply -> hlen , msg -> hlen );
368
368
return 0 ;
369
369
}
370
370
if (memcmp (msg -> chaddr , reply -> chaddr , msg -> hlen )) {
371
- if (verbose ) LOGD ("netcfg: Wrong chaddr %x != %x\n" , * (reply -> chaddr ),* (msg -> chaddr ));
371
+ if (verbose ) ALOGD ("netcfg: Wrong chaddr %x != %x\n" , * (reply -> chaddr ),* (msg -> chaddr ));
372
372
return 0 ;
373
373
}
374
374
return 1 ;
@@ -469,7 +469,7 @@ int dhcp_init_ifc(const char *ifname)
469
469
r = receive_packet (s , & reply );
470
470
if (r < 0 ) {
471
471
if (errno != 0 ) {
472
- LOGD ("receive_packet failed (%d): %s" , r , strerror (errno ));
472
+ ALOGD ("receive_packet failed (%d): %s" , r , strerror (errno ));
473
473
if (errno == ENETDOWN || errno == ENXIO ) {
474
474
return -1 ;
475
475
}
0 commit comments