Network: Added IPv6Interface.
* Pretty much the same as the IPv4 one.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
SubDir HAIKU_TOP src add-ons network_settings ;
|
SubDir HAIKU_TOP src add-ons network_settings ;
|
||||||
|
|
||||||
SubInclude HAIKU_TOP src add-ons network_settings ipv4 ;
|
SubInclude HAIKU_TOP src add-ons network_settings ipv4 ;
|
||||||
#SubInclude HAIKU_TOP src add-ons network_settings ipv6 ;
|
SubInclude HAIKU_TOP src add-ons network_settings ipv6 ;
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
SubDir HAIKU_TOP src add-ons network_settings ipv4 ;
|
SubDir HAIKU_TOP src add-ons network_settings ipv4 ;
|
||||||
|
|
||||||
#UseHeaders [ FDirName $(HAIKU_TOP) src preferences network ] ;
|
|
||||||
#UseHeaders [ FDirName $(HAIKU_TOP) src servers net ] : true ;
|
|
||||||
|
|
||||||
UsePublicHeaders [ FDirName add-ons network_settings ] ;
|
UsePublicHeaders [ FDirName add-ons network_settings ] ;
|
||||||
UsePrivateHeaders shared ;
|
UsePrivateHeaders shared ;
|
||||||
|
|
||||||
|
|
||||||
AddResources Interfaces :
|
AddResources Interfaces :
|
||||||
InterfacesIcons.rdef
|
InterfacesIcons.rdef
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -0,0 +1,155 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2015 Haiku, Inc. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Axel Dörfler, <[email protected]>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <NetworkSettingsAddOn.h>
|
||||||
|
#include <StringItem.h>
|
||||||
|
|
||||||
|
#include "InterfaceAddressView.h"
|
||||||
|
|
||||||
|
|
||||||
|
using namespace BNetworkKit;
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
#define B_TRANSLATION_CONTEXT "IPv6InterfaceAddOn"
|
||||||
|
|
||||||
|
|
||||||
|
class IPv6InterfaceAddOn : public BNetworkSettingsAddOn {
|
||||||
|
public:
|
||||||
|
IPv6InterfaceAddOn(image_id image,
|
||||||
|
BNetworkSettings& settings);
|
||||||
|
virtual ~IPv6InterfaceAddOn();
|
||||||
|
|
||||||
|
virtual BNetworkSettingsInterfaceItem*
|
||||||
|
CreateNextInterfaceItem(uint32& cookie,
|
||||||
|
const char* interface);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class IPv6InterfaceItem : public BNetworkSettingsInterfaceItem {
|
||||||
|
public:
|
||||||
|
IPv6InterfaceItem(const char* interface,
|
||||||
|
BNetworkSettings& settings);
|
||||||
|
virtual ~IPv6InterfaceItem();
|
||||||
|
|
||||||
|
virtual BListItem* ListItem();
|
||||||
|
virtual BView* View();
|
||||||
|
|
||||||
|
virtual status_t Revert();
|
||||||
|
virtual bool IsRevertable();
|
||||||
|
|
||||||
|
virtual void ConfigurationUpdated(const BMessage& message);
|
||||||
|
|
||||||
|
private:
|
||||||
|
BNetworkSettings& fSettings;
|
||||||
|
BStringItem* fItem;
|
||||||
|
InterfaceAddressView*
|
||||||
|
fView;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
IPv6InterfaceItem::IPv6InterfaceItem(const char* interface,
|
||||||
|
BNetworkSettings& settings)
|
||||||
|
:
|
||||||
|
BNetworkSettingsInterfaceItem(interface),
|
||||||
|
fSettings(settings),
|
||||||
|
fItem(new BStringItem(B_TRANSLATE("IPv6"))),
|
||||||
|
fView(NULL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IPv6InterfaceItem::~IPv6InterfaceItem()
|
||||||
|
{
|
||||||
|
if (fView->Parent() == NULL)
|
||||||
|
delete fView;
|
||||||
|
|
||||||
|
delete fItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BListItem*
|
||||||
|
IPv6InterfaceItem::ListItem()
|
||||||
|
{
|
||||||
|
return fItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BView*
|
||||||
|
IPv6InterfaceItem::View()
|
||||||
|
{
|
||||||
|
if (fView == NULL)
|
||||||
|
fView = new InterfaceAddressView(AF_INET6, Interface(), fSettings);
|
||||||
|
|
||||||
|
return fView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
IPv6InterfaceItem::Revert()
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
IPv6InterfaceItem::IsRevertable()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
IPv6InterfaceItem::ConfigurationUpdated(const BMessage& message)
|
||||||
|
{
|
||||||
|
if (fView != NULL)
|
||||||
|
fView->ConfigurationUpdated(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
IPv6InterfaceAddOn::IPv6InterfaceAddOn(image_id image,
|
||||||
|
BNetworkSettings& settings)
|
||||||
|
:
|
||||||
|
BNetworkSettingsAddOn(image, settings)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IPv6InterfaceAddOn::~IPv6InterfaceAddOn()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BNetworkSettingsInterfaceItem*
|
||||||
|
IPv6InterfaceAddOn::CreateNextInterfaceItem(uint32& cookie,
|
||||||
|
const char* interface)
|
||||||
|
{
|
||||||
|
if (cookie++ == 0)
|
||||||
|
return new IPv6InterfaceItem(interface, Settings());
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
BNetworkSettingsAddOn*
|
||||||
|
instantiate_network_settings_add_on(image_id image, BNetworkSettings& settings)
|
||||||
|
{
|
||||||
|
return new IPv6InterfaceAddOn(image, settings);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
SubDir HAIKU_TOP src add-ons network_settings ipv6 ;
|
||||||
|
|
||||||
|
UsePublicHeaders [ FDirName add-ons network_settings ] ;
|
||||||
|
UsePrivateHeaders shared ;
|
||||||
|
|
||||||
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons network_settings ipv4 ] ;
|
||||||
|
|
||||||
|
AddResources Interfaces :
|
||||||
|
InterfacesIcons.rdef
|
||||||
|
;
|
||||||
|
|
||||||
|
Addon IPv6Interface :
|
||||||
|
IPv6InterfaceAddOn.cpp
|
||||||
|
InterfaceAddressView.cpp
|
||||||
|
|
||||||
|
: be bnetapi libshared.a <nogrist>Network [ TargetLibsupc++ ]
|
||||||
|
[ TargetLibstdc++ ] localestub
|
||||||
|
;
|
||||||
|
|
||||||
|
DoCatalogs IPv6Interface : x-vnd.Haiku-IPv6Interface :
|
||||||
|
IPv6InterfaceAddOn.cpp
|
||||||
|
InterfaceAddressView.cpp
|
||||||
|
;
|
||||||
Reference in New Issue
Block a user