mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-30 05:29:47 +00:00
Removed untested/unsupported NetBSD-related code (#694)
This commit is contained in:
parent
cd0baa4676
commit
7290803ace
@ -6,7 +6,6 @@
|
||||
// Powered by XM6 TypeG Technology.
|
||||
// Copyright (C) 2016-2020 GIMONS
|
||||
//
|
||||
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
||||
// Imported sava's bugfix patch(in RASDRV DOS edition).
|
||||
//
|
||||
// [ Host File System for the X68000 ]
|
||||
@ -30,21 +29,11 @@
|
||||
//---------------------------------------------------------------------------
|
||||
#define IC_BUF_SIZE 1024
|
||||
static char convert_buf[IC_BUF_SIZE];
|
||||
#ifndef __NetBSD__
|
||||
// Using POSIX.1 compliant iconv(3)
|
||||
#define CONVERT(src, dest, inbuf, outbuf, outsize) \
|
||||
convert(src, dest, (char *)inbuf, outbuf, outsize)
|
||||
static void convert(char const *src, char const *dest,
|
||||
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';
|
||||
size_t in = strlen(inbuf);
|
||||
size_t out = outsize - 1;
|
||||
@ -61,7 +50,6 @@ static void convert(char const *src, char const *dest,
|
||||
|
||||
iconv_close(cd);
|
||||
*outbuf = '\0';
|
||||
#endif //ifndef __APPLE__
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -7,8 +7,6 @@
|
||||
// Copyright (C) 2016-2020 GIMONS
|
||||
// Copyright (C) akuker
|
||||
//
|
||||
// Imported NetBSD support and some optimisation patches by Rin Okuyama.
|
||||
//
|
||||
// [ TAP Driver ]
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
@ -47,8 +45,6 @@ CTapDriver::CTapDriver()
|
||||
// Initialization
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
#ifdef __linux__
|
||||
|
||||
static bool br_setif(int br_socket_fd, const char* bridgename, const char* ifname, bool add) {
|
||||
struct ifreq ifr;
|
||||
ifr.ifr_ifindex = if_nametoindex(ifname);
|
||||
@ -349,53 +345,6 @@ bool CTapDriver::Init(const map<string, string>& const_params)
|
||||
|
||||
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) {
|
||||
if (m_pcap == NULL) {
|
||||
|
@ -7,8 +7,6 @@
|
||||
// Copyright (C) 2016-2020 GIMONS
|
||||
// Copyright (C) akuker
|
||||
//
|
||||
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
||||
//
|
||||
// [ TAP Driver ]
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -10,7 +10,6 @@
|
||||
// Copyright (C) 2010 Y.Sugahara
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -10,7 +10,6 @@
|
||||
// Copyright (C) 2010 Y.Sugahara
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// [ DiskTrack and DiskCache ]
|
||||
|
@ -6,8 +6,6 @@
|
||||
// Powered by XM6 TypeG Technology.
|
||||
// Copyright (C) 2016-2020 GIMONS
|
||||
//
|
||||
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
||||
//
|
||||
// [ GPIO-SCSI bus ]
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -7,8 +7,6 @@
|
||||
// Copyright (C) 2016-2020 GIMONS
|
||||
// Copyright (C) 2020 akuker
|
||||
//
|
||||
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
||||
//
|
||||
// [ OS related definitions ]
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
@ -58,23 +56,11 @@
|
||||
#include <pwd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#if defined(__linux__)
|
||||
#include <sys/epoll.h>
|
||||
#endif
|
||||
#include <netinet/in.h>
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/if.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
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user