diff options
author | Cristian Maglie <c.maglie@bug.st> | 2012-05-21 01:56:06 +0200 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2012-05-22 11:23:47 +0200 |
commit | 3786e337e0211ca1ef94b37b03e891adfb3b5f9a (patch) | |
tree | dd7f8f6fd396243460ec22da89bfbd71d552f484 /libraries/Ethernet/Dhcp.h | |
parent | 324023a67afd1691f12ead4388d7cdf1a9d1a6ef (diff) | |
parent | 9a8976ce56bcdb70815dd58c1764d9e5c3b6fe95 (diff) |
Pre-merge upstream Arduino
Diffstat (limited to 'libraries/Ethernet/Dhcp.h')
-rwxr-xr-x | libraries/Ethernet/Dhcp.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libraries/Ethernet/Dhcp.h b/libraries/Ethernet/Dhcp.h index 149876d..4a47936 100755 --- a/libraries/Ethernet/Dhcp.h +++ b/libraries/Ethernet/Dhcp.h @@ -45,6 +45,13 @@ #define MAX_DHCP_OPT 16
#define HOST_NAME "WIZnet"
+#define DEFAULT_LEASE (900) //default lease time in seconds
+
+#define DHCP_CHECK_NONE (0)
+#define DHCP_CHECK_RENEW_FAIL (1)
+#define DHCP_CHECK_RENEW_OK (2)
+#define DHCP_CHECK_REBIND_FAIL (3)
+#define DHCP_CHECK_REBIND_OK (4)
enum
{
@@ -139,8 +146,19 @@ private: uint8_t _dhcpGatewayIp[4];
uint8_t _dhcpDhcpServerIp[4];
uint8_t _dhcpDnsServerIp[4];
+ uint32_t _dhcpLeaseTime;
+ uint32_t _dhcpT1, _dhcpT2;
+ signed long _renewInSec;
+ signed long _rebindInSec;
+ signed long _lastCheck;
+ unsigned long _timeout;
+ unsigned long _responseTimeout;
+ unsigned long _secTimeout;
+ uint8_t _dhcp_state;
EthernetUDP _dhcpUdpSocket;
+ int request_DHCP_lease();
+ void reset_DHCP_lease();
void presend_DHCP();
void send_DHCP_MESSAGE(uint8_t, uint16_t);
void printByte(char *, uint8_t);
@@ -154,6 +172,7 @@ public: IPAddress getDnsServerIp();
int beginWithDHCP(uint8_t *, unsigned long timeout = 60000, unsigned long responseTimeout = 4000);
+ int checkLease();
};
#endif
|