include config.mk
-OBJS=access.o generic.o dump.o names.o filter.o names-hash.o names-parse.o
+OBJS=access.o generic.o dump.o names.o filter.o names-hash.o names-parse.o names-net.o names-cache.o
INCL=internal.h pci.h config.h header.h sysdep.h types.h
PCILIB=libpci.a
PCILIB=libpciutils.a
endif
-# FIXME: Conditions
-OBJS += names-net.o names-cache.o
-
all: $(PCILIB) $(PCILIBPC)
$(PCILIB): $(OBJS)
;;
esac
echo >>$c '#define PCI_HAVE_64BIT_ADDRESS'
+ echo >>$c '#define PCI_USE_DNS'
;;
sunos)
case $cpu in
;;
esac
echo >>$c '#define PCI_HAVE_STDINT_H'
+ echo >>$c '#define PCI_USE_DNS'
;;
freebsd)
echo_n " fbsd-device"
echo >>$c '#define PCI_HAVE_PM_FBSD_DEVICE'
echo >>$c '#define PCI_PATH_FBSD_DEVICE "/dev/pci"'
+ echo >>$c '#define PCI_USE_DNS'
;;
openbsd)
echo_n " obsd-device"
echo >>$c '#define PCI_HAVE_PM_OBSD_DEVICE'
echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"'
+ echo >>$c '#define PCI_USE_DNS'
;;
aix)
echo_n " aix-device"
;;
netbsd)
echo_n " nbsd-libpci"
+ echo >>$c '#define PCI_USE_DNS'
echo >>$c '#define PCI_HAVE_PM_NBSD_LIBPCI'
echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"'
echo >>$m 'PCILIB=lib/libpciutils.a'
gnu)
echo_n " i386-ports"
echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
+ echo >>$c '#define PCI_USE_DNS'
;;
*)
echo " Unfortunately, your OS is not supported by the PCI Library"
#include "internal.h"
#include "names.h"
+#ifdef PCI_USE_DNS
+
static const char cache_version[] = "#PCI-CACHE-1.0";
int
return 1;
}
-void
-pci_id_cache_dirty(struct pci_access *a)
-{
- if (a->id_cache_status >= 1)
- a->id_cache_status = 2;
-}
-
void
pci_id_cache_flush(struct pci_access *a)
{
fclose(f);
}
+#else
+
+int pci_id_cache_load(struct pci_access *a UNUSED, int flags UNUSED)
+{
+ a->id_cache_status = 1;
+ return 0;
+}
+
+void pci_id_cache_flush(struct pci_access *a)
+{
+ a->id_cache_status = 0;
+}
+
+#endif
+
+void
+pci_id_cache_dirty(struct pci_access *a)
+{
+ if (a->id_cache_status >= 1)
+ a->id_cache_status = 2;
+}
+
void
pci_set_id_cache(struct pci_access *a, char *name, int to_be_freed)
{
#include <string.h>
#include <stdlib.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
#include "internal.h"
#include "names.h"
+#ifdef PCI_USE_DNS
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+
char
*pci_id_net_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, int id4)
{
return NULL;
}
+#else
+
+char *pci_id_net_lookup(struct pci_access *a UNUSED, int cat UNUSED, int id1 UNUSED, int id2 UNUSED, int id3 UNUSED, int id4 UNUSED)
+{
+ return NULL;
+}
+
+#endif
+
void
pci_set_net_domain(struct pci_access *a, char *name, int to_be_freed)
{