The Pedigree Project  0.1
Lo.h
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef LOOPBACK_H
21 #define LOOPBACK_H
22 
23 #include "pedigree/kernel/machine/Device.h"
24 #include "pedigree/kernel/machine/IrqHandler.h"
25 #include "pedigree/kernel/machine/Network.h"
26 #include "pedigree/kernel/process/Semaphore.h"
27 #include "pedigree/kernel/process/Thread.h"
28 #include "pedigree/kernel/processor/IoBase.h"
29 #include "pedigree/kernel/processor/IoPort.h"
30 #include "pedigree/kernel/processor/types.h"
31 #include "pedigree/kernel/utilities/List.h"
32 
34 class Loopback : public Network
35 {
36  public:
37  Loopback();
38  Loopback(Network *pDev);
39  ~Loopback();
40 
41  Loopback &instance()
42  {
43  return m_Instance;
44  }
45 
46  virtual void getName(String &str)
47  {
48  str = "Loopback";
49  }
50 
51  virtual bool send(size_t nBytes, uintptr_t buffer);
52 
53  virtual bool setStationInfo(StationInfo info);
54 
55  virtual StationInfo getStationInfo();
56 
57  private:
58  static Loopback m_Instance;
59 
60  Loopback(const Loopback &);
61  void operator=(const Loopback &);
62 };
63 
64 #endif
Definition: Lo.h:34
virtual void getName(String &str)
Definition: Lo.h:46
virtual bool send(size_t nBytes, uintptr_t buffer)
Definition: Lo.cc:68
Definition: String.h:49
virtual StationInfo getStationInfo()
Definition: Lo.cc:85