summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2016-09-28 12:07:20 -0500
committerMark Salyzyn2016-09-30 14:47:05 -0500
commit66ce3e08c5632a20ea66bde6dd76397041edf034 (patch)
treee77589e0f6c62e8ac1c8faabe2d9dd2934d3ecee /libnetutils
parent0dd4431072cce3c62876b728cb20aa5b77b11a8d (diff)
downloadplatform-system-core-66ce3e08c5632a20ea66bde6dd76397041edf034.tar.gz
platform-system-core-66ce3e08c5632a20ea66bde6dd76397041edf034.tar.xz
platform-system-core-66ce3e08c5632a20ea66bde6dd76397041edf034.zip
system/core Replace cutils/log.h with android/log.h
Should use android/log.h instead of cutils/log.h as a good example to all others. Adjust header order to comply with Android Coding standards. Test: Compile Bug: 26552300 Bug: 31289077 Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
Diffstat (limited to 'libnetutils')
-rw-r--r--libnetutils/dhcpclient.c26
-rw-r--r--libnetutils/ifc_utils.c50
-rw-r--r--libnetutils/packet.c29
3 files changed, 49 insertions, 56 deletions
diff --git a/libnetutils/dhcpclient.c b/libnetutils/dhcpclient.c
index 240a7891e..d17bdd3c2 100644
--- a/libnetutils/dhcpclient.c
+++ b/libnetutils/dhcpclient.c
@@ -14,27 +14,25 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17#include <stdio.h> 17#define LOG_TAG "DHCP"
18
19#include <dirent.h>
20#include <errno.h>
21#include <poll.h>
22#include <netinet/in.h>
18#include <stdarg.h> 23#include <stdarg.h>
19#include <stdlib.h> 24#include <stdlib.h>
20#include <unistd.h> 25#include <stdio.h>
21#include <errno.h>
22#include <string.h> 26#include <string.h>
23
24#include <time.h>
25#include <sys/time.h>
26#include <poll.h>
27
28#include <sys/socket.h>
29#include <sys/select.h> 27#include <sys/select.h>
28#include <sys/socket.h>
29#include <sys/time.h>
30#include <sys/types.h> 30#include <sys/types.h>
31#include <netinet/in.h> 31#include <time.h>
32#include <unistd.h>
32 33
34#include <android/log.h>
33#include <cutils/properties.h> 35#include <cutils/properties.h>
34#define LOG_TAG "DHCP"
35#include <cutils/log.h>
36
37#include <dirent.h>
38 36
39#include <netutils/ifc.h> 37#include <netutils/ifc.h>
40#include "dhcpmsg.h" 38#include "dhcpmsg.h"
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index eae32ce36..275327ab4 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -1,34 +1,21 @@
1/* 1/*
2 * Copyright 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, 11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17#include <stdio.h>
18#include <stdlib.h>
19#include <unistd.h>
20#include <string.h>
21#include <errno.h>
22#include <pthread.h>
23
24#include <sys/socket.h>
25#include <sys/select.h>
26#include <sys/types.h>
27#include <netinet/in.h>
28#include <arpa/inet.h> 17#include <arpa/inet.h>
29#include <net/if.h> 18#include <errno.h>
30#include <netdb.h>
31
32#include <linux/if.h> 19#include <linux/if.h>
33#include <linux/if_ether.h> 20#include <linux/if_ether.h>
34#include <linux/if_arp.h> 21#include <linux/if_arp.h>
@@ -37,20 +24,29 @@
37#include <linux/ipv6_route.h> 24#include <linux/ipv6_route.h>
38#include <linux/rtnetlink.h> 25#include <linux/rtnetlink.h>
39#include <linux/sockios.h> 26#include <linux/sockios.h>
40 27#include <net/if.h>
41#include "netutils/ifc.h" 28#include <netdb.h>
29#include <netinet/in.h>
30#include <pthread.h>
31#include <stdio.h>
32#include <stdlib.h>
33#include <string.h>
34#include <sys/select.h>
35#include <sys/socket.h>
36#include <sys/types.h>
37#include <unistd.h>
42 38
43#ifdef ANDROID 39#ifdef ANDROID
44#define LOG_TAG "NetUtils" 40#define LOG_TAG "NetUtils"
45#include <cutils/log.h> 41#include <android/log.h>
46#include <cutils/properties.h> 42#include <cutils/properties.h>
47#else 43#else
48#include <stdio.h>
49#include <string.h>
50#define ALOGD printf 44#define ALOGD printf
51#define ALOGW printf 45#define ALOGW printf
52#endif 46#endif
53 47
48#include "netutils/ifc.h"
49
54#if defined(__ANDROID__) 50#if defined(__ANDROID__)
55/* SIOCKILLADDR is an Android extension. */ 51/* SIOCKILLADDR is an Android extension. */
56#define SIOCKILLADDR 0x8939 52#define SIOCKILLADDR 0x8939
diff --git a/libnetutils/packet.c b/libnetutils/packet.c
index cd26d058a..56168e844 100644
--- a/libnetutils/packet.c
+++ b/libnetutils/packet.c
@@ -1,37 +1,36 @@
1/* 1/*
2 * Copyright 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, 11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17#include <errno.h>
17#include <stdlib.h> 18#include <stdlib.h>
18#include <string.h> 19#include <string.h>
19#include <unistd.h>
20#include <sys/uio.h>
21#include <sys/socket.h> 20#include <sys/socket.h>
21#include <sys/uio.h>
22#include <linux/if_ether.h>
23#include <linux/if_packet.h>
22#include <netinet/in.h> 24#include <netinet/in.h>
23#include <netinet/ip.h> 25#include <netinet/ip.h>
24#include <netinet/udp.h> 26#include <netinet/udp.h>
25#include <linux/if_packet.h> 27#include <unistd.h>
26#include <linux/if_ether.h>
27#include <errno.h>
28 28
29#ifdef ANDROID 29#ifdef ANDROID
30#define LOG_TAG "DHCP" 30#define LOG_TAG "DHCP"
31#include <cutils/log.h> 31#include <android/log.h>
32#else 32#else
33#include <stdio.h> 33#include <stdio.h>
34#include <string.h>
35#define ALOGD printf 34#define ALOGD printf
36#define ALOGW printf 35#define ALOGW printf
37#endif 36#endif