45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
|
|
/*
|
|||
|
|
* eth_udp.hpp
|
|||
|
|
*
|
|||
|
|
* Created on: 15 <EFBFBD><EFBFBD><EFBFBD>. 2023 <EFBFBD>.
|
|||
|
|
* Author: sychev
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#ifndef FREE_RTOS_ETHERNET_IP_ETH_UDP_SERVER_HPP_
|
|||
|
|
#define FREE_RTOS_ETHERNET_IP_ETH_UDP_SERVER_HPP_
|
|||
|
|
|
|||
|
|
#include "handler_store/handler_store.hpp"
|
|||
|
|
#include "ethernet_ip/eth_udp_server_iface.hpp"
|
|||
|
|
#include "ethernet_ip/eth_ip_iface.hpp"
|
|||
|
|
#include "ethernet/eth_types.h"
|
|||
|
|
#include <map>
|
|||
|
|
|
|||
|
|
namespace free_rtos {
|
|||
|
|
|
|||
|
|
class EthUdpServer : public Handler, public EthUdpServerIface {
|
|||
|
|
public:
|
|||
|
|
EthUdpServer(EthIpIface& ip_iface);
|
|||
|
|
|
|||
|
|
void setPortId(TEthMacPorts port_id) { port_id_ = port_id;};
|
|||
|
|
|
|||
|
|
virtual std::shared_ptr<EthUpdClient> createClient(uint16_t port_dst,
|
|||
|
|
uint16_t port_src,
|
|||
|
|
bool use_chksum) override;
|
|||
|
|
|
|||
|
|
virtual int32_t Process(uint8_t * p_data, uint32_t len) override;
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
EthIpIface& ip_iface_;
|
|||
|
|
|
|||
|
|
TEthMacPorts port_id_;
|
|||
|
|
|
|||
|
|
std::map<uint16_t, std::shared_ptr<EthUpdClient>> connections_; /// <20><><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
|
|||
|
|
///HandlerStore handlers_; /// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> udp-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endif /* FREE_RTOS_ETHERNET_IP_ETH_UDP_SERVER_HPP_ */
|