* libppp: [PPPManager]: Added ControlModule() method.
* PPPoE: fixed GET_INTERFACES ioctl() * PPP interface: fixed path generation for controlling PPP modules (a '/' was missing). And some minor changes I do not remember anymore. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7119 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8a8389eed0
commit
53a2aa40d5
@ -419,12 +419,11 @@ PPPManager::Control(uint32 op, void *data, size_t length)
|
||||
return B_ERROR;
|
||||
|
||||
char name[B_PATH_NAME_LENGTH];
|
||||
strcpy(name, PPP_MODULES_PATH);
|
||||
strcat(name, args->name);
|
||||
sprintf(name, "%s/%s", PPP_MODULES_PATH, args->name);
|
||||
ppp_module_info *module;
|
||||
if(get_module(name, (module_info**) &module) != B_OK
|
||||
|| !module->control)
|
||||
return B_ERROR;
|
||||
return B_NAME_NOT_FOUND;
|
||||
|
||||
return module->control(args->op, args->data, args->length);
|
||||
} break;
|
||||
|
@ -1,3 +1,3 @@
|
||||
- add CHAP
|
||||
- add ISDN (CAPI)
|
||||
- add PPP over TCP/IP (this is a virtual device that uses TCP/IP to connect to some other PPP server on the net)
|
||||
- add PPTP (this is a virtual device that uses TCP/IP to connect to some other PPP server on the net)
|
||||
|
@ -37,7 +37,7 @@ extern struct core_module_info *core;
|
||||
|
||||
#if DEBUG
|
||||
// defined in ModemDevice.cpp
|
||||
void dump_packet(struct mbuf *packet);
|
||||
extern void dump_packet(struct mbuf *packet);
|
||||
#endif // DEBUG
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ class PPPoEDevice;
|
||||
#define PPPoE_VERSION 0x1
|
||||
#define PPPoE_TYPE 0x1
|
||||
|
||||
#define PPPoE_INTERFACE_KEY "interface"
|
||||
#define PPPoE_INTERFACE_KEY "Interface"
|
||||
#define PPPoE_AC_NAME_KEY "ACName"
|
||||
#define PPPoE_SERVICE_NAME_KEY "ServiceName"
|
||||
|
||||
@ -62,14 +62,14 @@ typedef struct complete_pppoe_header {
|
||||
|
||||
|
||||
// defined in pppoe.cpp
|
||||
ifnet *FindPPPoEInterface(const char *name);
|
||||
uint32 NewHostUniq();
|
||||
void add_device(PPPoEDevice *device);
|
||||
void remove_device(PPPoEDevice *device);
|
||||
extern ifnet *FindPPPoEInterface(const char *name);
|
||||
extern uint32 NewHostUniq();
|
||||
extern void add_device(PPPoEDevice *device);
|
||||
extern void remove_device(PPPoEDevice *device);
|
||||
|
||||
#if DEBUG
|
||||
// defined in PPPoEDevice.cpp
|
||||
void dump_packet(struct mbuf *packet);
|
||||
extern void dump_packet(struct mbuf *packet);
|
||||
#endif // DEBUG
|
||||
|
||||
|
||||
|
@ -1,2 +1,3 @@
|
||||
- add support for server mode
|
||||
- add service-query support (for userland preflet)
|
||||
- test service-query feature
|
||||
- test if AC and Service settings specifications are handled correctly
|
||||
|
@ -243,12 +243,13 @@ control(uint32 op, void *data, size_t length)
|
||||
|
||||
ifnet *current = get_interfaces();
|
||||
for(; current; current = current->if_next) {
|
||||
if(current->if_type == IFT_ETHER && current->name) {
|
||||
if(position + strlen(current->name) + 1 > length)
|
||||
if(current->if_type == IFT_ETHER && current->if_name) {
|
||||
if(position + strlen(current->if_name) + 1 > length)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
strcpy(names + position, current->name);
|
||||
position += strlen(current->name) + 1;
|
||||
strcpy(names + position, current->if_name);
|
||||
position += strlen(current->if_name);
|
||||
names[position++] = 0;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,22 @@ PPPManager::Control(uint32 op, void *data, size_t length) const
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
PPPManager::ControlModule(const char *name, uint32 op, void *data,
|
||||
size_t length) const
|
||||
{
|
||||
if(!name)
|
||||
return B_ERROR;
|
||||
|
||||
control_net_module_args args;
|
||||
args.name = name;
|
||||
args.op = op;
|
||||
args.data = data;
|
||||
args.length = length;
|
||||
return Control(PPPC_CONTROL_MODULE, &args, sizeof(args));
|
||||
}
|
||||
|
||||
|
||||
ppp_interface_id
|
||||
PPPManager::CreateInterface(const driver_settings *settings,
|
||||
const driver_settings *profile = NULL) const
|
||||
|
@ -24,6 +24,8 @@ class PPPManager {
|
||||
status_t InitCheck() const;
|
||||
|
||||
status_t Control(uint32 op, void *data, size_t length) const;
|
||||
status_t ControlModule(const char *name, uint32 op, void *data,
|
||||
size_t length) const;
|
||||
|
||||
ppp_interface_id CreateInterface(const driver_settings *settings,
|
||||
const driver_settings *profile = NULL) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user