OpenNet
System.h
Aller à la documentation de ce fichier.
1 
2 // Product OpenNet
3 
7 
8 #pragma once
9 
10 // Includes
12 
13 // ===== Includes ===========================================================
14 #include <OpenNet/OpenNet.h>
15 #include <OpenNet/Status.h>
16 #include <OpenNetK/Adapter_Types.h>
17 
18 namespace OpenNet
19 {
20 
21  class Adapter ;
22  class Kernel ;
23  class Processor;
24 
25  // Class
27 
34  class System
35  {
36 
37  public:
38 
47  typedef struct
48  {
49  unsigned int mPacketSize_byte;
50 
51  unsigned char mReserved0[60];
52  }
53  Config;
54 
63  typedef struct
64  {
65  unsigned int mSystemId;
66 
67  unsigned char mReserved0[60];
68  }
69  Info;
70 
84  static OPEN_NET_PUBLIC const unsigned int START_FLAG_LOOPBACK;
85 
98  static OPEN_NET_PUBLIC System * Create();
99 
114  static OPEN_NET_PUBLIC Status Display(const Config & aConfig, FILE * aOut);
115 
130  static OPEN_NET_PUBLIC Status Display(const Info & aInfo, FILE * aOut);
131 
143  virtual Status GetConfig(Config * aOut) const = 0;
144 
155  virtual Status GetInfo(Info * aOut) const = 0;
156 
168  virtual Status SetConfig(const Config & aConfig) = 0;
169 
177  virtual void Delete();
178 
188  virtual Status Adapter_Connect(Adapter * aAdapter) = 0;
189 
196  virtual unsigned int Adapter_GetCount() const = 0;
197 
208  virtual Adapter * Adapter_Get( unsigned int aIndex ) = 0;
209 
222  virtual Adapter * Adapter_Get(OpenNetK::Adapter_Type aType, unsigned int aIndex) = 0;
223 
242  virtual Adapter * Adapter_Get(const unsigned char * aAddress, const unsigned char * aMask, const unsigned char * aMaskDiff) = 0;
243 
253  virtual Status Display(FILE * aOut) = 0;
254 
267  virtual OpenNet::Kernel * Kernel_Get(unsigned int aIndex) = 0;
268 
277  virtual unsigned int Kernel_GetCount() const = 0;
278 
285  virtual unsigned int Processor_GetCount() const = 0;
286 
295  virtual Processor * Processor_Get( unsigned int aIndex ) = 0;
296 
307  virtual Status Start(unsigned int aFlags) = 0;
308 
317  virtual Status Stop() = 0;
318 
319  protected:
320 
321  System();
322 
323  virtual ~System();
324 
325  private:
326 
327  System(const System &);
328 
329  const System & operator = (const System &);
330 
331  };
332 
333 }
Configuration du system.
Definition: System.h:47
virtual Status Start(unsigned int aFlags)=0
Demarrer.
Information au sujet du system.
Definition: System.h:63
Cette classe definit l'interface au niveau systeme.
Definition: System.h:34
virtual unsigned int Kernel_GetCount() const =0
Obtenir le nombre de Kernel.
virtual Adapter * Adapter_Get(unsigned int aIndex)=0
Definition: Adapter.h:19
virtual Status GetConfig(Config *aOut) const =0
Obtenir la configuration du système.
La classe Kernel.
Definition: Kernel.h:38
virtual void Delete()
Cette méthode detruit l'instance.
static OPEN_NET_PUBLIC Status Display(const Config &aConfig, FILE *aOut)
Cette méthode statique affiche la configuration d'un système.
virtual unsigned int Adapter_GetCount() const =0
static OPEN_NET_PUBLIC const unsigned int START_FLAG_LOOPBACK
Utiliser ce drapeau quand des adaptateurs sont physiquement connectés entre eux. Il force le système ...
Definition: System.h:84
OpenNetK::Adapter_Config, OpenNetK::Adapter_Info, OpenNetK::Adapter_State, OpenNetK::Buffer, OpenNetK::EthernetAddress, OpenNetK::IPv4Address, OpenNetK::VersionInfo (SDK)
virtual Processor * Processor_Get(unsigned int aIndex)=0
virtual OpenNet::Kernel * Kernel_Get(unsigned int aIndex)=0
Obtenir un Kernel.
virtual unsigned int Processor_GetCount() const =0
virtual Status Adapter_Connect(Adapter *aAdapter)=0
Connecter un Adapter au System.
virtual Status SetConfig(const Config &aConfig)=0
Changer la configuration du système.
Cette classe définit l'interface au niveau de l'adaptateur.
Definition: Adapter.h:35
virtual Status GetInfo(Info *aOut) const =0
Obtenir l'information au sujet du système.
Cette classe définit l'interface au niveau du processeur.
Definition: Processor.h:33
static OPEN_NET_PUBLIC System * Create()
Cette méthode statique crée une instance de la classe System.
virtual Status Stop()=0
Arreter.