sitara_depot/components/free_rtos/ethernet_ip/eth_ip_iface.hpp

40 lines
960 B
C++
Raw Normal View History

/*
* eth_ip_iface.hpp
*
* Created on: 15 мар. 2023 г.
* Author: sychev
*/
#ifndef FREE_RTOS_ETHERNET_IP_ETH_IP_IFACE_HPP_
#define FREE_RTOS_ETHERNET_IP_ETH_IP_IFACE_HPP_
#include <cstdint>
#include "free_rtos/ethernet/eth_types.h"
#include "free_rtos/ethernet/eth_frame.h"
#include "free_rtos/ethernet_ip/eth_ip_types.h"
#include "free_rtos/ethernet_ip/eth_stack_iface.hpp"
struct IpHandlerArgs : public EthStackHandlerArgs {
uint16_t ip_header_len;
uint16_t ip_data_len;
uint32_t dest_ip;
2023-10-26 13:47:28 +03:00
uint64_t dest_mac;
uint8_t ip_prot_id;
Handler* ip_handler;
};
class EthIpIface {
public:
/**
* Передача пакета
*/
virtual bool send(TEthMacPorts port_id, uint32_t dest_ip, uint8_t prot_id, TEthPkt& pkt) = 0;
virtual bool send(IpHandlerArgs& handlerArgs) = 0;
virtual uint32_t getSelfIpAddr() = 0;
virtual ~EthIpIface() {};
};
#endif /* FREE_RTOS_ETHERNET_IP_ETH_IP_IFACE_HPP_ */