KolibriLib
Loading...
Searching...
No Matches
network.hpp
1#ifndef __NETWORK_H__
2#define __NETWORK_H__
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <sys/ksys.h>
7
8#include "childWindow.hpp"
9
12namespace KolibriLib
13{
14
16 namespace Network
17 {
18
20 namespace Devices
21 {
24 inline int GetDevicesAmount()
25 {
26 int amount;
27 asm_inline(
28 "int $0x40"
29 :"=a"(amount)
30 :"a"(74), "b"(-1)
31 );
32 return amount;
33 }
34
38 inline int GetDeviceType(const int device)
39 {
40 int type;
41 asm_inline(
42 "int $0x40"
43 :"=a"(type)
44 :"a"(74), "b"(0)
45 );
46 return type;
47 }
48
52 inline std::string GetDeviceName(const int Device)
53 {
54 int abc;
55 void *buff = malloc(64);
56 asm_inline(
57 "int $0x40"
58 :"=a"(abc)
59 :"a"(74), "b"((1 << 16) + Device), "c"(buff)
60 );
61 return std::string((char*)buff);
62 }
63
67 int ResetDevice(const unsigned Device)
68 {
69 int error;
70 void *ptr = malloc(64);
71 asm_inline(
72 "int $0x40"
73 :"=a"(error)
74 :"a"(74), "b"((2 << 16) + Device), "c"(ptr)
75 );
76 return error;
77 }
78
81 {
82 private:
83 unsigned _device;
84 public:
85 NetDevice(/* args */);
86 ~NetDevice();
87
90 std::string GetName();
91
94 int Reset();
95 };
96
97 NetDevice::NetDevice(/* args */)
98 {
99 }
100
101 NetDevice::~NetDevice()
102 {
103 }
104
105 } // namespace Devices
106
107
108 } // namespace network
109
110} // namespace KolibriLib
111
112
113#endif // __NETWORK_H__
Класс для работы с сетевыми устройствами
Definition network.hpp:81
std::string GetName()
Получить имя устройства
int Reset()
Сбросить устройство
int ResetDevice(const unsigned Device)
Сбросить устройство
Definition network.hpp:67
std::string GetDeviceName(const int Device)
Получить имя устройства
Definition network.hpp:52
int GetDevicesAmount()
Получить кол-во сетевых устройств
Definition network.hpp:24
int GetDeviceType(const int device)
Получить тип устройства
Definition network.hpp:38
Основное пространство имён
Definition base.hpp:17