Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions net/ndproxy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PLUGIN_NAME= ndproxy
PLUGIN_VERSION= 1.0
PLUGIN_DEPENDS= ndproxy
PLUGIN_COMMENT= Neighbor Discovery Proxy
PLUGIN_MAINTAINER= cedrik@pischem.com

.include "../../Mk/plugins.mk"
8 changes: 8 additions & 0 deletions net/ndproxy/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Ndproxy is a kernel module that implements IPv6 Neighbor Discovery proxying over Ethernet-like access networks.

Plugin Changelog
================

1.0

* Initial Release
64 changes: 64 additions & 0 deletions net/ndproxy/src/etc/inc/plugins.inc.d/ndproxy.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

/*
* Copyright (C) 2024 Cedrik Pischem
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

function ndproxy_services()
{
global $config;

$services = [];

if (isset($config['OPNsense']['ndproxy']['general']['enabled']) &&
$config['OPNsense']['ndproxy']['general']['enabled'] == 1) {
$services[] = [
'description' => gettext('Ndproxy'),
'configd' => [
'start' => ['ndproxy start'],
'restart' => ['ndproxy restart'],
'stop' => ['ndproxy stop'],
],
'name' => 'ndproxy',
'nocheck' => true,
];
}

return $services;
}

function ndproxy_xmlrpc_sync()
{
$result = [];

$result[] = array(
'description' => gettext('Ndproxy'),
'section' => 'OPNsense.ndproxy',
'id' => 'ndproxy',
'services' => ["ndproxy"],
);

return $result;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/**
* Copyright (C) 2024 Cedrik Pischem
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/

namespace OPNsense\Ndproxy\Api;

use OPNsense\Base\ApiMutableModelControllerBase;
use OPNsense\Core\Config;

class GeneralController extends ApiMutableModelControllerBase
{
protected static $internalModelName = 'ndproxy';
protected static $internalModelClass = 'OPNsense\Ndproxy\Ndproxy';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

/**
* Copyright (C) 2024 Cedrik Pischem
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/

namespace OPNsense\Ndproxy\Api;

use OPNsense\Base\ApiMutableServiceControllerBase;

class ServiceController extends ApiMutableServiceControllerBase
{
protected static $internalServiceClass = '\OPNsense\Ndproxy\Ndproxy';
protected static $internalServiceTemplate = 'OPNsense/Ndproxy';
protected static $internalServiceEnabled = 'general.enabled';
protected static $internalServiceName = 'ndproxy';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/**
* Copyright (C) 2024 Cedrik Pischem
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/

namespace OPNsense\Ndproxy;

use OPNsense\Base\IndexController;

class GeneralController extends IndexController
{
public function indexAction()
{
$this->view->pick('OPNsense/Ndproxy/general');
$this->view->generalForm = $this->getForm("general");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/**
* Copyright (C) 2024 Cedrik Pischem
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/

namespace OPNsense\Ndproxy\Api;

use OPNsense\Base\ApiMutableModelControllerBase;
use OPNsense\Core\Config;

class GeneralController extends ApiMutableModelControllerBase
{
protected static $internalModelName = 'ndproxy';
protected static $internalModelClass = 'OPNsense\Ndproxy\Ndproxy';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

/**
* Copyright (C) 2024 Cedrik Pischem
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/

namespace OPNsense\Ndproxy\Api;

use OPNsense\Base\ApiMutableServiceControllerBase;

class ServiceController extends ApiMutableServiceControllerBase
{
protected static $internalServiceClass = '\OPNsense\Ndproxy\Ndproxy';
protected static $internalServiceTemplate = 'OPNsense/Ndproxy';
protected static $internalServiceEnabled = 'general.enabled';
protected static $internalServiceName = 'ndproxy';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/**
* Copyright (C) 2024 Cedrik Pischem
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/

namespace OPNsense\Ndproxy;

use OPNsense\Base\IndexController;

class GeneralController extends IndexController
{
public function indexAction()
{
$this->view->pick('OPNsense/Ndproxy/general');
$this->view->generalForm = $this->getForm("general");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<form>
<field>
<type>header</type>
<label>General Settings</label>
</field>
<field>
<id>ndproxy.general.enabled</id>
<label>Enable</label>
<type>checkbox</type>
<help><![CDATA[Enable or disable ndproxy.]]></help>
</field>
<field>
<id>ndproxy.general.ndproxy_uplink_interface</id>
<label>Uplink Interface</label>
<type>dropdown</type>
<help><![CDATA[Choose the uplink interface which receives the external IPv6 prefix from the ISP. Usually, this is the WAN interface.]]></help>
</field>
<field>
<id>ndproxy.general.ndproxy_downlink_mac_address</id>
<label>Downlink MAC Address</label>
<type>text</type>
<help><![CDATA[Enter the MAC address of the downlink interface that will distribute the external IPv6 prefix of the upstream interface. Usually, this is the LAN interface.]]></help>
</field>
<field>
<id>ndproxy.general.ndproxy_uplink_ipv6_addresses</id>
<label>Uplink IPv6 Addresses</label>
<type>select_multiple</type>
<style>tokenize</style>
<allownew>true</allownew>
<help><![CDATA[Define IPv6 addresses of the Provider Edge (PE) router(s). These addresses represent the sources from which ndproxy will handle and respond to NDP traffic. Defining these addresses ensures that ndproxy only proxies traffic from trusted upstream routers.]]></help>
</field>
<field>
<id>ndproxy.general.ndproxy_exception_ipv6_addresses</id>
<label>Exception IPv6 Addresses</label>
<type>select_multiple</type>
<style>tokenize</style>
<allownew>true</allownew>
<help><![CDATA[Define IPv6 addresses that should be excepted from proxying. This is to prevent ndproxy from handling NDP requests for specific addresses on the network that should be managed by other devices. Can be left empty for simple networks.]]></help>
</field>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<acl>
<page-ndproxy-general>
<name>Services: Ndproxy: General Settings</name>
<description>Allow access to Ndproxy General Settings</description>
<patterns>
<pattern>ui/ndproxy/general/*</pattern>
<pattern>api/ndproxy/general/*</pattern>
</patterns>
</page-ndproxy-general>
</acl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<menu>
<Services>
<Ndproxy VisibleName="Ndproxy" cssClass="fa fa-bullseye fa-fw" url="/ui/ndproxy/general"/>
</Services>
</menu>
Loading