Commit Graph

696 Commits

Author SHA1 Message Date
Nicholas J. Kain
6f483045f4 Remove redundant #include. 2010-12-26 18:17:41 -05:00
Nicholas J. Kain
0f3d4598ad Add a missing header and remove an unused variable. 2010-12-26 15:06:16 -05:00
Nicholas J. Kain
ea4041983d Use non-blocking sockets for the listen socket. 2010-12-26 15:05:00 -05:00
Nicholas J. Kain
8b97107b8d Allow receive of short dhcp packets over raw listen sockets. 2010-12-26 15:03:14 -05:00
Nicholas J. Kain
08301a7053 Update DESIGN 2010-12-24 10:49:45 -05:00
Nicholas J. Kain
121e4d1510 Fix --hostname option. 2010-12-24 10:44:06 -05:00
Nicholas J. Kain
d96cb14711 Fix stale declaration of arp_check(). 2010-12-24 10:40:46 -05:00
Nicholas J. Kain
87b28de015 Fix --clientid option. 2010-12-24 10:27:24 -05:00
Nicholas J. Kain
c0b699ba88 Rename script.[ch] to ifchange.[ch]. 2010-12-24 10:12:41 -05:00
Nicholas J. Kain
eab048fec7 Remove old files from original ndhc. 2010-12-24 10:04:16 -05:00
Nicholas J. Kain
08f7db1637 Rename clientpacket.c to dhcpmsg.c. 2010-12-24 10:01:12 -05:00
Nicholas J. Kain
d04916aec5 Rename arpping.[ch] to arp.[ch]. 2010-12-24 09:58:47 -05:00
Nicholas J. Kain
8e905d0611 Move background() to sys.[ch]. 2010-12-24 09:47:09 -05:00
Nicholas J. Kain
59a0661eb9 Move change_listen_mode to packet.c. 2010-12-24 09:41:52 -05:00
Nicholas J. Kain
94ad810260 Move timeout and arp handling code out to arpping.c and timeout.c. 2010-12-24 09:32:58 -05:00
Nicholas J. Kain
adcc4bdd3d Move dhcp packet reply code to packet.c. 2010-12-24 08:55:59 -05:00
Nicholas J. Kain
9390e131b6 Move client runtime state structure declaration and flags to config.h. 2010-12-24 07:07:48 -05:00
Nicholas J. Kain
8a3deb3c6a Move dhcp client runtime global state into global struct client_state_t cs. 2010-12-24 07:00:42 -05:00
Nicholas J. Kain
406e316274 Split state machine apart into functions. 2010-12-24 06:31:06 -05:00
Nicholas J. Kain
6772ddac1b Rename dhcpc.h to config.h. 2010-12-24 06:00:37 -05:00
Nicholas J. Kain
d34c5f27b2 Make dhcp client timeout value signed.
Add DHCP_STATE_NULL = 0 state and make LISTEN_NONE = 0.
2010-12-23 13:41:25 -05:00
Nicholas J. Kain
c45d116200 Async arp ping now works properly: arp_success() should be called on timeout
Timeout delta now properly uses signed operators.
listenFd properly initialized to -1.
2010-12-23 11:34:57 -05:00
Nicholas J. Kain
fa98b4c024 timeout values now have millisecond precision. 2010-12-02 00:15:03 -05:00
Nicholas J. Kain
e37ed0e16b arpping() no longer blocks and address verification via arp is now performed
asynchronously in the main event loop.
2010-12-01 23:33:25 -05:00
Nicholas J. Kain
a154f96538 Use epoll() in ndhc. 2010-12-01 13:11:09 -05:00
Nicholas J. Kain
a259640779 Use signalfd() in ndhc. 2010-12-01 12:35:13 -05:00
Nicholas J. Kain
712c8446d6 Update README. 2010-12-01 12:24:47 -05:00
Nicholas J. Kain
f2b4527179 Use epoll() and signalfd() in ifchd. 2010-12-01 12:22:08 -05:00
Nicholas J. Kain
fb56a9cb2b Make sure to #include <stddef.h> when using offsetof(). 2010-11-16 17:41:46 -05:00
Nicholas J. Kain
9dce1a0378 Make sure our assigned address is unique on our segment by using arp. 2010-11-15 20:06:50 -05:00
Nicholas J. Kain
5eb3c18b01 Indentation fix. 2010-11-14 08:49:58 -05:00
Nicholas J. Kain
ba553e5d94 Clean up end_option(), and fix a possible off-by-one in the bound check. 2010-11-14 07:50:21 -05:00
Nicholas J. Kain
5a38e49a81 Update get_option() to use the function from busybox's udhcp variant;
it's much easier to read.  The original one is indecipherable, and thus
it is difficult to verify correctness.
2010-11-14 03:41:36 -05:00
Nicholas J. Kain
1ffd1d9df3 Replace 308 with DHCP_OPTIONS_BUFSIZE in options.c. 2010-11-14 02:02:32 -05:00
Nicholas J. Kain
4ce4323d00 Replace sizeof(struct dhcpMessage) with DHCP_SIZE. 2010-11-14 02:01:17 -05:00
Nicholas J. Kain
9421da3157 Don't zero-pad kernel-packet sent dhcp packets. 2010-11-14 01:56:54 -05:00
Nicholas J. Kain
f8d856cc0a Don't zero-pad sent raw dhcp packets and clean up packet.c. 2010-11-14 01:53:23 -05:00
Nicholas J. Kain
8401d175a1 Remove a Win98 DHCP client bug workaround from get_packet(). 2010-11-14 01:12:32 -05:00
Nicholas J. Kain
0661f4371b Untabify and reindent packet.h. 2010-11-14 00:54:05 -05:00
Nicholas J. Kain
6a3b004eee Specialize init_header() to only handle client packets, move it to
clientpacket.c, and make it static.
2010-11-14 00:52:32 -05:00
Nicholas J. Kain
1cc648b5ad Clean up and comment listen_socket(). 2010-11-14 00:46:02 -05:00
Nicholas J. Kain
86ef084835 Clean up parameter names and comment read_interface(). 2010-11-14 00:41:32 -05:00
Nicholas J. Kain
987ba12982 Enforce upper and lower sanity bounds on lease times.
Add some comments.
2010-11-13 19:37:08 -05:00
Nicholas J. Kain
aaca1ab6ef Formatting fixes. 2010-11-13 19:14:16 -05:00
Nicholas J. Kain
675b527aac Remove some unnecessary memset() and an unused buffer in bound_if(). 2010-11-13 19:07:00 -05:00
Nicholas J. Kain
00ec886737 Ident fix. 2010-11-13 19:04:28 -05:00
Nicholas J. Kain
ef3a69e00e Clean up an unnecessary buffer in perform_release(). 2010-11-13 18:49:46 -05:00
Nicholas J. Kain
f34fac92bd Remove bashism from the gentoo net script. 2010-11-13 16:12:17 -05:00
Nicholas J. Kain
75206dce13 Check for failure in creating listen sockets in change_listen_mode(). 2010-11-13 12:34:22 -05:00
Nicholas J. Kain
faa56bb616 Make change_listen_mode() create a new socket instantly rather than
waiting for select loop to cycle again.  Works better in practice
and simplifies the select loop, too.
2010-11-13 12:30:54 -05:00