Skip to content

Commit

Permalink
Add supervisor linux platform specific code boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao committed May 12, 2020
1 parent 06a2019 commit 5853617
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 5 deletions.
2 changes: 1 addition & 1 deletion services/wireguard/endpoint/remoteclient/network_darwin.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 The "MysteriumNetwork/node" Authors.
* Copyright (C) 2020 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
35 changes: 35 additions & 0 deletions services/wireguard/endpoint/remoteclient/network_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2020 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package remoteclient

import (
"errors"
"net"
)

func assignIP(iface string, subnet net.IPNet) error {
return errors.New("not implemented")
}

func excludeRoute(ip net.IP) error {
return errors.New("not implemented")
}

func addDefaultRoute(iface string) error {
return errors.New("not implemented")
}
2 changes: 1 addition & 1 deletion services/wireguard/endpoint/remoteclient/tun.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// +build !windows

/*
* Copyright (C) 2019 The "MysteriumNetwork/node" Authors.
* Copyright (C) 2020 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
27 changes: 27 additions & 0 deletions supervisor/client/transport_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2020 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package client

import (
"errors"
"io"
)

func connect() (io.ReadWriteCloser, error) {
return nil, errors.New("not implemented")
}
20 changes: 20 additions & 0 deletions supervisor/config/const_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2020 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package config

const confPath = "TODO"
29 changes: 29 additions & 0 deletions supervisor/daemon/myst_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (C) 2020 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package daemon

import "errors"

// RunMyst runs mysterium node daemon. Blocks.
func (d *Daemon) RunMyst() error {
return errors.New("not implemented")
}

func (d *Daemon) killMyst() error {
return errors.New("not implemented")
}
26 changes: 26 additions & 0 deletions supervisor/daemon/transport/transport_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2020 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package transport

import "errors"

// Start starts a listener on a unix domain socket.
// Conversation is handled by the handlerFunc.
func Start(handle handlerFunc) error {
return errors.New("not implemented")
}
37 changes: 37 additions & 0 deletions supervisor/daemon/wireguard/wginterface/interface_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2020 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package wginterface

import (
"errors"
)

// New creates new WgInterface instance.
func New(requestedInterfaceName string, uid string) (*WgInterface, error) {
return nil, errors.New("not implemented")
}

// Listen listens for WireGuard configuration changes via user space socket.
func (a *WgInterface) Listen() {

}

// Down closes device and user space api socket.
func (a *WgInterface) Down() {

}
7 changes: 4 additions & 3 deletions supervisor/install/install_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

package install

import "fmt"
import "errors"

func Install() {
fmt.Println("Installing...")
// Install installs service for linux. Not implemented yet.
func Install(options Options) error {
return errors.New("not implemented")
}

0 comments on commit 5853617

Please sign in to comment.