dhcps.h
00001 #ifndef __DHCPS_H__6M2XYUGNTK__
00002 #define __DHCPS_H__6M2XYUGNTK__
00003 #include "contiki-net.h"
00004 #include <stdint.h>
00005
00006 #define MAX_HLEN 6
00007
00008 struct dhcps_client_lease
00009 {
00010 uint8_t chaddr[MAX_HLEN];
00011 uip_ipaddr_t ipaddr;
00012 unsigned long lease_end;
00013 uint8_t flags;
00014 };
00015
00016 struct dhcps_config
00017 {
00018 unsigned long default_lease_time;
00019 uip_ipaddr_t netmask;
00020 uip_ipaddr_t dnsaddr;
00021 uip_ipaddr_t default_router;
00022 struct dhcps_client_lease *leases;
00023 uint8_t flags;
00024 uint8_t num_leases;
00025 };
00026
00027 #define DHCP_CONF_NETMASK 0x01
00028 #define DHCP_CONF_DNSADDR 0x02
00029 #define DHCP_CONF_DEFAULT_ROUTER 0x04
00030
00031 #define DHCP_INIT_LEASE(addr0, addr1, addr2, addr3) \
00032 {{0},{addr0, addr1, addr2, addr3},0,0}
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 void dhcps_init(const struct dhcps_config *conf);
00046
00047 #endif