diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-17 11:54:52 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-17 11:54:52 +0200 |
commit | ac906fa85e61b4e34161709de777616f858bc945 (patch) | |
tree | 7b247714814fd9dcf3fd3dccf954521b29eef5a2 /networking/udhcp/common.h | |
parent | ed8982bfc0e9895fe707a5f6152cf184e06f2052 (diff) | |
download | busybox-w32-ac906fa85e61b4e34161709de777616f858bc945.tar.gz busybox-w32-ac906fa85e61b4e34161709de777616f858bc945.tar.bz2 busybox-w32-ac906fa85e61b4e34161709de777616f858bc945.zip |
udhcp: change UDHCP_DEBUG into int, make verbosity selectable with -v
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/common.h')
-rw-r--r-- | networking/udhcp/common.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index 0f12be063..40b8df4df 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h | |||
@@ -62,15 +62,15 @@ uint16_t udhcp_checksum(void *addr, int count) FAST_FUNC; | |||
62 | 62 | ||
63 | void udhcp_init_header(struct dhcpMessage *packet, char type) FAST_FUNC; | 63 | void udhcp_init_header(struct dhcpMessage *packet, char type) FAST_FUNC; |
64 | 64 | ||
65 | /*int udhcp_recv_raw_packet(struct dhcpMessage *payload, int fd); - in dhcpc.h */ | 65 | /*int udhcp_recv_raw_packet(struct dhcpMessage *dhcp_pkt, int fd); - in dhcpc.h */ |
66 | int udhcp_recv_kernel_packet(struct dhcpMessage *packet, int fd) FAST_FUNC; | 66 | int udhcp_recv_kernel_packet(struct dhcpMessage *packet, int fd) FAST_FUNC; |
67 | 67 | ||
68 | int udhcp_send_raw_packet(struct dhcpMessage *payload, | 68 | int udhcp_send_raw_packet(struct dhcpMessage *dhcp_pkt, |
69 | uint32_t source_ip, int source_port, | 69 | uint32_t source_ip, int source_port, |
70 | uint32_t dest_ip, int dest_port, const uint8_t *dest_arp, | 70 | uint32_t dest_ip, int dest_port, const uint8_t *dest_arp, |
71 | int ifindex) FAST_FUNC; | 71 | int ifindex) FAST_FUNC; |
72 | 72 | ||
73 | int udhcp_send_kernel_packet(struct dhcpMessage *payload, | 73 | int udhcp_send_kernel_packet(struct dhcpMessage *dhcp_pkt, |
74 | uint32_t source_ip, int source_port, | 74 | uint32_t source_ip, int source_port, |
75 | uint32_t dest_ip, int dest_port) FAST_FUNC; | 75 | uint32_t dest_ip, int dest_port) FAST_FUNC; |
76 | 76 | ||
@@ -100,10 +100,20 @@ int arpping(uint32_t test_ip, | |||
100 | uint8_t *from_mac, | 100 | uint8_t *from_mac, |
101 | const char *interface) FAST_FUNC; | 101 | const char *interface) FAST_FUNC; |
102 | 102 | ||
103 | #if ENABLE_UDHCP_DEBUG | 103 | #if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1 |
104 | # define DEBUG(str, args...) bb_info_msg("### " str, ## args) | 104 | extern int dhcp_verbose; |
105 | # define log1(...) do { if (dhcp_verbose >= 1) bb_info_msg(__VA_ARGS__); } while (0) | ||
106 | # if CONFIG_UDHCP_DEBUG >= 2 | ||
107 | void udhcp_dump_packet(struct dhcpMessage *packet) FAST_FUNC; | ||
108 | # define log2(...) do { if (dhcp_verbose >= 2) bb_info_msg(__VA_ARGS__); } while (0) | ||
109 | # else | ||
110 | # define udhcp_dump_packet(...) ((void)0) | ||
111 | # define log2(...) ((void)0) | ||
112 | # endif | ||
105 | #else | 113 | #else |
106 | # define DEBUG(str, args...) do {;} while (0) | 114 | # define udhcp_dump_packet(...) ((void)0) |
115 | # define log1(...) ((void)0) | ||
116 | # define log2(...) ((void)0) | ||
107 | #endif | 117 | #endif |
108 | 118 | ||
109 | POP_SAVED_FUNCTION_VISIBILITY | 119 | POP_SAVED_FUNCTION_VISIBILITY |