FreeRTOS_DHCP_Server.h 961 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _DHCPSERVER_H
  2. #define _DHCPSERVER_H
  3. #ifndef DHCPSERVER_LEASE_TIME
  4. #define DHCPSERVER_LEASE_TIME (864000)
  5. #endif
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /* Start DHCP server.
  10. Static IP of server should already be set and network interface enabled.
  11. first_client_addr is the IP address of the first lease to be handed
  12. to a client. Subsequent lease addresses are calculated by
  13. incrementing the final octet of the IPv4 address, up to max_leases.
  14. */
  15. void dhcpserver_start(const uint8_t ucIPAddress[4], uint32_t first_client_addr, uint8_t max_leases);
  16. /* Stop DHCP server.
  17. */
  18. void dhcpserver_stop(void);
  19. /* Set a router address to send as an option. */
  20. void dhcpserver_set_router(uint32_t router);
  21. /* Set a DNS address to send as an option. */
  22. void dhcpserver_set_dns(uint32_t dns);
  23. uint16_t htons(uint16_t hs);
  24. uint32_t htonl(uint32_t hl);
  25. uint16_t ntohs(uint16_t ns);
  26. uint32_t ntohl(uint32_t nl);
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif