1 /* 2 * Copyright (c) 2022 CHIPSEA Co., Ltd. All rights reserved. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef _LWIPHOOKS_H_ 17 #define _LWIPHOOKS_H_ 18 19 #define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL net_eth_receive 20 21 /** 22 **************************************************************************************** 23 * @brief LWIP hook to process ethernet packet not supported. 24 * 25 * Check if a socket has been created for this (netif, ethertype) couple. 26 * If so push the buffer in the socket buffer list. (no buffer copy is done) 27 * 28 * @param[in] pbuf Buffer containing the ethernet frame 29 * @param[in] netif Pointer to the network interface that received the frame 30 * 31 * @return ERR_OK if a L2 socket exist for this frame and buffer has been successfully 32 * pushed, ERR_MEM/ERR_VAL otherwise. 33 **************************************************************************************** 34 */ 35 err_t net_eth_receive(struct pbuf *pbuf, struct netif *netif); 36 37 #define SO_CONNINFO 0x100c 38 39 #define LWIP_HOOK_SOCKETS_GETSOCKOPT lwip_sockopt_hook 40 41 #endif /* _LWIPHOOKS_H_ */ 42