mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-09 17:13:49 +08:00
Continued chrysn's work: changed nearly all functions taking 'ip(X)_addr_t' pointer to take const pointers (changed user callbacks: raw_recv_fn, udp_recv_fn; changed port callbacks: netif_output_fn, netif_igmp_mac_filter_fn)
This commit is contained in:
@@ -263,8 +263,8 @@ LWIP_NETCONN_SCOPE err_t netconn_getaddr(struct netconn *conn, ip_addr_t *addr
|
||||
#define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0)
|
||||
#define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1)
|
||||
|
||||
LWIP_NETCONN_SCOPE err_t netconn_bind(struct netconn *conn, ip_addr_t *addr, u16_t port);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_connect(struct netconn *conn, ip_addr_t *addr, u16_t port);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_connect(struct netconn *conn, const ip_addr_t *addr, u16_t port);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_disconnect (struct netconn *conn);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_listen_with_backlog(struct netconn *conn, u8_t backlog);
|
||||
#define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG)
|
||||
@@ -273,7 +273,7 @@ LWIP_NETCONN_SCOPE err_t netconn_recv(struct netconn *conn, struct netbuf **ne
|
||||
LWIP_NETCONN_SCOPE err_t netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf);
|
||||
LWIP_NETCONN_SCOPE void netconn_recved(struct netconn *conn, u32_t length);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_sendto(struct netconn *conn, struct netbuf *buf,
|
||||
ip_addr_t *addr, u16_t port);
|
||||
const ip_addr_t *addr, u16_t port);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_send(struct netconn *conn, struct netbuf *buf);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_write_partly(struct netconn *conn, const void *dataptr, size_t size,
|
||||
u8_t apiflags, size_t *bytes_written);
|
||||
@@ -283,8 +283,8 @@ LWIP_NETCONN_SCOPE err_t netconn_close(struct netconn *conn);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx);
|
||||
|
||||
#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
|
||||
LWIP_NETCONN_SCOPE err_t netconn_join_leave_group(struct netconn *conn, ip_addr_t *multiaddr,
|
||||
ip_addr_t *netif_addr, enum netconn_igmp join_or_leave);
|
||||
LWIP_NETCONN_SCOPE err_t netconn_join_leave_group(struct netconn *conn, const ip_addr_t *multiaddr,
|
||||
const ip_addr_t *netif_addr, enum netconn_igmp join_or_leave);
|
||||
#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */
|
||||
#if LWIP_DNS
|
||||
err_t netconn_gethostbyname(const char *name, ip_addr_t *addr);
|
||||
|
||||
@@ -56,9 +56,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if LWIP_MPU_COMPATIBLE
|
||||
#define API_MSG_M_DEF(m) m
|
||||
#define API_MSG_M_DEF(m) m
|
||||
#define API_MSG_M_DEF_C(t, m) t m
|
||||
#else /* LWIP_MPU_COMPATIBLE */
|
||||
#define API_MSG_M_DEF(m) *m
|
||||
#define API_MSG_M_DEF(m) *m
|
||||
#define API_MSG_M_DEF_C(t, m) const t * m
|
||||
#endif /* LWIP_MPU_COMPATIBLE */
|
||||
|
||||
/* For the netconn API, these values are use as a bitmask! */
|
||||
@@ -88,7 +90,7 @@ struct api_msg_msg {
|
||||
} n;
|
||||
/** used for lwip_netconn_do_bind and lwip_netconn_do_connect */
|
||||
struct {
|
||||
ip_addr_t API_MSG_M_DEF(ipaddr);
|
||||
API_MSG_M_DEF_C(ip_addr_t, ipaddr);
|
||||
u16_t port;
|
||||
} bc;
|
||||
/** used for lwip_netconn_do_getaddr */
|
||||
@@ -122,8 +124,8 @@ struct api_msg_msg {
|
||||
#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
|
||||
/** used for lwip_netconn_do_join_leave_group */
|
||||
struct {
|
||||
ipX_addr_t API_MSG_M_DEF(multiaddr);
|
||||
ipX_addr_t API_MSG_M_DEF(netif_addr);
|
||||
API_MSG_M_DEF_C(ipX_addr_t, multiaddr);
|
||||
API_MSG_M_DEF_C(ipX_addr_t, netif_addr);
|
||||
enum netconn_igmp join_or_leave;
|
||||
} jl;
|
||||
#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */
|
||||
@@ -167,7 +169,7 @@ struct dns_api_msg {
|
||||
#else /* LWIP_MPU_COMPATIBLE */
|
||||
const char *name;
|
||||
#endif /* LWIP_MPU_COMPATIBLE */
|
||||
/** Rhe resolved address is stored here */
|
||||
/** The resolved address is stored here */
|
||||
ip_addr_t API_MSG_M_DEF(addr);
|
||||
/** This semaphore is posted when the name is resolved, the application thread
|
||||
should wait on it. */
|
||||
|
||||
@@ -57,7 +57,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
err_t ethip6_output(struct netif *netif, struct pbuf *q, ip6_addr_t *ip6addr);
|
||||
err_t ethip6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -91,10 +91,10 @@ void igmp_init(void);
|
||||
err_t igmp_start(struct netif *netif);
|
||||
err_t igmp_stop(struct netif *netif);
|
||||
void igmp_report_groups(struct netif *netif);
|
||||
struct igmp_group *igmp_lookfor_group(struct netif *ifp, ip_addr_t *addr);
|
||||
void igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest);
|
||||
err_t igmp_joingroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr);
|
||||
err_t igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr);
|
||||
struct igmp_group *igmp_lookfor_group(struct netif *ifp, const ip_addr_t *addr);
|
||||
void igmp_input(struct pbuf *p, struct netif *inp, const ip_addr_t *dest);
|
||||
err_t igmp_joingroup(const ip_addr_t *ifaddr, const ip_addr_t *groupaddr);
|
||||
err_t igmp_leavegroup(const ip_addr_t *ifaddr, const ip_addr_t *groupaddr);
|
||||
void igmp_tmr(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -82,9 +82,9 @@ u16_t lwip_chksum_copy(void *dst, const void *src, u16_t len);
|
||||
|
||||
#if LWIP_IPV6
|
||||
u16_t ip6_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
|
||||
ip6_addr_t *src, ip6_addr_t *dest);
|
||||
const ip6_addr_t *src, const ip6_addr_t *dest);
|
||||
u16_t ip6_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
|
||||
u16_t chksum_len, ip6_addr_t *src, ip6_addr_t *dest);
|
||||
u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest);
|
||||
|
||||
#define ipX_chksum_pseudo(isipv6, p, proto, proto_len, src, dest) \
|
||||
((isipv6) ? \
|
||||
|
||||
@@ -162,17 +162,17 @@ PACK_STRUCT_END
|
||||
|
||||
|
||||
#define ip6_init() /* TODO should we init current addresses and header pointer? */
|
||||
struct netif *ip6_route(struct ip6_addr *src, struct ip6_addr *dest);
|
||||
ip6_addr_t *ip6_select_source_address(struct netif *netif, ip6_addr_t * dest);
|
||||
struct netif *ip6_route(const struct ip6_addr *src, const struct ip6_addr *dest);
|
||||
ip6_addr_t *ip6_select_source_address(struct netif *netif, const ip6_addr_t * dest);
|
||||
err_t ip6_input(struct pbuf *p, struct netif *inp);
|
||||
err_t ip6_output(struct pbuf *p, struct ip6_addr *src, struct ip6_addr *dest,
|
||||
u8_t hl, u8_t tc, u8_t nexth);
|
||||
err_t ip6_output_if(struct pbuf *p, struct ip6_addr *src, struct ip6_addr *dest,
|
||||
err_t ip6_output_if(struct pbuf *p, const struct ip6_addr *src, const struct ip6_addr *dest,
|
||||
u8_t hl, u8_t tc, u8_t nexth, struct netif *netif);
|
||||
err_t ip6_output_if_src(struct pbuf *p, struct ip6_addr *src, struct ip6_addr *dest,
|
||||
err_t ip6_output_if_src(struct pbuf *p, const struct ip6_addr *src, const struct ip6_addr *dest,
|
||||
u8_t hl, u8_t tc, u8_t nexth, struct netif *netif);
|
||||
#if LWIP_NETIF_HWADDRHINT
|
||||
err_t ip6_output_hinted(struct pbuf *p, ip6_addr_t *src, ip6_addr_t *dest,
|
||||
err_t ip6_output_hinted(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
|
||||
u8_t hl, u8_t tc, u8_t nexth, u8_t *addr_hint);
|
||||
#endif /* LWIP_NETIF_HWADDRHINT */
|
||||
#if LWIP_IPV6_MLD
|
||||
|
||||
@@ -103,10 +103,10 @@ PACK_STRUCT_END
|
||||
err_t mld6_stop(struct netif *netif);
|
||||
void mld6_report_groups(struct netif *netif);
|
||||
void mld6_tmr(void);
|
||||
struct mld_group *mld6_lookfor_group(struct netif *ifp, ip6_addr_t *addr);
|
||||
struct mld_group *mld6_lookfor_group(struct netif *ifp, const ip6_addr_t *addr);
|
||||
void mld6_input(struct pbuf *p, struct netif *inp);
|
||||
err_t mld6_joingroup(ip6_addr_t *srcaddr, ip6_addr_t *groupaddr);
|
||||
err_t mld6_leavegroup(ip6_addr_t *srcaddr, ip6_addr_t *groupaddr);
|
||||
err_t mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr);
|
||||
err_t mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -345,12 +345,12 @@ extern u32_t retrans_timer;
|
||||
#define nd6_init() /* TODO should we init tables? */
|
||||
void nd6_tmr(void);
|
||||
void nd6_input(struct pbuf *p, struct netif *inp);
|
||||
s8_t nd6_get_next_hop_entry(ip6_addr_t * ip6addr, struct netif * netif);
|
||||
s8_t nd6_select_router(ip6_addr_t * ip6addr, struct netif * netif);
|
||||
u16_t nd6_get_destination_mtu(ip6_addr_t * ip6addr, struct netif * netif);
|
||||
s8_t nd6_get_next_hop_entry(const ip6_addr_t * ip6addr, struct netif * netif);
|
||||
s8_t nd6_select_router(const ip6_addr_t * ip6addr, struct netif * netif);
|
||||
u16_t nd6_get_destination_mtu(const ip6_addr_t * ip6addr, struct netif * netif);
|
||||
err_t nd6_queue_packet(s8_t neighbor_index, struct pbuf * p);
|
||||
#if LWIP_ND6_TCP_REACHABILITY_HINTS
|
||||
void nd6_reachability_hint(ip6_addr_t * ip6addr);
|
||||
void nd6_reachability_hint(const ip6_addr_t * ip6addr);
|
||||
#endif /* LWIP_ND6_TCP_REACHABILITY_HINTS */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -134,7 +134,7 @@ typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p,
|
||||
* @param ipaddr The IPv6 address to which the packet shall be sent
|
||||
*/
|
||||
typedef err_t (*netif_output_ip6_fn)(struct netif *netif, struct pbuf *p,
|
||||
ip6_addr_t *ipaddr);
|
||||
const ip6_addr_t *ipaddr);
|
||||
#endif /* LWIP_IPV6 */
|
||||
/** Function prototype for netif->linkoutput functions. Only used for ethernet
|
||||
* netifs. This function is called by ARP when a packet shall be sent.
|
||||
@@ -151,7 +151,7 @@ typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif,
|
||||
#if LWIP_IPV6 && LWIP_IPV6_MLD
|
||||
/** Function prototype for netif mld_mac_filter functions */
|
||||
typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif,
|
||||
ip6_addr_t *group, u8_t action);
|
||||
const ip6_addr_t *group, u8_t action);
|
||||
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
|
||||
|
||||
/** Generic data structure used for all lwIP network interfaces.
|
||||
|
||||
@@ -123,7 +123,7 @@ struct udp_pcb {
|
||||
|
||||
#if LWIP_IGMP
|
||||
/** outgoing network interface for multicast packets */
|
||||
const ip_addr_t multicast_ip;
|
||||
ip_addr_t multicast_ip;
|
||||
#endif /* LWIP_IGMP */
|
||||
|
||||
#if LWIP_UDPLITE
|
||||
|
||||
Reference in New Issue
Block a user