Imported most of the old libnet.so compatibility functions (from old/compat/libnet/compat.c).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19015 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,6 +6,7 @@ SharedLibrary libnetwork.so :
|
|||||||
init.cpp
|
init.cpp
|
||||||
interfaces.cpp
|
interfaces.cpp
|
||||||
socket.cpp
|
socket.cpp
|
||||||
|
r5_compatibility.cpp
|
||||||
:
|
:
|
||||||
<libnetwork_dns>dns_dst.o
|
<libnetwork_dns>dns_dst.o
|
||||||
<libnetwork_dns>dns_inet.o
|
<libnetwork_dns>dns_inet.o
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Philippe Houdoin
|
||||||
|
* Jérôme Duval, [email protected]
|
||||||
|
* Axel Dörfler, [email protected]
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
|
struct net_settings;
|
||||||
|
|
||||||
|
int _netstat(int fd, char **output, int verbose);
|
||||||
|
int closesocket(int socket);
|
||||||
|
char *find_net_setting(net_settings* settings, const char* heading,
|
||||||
|
const char* name, char* value, unsigned numBytes);
|
||||||
|
status_t set_net_setting(net_settings* settings, const char* heading,
|
||||||
|
const char* name, const char* value);
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
_netstat(int fd, char **output, int verbose)
|
||||||
|
{
|
||||||
|
return ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
closesocket(int socket)
|
||||||
|
{
|
||||||
|
return close(socket);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* TODO: This is a terrible hack :(
|
||||||
|
* TODO: We should really get these settings values by parsing the real settings
|
||||||
|
*/
|
||||||
|
|
||||||
|
char *
|
||||||
|
find_net_setting(net_settings* settings, const char* heading,
|
||||||
|
const char* name, char* value, unsigned numBytes)
|
||||||
|
{
|
||||||
|
if (strcmp(heading, "GLOBAL") != 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!strcmp(name, "HOSTNAME"))
|
||||||
|
strlcpy(value, "hostname", numBytes);
|
||||||
|
else if (!strcmp(name, "USERNAME"))
|
||||||
|
strlcpy(value, "baron", numBytes);
|
||||||
|
else if (!strcmp(name, "PASSWORD"))
|
||||||
|
strlcpy(value, "password", numBytes);
|
||||||
|
else if (!strcmp(name, "FTP_ENABLED"))
|
||||||
|
strlcpy(value, "1", numBytes);
|
||||||
|
else if (!strcmp(name, "TELNETD_ENABLED"))
|
||||||
|
strlcpy(value, "1", numBytes);
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
set_net_setting(net_settings* settings, const char* heading,
|
||||||
|
const char* name, const char* value)
|
||||||
|
{
|
||||||
|
return B_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user