-PcktSieve special return functionality added -ARP multicast learning bug fixed -include guards have been refactored -Doxygen style tweaked
40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
#ifndef ETHERLIB_UDP_CONNBLOCK_H
|
|
#define ETHERLIB_UDP_CONNBLOCK_H
|
|
|
|
#include <stdint.h>
|
|
#include "../../connection_block.h"
|
|
#include "../../eth_interface.h"
|
|
#include "ipv4_connblock.h"
|
|
#include "../../cbd_table.h"
|
|
|
|
#define UDP_PORT_FROM_FILTCOND(fc) ((fc)->uw[0])
|
|
#define UDP_PORT_TO_FILTCOND(fc,port) (((fc)->uw[0]) = (port))
|
|
|
|
/**
|
|
* Create new IPv4 connection block.
|
|
* @param intf interface to the connection block will be associated
|
|
* @param ipAddr address of the connection block
|
|
* @param port port of the connection block
|
|
* @param cbFn callback function fired when connection block receives data or some event occurs
|
|
* @return instance of a new connection block
|
|
*/
|
|
cbd udp_new_connblock(EthInterface * intf, ip4_addr ipAddr, uint16_t port, SieveCallBackFn cbFn);
|
|
|
|
/**
|
|
* UDP transmit callback.
|
|
* @param connBlock UDP connection block
|
|
* @param data pointer to data buffer
|
|
* @param size data size
|
|
* @param addr remote address to send datagram to
|
|
* @param addr remote port
|
|
*/
|
|
int udp_sendto(cbd connBlock, const uint8_t * data, uint32_t size, ip4_addr addr, uint16_t port);
|
|
|
|
/**
|
|
* Print UDP connblock report.
|
|
* @param connBlock UDP connblock
|
|
*/
|
|
void udp_print_report(const ConnBlock* connBlock);
|
|
|
|
#endif //ETHERLIB_UDP_CONNBLOCK_H
|