36 lines
878 B
C
36 lines
878 B
C
#ifndef ETHERLIB_CONNECTION_BLOCK_H
|
|
#define ETHERLIB_CONNECTION_BLOCK_H
|
|
|
|
#include "packet_sieve.h"
|
|
|
|
struct ConnBlock_;
|
|
|
|
typedef int (*ConnBlockTransmitFn)(struct EthInterface_ * intf, const uint8_t * data, uint32_t size, const struct ConnBlock_ * connBlock);
|
|
|
|
/**
|
|
* Connection block.
|
|
*/
|
|
typedef struct ConnBlock_ {
|
|
PcktSieve * sieve; ///< Ethernet interface
|
|
PcktSieveLayer * sieveLayer; ///< Sieve layer
|
|
} ConnBlock;
|
|
|
|
typedef struct ConstConnBlock_ {
|
|
const PcktSieve * sieve; ///< Ethernet interface
|
|
const PcktSieveLayer * sieveLayer; ///< Sieve layer
|
|
} ConstConnBlock;
|
|
|
|
/**
|
|
* Initialize non-mandatory fields to default values.
|
|
* @param connb
|
|
*/
|
|
void connb_init_defaults(ConnBlock * connb);
|
|
|
|
/**
|
|
* Remove connection block.
|
|
* @param connb pointer to existing connection block
|
|
*/
|
|
void connb_remove(ConnBlock * connb);
|
|
|
|
#endif //ETHERLIB_CONNECTION_BLOCK_H
|