61 #define DATAGRAM_ADDRESS_MAX 48
64 #define DATAGRAM_PAYLOAD_MAX 65536
67 #define DATAGRAM_PORT_ANY 0
70 #define DATAGRAM_ADDRESS_BROADCAST "255.255.255.255"
99 int datagram_recv(
struct datagram *d,
char *data,
int length,
char *addr,
int *port,
int timeout);
109 int datagram_send(
struct datagram *d,
const char *data,
int length,
const char *addr,
int port);
int datagram_send(struct datagram *d, const char *data, int length, const char *addr, int port)
Send a datagram.
struct datagram * datagram_create(int port)
Create a new port for sending or receiving datagrams.
int datagram_recv(struct datagram *d, char *data, int length, char *addr, int *port, int timeout)
Receive a datagram.
void datagram_delete(struct datagram *d)
Destroy a datagram port.
struct datagram * datagram_create_address(const char *address, int port)
Create a new address/port for sending or receiving datagrams.
int datagram_fd(struct datagram *d)
Obtain the file descriptor of a datagram object.