1 #ifndef DATATYPES_H 2 #define DATATYPES_H 3 4 typedef unsigned char u8b; 5 typedef unsigned short u16b; 6 typedef unsigned int u32b; 7 8 typedef struct{ 9 u8b op; 10 u8b htype; 11 u8b hlen; 12 u8b hops; 13 u32b xid; 14 u16b secs; 15 u16b flags; 16 u32b ciaddr; 17 u32b yiaddr; 18 u32b siaddr; 19 u32b giaddr; 20 u8b chaddr[16]; 21 u8b sname[64]; 22 u8b file[128]; 23 u8b options[312]; 24 } DHCPMESSAGE; 25 26 typedef struct{ 27 u8b type; 28 u32b r_ip; 29 u32b r_mask; 30 u32b r_router; 31 u32b r_lease; 32 char *hostname; 33 } DHCPOPTIONS; 34 35 typedef struct{ 36 u32b ip; 37 u32b router; 38 u32b mask; 39 u32b lease; 40 u32b siaddr; 41 } DHCPLEASE; 42 43 struct _DHCPLIST{ 44 u8b available; 45 u32b xid; 46 u8b chaddr[16]; 47 u8b type; 48 u32b ltime; 49 DHCPLEASE data; 50 struct _DHCPLIST *next; 51 struct _DHCPLIST *back; 52 }; 53 54 typedef struct _DHCPLIST DHCPLIST; 55 56 #endif 57