Removed untested/unsupported NetBSD-related code (#694)

This commit is contained in:
Uwe Seimet 2022-02-23 04:07:06 +01:00 committed by GitHub
parent cd0baa4676
commit 7290803ace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 0 additions and 83 deletions

View File

@ -6,7 +6,6 @@
// Powered by XM6 TypeG Technology. // Powered by XM6 TypeG Technology.
// Copyright (C) 2016-2020 GIMONS // Copyright (C) 2016-2020 GIMONS
// //
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
// Imported sava's bugfix patch(in RASDRV DOS edition). // Imported sava's bugfix patch(in RASDRV DOS edition).
// //
// [ Host File System for the X68000 ] // [ Host File System for the X68000 ]
@ -30,21 +29,11 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#define IC_BUF_SIZE 1024 #define IC_BUF_SIZE 1024
static char convert_buf[IC_BUF_SIZE]; static char convert_buf[IC_BUF_SIZE];
#ifndef __NetBSD__
// Using POSIX.1 compliant iconv(3)
#define CONVERT(src, dest, inbuf, outbuf, outsize) \ #define CONVERT(src, dest, inbuf, outbuf, outsize) \
convert(src, dest, (char *)inbuf, outbuf, outsize) convert(src, dest, (char *)inbuf, outbuf, outsize)
static void convert(char const *src, char const *dest, static void convert(char const *src, char const *dest,
char *inbuf, char *outbuf, size_t outsize) char *inbuf, char *outbuf, size_t outsize)
#else
// Using NetBSD version of iconv(3): The second argument is 'const char **'
#define CONVERT(src, dest, inbuf, outbuf, outsize) \
convert(src, dest, inbuf, outbuf, outsize)
static void convert(char const *src, char const *dest,
const char *inbuf, char *outbuf, size_t outsize)
#endif
{ {
#ifndef __APPLE__
*outbuf = '\0'; *outbuf = '\0';
size_t in = strlen(inbuf); size_t in = strlen(inbuf);
size_t out = outsize - 1; size_t out = outsize - 1;
@ -61,7 +50,6 @@ static void convert(char const *src, char const *dest,
iconv_close(cd); iconv_close(cd);
*outbuf = '\0'; *outbuf = '\0';
#endif //ifndef __APPLE__
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@ -7,8 +7,6 @@
// Copyright (C) 2016-2020 GIMONS // Copyright (C) 2016-2020 GIMONS
// Copyright (C) akuker // Copyright (C) akuker
// //
// Imported NetBSD support and some optimisation patches by Rin Okuyama.
//
// [ TAP Driver ] // [ TAP Driver ]
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -47,8 +45,6 @@ CTapDriver::CTapDriver()
// Initialization // Initialization
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#ifdef __linux__
static bool br_setif(int br_socket_fd, const char* bridgename, const char* ifname, bool add) { static bool br_setif(int br_socket_fd, const char* bridgename, const char* ifname, bool add) {
struct ifreq ifr; struct ifreq ifr;
ifr.ifr_ifindex = if_nametoindex(ifname); ifr.ifr_ifindex = if_nametoindex(ifname);
@ -349,53 +345,6 @@ bool CTapDriver::Init(const map<string, string>& const_params)
return true; return true;
} }
#endif // __linux__
#ifdef __NetBSD__
bool CTapDriver::Init(const map<string, string>&)
{
struct ifreq ifr;
struct ifaddrs *ifa, *a;
// TAP Device Initialization
if ((m_hTAP = open("/dev/tap", O_RDWR)) < 0) {
LOGERROR("Can't open tap: %s", strerror(errno));
return false;
}
// Get device name
if (ioctl(m_hTAP, TAPGIFNAME, (void *)&ifr) < 0) {
LOGERROR("Can't ioctl TAPGIFNAME: %s", strerror(errno));
close(m_hTAP);
return false;
}
// Get MAC address
if (getifaddrs(&ifa) == -1) {
LOGERROR("Can't getifaddrs: %s", strerror(errno));
close(m_hTAP);
return false;
}
for (a = ifa; a != NULL; a = a->ifa_next)
if (strcmp(ifr.ifr_name, a->ifa_name) == 0 &&
a->ifa_addr->sa_family == AF_LINK)
break;
if (a == NULL) {
LOGERROR("Can't get MAC address: %s", strerror(errno));
close(m_hTAP);
return false;
}
// Save MAC address
memcpy(m_MacAddr, LLADDR((struct sockaddr_dl *)a->ifa_addr),
sizeof(m_MacAddr));
freeifaddrs(ifa);
LOGINFO("Tap device: %s\n", ifr.ifr_name);
return true;
}
#endif // __NetBSD__
void CTapDriver::OpenDump(const Filepath& path) { void CTapDriver::OpenDump(const Filepath& path) {
if (m_pcap == NULL) { if (m_pcap == NULL) {

View File

@ -7,8 +7,6 @@
// Copyright (C) 2016-2020 GIMONS // Copyright (C) 2016-2020 GIMONS
// Copyright (C) akuker // Copyright (C) akuker
// //
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
//
// [ TAP Driver ] // [ TAP Driver ]
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@ -10,7 +10,6 @@
// Copyright (C) 2010 Y.Sugahara // Copyright (C) 2010 Y.Sugahara
// //
// Imported sava's Anex86/T98Next image and MO format support patch. // Imported sava's Anex86/T98Next image and MO format support patch.
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
// Comments translated to english by akuker. // Comments translated to english by akuker.
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@ -10,7 +10,6 @@
// Copyright (C) 2010 Y.Sugahara // Copyright (C) 2010 Y.Sugahara
// //
// Imported sava's Anex86/T98Next image and MO format support patch. // Imported sava's Anex86/T98Next image and MO format support patch.
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
// Comments translated to english by akuker. // Comments translated to english by akuker.
// //
// [ DiskTrack and DiskCache ] // [ DiskTrack and DiskCache ]

View File

@ -6,8 +6,6 @@
// Powered by XM6 TypeG Technology. // Powered by XM6 TypeG Technology.
// Copyright (C) 2016-2020 GIMONS // Copyright (C) 2016-2020 GIMONS
// //
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
//
// [ GPIO-SCSI bus ] // [ GPIO-SCSI bus ]
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@ -7,8 +7,6 @@
// Copyright (C) 2016-2020 GIMONS // Copyright (C) 2016-2020 GIMONS
// Copyright (C) 2020 akuker // Copyright (C) 2020 akuker
// //
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
//
// [ OS related definitions ] // [ OS related definitions ]
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -58,23 +56,11 @@
#include <pwd.h> #include <pwd.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/socket.h> #include <sys/socket.h>
#if defined(__linux__)
#include <sys/epoll.h> #include <sys/epoll.h>
#endif
#include <netinet/in.h> #include <netinet/in.h>
#if defined(__linux__)
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/if.h> #include <linux/if.h>
#include <linux/if_tun.h> #include <linux/if_tun.h>
#elif defined(__NetBSD__)
#include <sys/param.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_tap.h>
#include <ifaddrs.h>
#endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //