Browse Source

Support building without wireless support (NO_WIRELESS=1).

r28042
tags/1.10
Colin Watson 16 years ago
parent
commit
1f079a1731
5 changed files with 55 additions and 1 deletions
  1. +4
    -0
      Makefile
  2. +7
    -0
      debian/changelog
  3. +9
    -0
      netcfg-common.c
  4. +4
    -0
      netcfg.c
  5. +31
    -1
      wireless.c

+ 4
- 0
Makefile View File

@@ -5,6 +5,10 @@ LDOPTS = -ldebconfclient -ldebian-installer -liw
CFLAGS = -W -Wall -DNDEBUG
COMMON_OBJS = netcfg-common.o wireless.o

ifeq ($(NO_WIRELESS),)
CFLAGS += -DWIRELESS
endif

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0 -g3
else


+ 7
- 0
debian/changelog View File

@@ -1,3 +1,10 @@
netcfg (1.10) UNRELEASED; urgency=low

* Colin Watson
- Support building without wireless support (NO_WIRELESS=1).

-- Colin Watson <cjwatson@debian.org> Sun, 29 May 2005 11:24:34 +0100

netcfg (1.09) unstable; urgency=low

* Christian Perrier


+ 9
- 0
netcfg-common.c View File

@@ -22,7 +22,11 @@
*/

#include "netcfg.h"
#if defined(WIRELESS)
#include <iwlib.h>
#elif defined(__linux__)
#include <linux/if.h>
#endif
#include <errno.h>
#include <assert.h>
#include <ctype.h>
@@ -34,6 +38,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <cdebconf/debconfclient.h>
#include <debian-installer.h>
#include <time.h>
@@ -55,7 +60,9 @@ int have_domain = 0;

/* File descriptors for ioctls and such */
int skfd = 0;
#ifdef WIRELESS
int wfd = 0;
#endif

/* convert a netmask (255.255.255.0) into the length (24) */
int inet_ptom (const char *src, int *dst, struct in_addr *addrp)
@@ -107,7 +114,9 @@ const char *inet_mtop (int src, char *dst, socklen_t cnt)

void open_sockets (void)
{
#ifdef WIRELESS
wfd = iw_sockets_open();
#endif
skfd = socket (AF_INET, SOCK_DGRAM, 0);
}



+ 4
- 0
netcfg.c View File

@@ -28,7 +28,9 @@
#include <sys/types.h>
#include <cdebconf/debconfclient.h>
#include <debian-installer.h>
#ifdef WIRELESS
#include <iwlib.h>
#endif
#include "netcfg.h"

static method_t netcfg_method = DHCP;
@@ -122,6 +124,7 @@ int main(int argc, char *argv[])
interface_down(*ifaces);
break;
}
#ifdef WIRELESS
else
{
struct wireless_config wc;
@@ -157,6 +160,7 @@ int main(int argc, char *argv[])

interface_down(*ifaces);
}
#endif

interface_down(*ifaces);



+ 31
- 1
wireless.c View File

@@ -5,10 +5,13 @@
*/

#include "netcfg.h"

#ifdef WIRELESS
#include <debian-installer/log.h>
#include <iwlib.h>
#include <sys/types.h>
#include <assert.h>
#endif

/* Wireless mode */
wifimode_t mode = MANAGED;
@@ -17,6 +20,8 @@ wifimode_t mode = MANAGED;
char* wepkey = NULL;
char* essid = NULL;

#ifdef WIRELESS

int is_wireless_iface (const char* iface)
{
wireless_config wc;
@@ -153,7 +158,7 @@ automatic:
return 0;
}

void unset_wep_key (char* iface)
static void unset_wep_key (char* iface)
{
wireless_config wconf;
int ret;
@@ -232,3 +237,28 @@ int netcfg_wireless_set_wep (struct debconfclient * client, char* iface)
return 0;
}

#else

int is_wireless_iface (const char *iface)
{
(void) iface;
return 0;
}

int netcfg_wireless_set_essid (struct debconfclient *client, char *iface, char *priority)
{
(void) client;
(void) iface;
(void) priority;
return 0;
}

int netcfg_wireless_set_wep (struct debconfclient *client, char *iface)
{
(void) client;
(void) iface;
return 0;
}

#endif

Loading…
Cancel
Save