25 lines
795 B
C
25 lines
795 B
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"
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
ConnBlock udp_new_connblock(EthInterface * intf, ip4_addr ipAddr, uint16_t port, SieveCallBackFn cbFn);
|
|
|
|
/**
|
|
* UDP transmit callback.
|
|
*/
|
|
int udp_send(const struct ConnBlock_ * connBlock, const uint8_t * data, uint32_t size);
|
|
|
|
#endif //ETHERLIB_UDP_CONNBLOCK_H
|