Author: tjansen Date: Wed Oct 21 13:54:10 2009 New Revision: 1254 Log: Removed unused modules from libpisa: iw.c iwlib.c and buffer.c They were used in preauth code and are no longer necessary. One exception is the PISA_STRNCPY macro, that was used in several places. As it's only purpose was to wrap strncpy and make code less readable in the process I substitued PISA_STRNCPY with strncpy. By removing iwlib.{c,h} and wireless.h we have less dependencies on external code and foreign licenses in PISA. Deleted: trunk/include/buffer.h trunk/include/iwlib.h trunk/include/wireless.h trunk/libpisa/buffer.c trunk/libpisa/iw.c trunk/libpisa/iwlib.c Modified: trunk/LICENSE trunk/Makefile.am trunk/libpisa/Makefile.am trunk/libpisa/util.c trunk/pisacd/cdconf.c trunk/pisacd/cdctx.c trunk/pisacd/cdctx.h trunk/pisacd/cdmain.c trunk/pisasd/sdconf.c trunk/pisasd/sdctx.c trunk/pisasd/sdmain.c trunk/test/Makefile.am Modified: trunk/LICENSE ============================================================================== --- trunk/LICENSE Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/LICENSE Wed Oct 21 13:54:10 2009 (r1254) @@ -8,11 +8,5 @@ 3-clause BSD license: include/uthash.h - -GPL (any version): -libpisa/iwlib.c -include/iwlib.h -include/wireless.h - GPL (version 2): test/packaging/create-package.sh Modified: trunk/Makefile.am ============================================================================== --- trunk/Makefile.am Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/Makefile.am Wed Oct 21 13:54:10 2009 (r1254) @@ -28,7 +28,6 @@ pisainclude_HEADERS= \ include/ac_config.h \ include/arp.h \ - include/buffer.h \ include/checksum.h \ include/config.h \ include/conmgr.h \ @@ -38,7 +37,6 @@ include/dhcp.h \ include/global.h \ include/hitlist.h \ - include/iwlib.h \ include/linkedlist.h \ include/log.h \ include/nat.h \ @@ -53,8 +51,7 @@ include/token.h \ include/tunnel.h \ include/uthash.h \ - include/util.h \ - include/wireless.h + include/util.h deb rpm: test/packaging/create-package.sh $@ Modified: trunk/libpisa/Makefile.am ============================================================================== --- trunk/libpisa/Makefile.am Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/libpisa/Makefile.am Wed Oct 21 13:54:10 2009 (r1254) @@ -4,8 +4,8 @@ # Author: Dongsu Park <dpark1978@xxxxxxxxx> lib_LTLIBRARIES = libpisa.la -libpisa_la_SOURCES = arp.c buffer.c config.c conmgr.c crypto.c -libpisa_la_SOURCES += ctrlhandler.c debug.c hitlist.c iw.c iwlib.c linkedlist.c +libpisa_la_SOURCES = arp.c config.c conmgr.c crypto.c +libpisa_la_SOURCES += ctrlhandler.c debug.c hitlist.c linkedlist.c libpisa_la_SOURCES += nat.c packet.c socket.c token.c tunnel.c util.c libpisa_la_SOURCES += pisaconf.c scheduler.c if PISA_LOGGING Modified: trunk/libpisa/util.c ============================================================================== --- trunk/libpisa/util.c Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/libpisa/util.c Wed Oct 21 13:54:10 2009 (r1254) @@ -25,7 +25,6 @@ #include <ctype.h> #include "debug.h" -#include "buffer.h" #include "util.h" #define MAX_FILENAME 1024 @@ -442,7 +441,7 @@ char data[MAX_BUF]; int err = 0, pid = 0, ret, result = FALSE; - PISA_STRNCPY(filename, HIPD_LOCKFILE, MAX_FILENAME); + strncpy(filename, HIPD_LOCKFILE, MAX_FILENAME); err = stat(filename, &file_stat); if (err && errno == ENOENT) { @@ -678,7 +677,7 @@ char *pp; /* skip alphanumeric characters */ - for (pp = instr; *pp && !PISA_ISSPACE(*pp); pp++); + for (pp = instr; *pp && !isspace(*pp); pp++); /* now pp points to a space character */ *pp = '\0'; @@ -733,7 +732,7 @@ { /* With regard to the address family, convert ipaddr_str into sa. */ if (ipaddr_ca->saf == AF_INET) { - PISA_STRNCPY(ipaddr_str, inet_ntoa(ipaddr_ca->sa.sa4), INET_ADDRSTRLEN); + strncpy(ipaddr_str, inet_ntoa(ipaddr_ca->sa.sa4), INET_ADDRSTRLEN); } else if (ipaddr_ca->saf == AF_INET6) { inet_ntop(AF_INET6, &ipaddr_ca->sa.sa6, ipaddr_str, INET6_ADDRSTRLEN); Modified: trunk/pisacd/cdconf.c ============================================================================== --- trunk/pisacd/cdconf.c Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/pisacd/cdconf.c Wed Oct 21 13:54:10 2009 (r1254) @@ -12,7 +12,6 @@ #include "debug.h" #include "config.h" -#include "iwlib.h" #include "cdconf.h" #include "util.h" #include "cdctx.h" @@ -73,7 +72,7 @@ /* Use default path if no config file was given via commandline argument */ if (cdconf->conffile[0] == '\0') { pisa_check_and_create_dir(PISA_CONFDIR_PATH, DEFAULT_CONFIG_DIR_MODE); - PISA_STRNCPY(cdconf->conffile, PISACD_CONFFILE_FULLPATH, sizeof(cdconf->conffile)); + strncpy(cdconf->conffile, PISACD_CONFFILE_FULLPATH, sizeof(cdconf->conffile)); } if (pisa_cfg_setup_file(cdconf->conffile) <= 0) { @@ -110,7 +109,7 @@ if (*cdconf->debuglevel == '\0') { if (!pisa_cfg_get_string_value("debuglevel", cdconf->debuglevel, sizeof(cdconf->debuglevel))) { PISA_DEBUG(PL_CONFIG, "Using the default debuglevel %s\n", PISACD_DEFAULT_DEBUGLEVEL); - PISA_STRNCPY(cdconf->debuglevel, PISACD_DEFAULT_DEBUGLEVEL, sizeof(cdconf->debuglevel)); + strncpy(cdconf->debuglevel, PISACD_DEFAULT_DEBUGLEVEL, sizeof(cdconf->debuglevel)); } } } Modified: trunk/pisacd/cdctx.c ============================================================================== --- trunk/pisacd/cdctx.c Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/pisacd/cdctx.c Wed Oct 21 13:54:10 2009 (r1254) @@ -10,7 +10,6 @@ * @date Jan. 2009 */ -#include "iwlib.h" #include "cdctx.h" #include "cdconf.h" #include "util.h" Modified: trunk/pisacd/cdctx.h ============================================================================== --- trunk/pisacd/cdctx.h Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/pisacd/cdctx.h Wed Oct 21 13:54:10 2009 (r1254) @@ -14,7 +14,6 @@ #define PISA_CDCTX_H #include "global.h" -#include "buffer.h" #include "conmgr.h" #include "ctrlhandler.h" #include "linkedlist.h" Modified: trunk/pisacd/cdmain.c ============================================================================== --- trunk/pisacd/cdmain.c Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/pisacd/cdmain.c Wed Oct 21 13:54:10 2009 (r1254) @@ -303,7 +303,7 @@ while ((c = getopt_long(argc, argv, OPTS, cd_longopts, &option_index)) != -1) { switch (c) { case 'f': - PISA_STRNCPY(cd_cfg.conffile, optarg, sizeof(cd_cfg.conffile)); + strncpy(cd_cfg.conffile, optarg, sizeof(cd_cfg.conffile)); break; case 'p': cd_cfg.port_control = atoi(optarg); @@ -315,7 +315,7 @@ cd_ctx.is_bgrun = TRUE; break; case 'd': - PISA_STRNCPY(cd_cfg.debuglevel, "all", sizeof(cd_cfg.debuglevel)); + strncpy(cd_cfg.debuglevel, "all", sizeof(cd_cfg.debuglevel)); break; case 'v': cd_print_version(); Modified: trunk/pisasd/sdconf.c ============================================================================== --- trunk/pisasd/sdconf.c Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/pisasd/sdconf.c Wed Oct 21 13:54:10 2009 (r1254) @@ -12,7 +12,6 @@ #include "config.h" #include "debug.h" -#include "buffer.h" #include "hitlist.h" #include "sdconf.h" #include "util.h" @@ -84,7 +83,7 @@ /* Use default path if no config file was given per commandline argument */ if (sdconf->conffile[0] == '\0') { pisa_check_and_create_dir(PISA_CONFDIR_PATH, DEFAULT_CONFIG_DIR_MODE); - PISA_STRNCPY(sdconf->conffile, PISASD_CONFFILE_FULLPATH, sizeof(sdconf->conffile)); + strncpy(sdconf->conffile, PISASD_CONFFILE_FULLPATH, sizeof(sdconf->conffile)); } if (pisa_cfg_setup_file(sdconf->conffile) <= 0) { @@ -136,7 +135,7 @@ if (!pisa_cfg_get_string_value("debuglevel", sdconf->debuglevel, sizeof(sdconf->debuglevel))) { PISA_DEBUG("Using the default debuglevel %s\n", PISASD_DEFAULT_DEBUGLEVEL); - PISA_STRNCPY(sdconf->debuglevel, PISASD_DEFAULT_DEBUGLEVEL, sizeof(sdconf->debuglevel)); + strncpy(sdconf->debuglevel, PISASD_DEFAULT_DEBUGLEVEL, sizeof(sdconf->debuglevel)); } } } @@ -166,7 +165,7 @@ if (!pisa_cfg_get_string_value("interface_eth", sdconf->ifname_eth, sizeof(sdconf->ifname_eth))) { PISA_DEBUG("Using the default ethernet interface name %s\n", PISASD_DEFAULT_IFNAME_ETH); - PISA_STRNCPY(sdconf->ifname_eth, PISASD_DEFAULT_IFNAME_ETH, sizeof(sdconf->ifname_eth)); + strncpy(sdconf->ifname_eth, PISASD_DEFAULT_IFNAME_ETH, sizeof(sdconf->ifname_eth)); } } } @@ -250,7 +249,7 @@ */ if (authorized_cfg_file[0] == '\0') { pisa_check_and_create_dir(PISA_CONFDIR_PATH, DEFAULT_CONFIG_DIR_MODE); - PISA_STRNCPY(authorized_cfg_file, PISA_AUTHORIZED_HOSTS_CONFFILE_FULLPATH, sizeof(authorized_cfg_file)); + strncpy(authorized_cfg_file, PISA_AUTHORIZED_HOSTS_CONFFILE_FULLPATH, sizeof(authorized_cfg_file)); } if (pisa_cfg_authorized_hosts_setup_file(authorized_cfg_file) <= 0) { Modified: trunk/pisasd/sdctx.c ============================================================================== --- trunk/pisasd/sdctx.c Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/pisasd/sdctx.c Wed Oct 21 13:54:10 2009 (r1254) @@ -13,7 +13,6 @@ #include "sdctx.h" #include "sdconf.h" #include "util.h" -#include "buffer.h" /** * sd_ctx contains all of the necessary information about the current Modified: trunk/pisasd/sdmain.c ============================================================================== --- trunk/pisasd/sdmain.c Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/pisasd/sdmain.c Wed Oct 21 13:54:10 2009 (r1254) @@ -24,7 +24,6 @@ #include <unistd.h> #include "config.h" -#include "buffer.h" #include "socket.h" #include "tunnel.h" #include "util.h" @@ -337,15 +336,15 @@ switch (c) { case 'f': - PISA_STRNCPY(sd_cfg.conffile, optarg, sizeof(sd_cfg.conffile)); + strncpy(sd_cfg.conffile, optarg, sizeof(sd_cfg.conffile)); break; case 'a': - PISA_STRNCPY(authorized_cfg_file,optarg,sizeof(authorized_cfg_file)); + strncpy(authorized_cfg_file,optarg,sizeof(authorized_cfg_file)); break; case 'i': - PISA_STRNCPY(sd_cfg.ifname_eth, optarg, sizeof(sd_cfg.ifname_eth)); + strncpy(sd_cfg.ifname_eth, optarg, sizeof(sd_cfg.ifname_eth)); break; case 'p': @@ -361,7 +360,7 @@ break; case 'd': - PISA_STRNCPY(sd_cfg.debuglevel, "all", sizeof(sd_cfg.debuglevel)); + strncpy(sd_cfg.debuglevel, "all", sizeof(sd_cfg.debuglevel)); break; case 'v': Modified: trunk/test/Makefile.am ============================================================================== --- trunk/test/Makefile.am Wed Oct 21 13:22:45 2009 (r1253) +++ trunk/test/Makefile.am Wed Oct 21 13:54:10 2009 (r1254) @@ -11,9 +11,6 @@ bin_PROGRAMS = checkhipd bin_PROGRAMS += getns bin_PROGRAMS += ifaddr -bin_PROGRAMS += ifdefgw -bin_PROGRAMS += iwessid -bin_PROGRAMS += iwlist bin_PROGRAMS += udpserver bin_PROGRAMS += udpclient @@ -37,10 +34,5 @@ checkhipd_SOURCES = checkhipd.c getns_SOURCES = getns.c ifaddr_SOURCES = ifaddr.c -ifdefgw_SOURCES = ifdefgw.c - -iwessid_SOURCES = iwessid.c -iwlist_SOURCES = iwlist.c - udpserver_SOURCES = udpserver.c udpclient_SOURCES = udpclient.c