Clean up Webserver project - add more Doxygen documentation for the new DHCP client...
[pub/USBasp.git] / Projects / Webserver / Lib / DHCPApp.h
index 9e9faaa..5d11d82 100644 (file)
                #include "../Webserver.h"\r
                \r
        /* Macros: */\r
+               /** UDP listen port for a BOOTP server */\r
                #define DHCPC_SERVER_PORT         67\r
+\r
+               /** UDP listen port for a BOOTP client */\r
                #define DHCPC_CLIENT_PORT         68\r
 \r
+               /** BOOTP message type for a BOOTP REQUEST message */\r
                #define DHCP_OP_BOOTREQUEST       0x01\r
+\r
+               /** BOOTP message type for a BOOTP REPLY message */\r
                #define DHCP_OP_BOOTREPLY         0x02\r
 \r
+               /** BOOTP flag for a BOOTP broadcast message */\r
                #define BOOTP_BROADCAST           0x8000\r
                \r
+               /** Magic DHCP cookie for a BOOTP message to identify it as a DHCP message */\r
                #define DHCP_MAGIC_COOKIE         0x63538263\r
                \r
+               /** Unique transaction ID used to identify DHCP responses to the client */\r
                #define DHCP_TRANSACTION_ID       0x13245466\r
 \r
+               /** DHCP message type for a DISCOVER message */\r
                #define DHCP_DISCOVER             1\r
+\r
+               /** DHCP message type for an OFFER message */\r
                #define DHCP_OFFER                2\r
+\r
+               /** DHCP message type for a REQUEST message */\r
                #define DHCP_REQUEST              3\r
+\r
+               /** DHCP message type for a DECLINE message */\r
                #define DHCP_DECLINE              4\r
+\r
+               /** DHCP message type for an ACK message */\r
                #define DHCP_ACK                  5\r
+\r
+               /** DHCP message type for a NAK message */\r
                #define DHCP_NAK                  6\r
+\r
+               /** DHCP message type for a RELEASE message */\r
                #define DHCP_RELEASE              7\r
 \r
+               /** DHCP medium type for standard Ethernet */\r
                #define DHCP_HTYPE_ETHERNET       1\r
 \r
+               /** DHCP message option for the network subnet mask */\r
                #define DHCP_OPTION_SUBNET_MASK   1\r
+\r
+               /** DHCP message option for the network gateway IP */\r
                #define DHCP_OPTION_ROUTER        3\r
+\r
+               /** DHCP message option for the network DNS server */\r
                #define DHCP_OPTION_DNS_SERVER    6\r
+\r
+               /** DHCP message option for the requested client IP address */\r
                #define DHCP_OPTION_REQ_IPADDR    50\r
+\r
+               /** DHCP message option for the IP address lease time */\r
                #define DHCP_OPTION_LEASE_TIME    51\r
+\r
+               /** DHCP message option for the DHCP message type */\r
                #define DHCP_OPTION_MSG_TYPE      53\r
+               \r
+               /** DHCP message option for the DHCP server IP */               \r
                #define DHCP_OPTION_SERVER_ID     54\r
+\r
+               /** DHCP message option for the list of required options from the server */\r
                #define DHCP_OPTION_REQ_LIST      55\r
+\r
+               /** DHCP message option for the options list terminator */\r
                #define DHCP_OPTION_END           255\r
 \r
        /* Type Defines: */\r
                } DHCP_Header_t;\r
 \r
        /* Enums: */\r
+               /** States for each DHCP connection to a DHCP client. */\r
                enum DHCP_States_t\r
                {\r
-                       DHCP_STATE_SendDiscover,\r
-                       DHCP_STATE_WaitForResponse,\r
-                       DHCP_STATE_SendRequest,\r
-                       DHCP_STATE_WaitForACK,\r
-                       DHCP_STATE_AddressLeased,\r
+                       DHCP_STATE_SendDiscover,  /**< Send DISCOVER packet to retrieve DHCP lease offers */\r
+                       DHCP_STATE_WaitForOffer,  /**< Waiting for OFFER packet giving available DHCP leases */\r
+                       DHCP_STATE_SendRequest,   /**< Send REQUEST packet to request a DHCP lease */\r
+                       DHCP_STATE_WaitForACK,    /**< Wait for ACK packet to complete the DHCP lease */\r
+                       DHCP_STATE_AddressLeased, /**< DHCP address has been leased from a DHCP server */\r
                };\r
 \r
        /* Function Prototypes: */\r
                void DHCPApp_Callback(void);\r
                \r
                uint16_t DHCPApp_FillDHCPHeader(DHCP_Header_t* DHCPHeader, uint8_t DHCPMessageType, uip_udp_appstate_t* AppState);\r
-               uint8_t  DHCPApp_SetOption(uint8_t* DHCPOptionList, uint8_t Option, uint8_t DataLen, void* Source);\r
+               uint8_t  DHCPApp_SetOption(uint8_t* DHCPOptionList, uint8_t Option, uint8_t DataLen, void* OptionData);\r
                bool     DHCPApp_GetOption(uint8_t* DHCPOptionList, uint8_t Option, void* Destination);\r
                \r
 #endif\r