]> git.sur5r.net Git - gsconf/blob - gs105e.h
e89828d405a9ae15c91c33406dfdec3af3c86bc3
[gsconf] / gs105e.h
1 #ifndef GS105E_H
2 #define GS105E_H
3 #include <stdio.h>
4
5 #define GS_MODEL 0x0001
6 #define GS_NAME 0x0003
7 #define GS_MAC 0x0004
8 #define GS_IP 0x0006
9 #define GS_SUBNETMSK 0x0007
10 #define GS_GATEWAY 0x0008
11
12 #define GS_NEWPASSWORD 0x0009
13 #define GS_PASSWORD 0x000a
14
15 #define GS_FIRMWAREVER 0x000d
16
17 #define GS_PACKETSTATISTICS 0x1000
18
19 #define GS_VLAN 0x2800
20 #define GS_PORTSTATUS 0x0c00
21 #define GS_PORTDIAG 0x1c00
22 #define ACT_DHCP 0x000b
23
24
25 #define ACT_ADDVLAN 0x2800
26 #define ACT_DELVLAN 0x2c00
27 #define ACT_RESTART 0x0013
28 #define ACT_PORTMIRROR 0x5c00
29
30
31
32 #define QR_REQ 0x0101
33 #define QR_ANSWER 0x0102
34 #define QR_EXEC 0x0103
35 #define QR_EXECUTED 0x0104
36
37 #define MSK_PORT1 0x80
38 #define MSK_PORT2 0x40
39 #define MSK_PORT3 0x20
40 #define MSK_PORT4 0x10
41 #define MSK_PORT5 0x08
42
43
44 #define DHCP_ON 0x01
45 #define DHCP_OFF 0x00
46 #define DHCP_RENEW 0x02
47
48 int packetId;
49
50 struct vlan {
51         int id;
52         char members;
53         char tag;
54         struct vlan * next;
55 };
56
57 struct portSniffing {
58         char ports;
59         char output;
60 };
61
62 struct portStatistic {
63         char portId;
64         unsigned long bytesIn;
65         unsigned long bytesOut;
66         unsigned long errors;
67         char state;
68         char cableError;
69         char errorDist;
70 };
71
72 struct gs105e_settings {
73         
74         char * password;
75         char * model;
76         
77         char mac[6];
78         char ip[4];
79         char subnetmask[4];
80         char gateway[4];
81         
82         char * name;
83         char * swVersion;
84         
85         char dhcp;
86         
87         struct vlan * vlans;
88         
89
90         
91         struct portStatistic portStatistics[5];
92         
93         struct portSniffing portMonitor;
94         
95         
96 };
97
98
99 struct gs105e_discovered {     
100         int id;
101         char * model;
102         
103         char mac[6];
104         char ip[4];
105         char subnetmask[4];
106         char gateway[4];
107         
108         char * name;
109         struct gs105e_discovered * next;
110 };
111
112
113 struct gs105e_discovered * gs105e_devs ;
114
115 struct gs105e_settings settings;
116
117 void debug(void);
118
119 void gs105e_init(void) ;
120 void makeHeader(unsigned int queryType);
121
122 void gs105e_query (void);
123
124 int gs105e_addVlan(int vlanId) ;
125 int gs105e_delVlan(int vlanId) ;
126 int gs105e_discover(void);
127
128 int gs105e_setName(char * data);
129 #endif