|
@@ -31,6 +31,34 @@ void set_ipaddr ( struct in_addr address ) {
|
31
|
31
|
uip_sethostaddr ( u.uip_address );
|
32
|
32
|
}
|
33
|
33
|
|
|
34
|
+/**
|
|
35
|
+ * Set netmask
|
|
36
|
+ *
|
|
37
|
+ */
|
|
38
|
+void set_netmask ( struct in_addr address ) {
|
|
39
|
+ union {
|
|
40
|
+ struct in_addr address;
|
|
41
|
+ uint16_t uip_address[2];
|
|
42
|
+ } u;
|
|
43
|
+
|
|
44
|
+ u.address = address;
|
|
45
|
+ uip_setnetmask ( u.uip_address );
|
|
46
|
+}
|
|
47
|
+
|
|
48
|
+/**
|
|
49
|
+ * Set default gateway
|
|
50
|
+ *
|
|
51
|
+ */
|
|
52
|
+void set_gateway ( struct in_addr address ) {
|
|
53
|
+ union {
|
|
54
|
+ struct in_addr address;
|
|
55
|
+ uint16_t uip_address[2];
|
|
56
|
+ } u;
|
|
57
|
+
|
|
58
|
+ u.address = address;
|
|
59
|
+ uip_setdraddr ( u.uip_address );
|
|
60
|
+}
|
|
61
|
+
|
34
|
62
|
/**
|
35
|
63
|
* Initialise TCP/IP stack
|
36
|
64
|
*
|