]> git.sur5r.net Git - gsconf/blob - main.c
2e39ff0bb351218da205a1f89d40c81c213196a8
[gsconf] / main.c
1 #include <stdio.h>
2 #include "socket.h"
3
4 #include "gs105e.h"
5 #include <stdlib.h>
6 #include <string.h>
7 #include "shell.h"
8 #include <pwd.h>
9 int shellHandler = 0;
10
11 /*void shellHandlers[] = {
12
13         
14 }*/
15
16
17 int main () {
18         int n;
19         
20         init_socket();
21         
22         myMac = get_mac("eth0");
23         
24         gs105e_init();
25
26         shell();
27         /*
28         printf("Model: %s\n", settings.model);
29         struct vlan * vl = settings.vlans;
30         
31         if (vl == NULL) {
32                 printf("NO Vlans\n");
33         } else
34                 printf("Vlans\n");
35         
36         while (vl != NULL) {
37                 printf("%u\t", vl->id);
38                 for (n = 0; n < 5; n++)
39                         printf("%c\t", vl->members & (0x80 >> n) ? (vl->tag & (0x80 >> n) ? 'T' : 'U') : '-', (unsigned int) vl->members);
40                 printf("\n");
41                 vl = vl->next;
42         }
43         
44         for (n = 0; n < 5; n++) {
45                 printf("Port %u\t%s\t\t%lu Bytes in\t\t%lu Bytes out\n", n + 1, 
46                         (settings.portStatistics[n].state == 0x05 ? "1000 Mbit/s" : (settings.portStatistics[n].state == 0x04 ? "100 Mbit/s" : (settings.portStatistics[n].state == 0x03 ? "10 Mbit/s":  (settings.portStatistics[n].state == 0x00 ? "no connection": "???")))), settings.portStatistics[n].bytesIn, settings.portStatistics[n].bytesOut);
47         }
48         
49         
50         
51         //settings.password = "password";
52         
53         //gs105e_mirrorPorts(3, MSK_PORT1|MSK_PORT4);
54
55         */
56 }
57
58
59
60
61