make plan9 optional build, not built by default use make PLAN9=1 to build it
[clinton/Smoothieware.git] / src / libs / Network / uip / Network.h
1 #ifndef _NETWORK_H
2 #define _NETWORK_H
3
4 #include "timer.h"
5 #include "LPC17XX_Ethernet.h"
6 #include "Module.h"
7
8 class Sftpd;
9 class CommandQueue;
10
11 class Network : public Module
12 {
13 public:
14 Network();
15 virtual ~Network();
16
17 void on_module_loaded();
18 void on_idle(void* argument);
19 void on_main_loop(void* argument);
20 void on_get_public_data(void* argument);
21 void dhcpc_configured(uint32_t ipaddr, uint32_t ipmask, uint32_t ipgw);
22 void tapdev_send(void *pPacket, unsigned int size);
23
24 // accessed from C
25 Sftpd *sftpd;
26 struct {
27 bool webserver_enabled:1;
28 bool telnet_enabled:1;
29 bool plan9_enabled:1;
30 bool use_dhcp:1;
31 };
32
33
34 private:
35 void init();
36 void setup_servers();
37 uint32_t tick(uint32_t dummy);
38 void handlePacket();
39
40 CommandQueue *command_q;
41 LPC17XX_Ethernet *ethernet;
42
43 struct timer periodic_timer, arp_timer;
44 char *hostname;
45 volatile uint32_t tickcnt;
46 uint8_t mac_address[6];
47 uint8_t ipaddr[4];
48 uint8_t ipmask[4];
49 uint8_t ipgw[4];
50 };
51
52 #endif