gdhcp: Move get_interface_name and interface_is_up to common.c
[framework/connectivity/connman.git] / gdhcp / common.h
index 5b6fe58..3aab3d2 100644 (file)
@@ -47,10 +47,14 @@ do {                                                \
 
 #define EXTEND_FOR_BUGGY_SERVERS 80
 
-static const uint8_t MAC_BCAST_ADDR[6] __attribute__((aligned(2))) = {
+static const uint8_t MAC_BCAST_ADDR[ETH_ALEN] __attribute__((aligned(2))) = {
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff
 };
 
+static const uint8_t MAC_ANY_ADDR[ETH_ALEN] __attribute__((aligned(2))) = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
 /* DHCP packet */
 #define DHCP_MAGIC              0x63825363
 #define DHCP_OPTIONS_BUFSIZE    308
@@ -171,3 +175,5 @@ int dhcp_send_kernel_packet(struct dhcp_packet *dhcp_pkt,
                        uint32_t dest_ip, int dest_port);
 int dhcp_l3_socket(int port, const char *interface);
 int dhcp_recv_l3_packet(struct dhcp_packet *packet, int fd);
+char *get_interface_name(int index);
+gboolean interface_is_up(int index);