30 lines
991 B
C
30 lines
991 B
C
#ifndef ETHERLIB_IPV4_CONNBLOCK_H
|
|
#define ETHERLIB_IPV4_CONNBLOCK_H
|
|
|
|
#include <stdint.h>
|
|
#include "../../connection_block.h"
|
|
#include "../../eth_interface.h"
|
|
|
|
typedef uint32_t ip4_addr;
|
|
|
|
/**
|
|
* Create new IPv4 connection block.
|
|
* @param intf interface to the connection block will be associated
|
|
* @param ipAddr address of the connection block
|
|
* @param cbFn callback function fired when connection block receives data
|
|
* @return instance of a new connection block
|
|
*/
|
|
ConnBlock ipv4_new_connblock(EthInterface * intf, ip4_addr ipAddr, SieveCallBackFn cbFn);
|
|
|
|
/**
|
|
* Send IPv4 packet to specified IPv4 address.
|
|
* @param intf interface we will use
|
|
* @param addr address to send to
|
|
* @param data data to be transmitted
|
|
* @param size data size
|
|
* @param headers linked list of headers, always list top contains relevant info
|
|
*/
|
|
void ipv4_send(EthInterface * intf, ip4_addr addr, const uint8_t * data, uint32_t size, const PcktHeaderElement * headers);
|
|
|
|
#endif //ETHERLIB_IPV4_CONNBLOCK_H
|