diff options
author | Niklas | 2011-07-13 17:03:29 +0200 |
---|---|---|
committer | Niklas | 2011-07-13 17:03:29 +0200 |
commit | 5c815484e63280f9fdbe167149a5f693a29945b9 (patch) | |
tree | 6de3b0de48aad83aa151922127c8cba50400e16a /workspace/customdhcpcd/src/client.c | |
parent | added the custom dhcpcd client to git. (diff) | |
download | fbgui-5c815484e63280f9fdbe167149a5f693a29945b9.tar.gz fbgui-5c815484e63280f9fdbe167149a5f693a29945b9.tar.xz fbgui-5c815484e63280f9fdbe167149a5f693a29945b9.zip |
multiple clients possible. inserted something into _send_message
Diffstat (limited to 'workspace/customdhcpcd/src/client.c')
-rw-r--r-- | workspace/customdhcpcd/src/client.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/workspace/customdhcpcd/src/client.c b/workspace/customdhcpcd/src/client.c index 8ce2721..24c8680 100644 --- a/workspace/customdhcpcd/src/client.c +++ b/workspace/customdhcpcd/src/client.c @@ -60,6 +60,9 @@ #include "signal.h" #include "socket.h" +#include "logwriter.h" +#include "status.h" + #ifdef ENABLE_DUID # include "duid.h" #endif @@ -453,6 +456,7 @@ static bool _send_message (state_t *state, int type, const options_t *options) state->last_type = type; state->last_sent = uptime (); + logSendToQt(type); retval = send_message (state->interface, state->dhcp, state->xid, type, options); return (retval == -1 ? false : true); @@ -596,8 +600,9 @@ static bool handle_signal (int sig, state_t *state, const options_t *options) if (! IN_LINKLOCAL (ntohl (state->dhcp->address.s_addr))) { do_socket (state, SOCKET_OPEN); state->xid = (uint32_t) random (); - if ((open_socket (state->interface, false)) >= 0) + if ((open_socket (state->interface, false)) >= 0) { _send_message (state, DHCP_RELEASE, options); + } do_socket (state, SOCKET_CLOSED); } unlink (state->interface->infofile); @@ -847,6 +852,9 @@ static int handle_dhcp (state_t *state, int type, const options_t *options) logger (LOG_ERR, "%d not an ACK or OFFER", type); return (0); } + + /* if we are here, than we received an ACK and can go on with configuration */ + logToQt(STAT_OK, DHCP_ACK, ""); switch (state->state) { case STATE_RENEW_REQUESTED: @@ -1064,6 +1072,7 @@ int dhcp_run (const options_t *options, int *pidfd) if (! options) return (-1); + /*read_interface : defined in interface.c*/ iface = read_interface (options->interface, options->metric); if (! iface) goto eexit; |