SNMP agent attached to SPI slave
udp.c File Reference
User Datagram Protocol module v0.1: Debug statements in udp_connect. More...
Go to the source code of this file.
Functions | |
void | udp_input (struct pbuf *p, struct netif *inp) |
Process an incoming UDP datagram. |
Detailed Description
User Datagram Protocol module v0.1: Debug statements in udp_connect.
Definition in file udp.c.
Function Documentation
void udp_input | ( | struct pbuf * | p, |
struct netif * | inp | ||
) |
Process an incoming UDP datagram.
Given an incoming UDP datagram (as a chain of pbufs) this function finds a corresponding UDP PCB and hands over the pbuf to the pcbs recv function. If no pcb is found or the datagram is incorrect, the pbuf is freed.
- Parameters:
-
p pbuf to be demultiplexed to a UDP PCB. inp network interface on which the datagram was received.
Send data using UDP.
- Parameters:
-
pcb UDP PCB used to send the data. p chain of pbuf's to be sent.
The datagram will be sent to the current remote_ip & remote_port stored in pcb. If the pcb is not bound to a port, it will automatically be bound to a random port.
- Returns:
- lwIP error code.
- ERR_OK. Successful. No error occured.
- ERR_MEM. Out of memory.
- ERR_RTE. Could not find route to destination address.
- More errors could be returned by lower protocol layers.
- See also:
- udp_disconnect() udp_sendto()
Same as udp_send() but with checksum
Send data to a specified address using UDP.
- Parameters:
-
pcb UDP PCB used to send the data. p chain of pbuf's to be sent. dst_ip Destination IP address. dst_port Destination UDP port.
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.
- Returns:
- lwIP error code (
- See also:
- udp_send for possible error codes)
- udp_disconnect() udp_send()
Same as udp_sendto(), but with checksum
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.
- Parameters:
-
pcb UDP PCB used to send the data. p chain of pbuf's to be sent. dst_ip Destination IP address. dst_port Destination UDP port. netif the netif used for sending.
dst_ip & dst_port are expected to be in the same byte order as in the pcb.
- Returns:
- lwIP error code (
- See also:
- udp_send for possible error codes)
- udp_disconnect() udp_send()
Same as udp_sendto_if(), but with checksum
Generated on Tue Jul 12 2022 19:17:35 by 1.7.2