EtherLib/connection_block.h
2024-04-24 22:23:08 +02:00

36 lines
896 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; ///< Pointer to the packet sieve
PcktSieveLayer * sieveLayer; ///< Sieve layer
} ConnBlock;
typedef struct ConstConnBlock_ {
const PcktSieve * sieve; ///< Pointer to the packet sieve
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