aboutsummaryrefslogtreecommitdiffstats
path: root/c/sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/sock.h')
-rw-r--r--c/sock.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/c/sock.h b/c/sock.h
index 1298271..9e4dd40 100644
--- a/c/sock.h
+++ b/c/sock.h
@@ -55,4 +55,11 @@ static void net_close(unsigned char s) {
static void net_poll(void) {
_nr.op = 6; sys_net(&_nr);
}
+/* set our IPv4 address (the DHCP client calls this once it has a lease) */
+static void net_setip(const unsigned char *ip) {
+ unsigned char i;
+ _nr.op = 7;
+ for (i = 0; i < 4; i++) _nr.ip[i] = ip[i];
+ sys_net(&_nr);
+}
#endif