Check whether "cp" is a valid ascii representation of an IPv6 address and convert to a binary address. Returns 1 if the address is valid, 0 if not.
Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used.
Convert numeric IPv6 address into ASCII representation. returns ptr to static buffer; not reentrant!
Bind an UDP PCB. ipaddr & port are expected to be in the same byte order as in the pcb. @see udp_disconnect()
Join a group on a network interface.
Leave a group on a network interface.
Finds the appropriate network interface for a given IPv6 address. It tries to select a netif following a sequence of heuristics: 1) if there is only 1 netif, return it 2) if the destination is a zoned address, match its zone to a netif 3) if the either the source or destination address is a scoped address, match the source address's zone (if set) or address (if not) to a netif 4) tries to match the destination subnet to a configured address 5) tries to find a router-announced route 6) tries to match the (unscoped) source address to the netif 7) returns the default netif, if configured Note that each of the two given addresses may or may not be properly zoned.
Send data to a specified address using UDP. The netif used for sending can be specified. This function exists mainly for DHCP, to be able to send UDP packets on a netif that is still down. dst_ip & dst_port are expected to be in the same byte order as in the pcb. @see udp_disconnect() udp_send()
Sends an IPv6 packet on a network interface. This function constructs the IPv6 header. If the source IPv6 address is NULL, the IPv6 "ANY" address is used as source (usually during network startup). If the source IPv6 address it IP6_ADDR_ANY, the most appropriate IPv6 address of the outgoing network interface is filled in as source address. If the destination IPv6 address is LWIP_IP_HDRINCL, p is assumed to already include an IPv6 header and p->payload points to it instead of the data.
Send data to a specified address using UDP. dst_ip & dst_port are expected to be in the same byte order as in the pcb. If the PCB already has a remote address association, it will be restored after the data is sent. @see udp_disconnect() udp_send()
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. IPv6 addresses are expected to be in network byte order.
Select the best IPv6 source address for a given destination IPv6 address. This implementation follows RFC 6724 Sec. 5 to the following extent: - Rules 1, 2, 3: fully implemented - Rules 4, 5, 5.5: not applicable - Rule 6: not implemented - Rule 7: not applicable - Rule 8: limited to "prefer /64 subnet match over non-match" For Rule 2, we deliberately deviate from RFC 6724 Sec. 3.1 by considering ULAs to be of smaller scope than global addresses, to avoid that a preferred ULA is picked over a deprecated global address when given a global address as destination, as that would likely result in broken two-way communication. As long as temporary addresses are not supported (as used in Rule 7), a proper implementation of Rule 8 would obviate the need to implement Rule 6.
Search for a neighbor cache entry
Checks if a specific local address is present on the netif and returns its index. Depending on its state, it may or may not be assigned to the interface (as per RFC terminology). The given address may or may not be zoned (i.e., have a zone index other than IP6_NO_ZONE). If the address is zoned, it must have the correct zone for the given netif, or no match will be found.
Send a TCP RESET packet (empty segment with RST flag set) to abort a connection. Called by tcp_abort() (to abort a local connection), tcp_closen() (if not all data has been received by the application), tcp_timewait_input() (if a SYN is received) and tcp_process() (received segment in the wrong state). Since a RST segment is in most cases not sent for an active connection, tcp_rst() has a number of arguments that are taken from a tcp_pcb for most other segment output functions.
Search for a group that is joined on a netif
Search for a destination cache entry
Initialize one of the DNS servers.
Same as udp_sendto_if, but with source address
dns_call_found() - call the found callback and check if there are duplicate entries for the given hostname. If there are any, their found callback will be called and they will be removed.
Calculates the effective send mss that can be used for a specific IP address by calculating the minimum of TCP_MSS and the mtu (if set) of the target netif (if not NULL).
Resolve and fill-in Ethernet address header for outgoing IPv6 packet. For IPv6 multicast, corresponding Ethernet addresses are selected and the packet is transmitted on the link. For unicast addresses, ask the ND6 module what to do. It will either let us send the the packet right away, or queue the packet for later itself, unless an error occurs. @todo anycast addresses
Get the Path MTU for a destination.
Send a neighbor advertisement message
Sets the remote end of the pcb. This function does not generate any network traffic, but only sets the remote address of the pcb. ipaddr & port are expected to be in the same byte order as in the pcb. The udp pcb is bound to a random local port if not already bound. @see udp_disconnect()
Like dns_gethostbyname, but returned address type can be controlled:
Get the local or remote IP address and port of a netconn. For RAW netconns, this returns the protocol instead of a port!
Output a control segment pbuf to IP. Called from tcp_rst, tcp_send_empty_ack, tcp_keepalive and tcp_zero_window_probe, this function combines selecting a netif for transmission, generating the tcp header checksum and calling ip_output_if while handling netif hints and stats.
Same as ip6_output_if() but 'src' address is not replaced by netif address when it is 'any'.
Provide the Neighbor discovery process with a hint that a destination is reachable. Called by tcp_receive when ACKs are received or sent (as per RFC). This is useful to avoid sending NS messages every 30 seconds.
Send an ICMPv6 packet (with srd/dst address and netif given).
Send a neighbor solicitation message
Select a default router for a destination. This function is used both for routing and for finding a next-hop target for a packet. In the former case, the given netif is NULL, and the returned router entry must be for a netif suitable for sending packets (up, link up). In the latter case, the given netif is not NULL and restricts router choice.
Send the raw IP packet to the given address. An IP header will be prepended to the packet, unless the RAW_FLAGS_HDRINCL flag is set on the PCB. In that case, the packet must include an IP header, which will then be sent as is.
Send a TCP RESET packet (empty segment with RST flag set) to show that there is no matching local connection for a received segment. Called by tcp_input() (if no matching local pcb was found) and tcp_listen_input() (if incoming segment has ACK flag set). Since a RST segment is in most cases not sent for an active connection, tcp_rst() has a number of arguments that are taken from a tcp_pcb for most other segment output functions.
Output a control segment pbuf to IP. Called instead of tcp_output_control_segment when we don't have a pcb but we do know the interface to send to.
Change an IPv6 address of a network interface
This function allows for the easy addition of a new IPv6 address to an interface. It takes care of finding an empty slot and then sets the address tentative (to make sure that all the subsequent processing happens).
Join a group on one or all network interfaces. If the group is to be joined on all interfaces, the given group address must not have a zone set (i.e., it must have its zone index set to IP6_NO_ZONE). If the group is to be joined on one particular interface, the given group address may or may not have a zone set.
Leave a group on a network interface. Zoning of address follows the same rules as mld6_joingroup.
Find a router-announced route to the given destination. This route may be based on an on-link prefix or a default router. If a suitable route is found, the returned netif is guaranteed to be in a suitable state (up, link up) to be used for packet transmission.
A packet is to be transmitted to a specific IPv6 destination on a specific interface. Check if we can find the hardware address of the next hop to use for the packet. If so, give the hardware address to the caller, which should use it to send the packet right away. Otherwise, enqueue the packet for later transmission while looking up the hardware address, if possible. As such, this function returns one of three different possible results: - ERR_OK with a non-NULL 'hwaddrp': the caller should send the packet now. - ERR_OK with a NULL 'hwaddrp': the packet has been enqueued for later. - not ERR_OK: something went wrong; forward the error upward in the stack.
Register a new MLD6 membership. On socket close, the membership is dropped automatically. ATTENTION: this function is called from tcpip_thread (or under CORE_LOCK).
Unregister a previously registered MLD6 membership. This prevents dropping the membership on socket close. ATTENTION: this function is called from tcpip_thread (or under CORE_LOCK).
Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. IPv6 addresses are expected to be in network byte order. Will only compute for a portion of the payload.
Fragment an IPv6 datagram if too large for the netif or path MTU. Chop the datagram in MTU sized chunks and send them in order by pointing PBUF_REFs into p
Dummy IPv6 output function for netifs not supporting IPv6
Send an ICMPv6 packet in response to an incoming packet. Call this function if the packet is NOT sent as a direct response to an incoming packet, but rather sometime later (e.g. for a fragment reassembly timeout). The caller must provide the zoned source and destination addresses from the original packet with the src_addr and dest_addr parameters. The reason for this approach is that while the addresses themselves are part of the original packet, their zone information is not, thus possibly resulting in a link-local response being sent over the wrong link.
Find an entry for a default router.
Create a new entry for a default router.
Find the cached entry for an on-link prefix.
Creates a new entry for an on-link prefix.
Determine the next hop for a destination. Will determine if the destination is on-link, else a suitable on-link router is selected. The last entry index is cached for fast entry search.
Binds the connection to a local port number and IP address. If the IP address is not given (i.e., ipaddr == IP_ANY_TYPE), the connection is bound to all local IP addresses. If another connection is bound to the same port, the function will return ERR_USE, otherwise ERR_OK is returned. @see MEMP_NUM_TCP_PCB_LISTEN and MEMP_NUM_TCP_PCB
Connects to another host. The function given as the "connected" argument will be called when the connection has been established. Sets up the pcb to connect to the remote host and sends the initial SYN segment which opens the connection. The tcp_connect() function returns immediately; it does not wait for the connection to be properly setup. Instead, it will call the function specified as the fourth argument (the "connected" argument) when the connection is established. If the connection could not be properly established, either because the other host refused the connection or because the other host didn't answer, the "err" callback function of this pcb (registered with tcp_err, see below) will be called. The tcp_connect() function can return ERR_MEM if no memory is available for enqueueing the SYN segment. If the SYN indeed was enqueued successfully, the tcp_connect() function returns ERR_OK.
Hook to generate an Initial Sequence Number (ISN) for a new TCP connection.
Resolve a hostname (string) into an IP address. NON-BLOCKING callback version for use with raw API!!! Returns immediately with one of err_t return codes: - ERR_OK if hostname is a valid IP address string or the host name is already in the local names table. - ERR_INPROGRESS enqueue a request to be sent to the DNS server for resolution if no errors are present. - ERR_ARG: dns client not initialized or invalid hostname
This function is called from netif.c when address is changed
Initialize one of the NTP servers by IP address
Join multicast groups for UDP netconns.
Join multicast groups for UDP netconns.
Bind a netconn to a specific local IP address and port. Binding one netconn twice might not always be checked correctly!
Connect a netconn to a specific remote IP address and port.
Send the raw IP packet to the given address, using a particular outgoing netif and source IP address. An IP header will be prepended to the packet, unless the RAW_FLAGS_HDRINCL flag is set on the PCB. In that case, the packet must include an IP header, which will then be sent as is.
Bind a RAW PCB. @see raw_disconnect()
Connect an RAW PCB. This function is required by upper layers of lwip. Using the raw api you could use raw_sendto() instead This will associate the RAW PCB with the remote address. @see raw_disconnect() and raw_sendto()
This function is called from netif.c when address is changed or netif is removed
Creates a new address information (addrinfo) structure based on the provided parameters.
Actually send an sntp request to a server.
Receive input function for DNS response packets arriving for the dns UDP pcb.
Look up a hostname in the array of known hostnames.
This function is called from netif.c when address is changed
Helper function for tcp_netif_ip_addr_changed() that iterates a pcb list
Simple interface to ip6_output_if. It finds the outgoing network interface and calls upon ip6_output_if to do the actual work.
Send an icmpv6 'time exceeded' packet, with explicit source and destination addresses. This function may be used to send a response sometime after receiving the packet for which this response is meant. The provided source and destination addresses are used primarily to retain their zone information.
We received a router advertisement that contains a prefix with the autoconfiguration flag set. Add or update an associated autogenerated address.
Send a pbuf doing the necessary SLIP encapsulation Uses the serial layer's sio_send()
Send data (in form of a netbuf) to a specific remote IP address and port. Only to be used for UDP and RAW netconns (not TCP).
Callback function that is called when DNS name is resolved (or on timeout). A waiting application thread is waked up by signaling the semaphore.
Receive callback function for UDP netconns. Posts the packet to conn->recvmbox or deletes it on memory error. @see udp.h (struct udp_pcb.recv) for parameters
Receive callback function for RAW netconns. Doesn't 'eat' the packet, only copies it and sends it to conn->recvmbox @see raw.h (struct raw_pcb.recv) for parameters and return value
DNS found callback when using DNS names as server address.
UDP recv callback for the sntp pcb