esp-idf/docs/en
David Cermak b5d13b9837 lwip/dhcpserver: Support for adding extra opts
This enables users appending an extra, user defined options in dhcp
server messages. Example of adding captive_portal option (160) to dhcp
offer message is provided:
* Add idf-lwip hook file (project makefile):
  idf_component_get_property(lwip lwip COMPONENT_LIB)
  target_compile_options(${lwip} PRIVATE "-I${PROJECT_DIR}/main")
  target_compile_definitions(${lwip} PRIVATE "-DESP_IDF_LWIP_HOOK_FILENAME=\"add_captive_portal.h\"")
* Implement appending (add_captive_portal.h):
  #pragma once
  #define LWIP_HOOK_DHCPS_POST_APPEND_OPTS(netif, dhcp, state, pp_opts) \
  if ((state)==DHCPOFFER) { *(pp_opts) = append_captive_portal_uri(*(pp_opts)); }
  static inline uint8_t *append_captive_portal_uri(uint8_t *optptr)
  {
    const static uint8_t DHCP_OPTION_CAPTIVE_PORTAL=160;
    const static char CAPTIVE_PORTAL_URI[]="my_uri";
    int size = sizeof(CAPTIVE_PORTAL_URI) - 1;
    *optptr++ = DHCP_OPTION_CAPTIVE_PORTAL;
    *optptr++ = size;
    for(int i = 0; i < size; ++i) {
        *optptr++ = CAPTIVE_PORTAL_URI[i];
    }
    return optptr;
  }

Merges https://github.com/espressif/esp-idf/pull/3308
2022-07-26 07:09:22 +00:00
..
_templates doc: Add exact git version & target SoC to feedback form parameters 2020-03-27 11:29:59 +11:00
api-guides lwip/dhcpserver: Support for adding extra opts 2022-07-26 07:09:22 +00:00
api-reference docs: updated documents related to wakeup source, ulp, flash-encryption and memory types 2022-07-25 10:57:40 +08:00
contribute docs: improve ci related docs 2022-07-22 08:18:19 +08:00
get-started docs: deleted IDE documentation and provided links to these IDE GitHub repos 2022-07-07 18:14:26 +08:00
hw-reference docs:updates based on feedbacks 2022-07-22 15:58:09 +08:00
libraries-and-frameworks ASIO: Remove internal component, examples, test and docs 2022-07-04 22:15:24 +04:00
migration-guides esp_system: Add esp_cpu.h migration guide 2022-07-22 00:06:06 +08:00
security docs: updated documents related to wakeup source, ulp, flash-encryption and memory types 2022-07-25 10:57:40 +08:00
third-party-tools docs: fix link_roles not linking correctly for certain files 2020-06-22 20:42:59 +08:00
404.rst docs: update 404.rst 2022-07-04 14:44:29 +08:00
about.rst docs: update redirected links 2022-05-07 13:09:41 +08:00
conf.py docs: update copyright date for docs automatically 2022-01-10 15:05:33 +08:00
COPYRIGHT.rst ASIO: Remove internal component, examples, test and docs 2022-07-04 22:15:24 +04:00
index.rst docs: update redirected links 2022-05-07 13:09:41 +08:00
languages.rst doc:updated cn translation for language.rst and version.rst to provide new layout for version/target select 2021-03-12 16:15:56 +08:00
resources.rst docs: update redirected links 2022-05-07 13:09:41 +08:00
versions.rst docs: update redirected links 2022-05-07 13:09:41 +08:00