update sdhcp documentation - sdhcp - simple dhcp client | |
git clone git://git.codemadness.org/sdhcp | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 7c74f27acfe5963ecded3ca444421e691216d5e9 | |
parent 9261d14454972ced5ae7b014b50b0f12eaad8de0 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Mon, 28 Apr 2014 21:17:26 +0000 | |
update sdhcp documentation | |
Signed-off-by: Hiltjo Posthuma <[email protected]> | |
Diffstat: | |
M TODO | 21 +++++++++++++-------- | |
M sdhcp.1 | 35 +++++++++++++++++++++++++++++… | |
2 files changed, 47 insertions(+), 9 deletions(-) | |
--- | |
diff --git a/TODO b/TODO | |
@@ -1,10 +1,9 @@ | |
TODO: | |
[ ] manual check memcpy bounds. | |
- [ ] add flag (-e?) to call a script with vars set (setenv()), not call… | |
[ ] add flag (-s?) to probe a specific DHCP server, not broadcast? | |
probably skip in run() Init: etc stages. | |
[ ] sane default value for client-id and test it. | |
- [ ] add new options to man page (-d, -i, -c). | |
+ [ ] add new options to man page (-d, -i). | |
[ ] update LICENSE. | |
[ ] replace unsigned char ip[4] and so on from function declarations. | |
[?] ipv6 support ? | |
@@ -18,7 +17,7 @@ Changed (for now): | |
-D_BSD_SOURCE added and explicitly added missing headers (ti… | |
- moved man page from sdhcp.8 to sdhcp.1 | |
- typos: | |
- - sdhcp.c: inferface typo. | |
+ - sdhcp.c: interface typo. | |
- sdhcp.1: shdcp typo. | |
- make exit([01]), EXIT_SUCCESS or EXIT_FAILURE. | |
- replace write() for stdout messages with fprintf() | |
@@ -28,8 +27,14 @@ Changed (for now): | |
- make sure on install /sbin and mandir exists. | |
- add config.mk, and follow suckless Makefile style. | |
- add arg.h | |
- - first parameter remaings interface. | |
- - add -d flag, update /etc/resolv.conf (default changed to no). | |
- - add -c flag, set client id, used to be hardcoded to "vaio". | |
- this can also be specified as a second parameter. | |
- - add -i flag, set interface name. | |
+ - first parameter remains interface. | |
+ - second parameter is optional client-id, used to be hardcoded… | |
+ "vaio". | |
+ - add -d flag, don't update /etc/resolv.conf. | |
+ - add -i flag, don't set ip. | |
+ - add -e flag, run program, this has the following variables s… | |
+ $SERVER, DHCP ip. | |
+ $DNS, DNS ip. | |
+ $ROUTER, router ip. | |
+ $MASK, network mask. | |
+ $CLIENT, client ip. | |
diff --git a/sdhcp.1 b/sdhcp.1 | |
@@ -3,11 +3,44 @@ | |
sdhcp \- a simple dhcp client | |
.SH SYNOPSIS | |
.B sdhcp | |
-.RB [interface] | |
+.RB [ \-d ] | |
+.RB [ \-i ] | |
+.RB "[ \-e" | |
+.IR "program" | |
+.RB "]" | |
+.RB "[ " | |
+.IR interface | |
+.RB "]" | |
+.RB "[" | |
+.IR "client\-id" | |
+.RB "]" | |
.SH DESCRIPTION | |
sdhcp is a simple, tiny dhcp client. It runs until it enters the "Bound" | |
state, then forks to the background and runs as a daemon to keep | |
the lease alive. | |
+.SH OPTIONS | |
+.TP | |
+.B \-d | |
+don't change DNS in /etc/resolv.conf. | |
+.TP | |
+.B \-i | |
+don't change interface information such as an IP address. | |
+.TP | |
+.B "\-e program" | |
+run program. Variables will be set, see VARIABLES. | |
+.SH VARIABLES | |
+.LP | |
+The following variables are set: | |
+.LP | |
+$SERVER DHCP IP. | |
+.LP | |
+$DNS DNS IP. | |
+.LP | |
+$ROUTER router IP. | |
+.LP | |
+$MASK network mask. | |
+.LP | |
+$CLIENT your client IP. | |
.SH BUGS | |
I'm sure there's plenty. It only currently supports a small subset of | |
DHCP options, and has been untested on larger networks. It ignores most of |