Use the NET_STACK_DRIVER_PATH environment variable if available.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5157 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Waldemar Kornewald
2003-10-25 10:13:51 +00:00
parent 2094b5ffbb
commit 52fad5f56b
5 changed files with 44 additions and 5 deletions
@@ -11,6 +11,7 @@ UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkerne
StaticLibrary ppp :
settings_tools.cpp
_libppputils.cpp
PPPInterface.cpp
PPPManager.cpp
;
@@ -8,12 +8,12 @@
#include "PPPInterface.h"
#include <unistd.h>
#include <net_stack_driver.h>
#include "_libppputils.h"
PPPInterface::PPPInterface(interface_id ID = PPP_UNDEFINED_INTERFACE_ID)
{
fFD = open("/dev/net/stack", O_RDWR);
fFD = open(get_stack_driver_path(), O_RDWR);
SetTo(ID);
}
@@ -21,7 +21,7 @@ PPPInterface::PPPInterface(interface_id ID = PPP_UNDEFINED_INTERFACE_ID)
PPPInterface::PPPInterface(const PPPInterface& copy)
{
fFD = open("/dev/net/stack", O_RDWR);
fFD = open(get_stack_driver_path(), O_RDWR);
SetTo(copy.ID());
}
@@ -8,14 +8,14 @@
#include "PPPManager.h"
#include "PPPInterface.h"
#include <net_stack_driver.h>
#include <settings_tools.h>
#include <unistd.h>
#include "_libppputils.h"
PPPManager::PPPManager()
{
fFD = open("/dev/net/stack", O_RDWR);
fFD = open(get_stack_driver_path(), O_RDWR);
}
@@ -0,0 +1,23 @@
//----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered
// by the OpenBeOS license.
//---------------------------------------------------------------------
#include <OS.h>
#include "_libppputils.h"
#include <cstdlib>
char*
get_stack_driver_path()
{
char *path;
// user-defined stack driver path?
path = getenv("NET_STACK_DRIVER_PATH");
if(path)
return path;
// use the default stack driver path
return NET_STACK_DRIVER_PATH;
}
@@ -0,0 +1,15 @@
//----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered
// by the OpenBeOS license.
//---------------------------------------------------------------------
#ifndef __libppputils__h
#define __libppputils__h
#include <net_stack_driver.h>
char *get_stack_driver_path();
#endif