+ Make all network modules using NETWORK_MODULES_ROOT as their root module name, allowing

to change this root in one single place, in headers/private/net/net_module.h.
Unfortunatly, it's not that easer in Jamfile...
+ Expand openbeos-networkingkit-cvs package contents.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6084 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2004-01-15 00:08:32 +00:00
parent 44d24e2984
commit 313b452ee5
24 changed files with 150 additions and 49 deletions

View File

@ -2,7 +2,7 @@ SubDir OBOS_TOP src add-ons kernel network core ;
UsePrivateHeaders net ;
R5KernelAddon core : kernel network :
R5KernelAddon core : kernel obos_network :
cksum.c
core.c
if.c
@ -21,5 +21,9 @@ R5KernelAddon core : kernel network :
;
# Installation
OBOSInstall install-networking : /boot/home/config/add-ons/kernel/network
OBOSInstall install-networking : /boot/home/config/add-ons/kernel/obos_network
: core ;
Package openbeos-networkingkit-cvs :
core :
boot home config add-ons kernel obos_network ;

View File

@ -38,8 +38,8 @@
#include <net_socket.h>
/* Defines we need */
#define NETWORK_INTERFACES "network/interfaces"
#define NETWORK_PROTOCOLS "network/protocols"
#define NETWORK_INTERFACES NETWORK_MODULES_ROOT "interfaces"
#define NETWORK_PROTOCOLS NETWORK_MODULES_ROOT "protocols"
/* Variables used in other core modules */
int ndevs = 0;

View File

@ -2,11 +2,15 @@ SubDir OBOS_TOP src add-ons kernel network interfaces ethernet ;
UsePrivateHeaders net ;
R5KernelAddon ethernet : kernel network interfaces :
R5KernelAddon ethernet : kernel obos_network interfaces :
ethernet.c
;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/interfaces
: /boot/home/config/add-ons/kernel/obos_network/interfaces
: ethernet ;
Package openbeos-networkingkit-cvs :
ethernet :
boot home config add-ons kernel obos_network interfaces ;

View File

@ -25,6 +25,7 @@
#include "core_module.h"
#include "core_funcs.h"
#include "net_timer.h"
#include "ether_driver.h"
#include "ethernet_module.h"
@ -161,7 +162,7 @@ static void attach_device(int devid, char *driver, char *devno)
ifp = &ed->sc_if;
/* get the MAC address... */
status = ioctl(devid, IF_GETADDR, &ed->sc_addr, 6);
status = ioctl(devid, ETHER_GETADDR, &ed->sc_addr, 6);
if (status < B_OK) {
printf("%s/%s: ignored: Failed to get a MAC address\n", driver, devno);
close(devid);
@ -169,9 +170,9 @@ static void attach_device(int devid, char *driver, char *devno)
return;
}
/* Try to detrmine the MTU to use */
status = ioctl(devid, IF_GETFRAMESIZE, &fsz, sizeof(fsz));
status = ioctl(devid, ETHER_GETFRAMESIZE, &fsz, sizeof(fsz));
if (status < 0) {
printf("%s/%s: IF_GETFRAMESIZE not supported, defaulting to %d\n",
printf("%s/%s: ETHER_GETFRAMESIZE not supported, defaulting to %d\n",
driver, devno, ETHERMTU);
ifp->if_mtu = ETHERMTU;
} else
@ -234,13 +235,55 @@ static void open_device(char *driver, char *devno)
return;
}
status = ioctl(dev, IF_INIT, NULL, 0);
status = ioctl(dev, ETHER_INIT, NULL, 0);
if (status == B_OK)
attach_device(dev, driver, devno);
close(dev);
};
#if 0
static void find_devices(char *root)
{
DIR *dir;
struct dirent *de;
struct stat st;
char path[1024];
dir = opendir(root);
if (!dir) {
printf("ethernet: Couldn't open the directory %s\n", root);
return;
};
while ((de = readdir(dir)) != NULL) {
if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0)
continue; // skip pseudo-directories
sprintf(path, "%s/%s", root, de->d_name);
if (stat(path, &st) < 0) {
printf("ethernet: Can't stat(%s) entry! Skipping...\n", path);
continue;
};
if (S_ISDIR(st.st_mode))
find_devices(path);
else if (S_ISCHR(st.st_mode)) { // char device = driver!
if (strcmp(de->d_name, "socket") == 0 || // OBOS old socket driver
strcmp(de->d_name, "stack") == 0 || // OBOS stack driver
strcmp(de->d_name, "server") == 0 || // OBOS server driver
strcmp(de->d_name, "api") == 0) // BONE stack driver
continue; // skip pseudo-entries
open_device(path, de->d_name);
};
};
closedir(dir);
}
#else
static void find_devices(void)
{
DIR *dir, *driv_dir;
@ -257,7 +300,7 @@ static void find_devices(void)
/* hmm, is it a driver? */
if (strcmp(de->d_name, ".") == 0 ||
strcmp(de->d_name, "..") == 0 ||
strcmp(de->d_name, "socket") == 0 ||
strcmp(de->d_name, "server") == 0 ||
strcmp(de->d_name, "stack") == 0)
continue;
@ -288,6 +331,8 @@ static void find_devices(void)
return;
}
#endif
#if DEBUG
static void dump_ether_details(struct mbuf *buf)
@ -929,7 +974,7 @@ static int ether_init(void *cpp)
if (ether_rxt > 0)
resume_thread(ether_rxt);
find_devices();
find_devices(); // "/dev/net");
memset(proto, 0, sizeof(struct protosw *) * IPPROTO_MAX);
add_protosw(proto, NET_LAYER2);

View File

@ -2,11 +2,15 @@ SubDir OBOS_TOP src add-ons kernel network interfaces loopback ;
UsePrivateHeaders net ;
R5KernelAddon loopback : kernel network interfaces :
R5KernelAddon loopback : kernel obos_network interfaces :
loopback.c
;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/interfaces
: /boot/home/config/add-ons/kernel/obos_network/interfaces
: loopback ;
Package openbeos-networkingkit-cvs :
loopback :
boot home config add-ons kernel obos_network interfaces ;

View File

@ -141,7 +141,7 @@ static int loopback_module_init(void *cpp)
struct kernel_net_module_info device_info = {
{
"network/interfaces/loopback",
NETWORK_MODULES_ROOT "interfaces/loopback",
0,
std_ops
},

View File

@ -6,7 +6,7 @@ UsePrivateHeaders [ FDirName kernel util ] ;
UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkernelppp headers ] ;
R5KernelAddon ppp : kernel network interfaces :
R5KernelAddon ppp : kernel obos_network interfaces :
ppp.cpp
PPPManager.cpp
;
@ -15,5 +15,9 @@ LinkSharedOSLibs ppp : libkernelppp.a ;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/interfaces
: /boot/home/config/add-ons/kernel/obos_network/interfaces
: ppp ;
Package openbeos-networkingkit-cvs :
ppp :
boot home config add-ons kernel obos_network interfaces ;

View File

@ -7,10 +7,8 @@ UsePrivateHeaders [ FDirName kernel util ] ;
UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkernelppp headers ] ;
UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkernelppp ] ;
R5KernelAddon ipcp : kernel network ppp :
R5KernelAddon ipcp : kernel obos_network ppp :
inet_addr.c
ipcp.cpp
Protocol.cpp
;
@ -21,5 +19,9 @@ LinkSharedOSLibs ipcp : libkernelppp.a ;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/ppp
: /boot/home/config/add-ons/kernel/obos_network/ppp
: ipcp ;
Package openbeos-networkingkit-cvs :
ipcp :
boot home config add-ons kernel obos_network ppp ;

View File

@ -5,9 +5,10 @@
// Copyright (c) 2003 Waldemar Kornewald, Waldemar.Kornewald@web.de
//---------------------------------------------------------------------
#include <core_funcs.h>
#include <KernelExport.h>
#include <driver_settings.h>
#include <core_funcs.h>
#include <net_module.h>
#include <KPPPInterface.h>
#include <KPPPModule.h>
@ -24,7 +25,7 @@
#endif
#define IPCP_MODULE_NAME "network/ppp/ipcp"
#define IPCP_MODULE_NAME NETWORK_MODULES_ROOT "ppp/ipcp"
struct protosw *gProto[IPPROTO_MAX];
struct core_module_info *core = NULL;

View File

@ -8,7 +8,7 @@ UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkerne
UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkernelppp ] ;
R5KernelAddon modem : kernel network ppp :
R5KernelAddon modem : kernel obos_network ppp :
modem.cpp
ModemDevice.cpp
ACFCHandler.cpp
@ -18,5 +18,9 @@ LinkSharedOSLibs modem : libkernelppp.a ;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/ppp
: /boot/home/config/add-ons/kernel/obos_network/ppp
: modem ;
Package openbeos-networkingkit-cvs :
modem :
boot home config add-ons kernel obos_network ppp ;

View File

@ -5,9 +5,10 @@
// Copyright (c) 2003 Waldemar Kornewald, Waldemar.Kornewald@web.de
//---------------------------------------------------------------------
#include <core_funcs.h>
#include <KernelExport.h>
#include <driver_settings.h>
#include <core_funcs.h>
#include <net_module.h>
#include <KPPPInterface.h>
#include <KPPPModule.h>
@ -24,7 +25,7 @@
#endif
#define MODEM_MODULE_NAME "network/ppp/modem"
#define MODEM_MODULE_NAME NETWORK_MODULES_ROOT "ppp/modem"
struct core_module_info *core = NULL;
status_t std_ops(int32 op, ...);

View File

@ -8,7 +8,7 @@ UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkerne
UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkernelppp ] ;
R5KernelAddon pap : kernel network ppp :
R5KernelAddon pap : kernel obos_network ppp :
pap.cpp
Protocol.cpp
;
@ -17,5 +17,9 @@ LinkSharedOSLibs pap : libkernelppp.a ;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/ppp
: /boot/home/config/add-ons/kernel/obos_network/ppp
: pap ;
Package openbeos-networkingkit-cvs :
pap :
boot home config add-ons kernel obos_network ppp ;

View File

@ -5,9 +5,10 @@
// Copyright (c) 2003 Waldemar Kornewald, Waldemar.Kornewald@web.de
//---------------------------------------------------------------------
#include <core_funcs.h>
#include <KernelExport.h>
#include <driver_settings.h>
#include <core_funcs.h>
#include <net_module.h>
#include <KPPPInterface.h>
#include <KPPPModule.h>
@ -24,7 +25,7 @@
#endif
#define PAP_MODULE_NAME "network/ppp/pap"
#define PAP_MODULE_NAME NETWORK_MODULES_ROOT "ppp/pap"
struct core_module_info *core = NULL;
status_t std_ops(int32 op, ...);

View File

@ -8,7 +8,7 @@ UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkerne
UseHeaders [ FDirName $(OBOS_TOP) src add-ons kernel network ppp shared libkernelppp ] ;
R5KernelAddon pppoe : kernel network ppp :
R5KernelAddon pppoe : kernel obos_network ppp :
pppoe.cpp
PPPoEDevice.cpp
DiscoveryPacket.cpp
@ -18,5 +18,9 @@ LinkSharedOSLibs pppoe : libkernelppp.a ;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/ppp
: /boot/home/config/add-ons/kernel/obos_network/ppp
: pppoe ;
Package openbeos-networkingkit-cvs :
pppoe :
boot home config add-ons kernel obos_network ppp ;

View File

@ -5,9 +5,10 @@
// Copyright (c) 2003 Waldemar Kornewald, Waldemar.Kornewald@web.de
//---------------------------------------------------------------------
#include <core_funcs.h>
#include <KernelExport.h>
#include <driver_settings.h>
#include <core_funcs.h>
#include <net_module.h>
#include <ethernet_module.h>
@ -27,7 +28,7 @@
#endif
#define PPPoE_MODULE_NAME "network/ppp/pppoe"
#define PPPoE_MODULE_NAME NETWORK_MODULES_ROOT "ppp/pppoe"
struct core_module_info *core = NULL;
static struct ethernet_module_info *sEthernet;

View File

@ -13,7 +13,7 @@
#include <PPPReportDefs.h>
#define PPP_INTERFACE_MODULE_NAME "network/interfaces/ppp"
#define PPP_INTERFACE_MODULE_NAME NETWORK_MODULES_ROOT "interfaces/ppp"
#define PPP_UNDEFINED_INTERFACE_ID 0
// create_interface() returns this value on failure

View File

@ -10,6 +10,8 @@
#include <SupportDefs.h>
#include "net_module.h"
typedef uint32 interface_id;
@ -30,7 +32,7 @@ typedef uint32 interface_id;
#define PPP_SERVER_MODE_VALUE "Server"
// path defines
#define PPP_MODULES_PATH "network/ppp"
#define PPP_MODULES_PATH NETWORK_MODULES_ROOT "ppp"
// built-in protocols
#define PPP_LCP_PROTOCOL 0xC021

View File

@ -2,11 +2,15 @@ SubDir OBOS_TOP src add-ons kernel network protocols icmp ;
UsePrivateHeaders net ;
R5KernelAddon icmp : kernel network protocols :
R5KernelAddon icmp : kernel obos_network protocols :
icmp.c
;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/protocols
: /boot/home/config/add-ons/kernel/obos_network/protocols
: icmp ;
Package openbeos-networkingkit-cvs :
icmp :
boot home config add-ons kernel obos_network protocols ;

View File

@ -2,11 +2,15 @@ SubDir OBOS_TOP src add-ons kernel network protocols ipv4 ;
UsePrivateHeaders net ;
R5KernelAddon ipv4 : kernel network protocols :
R5KernelAddon ipv4 : kernel obos_network protocols :
ipv4.c
;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/protocols
: /boot/home/config/add-ons/kernel/obos_network/protocols
: ipv4 ;
Package openbeos-networkingkit-cvs :
ipv4 :
boot home config add-ons kernel obos_network protocols ;

View File

@ -2,11 +2,15 @@ SubDir OBOS_TOP src add-ons kernel network protocols raw ;
UsePrivateHeaders net ;
R5KernelAddon raw : kernel network protocols :
R5KernelAddon raw : kernel obos_network protocols :
raw.c
;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/protocols
: /boot/home/config/add-ons/kernel/obos_network/protocols
: raw ;
Package openbeos-networkingkit-cvs :
raw :
boot home config add-ons kernel obos_network protocols ;

View File

@ -2,7 +2,7 @@ SubDir OBOS_TOP src add-ons kernel network protocols tcp ;
UsePrivateHeaders net ;
R5KernelAddon tcp : kernel network protocols :
R5KernelAddon tcp : kernel obos_network protocols :
arc4random.c
tcp.c
tcp_debug.c
@ -13,5 +13,9 @@ R5KernelAddon tcp : kernel network protocols :
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/protocols
: /boot/home/config/add-ons/kernel/obos_network/protocols
: tcp ;
Package openbeos-networkingkit-cvs :
tcp :
boot home config add-ons kernel obos_network protocols ;

View File

@ -30,7 +30,7 @@
#include "net_timer.h"
#include <KernelExport.h>
#define NET_TCP_MODULE_NAME "network/protocols/tcp"
#define NET_TCP_MODULE_NAME NETWORK_MODULES_ROOT "protocols/tcp"
status_t std_ops(int32 op, ...);
struct core_module_info *core = NULL;

View File

@ -2,11 +2,15 @@ SubDir OBOS_TOP src add-ons kernel network protocols udp ;
UsePrivateHeaders net ;
R5KernelAddon udp : kernel network protocols :
R5KernelAddon udp : kernel obos_network protocols :
udp.c
;
# Installation
OBOSInstall install-networking
: /boot/home/config/add-ons/kernel/network/protocols
: /boot/home/config/add-ons/kernel/obos_network/protocols
: udp ;
Package openbeos-networkingkit-cvs :
udp :
boot home config add-ons kernel obos_network protocols ;

View File

@ -26,7 +26,7 @@
#include <KernelExport.h>
status_t std_ops(int32 op, ...);
#define NET_UDP_MODULE_NAME "network/protocols/udp"
#define NET_UDP_MODULE_NAME NETWORK_MODULES_ROOT "protocols/udp"
/* Private variables */
static struct core_module_info *core = NULL;