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/dhcpcd.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/dhcpcd.c')
-rw-r--r-- | workspace/customdhcpcd/src/dhcpcd.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/workspace/customdhcpcd/src/dhcpcd.c b/workspace/customdhcpcd/src/dhcpcd.c index 97a685a..fca0bd4 100644 --- a/workspace/customdhcpcd/src/dhcpcd.c +++ b/workspace/customdhcpcd/src/dhcpcd.c @@ -51,6 +51,9 @@ const char copyright[] = "Copyright (c) 2006-2008 Roy Marples"; #include "socket.h" #include "version.h" +#include "logwriter.h" +#include "status.h" + static int doversion = 0; static int dohelp = 0; #define EXTRA_OPTS @@ -198,10 +201,17 @@ int nd_main(char *ifname) #endif */ + /* initializations for the ipc connection to qt*/ + setSocketName(""); + setInterfaceName(ifname); + initQtLoggerSocket(); + + if (strlen (ifname) > IF_NAMESIZE) { logger (LOG_ERR, "`%s' too long for an interface name (max=%d)", ifname, IF_NAMESIZE); + logToQt(STAT_ERROR,-1,"interface name is too long"); goto abort; } else { strlcpy (options->interface, ifname, @@ -223,12 +233,14 @@ int nd_main(char *ifname) if (IN_LINKLOCAL (ntohl (options->request_address.s_addr))) { logger (LOG_ERR, "you are not allowed to request a link local address"); + logToQt(STAT_ERROR, -1, "you are not allowed to request a link local address"); goto abort; } - if (geteuid ()) + if (geteuid ()) { logger (LOG_WARNING, PACKAGE " will not work correctly unless" " run as root"); + } prefix = xmalloc (sizeof (char) * (IF_NAMESIZE + 3)); snprintf (prefix, IF_NAMESIZE, "%s: ", options->interface); @@ -339,6 +351,7 @@ int nd_main(char *ifname) /* Massage our filters per platform */ setup_packet_filters (); + /*dhcp_run : defined in client.c*/ if (dhcp_run (options, &pidfd) == 0) retval = EXIT_SUCCESS; @@ -358,7 +371,7 @@ abort: #endif logger (LOG_INFO, "exiting"); - + logToQt(STAT_INFO, -1, "exiting due abort"); exit (retval); /* NOTREACHED */ } |