更新日期: 2022/06/01 来源: https://gitee.com/weharmony/kernel_liteos_a_note
fixme.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
3 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 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, this list of
9 * conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 * of conditions and the following disclaimer in the documentation and/or other materials
13 * provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
16 * to endorse or promote products derived from this software without specific prior written
17 * permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef LWIP_HDR_FIXME_H
33#define LWIP_HDR_FIXME_H
34
35#include "lwip/opt.h"
36#include "netif/etharp.h"
37#include "lwip/netif.h"
38
39#define link_rx_drop cachehit
40#define link_tx_drop cachehit
41#define link_rx_overrun cachehit
42#define link_tx_overrun cachehit
43
44#define ip_rx_err cachehit
45#define ip_tx_err cachehit
46#define ip_rx_bytes cachehit
47#define ip_tx_bytes cachehit
48
49#define DUP_ARP_DETECT_TIME 2000 /* 2 seconds period */
50#define NETCONN_PKT_RAW 0x80
51#define SYS_ARCH_ERROR 0x7fffffffUL
52
53#define LWIP_ENABLE_LOS_SHELL_CMD LOSCFG_SHELL
54#define LWIP_SHELL_CMD_PING_RETRY_TIMES 4
55#define LWIP_SHELL_CMD_PING_TIMEOUT 2000
56#define LWIP_MAX_UDP_RAW_SEND_SIZE 65332
57#define LWIP_EXT_POLL_SUPPORT LWIP_SOCKET_POLL
58
59#define ip_addr_set_val(dest, src) do { \
60 IP_SET_TYPE_VAL(*dest, IP_GET_TYPE(src)); \
61 if(IP_IS_V6_VAL(*(src))) { \
62 ip6_addr_set(ip_2_ip6(dest), ip_2_ip6(src)); \
63 } else { \
64 ip4_addr_set(ip_2_ip4(dest), ip_2_ip4(src)); \
65 } \
66 } while (0)
67
68#define ip_addr_ismulticast_val(ipaddr) ((IP_IS_V6_VAL(*ipaddr)) ? \
69 ip6_addr_ismulticast(ip_2_ip6(ipaddr)) : \
70 ip4_addr_ismulticast(ip_2_ip4(ipaddr)))
71
72#define ip_addr_isbroadcast_val(ipaddr, netif) ((IP_IS_V6_VAL(*ipaddr)) ? \
73 0 : \
74 ip4_addr_isbroadcast(ip_2_ip4(ipaddr), netif))
75
76#define ip_addr_netcmp_val(addr1, addr2, mask) ((IP_IS_V6_VAL(*(addr1)) && IP_IS_V6_VAL(*(addr2))) ? \
77 0 : \
78 ip4_addr_netcmp(ip_2_ip4(addr1), ip_2_ip4(addr2), mask))
79
80#define ip6_addr_isnone_val(ip6addr) (((ip6addr).addr[0] == 0xffffffffUL) && \
81 ((ip6addr).addr[1] == 0xffffffffUL) && \
82 ((ip6addr).addr[2] == 0xffffffffUL) && \
83 ((ip6addr).addr[3] == 0xffffffffUL))
84
85#define ip6_addr_isnone(ip6addr) (((ip6addr) == NULL) || ip6_addr_isnone_val(*(ip6addr)))
86
87#define ipaddr_ntoa_unsafe(addr) ((IP_IS_V6_VAL(*addr)) ? ip6addr_ntoa(ip_2_ip6(addr)) : ip4addr_ntoa(ip_2_ip4(addr)))
88
89#ifdef ip6_addr_cmp
90#undef ip6_addr_cmp
91#define ip6_addr_cmp(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \
92 ((addr1)->addr[1] == (addr2)->addr[1]) && \
93 ((addr1)->addr[2] == (addr2)->addr[2]) && \
94 ((addr1)->addr[3] == (addr2)->addr[3]))
95#endif
96
97err_t netif_dhcp_off(struct netif *netif);
98
99err_t netif_do_rmv_ipv6_addr(struct netif *netif, void *arguments);
100
101err_t netif_set_mtu(struct netif *netif, u16_t netif_mtu);
102
103err_t netif_set_hwaddr(struct netif *netif, const unsigned char *hw_addr, int hw_len);
104
105err_t etharp_update_arp_entry(struct netif *netif, const ip4_addr_t *ipaddr, struct eth_addr *ethaddr, u8_t flags);
106
107err_t etharp_delete_arp_entry(struct netif *netif, ip4_addr_t *ipaddr);
108
109err_t lwip_dns_setserver(u8_t numdns, ip_addr_t *dnsserver);
110
111err_t lwip_dns_getserver(u8_t numdns, ip_addr_t *dnsserver);
112
113#if PF_PKT_SUPPORT
114extern struct raw_pcb *pkt_raw_pcbs;
115#endif
116
117#if LWIP_RAW
118extern struct raw_pcb *raw_pcbs;
119#endif
120
121#endif /* LWIP_HDR_FIXME_H */
err_t etharp_delete_arp_entry(struct netif *netif, ip4_addr_t *ipaddr)
Definition: fixme.c:337
err_t lwip_dns_setserver(u8_t numdns, ip_addr_t *dnsserver)
Definition: fixme.c:345
struct raw_pcb * raw_pcbs
Definition: fixme.c:364
err_t netif_set_hwaddr(struct netif *netif, const unsigned char *hw_addr, int hw_len)
Definition: fixme.c:297
err_t netif_dhcp_off(struct netif *netif)
Definition: fixme.c:54
err_t netif_do_rmv_ipv6_addr(struct netif *netif, void *arguments)
Definition: fixme.c:165
err_t etharp_update_arp_entry(struct netif *netif, const ip4_addr_t *ipaddr, struct eth_addr *ethaddr, u8_t flags)
Definition: fixme.c:328
err_t netif_set_mtu(struct netif *netif, u16_t netif_mtu)
Definition: fixme.c:270
struct raw_pcb * pkt_raw_pcbs
Definition: fixme.c:360
err_t lwip_dns_getserver(u8_t numdns, ip_addr_t *dnsserver)
Definition: fixme.c:352