OpenNet
Adapter.h
Go to the documentation of this file.
1 
2 // Product OpenNet
3 
8 
9 #pragma once
10 
11 // Includes
13 
14 // ===== Includes ===========================================================
15 #include <OpenNet/Processor.h>
17 #include <OpenNetK/Adapter_Types.h>
18 
19 namespace OpenNet
20 {
21 
22  class SourceCode;
23  class System ;
24 
25  // Class
27 
35  class Adapter : public StatisticsProvider
36  {
37 
38  public:
39 
48  typedef struct
49  {
50  unsigned int mBufferQty ;
51  unsigned int mPacketSize_byte;
52 
53  // TODO OpenNet.Adapter
54  // Normal (Feature) - Ajouter un "Buffer Factor" pour
55  // allouer un multiple du multiple prefere du Kernel
56  // (division ou multiplication).
57 
58  unsigned char mReserved0[1016];
59  }
60  Config;
61 
64 
65  typedef void(*Event_Callback)(void * aContext, const OpenNetK::Event_Type aType, uint64_t aTimestamp_us, uint32_t aData0, void * aData1);
66 
80  static OPEN_NET_PUBLIC Status Display(const Config & aIn, FILE * aOut);
81 
95  static OPEN_NET_PUBLIC Status Display(const Info & aIn, FILE * aOut);
96 
110  static OPEN_NET_PUBLIC Status Display(const State & aIn, FILE * aOut);
111 
124  virtual Status GetAdapterNo(unsigned int * aOut) = 0;
125 
138  virtual Status GetConfig(Config * aOut) const = 0;
139 
151  virtual Status GetInfo(Info * aOut) const = 0;
152 
162  virtual const char * GetName() const = 0;
163 
176  virtual Status GetState(State * aOut) = 0;
177 
189  virtual bool IsConnected() = 0;
190 
204  virtual bool IsConnected(const System & aSystem) = 0;
205 
206  // TODO OpenNet.Adapter
207  // Normal (Feature) - Ajouter ResetConfig
208 
218  virtual Status ResetInputFilter() = 0;
219 
229  virtual Status ResetProcessor() = 0;
230 
243  virtual Status SetConfig(const Config & aConfig) = 0;
244 
258  virtual Status SetInputFilter(SourceCode * aSourceCode) = 0;
259 
274  virtual Status SetProcessor(Processor * aProcessor) = 0;
275 
286  virtual Status Display(FILE * aOut) const = 0;
287 
303  virtual Status Event_RegisterCallback(Event_Callback aCallback, void * aContext) = 0;
304 
320  virtual Status Packet_Send(const void * aData, unsigned int aSize_byte) = 0;
321 
336  virtual Status Read(void * aOut, unsigned int aOutSize_byte, unsigned int * aInfo_byte) = 0;
337 
345  virtual Status Tx_Disable() = 0;
346 
354  virtual Status Tx_Enable() = 0;
355 
356  protected:
357 
358  Adapter();
359 
360  private:
361 
362  Adapter(const Adapter &);
363 
364  const Adapter & operator = (const Adapter &);
365 
366  };
367 
368 }
virtual Status Tx_Enable()=0
This methode enable packet transmit.
This structure is used to return the information about an adapter.
Definition: Adapter_Types.h:227
This class define the system level interface.
Definition: System.h:34
OpenNet::StatisticsProvider.
Definition: Adapter.h:19
virtual Status Event_RegisterCallback(Event_Callback aCallback, void *aContext)=0
Wait for event.
virtual const char * GetName() const =0
This method returns the adapter's name.
The SourceCode class.
Definition: SourceCode.h:30
virtual Status Read(void *aOut, unsigned int aOutSize_byte, unsigned int *aInfo_byte)=0
This methode read data from the driver.
virtual Status ResetInputFilter()=0
This methode reset the input filter.
This structure is used to return the status.
Definition: Adapter_Types.h:260
virtual Status SetConfig(const Config &aConfig)=0
This methode set the configuration.
static OPEN_NET_PUBLIC Status Display(const Config &aIn, FILE *aOut)
Display.
OpenNet::Processor.
OpenNetK::Adapter_Config, OpenNetK::Adapter_Info, OpenNetK::Adapter_State, OpenNetK::Buffer, OpenNetK::EthernetAddress, OpenNetK::IPv4Address, OpenNetK::VersionInfo (SDK)
virtual Status GetState(State *aOut)=0
This methode returns the state of the adapter.
virtual bool IsConnected()=0
This methode indicate if the adapter is connected to a system.
virtual Status SetInputFilter(SourceCode *aSourceCode)=0
This methode set the input filter.
virtual Status GetInfo(Info *aOut) const =0
This methode returns the information about the adapter.
The configuration.
Definition: Adapter.h:48
virtual Status GetConfig(Config *aOut) const =0
This methode return the configuration of the adapter.
virtual Status Tx_Disable()=0
This methode disable packet transmit.
virtual Status SetProcessor(Processor *aProcessor)=0
This methode associate a processor to the adapter.
The StatisticsProvider class.
Definition: StatisticsProvider.h:30
This class define the adapter level interface.
Definition: Adapter.h:35
virtual Status ResetProcessor()=0
This methode reset the processor.
virtual Status GetAdapterNo(unsigned int *aOut)=0
This methode return the adapter numero.
This class define the processor level interface.
Definition: Processor.h:33
virtual Status Packet_Send(const void *aData, unsigned int aSize_byte)=0
This methode send a packet.