1 /* 2 * Copyright (c) Espressif Systems (Shanghai) CO LTD 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without modification, 6 * are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, 9 * this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright notice, 11 * this list of conditions and the following disclaimer in the documentation 12 * and/or other materials provided with the distribution. 13 * 3. Neither the name of the copyright holder nor the names of its contributors 14 * may be used to endorse or promote products derived from this software 15 * without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 * To use these additional DHCP options, make sure this file is included in LWIP_HOOK_FILENAME 29 * and define these hooks: 30 * 31 * #define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset) \ 32 * do { LWIP_UNUSED_ARG(msg); \ 33 * dhcp_parse_extra_opts(dhcp, state, option, len, pbuf, offset); \ 34 * } while(0) 35 * 36 * #define LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr) \ 37 * dhcp_append_extra_opts(netif, state, msg, options_len_ptr); 38 * 39 * To enable (disable) these option, please set one or both of the below macros to 1 (0) 40 * #define LWIP_DHCP_ENABLE_MTU_UPDATE 1 41 * #define LWIP_DHCP_ENABLE_CLIENT_ID 1 42 */ 43 44 #ifndef LWIP_HDR_CONTRIB_ADDONS_DHCP_OPTS_H 45 #define LWIP_HDR_CONTRIB_ADDONS_DHCP_OPTS_H 46 47 /* Add standard integers so the header could be included before lwip */ 48 #include <stdint.h> 49 50 /* Forward declare lwip structs */ 51 struct dhcp; 52 struct pbuf; 53 struct dhcp; 54 struct netif; 55 struct dhcp_msg; 56 57 /* Internal hook functions */ 58 void dhcp_parse_extra_opts(struct dhcp *dhcp, uint8_t state, uint8_t option, uint8_t len, struct pbuf* p, uint16_t offset); 59 void dhcp_append_extra_opts(struct netif *netif, uint8_t state, struct dhcp_msg *msg_out, uint16_t *options_out_len); 60 61 #endif /* LWIP_HDR_CONTRIB_ADDONS_DHCP_OPTS_H */ 62