Data Structures | |
struct | fip_udp_listenPortList_t |
This structure holds information on any open "listen" ports. More... | |
Files | |
file | fip_udp.c |
UDP Send/Receive. | |
file | fip_udp.h |
UDP Send/Receive. | |
Defines | |
#define | FIP_CONF_UDP_EPHEMERAL_START 49152 |
Ephemeral UDP port range: Start of Range. | |
#define | FIP_CONF_UDP_EPHEMERAL_END 65535 |
Ephemeral UDP port range: End of Range. | |
#define | FIP_UDP_NUM_CONNS (FIP_CONF_UDP_NUM_CONNS + 1) |
Have one extra connection for "default". | |
Functions | |
static uint16_t | fip_udp_selectNextEphemeral (void) |
Keep track of ephemeral ports used last, and return a new one when called. | |
fip_listenConnNum_t | fip_udp_openListenPort (uint16_t port, void(*udpCallback)(char *), char *parameter, fip_ipnum_t ipnum, fip_ifnum_t ifnum) |
Begin listening on a UDP port. | |
void | fip_udp_closeConnection (fip_listenConnNum_t listen) |
Close a listen connection. | |
void | fip_udp_sendFinish (unsigned int payloadLen) |
Finalize ICMPv6 Packets by calculating the checksum, setting the IPv6 lengths correctly, and marking the packet as ready to send. | |
Variables | |
fip_udp_listenPortList_t | fip_udp_listenPortList [FIP_UDP_NUM_CONNS] |
The list of local ports we are listening on, index '0' is reserved as the default catch-all process if one is assigned. | |
fip_udp_listenPortList_t | fip_udp_listenPortList [(FIP_CONF_UDP_NUM_CONNS+1)] |
The list of local ports we are listening on, index '0' is reserved as the default catch-all process if one is assigned. |
#define FIP_CONF_UDP_EPHEMERAL_START 49152 |
Ephemeral UDP port range: Start of Range.
Ephemeral ports are used by UDP when sending to a remote server, a random port is chosen as the source port. The IANA suggests using 49152 to 65535 as the range, though you can customise this as required.
Referenced by fip_udp_selectNextEphemeral().
#define fip_packet_getPtrToUDPBuf | ( | ) | (fip_packet_getBufPtr(FIP_TLBUF)) |
addtogroup fip_udp
Get a pointer to the UDP Buffer
void fip_udp_closeConnection | ( | fip_listenConnNum_t | listen | ) |
fip_listenConnNum_t fip_udp_openListenPort | ( | uint16_t | port, | |
void(*)(char *) | udpCallback, | |||
char * | parameter, | |||
fip_ipnum_t | ipnum, | |||
fip_ifnum_t | ifnum | |||
) |
Begin listening on a UDP port.
port | Local port to listen on, zero selects ephemeral port | |
udpCallback | Callback when a new UDP packet is received on that port. | |
parameter | This value is passed to the callback function, which can be used to point at any used data required. | |
ipnum | Unicast IP Number port should listen on | |
ifnum | IF Number port should listen on |
References fip_udp_listenPortList_t::dataToPass, FIP_UDP_NUM_CONNS, fip_udp_selectNextEphemeral(), fip_udp_listenPortList_t::ifnum, fip_udp_listenPortList_t::ipnum, fip_udp_listenPortList_t::listenPort, and fip_udp_listenPortList_t::udpProcess.
Referenced by fip_console_udp().
void fip_udp_sendFinish | ( | unsigned int | payloadLen | ) |
Finalize ICMPv6 Packets by calculating the checksum, setting the IPv6 lengths correctly, and marking the packet as ready to send.
payloadLen | Length of the payload written in, this can be smaller than the initial value passed at sendSetup but shouldn't be larger. |
References fip_ipUtils_checksum_pseudo6hdr(), fip_ipUtils_checksum_tl(), fip_packet_getBufPtr, fip_packet_setAttr, fip_packet_setBufSize, fip_packet_setToIP6Hdr_length, fip_udp_Attr, and PS_SEND.
Referenced by fip_console_udp().