2023-05-03 14:01:32 +03:00
|
|
|
|
/*
|
|
|
|
|
|
* eth_stack_iface.hpp
|
|
|
|
|
|
*
|
2024-02-21 10:41:56 +03:00
|
|
|
|
* Created on: 14 мар. 2023 г.
|
2023-05-03 14:01:32 +03:00
|
|
|
|
* Author: sychev
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef FREE_RTOS_ETHERNET_IP_ETH_STACK_IFACE_HPP_
|
|
|
|
|
|
#define FREE_RTOS_ETHERNET_IP_ETH_STACK_IFACE_HPP_
|
|
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
2023-06-26 18:22:30 +03:00
|
|
|
|
#include "free_rtos/ethernet/eth_types.h"
|
|
|
|
|
|
#include "free_rtos/ethernet/eth_frame.h"
|
2023-10-24 14:02:04 +03:00
|
|
|
|
#include "free_rtos/ethernet/eth_tx_flow_iface.hpp"
|
2023-06-26 18:22:30 +03:00
|
|
|
|
#include "free_rtos/handler_store/handler.hpp"
|
2023-05-03 14:01:32 +03:00
|
|
|
|
|
2023-10-24 14:02:04 +03:00
|
|
|
|
struct EthStackHandlerArgs : public TxFlowHandlerArgs {
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2023-05-03 14:01:32 +03:00
|
|
|
|
class EthStackIface {
|
|
|
|
|
|
public:
|
2024-02-21 10:41:56 +03:00
|
|
|
|
|
2023-05-03 14:01:32 +03:00
|
|
|
|
virtual void set_mac_address(uint64_t mac_addr_be) = 0;
|
|
|
|
|
|
|
2024-02-21 10:41:56 +03:00
|
|
|
|
|
2023-05-03 14:01:32 +03:00
|
|
|
|
virtual void rx_handler(uint8_t * p_data, uint32_t len) = 0;
|
|
|
|
|
|
|
2024-02-21 10:41:56 +03:00
|
|
|
|
|
2023-05-03 14:01:32 +03:00
|
|
|
|
virtual bool send_pkt(TEthMacPorts port_id, uint64_t mac_dst, uint16_t prot_id, TEthPkt& pkt) = 0;
|
|
|
|
|
|
|
2023-10-24 14:02:04 +03:00
|
|
|
|
virtual bool send_pkt(EthStackHandlerArgs& handlerArgs) = 0;
|
2023-06-08 12:27:49 +03:00
|
|
|
|
|
2024-02-21 10:41:56 +03:00
|
|
|
|
|
2023-05-03 14:01:32 +03:00
|
|
|
|
virtual bool Register(uint32_t prot_id, Handler * p_handler) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
virtual ~EthStackIface() {};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* FREE_RTOS_ETHERNET_IP_ETH_STACK_IFACE_HPP_ */
|