summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2006-04-05 13:41:15 +0200
committerMichael Brown2006-04-05 13:41:15 +0200
commit988bb509797ef3b0a68f740f12568fc37e0ac425 (patch)
tree06702f3b7fa3dbb2cc961d8847e2ec8d9afb53ca /src
parentWe don't need to know anything about ARP (diff)
downloadipxe-988bb509797ef3b0a68f740f12568fc37e0ac425.tar.gz
ipxe-988bb509797ef3b0a68f740f12568fc37e0ac425.tar.xz
ipxe-988bb509797ef3b0a68f740f12568fc37e0ac425.zip
Added set_netmask() and set_gateway()
Diffstat (limited to 'src')
-rw-r--r--src/include/gpxe/ip.h2
-rw-r--r--src/proto/ip.c28
2 files changed, 30 insertions, 0 deletions
diff --git a/src/include/gpxe/ip.h b/src/include/gpxe/ip.h
index 3a9716879..29aae5176 100644
--- a/src/include/gpxe/ip.h
+++ b/src/include/gpxe/ip.h
@@ -12,6 +12,8 @@
#include <gpxe/in.h>
extern void set_ipaddr ( struct in_addr address );
+extern void set_netmask ( struct in_addr address );
+extern void set_gateway ( struct in_addr address );
extern void init_tcpip ( void );
extern void run_tcpip ( void );
diff --git a/src/proto/ip.c b/src/proto/ip.c
index 3f46377c4..a0f36d746 100644
--- a/src/proto/ip.c
+++ b/src/proto/ip.c
@@ -32,6 +32,34 @@ void set_ipaddr ( struct in_addr address ) {
}
/**
+ * Set netmask
+ *
+ */
+void set_netmask ( struct in_addr address ) {
+ union {
+ struct in_addr address;
+ uint16_t uip_address[2];
+ } u;
+
+ u.address = address;
+ uip_setnetmask ( u.uip_address );
+}
+
+/**
+ * Set default gateway
+ *
+ */
+void set_gateway ( struct in_addr address ) {
+ union {
+ struct in_addr address;
+ uint16_t uip_address[2];
+ } u;
+
+ u.address = address;
+ uip_setdraddr ( u.uip_address );
+}
+
+/**
* Initialise TCP/IP stack
*
*/