NetBurner 3.5.0
PDF Version |
|
The NetBurner UDP protocol Socket API. More...
Functions | |
int | CreateRxUdpSocket (uint16_t listening_port) |
Open a UDP socket for receiving incoming UDP packets. | |
int | CreateTxUdpSocket (const IPADDR &send_to_addr, uint16_t remote_port, uint16_t local_port) |
Open a UDP socket for transmitting UDP packets. | |
int | CreateRxTxUdpSocket (const IPADDR &send_to_addr, uint16_t send_to_remote_port, uint16_t local_port) |
Open a UDP socket that can transmit and receive UDP packets. | |
int | sendto (int sock, puint8_t what_to_send, int len_to_send, const IPADDR &to_addr, uint16_t remote_port) |
Send a UDP packet. | |
int | sendtovia (int sock, puint8_t what_to_send, int len_to_send, const IPADDR &to_addr, uint16_t remote_port, int intfnum) |
Send a UDP packet on the specified interface. | |
int | recvfrom (int sock, puint8_t buffer, int len, IPADDR *pAddr, uint16_t *pLocal_port, uint16_t *pRemote_port) |
Receive a UDP packet. | |
int | SendFragmentedUdpPacket (const IPADDR &to, uint16_t source_port, uint16_t dest_port, puint8_t data, int length) |
Send a large fragmented UDP packet. | |
int | CreateRxUdpSocketVia (uint16_t listening_port, int interfacenum) |
Open a UDP socket for receiving incoming UDP packets on the specified network interface, by interface number. | |
int | CreateRxUdpSocketVia (uint16_t listening_port, const IPADDR interfaceIp) |
Open a UDP socket for receiving incoming UDP packets on the network interface with the specified IP address. If more than one interface has the same IP address, the lower interface number is used. | |
int | CreateRxTxUdpSocketVia (const IPADDR send_to_addr, uint16_t send_to_remote_port, uint16_t local_port, int interfacenum) |
Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an interface number. | |
int | CreateRxTxUdpSocketVia (const IPADDR send_to_addr, uint16_t send_to_remote_port, uint16_t local_port, IPADDR interfaceIp) |
Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an IP address. | |
int | CreateTxUdpSocketVia (const IPADDR send_to_addr, uint16_t remote_port, uint16_t local_port, int interfacenum) |
Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface number. | |
int | CreateTxUdpSocketVia (const IPADDR send_to_addr, uint16_t remote_port, uint16_t local_port, IPADDR interfaceIp) |
Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface IP address. | |
The NetBurner UDP protocol Socket API.
#include< udp.h >
|
inline |
#include <udp.h>
Open a UDP socket that can transmit and receive UDP packets.
send_to_addr | Destination IP address |
send_to_remote_port | Destination port number |
local_port | Local port number. A value of 0 will select a random port number (recommended) |
|
inline |
#include <udp.h>
Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an interface number.
send_to_addr | Destination IP address |
send_to_remote_port | Destination port number |
local_port | Local port number. A value of 0 will select a random port number (recommended) |
interfacenum | Local network interface number |
|
inline |
#include <udp.h>
Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an IP address.
send_to_addr | Destination IP address |
send_to_remote_port | Destination port number |
local_port | Local port number. A value of 0 will select a random port number (recommended) |
interfaceIp | IP address of local network interface to use |
int CreateRxUdpSocket | ( | uint16_t | listening_port | ) |
#include <udp.h>
Open a UDP socket for receiving incoming UDP packets.
Returns a file descriptor that can be used by read functions such as: read() and select() to process multiple file descriptors at one time.
listening_port | Port to listen on for incoming packets |
int CreateRxUdpSocketVia | ( | uint16_t | listening_port, |
const IPADDR | interfaceIp ) |
#include <udp.h>
Open a UDP socket for receiving incoming UDP packets on the network interface with the specified IP address. If more than one interface has the same IP address, the lower interface number is used.
Returns a file descriptor that can be used by read functions such as read() and select().
listening_port | Port to listen on for incoming packets |
interfaceIp | IP address of the network interface |
int CreateRxUdpSocketVia | ( | uint16_t | listening_port, |
int | interfacenum ) |
#include <udp.h>
Open a UDP socket for receiving incoming UDP packets on the specified network interface, by interface number.
Returns a file descriptor that can be used by read functions such as read() and select().
listening_port | Port to listen on for incoming packets |
interfacenum | Network interface number |
|
inline |
#include <udp.h>
Open a UDP socket for transmitting UDP packets.
Returns a file descriptor that can be used by transmit functions such as sendto().
send_to_addr | Destination IP address |
remote_port | Destination port number |
local_port | Local port number. A value of 0 will select a random port number (recommended) |
|
inline |
#include <udp.h>
Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface number.
Returns a file descriptor that can be used by transmit functions such as sendto().
send_to_addr | Destination IP address |
remote_port | Destination port number |
local_port | Local port number. A value of 0 will select a random port number (recommended) |
interfacenum | Local network interface number |
|
inline |
#include <udp.h>
Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface IP address.
Returns a file descriptor that can be used by transmit functions such as sendto().
send_to_addr | Destination IP address |
remote_port | Destination port number |
local_port | Local port number. A value of 0 will select a random port number (recommended) |
interfaceIp | IP address of the local network interface |
|
inline |
#include <udp.h>
Receive a UDP packet.
sock | File descriptor from a previous call to CreateRxUdpSocket() or CreateRxTxSocket() |
buffer | Pointer to BYTE array buffer to store received UDP packet data |
len | Maximum number of bytes to receive |
pAddr | Pointer to an IPADDR variable to store the sender's IP address of the packet |
pLocal_port | Pointer to WORD variable to store the local port number of the packet |
pRemote_port | Pointer to WORD variable to store the sender's port number of the packet |
|
inline |
#include <udp.h>
Send a large fragmented UDP packet.
to | Destination IP address |
source_port | Source port number, a value of 0 selects a random source port number (recommended) |
dest_port | Destination port number |
data | Pointer to data to send |
length | Number of bytes to send |
|
inline |
#include <udp.h>
Send a UDP packet.
sock | Socket to send packet to |
what_to_send | Pointer to data to be sent |
len_to_send | Number of data bytes to send |
to_addr | Destination IP address |
remote_port | Destination port number |
|
inline |
#include <udp.h>
Send a UDP packet on the specified interface.
sock | Socket to send packet to |
what_to_send | Pointer to data to be sent |
len_to_send | Number of data bytes to send |
to_addr | Destination IP address |
remote_port | Destination port number |
intfnum | Interface number |